Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2504977pxa; Fri, 7 Aug 2020 12:49:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5dR7kc7cJecW5Sto+5t3C61invulNJo+8dOsUOqjlgbd01SJApv4R+uaq27SSIBGJ2/2P X-Received: by 2002:a17:906:388b:: with SMTP id q11mr11582493ejd.100.1596829792326; Fri, 07 Aug 2020 12:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596829792; cv=none; d=google.com; s=arc-20160816; b=tjJWDXsHs/Q6IIl6zoO3zDiQnZ/HlDKOKZ7TMz6hOXeIn5ugRdZnvrQV9go1PePPVO u4ScGFeqbb71xHljs3y1d4lJ6Dab2ugvkGaFD6eJkpdbtPJJFa/hXVEjoPwaDajaTtkO U+lsBbY+3yuP9r0bjF/4wwse19dJ91O8GB6umHXopVEOtTjdX5u3zSY0F9Ui4DiOQT92 WbDe85R3gQ+eFQUJOwrk3GsX81zXO9JLRhKt6X3vY0ID6uMLWptDDObAxwjA+H3yEoXZ OBqGV+3jxht78ogReqZY+80WduNykI2kBQY9Sp1j1gjKvMiX2wc1YBWd9KNCXG0SoYkj umxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lY4fAjfFzmSTtjdhk13CmwcxC88599ecJpAWVKcZRrE=; b=I04qbEb0duqvMo8y6OzkM1fNpOVUFcG4HK24oIEtzSDzBagQbqZd9gBgEN7JMh8XkF tjyc4ctTThDmtmSsCS/ccGpQB3WaBzWnuix21xaWxv5+BkWZVdhts9eTlHY9H00noB9b 4BpefKd91AfB1sDKKcu5NgcnugvaqnWsKM2mH5rB6l1zcVyJvlRd64q4vQn03ZzbSI0P mMp2WuYcv3iPE1PHM7U0RBOIJT14n3W75hKZB7lySklhkZyfC3gReCcgKhmXs/R53MkJ GVetgIR6+bEXkQ5UpdsqKjcTTwlwN+9i/N9bQPL7YjLWdGnO2726dXjmpDn40Cqsd2oP 22aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si4936798ejb.475.2020.08.07.12.49.29; Fri, 07 Aug 2020 12:49:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726346AbgHGTq1 (ORCPT + 99 others); Fri, 7 Aug 2020 15:46:27 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36033 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHGTq1 (ORCPT ); Fri, 7 Aug 2020 15:46:27 -0400 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k48Jh-0003UW-34; Fri, 07 Aug 2020 19:46:13 +0000 Date: Fri, 7 Aug 2020 21:46:11 +0200 From: Christian Brauner To: Kees Cook Cc: Christian Zigotzky , "Alex Xu (Hello71)" , Thadeu Lima de Souza Cascardo , Linus Torvalds , Aleksa Sarai , Chris Palmer , Christoph Hellwig , Matt Denton , Robert Sesek , Sargun Dhillon , Shuah Khan , Tycho Andersen , Will Deacon , Will Drewry , Yonghong Song , linux-kernel@vger.kernel.org Subject: Re: [PATCH] net/scm: Fix typo in SCM_RIGHTS compat refactoring Message-ID: <20200807194611.zduj77nrobm3ibpr@wittgenstein> References: <202008071117.56ADE58@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202008071117.56ADE58@keescook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 07, 2020 at 11:20:05AM -0700, Kees Cook wrote: > When refactoring the SCM_RIGHTS code, I accidentally mis-merged my > native/compat diffs, which entirely broke using SCM_RIGHTS in compat > mode. Use the correct helper. > > Reported-by: Christian Zigotzky > Link: https://lists.ozlabs.org/pipermail/linuxppc-dev/2020-August/216156.html > Reported-by: "Alex Xu (Hello71)" > Link: https://lore.kernel.org/lkml/1596812929.lz7fuo8r2w.none@localhost/ > Suggested-by: Thadeu Lima de Souza Cascardo > Fixes: c0029de50982 ("net/scm: Regularize compat handling of scm_detach_fds()") > Signed-off-by: Kees Cook > --- Oh fun, Acked-by: Christian Brauner Thanks for fixing this quickly, Kees! I already built stuff on top of the notifier fd injection work we did this cycle so it's great that we don't have to revert this! > net/compat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/compat.c b/net/compat.c > index 703acb51c698..95ce707a30a3 100644 > --- a/net/compat.c > +++ b/net/compat.c > @@ -294,7 +294,7 @@ void scm_detach_fds_compat(struct msghdr *msg, struct scm_cookie *scm) > (struct compat_cmsghdr __user *)msg->msg_control; > unsigned int o_flags = (msg->msg_flags & MSG_CMSG_CLOEXEC) ? O_CLOEXEC : 0; > int fdmax = min_t(int, scm_max_fds_compat(msg), scm->fp->count); > - int __user *cmsg_data = CMSG_USER_DATA(cm); > + int __user *cmsg_data = CMSG_COMPAT_DATA(cm); > int err = 0, i; > > for (i = 0; i < fdmax; i++) { > -- > 2.25.1 > > > -- > Kees Cook