Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2454406pxa; Fri, 7 Aug 2020 11:30:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFSWNdAsncUIuRMpsOeZCpjfcyDcsOEDCrqtz1ThWPKvC1YBPmpXCoFvNcbRslCpdcQs2g X-Received: by 2002:a17:906:b2d7:: with SMTP id cf23mr10241292ejb.113.1596825029372; Fri, 07 Aug 2020 11:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596825029; cv=none; d=google.com; s=arc-20160816; b=Sx8HGccJsDOmPaxNXDJn3gaN+y7/LGmpyBCQxNQrSQIw6i3K6YewKX6/ue/p4c5J+8 gGKmgu5wDnZdm73nRnBdFUCmEF/k3qFoYZZ9K6RxrEPG8tMxcmjfNmhek9ApMoF4VKde mqqip5yPNFutU1CxWfZjCB2c1UmEhUQXdFojV1Upj9/VO4xW8SiMMZiDF1xxVBxXSuk+ B0GnoIWU7mo+Za8wb2eSajiCh0bspvpW2RemoPqfGa7bv/dG7uNvoXc3arkvnmrVUPvg m7u3Zr8Q8LPsxAIKbWuhroTXh3x2SsKvywdnZIuplGRWXvMWbMWBlLSd55cNd6t5bb0W Xk5g== 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=D+pQemAM5Bfj/jIUnqLUeJ7BYuQFV1mkflrQY6YQSiM=; b=y8+ntLDTeng7jeeWHHo+RM9A0+pEucjmaHHZviPZHHWMK6VH3or/1kUYtez3SMozk9 qDmFrq0PyflRfujgHIAecOOh19d5eyZrrjhJPwCKLzxyhUHofLvU+Y7WOR7J5PrExkhl Lg6ztw6Dkjyk5r7a1c2FMpoIYk2SJw/9Rpf5boiz+4HjTbgHLQDCkPqSQxeF4BWJMBU6 vbfwks9ovQJVaraECiWPqOe2cbYFdvdXi4c8W5wRUXHD8/vk4+tsozujPoASGUe2xm1i ExBWhLebZeLYGnINrLu/RrhAPy/YSFiwQp36nHYdEfhNoqPRKYDVOTi9092kZ7fPiGTi smCg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si5748999edv.605.2020.08.07.11.30.05; Fri, 07 Aug 2020 11:30:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726615AbgHGS3c (ORCPT + 99 others); Fri, 7 Aug 2020 14:29:32 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34632 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbgHGS3b (ORCPT ); Fri, 7 Aug 2020 14:29:31 -0400 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=mussarela) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k477H-0003VM-0J; Fri, 07 Aug 2020 18:29:19 +0000 Date: Fri, 7 Aug 2020 15:29:11 -0300 From: Thadeu Lima de Souza Cascardo To: Kees Cook Cc: Christian Zigotzky , "Alex Xu (Hello71)" , Linus Torvalds , Aleksa Sarai , Chris Palmer , Christian Brauner , 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: <20200807182911.GK4402@mussarela> References: <202008071117.56ADE58@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Hi, Kees. You might want to add the Teste-by line that Alex Xu sent. And if my ack adds any value on top of Suggested-by, here it goes: Acked-by: Thadeu Lima de Souza Cascardo Thanks. Cascardo. > --- > 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