Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp152923lqp; Mon, 10 Jun 2024 23:21:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXEYkavr7d3dqWk4L0dUScRyrsei0EL2b87r/iwN4ZPqXN6Rf/hOlc+QWoTMLSxlPNebJHdhG6J7hgOVNztDLZTHMRATrMKXZMKnodCg== X-Google-Smtp-Source: AGHT+IHRRKVLkrn/dvLB/d9wNI3/UzE93XqvedvlIurTpMl69UyRPGzvWivov+IawFSexQtFNf75 X-Received: by 2002:a05:6e02:1908:b0:36c:4cbd:ec88 with SMTP id e9e14a558f8ab-375802df7f8mr136214115ab.6.1718086876347; Mon, 10 Jun 2024 23:21:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718086876; cv=pass; d=google.com; s=arc-20160816; b=UVlhV0LLm7wRpADB3IMgAcXq2CpZ76j5NQ4Xbg7L9lJqY+sXu+HSMEaz90j3wsbKc1 FeYgWmndy+8uVHSqbMGHCt6jWur5Yst/q+KhiYSVrN0xDLN4+tG/9F6qg64rwVvsOAuV C1Zjc9kEbeqWRLHro0EDhsIDrgbCuaDYa/P4CKaDqoDp+JhXbuB62RiWkHxQM8wqpc34 cBUYNKPd7uBDnXtwyjVxMLyGmVc8Yx7PriX2/5b5ZWMg3+R1+OV85MTwueoaXvE8uLnJ LtelWGskJdz+eUUR74NKwRV5OeHKABo6iruCO5OWMiKCZyxlo8wopNRWmYG03A9Y2Q3s ctjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=S8O+u/YK5PTP1vaIwdLbV90tfBWJ/v4aaVNrNwq2jog=; fh=IsBsERLblXMhJu/Re0y/+PfZ1Sl5fKkILP+G3K+bl0Y=; b=zOzIMOgW2fAT6x+tNZ7fDb8eOjr9PyJxCxdm5k3boRL8cFmuxW/FXFvuqKSDVTF+D5 F/GYlY3tXznspyt6gywYLHOvbl8ARpo7c0ngVsmhOhGizyJ7ne5peF+APhBTypobPmk3 XiSnGkdzDIs4QQD5hepd/OMLr+JmNsZYEyzhrLdywidNzcrpu8BIg1N+VirGTUxM+fTr oXol942dxJBSnWyKoqcWYpKrgujw07bO+DhKwc5jWU2ePXtPMczaDiVANPBxKJnKkDaJ GdAXqLXUxP89nZ4BQhBvZDUBY+q/aj1A0IiruzWeG0Bd75GOjBZ2Dv497+adxCvQiLrv 4now==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hHgFOx36; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209312-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e3d14b79ebsi5886056a12.692.2024.06.10.23.21.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 23:21:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209312-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hHgFOx36; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209312-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209312-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D3BE7286288 for ; Tue, 11 Jun 2024 06:21:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B02E171647; Tue, 11 Jun 2024 06:21:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hHgFOx36" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3774617108B; Tue, 11 Jun 2024 06:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718086870; cv=none; b=kFdsgTOgD6LR3toEytuv//umwi4Zo6eVhI39pqtYXdEi8tHiFTvknL0J46a8Yt7o9wZ1LhHB6TkvQBoaRWK5qSn4E6rU7OCLK59DeEY2GYENXM+ps1Ljgi1H3H97Pi6fy9CFaYCYI4sqMr8WZsJPTCH76lhJt8QETGgUv0hLedM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718086870; c=relaxed/simple; bh=FdvcjugTQA5eN+YNmowO2Lsa9ldk4+jwb0PaqWtLnDI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qWIymFHrYObKxx/0I+2gKd8mG8sinlk+BVj/45H3J9WdyeQpfD1vdpOUXN4bIVMYX6lFJ4rgV6DCmGagi9w1qAitJ7jgs0vlG3I2FHoan9UmgwOEc8wXRfnhGjkJ1f5cGm/IirD3faVWJOzJCiuTTTRnhA8XQxVKKw8xyy232mE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hHgFOx36; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23157C4AF1C; Tue, 11 Jun 2024 06:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718086869; bh=FdvcjugTQA5eN+YNmowO2Lsa9ldk4+jwb0PaqWtLnDI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hHgFOx36G/kLrMsYBTD7TQ/ywAxmxhutm3HV5b0+lVSJafHpbrPySk5hTWlZGyuY/ Ff7RODDMdRHmZpaI/WcB3yBKFgDjuVv8NrCoXvWxWyzFEYdDF4j4crAyXg3itbz4QS /c2ufIcz0HgIwm/46toJAPdOwWoUrJKu6Ew4lda8= Date: Tue, 11 Jun 2024 08:21:06 +0200 From: Greg KH To: Kees Cook Cc: Thomas Gleixner , David Gow , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Sean Christopherson , Peter Zijlstra , Arnd Bergmann , "Kirill A. Shutemov" , Qiuxu Zhuo , Nadav Amit , Masahiro Yamada , Christian Brauner , David Howells , Uros Bizjak , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] x86/uaccess: Fix missed zeroing of ia32 u64 get_user() range checking Message-ID: <2024061151-flinch-storage-fe08@gregkh> References: <20240610210213.work.143-kees@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240610210213.work.143-kees@kernel.org> On Mon, Jun 10, 2024 at 02:02:27PM -0700, Kees Cook wrote: > When reworking the range checking for get_user(), the get_user_8() case > on 32-bit wasn't zeroing the high register. (The jump to bad_get_user_8 > was accidentally dropped.) Restore the correct error handling > destination (and rename the jump to using the expected ".L" prefix). > > While here, switch to using a named argument ("size") for the call > template ("%c4" to "%c[size]") as already used in the other call > templates in this file. > > Found after moving the usercopy selftests to KUnit: > > # usercopy_test_invalid: EXPECTATION FAILED at > lib/usercopy_kunit.c:278 > Expected val_u64 == 0, but > val_u64 == -60129542144 (0xfffffff200000000) > > Reported-by: David Gow > Closes: https://lore.kernel.org/all/CABVgOSn=tb=Lj9SxHuT4_9MTjjKVxsq-ikdXC4kGHO4CfKVmGQ@mail.gmail.com > Fixes: b19b74bc99b1 ("x86/mm: Rework address range check in get_user() and put_user()") > Signed-off-by: Kees Cook > --- > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: Borislav Petkov > Cc: Dave Hansen > Cc: x86@kernel.org > Cc: "H. Peter Anvin" > Cc: Sean Christopherson > Cc: Peter Zijlstra > Cc: Arnd Bergmann > Cc: "Kirill A. Shutemov" > Cc: Qiuxu Zhuo > Cc: Nadav Amit > Cc: Masahiro Yamada > --- > arch/x86/include/asm/uaccess.h | 4 ++-- > arch/x86/lib/getuser.S | 6 +++++- > 2 files changed, 7 insertions(+), 3 deletions(-) > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot