From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: David Laight Subject: RE: [PATCH v2 05/18] x86: remove __range_not_ok() Date: Fri, 18 Feb 2022 15:45:56 +0000 Message-ID: <905678e9e05d40b9a4e13e7b1a34cb68@AcuMS.aculab.com> References: <20220216131332.1489939-1-arnd@kernel.org> <20220216131332.1489939-6-arnd@kernel.org> <20220218062851.GC22576@lst.de> In-Reply-To: <20220218062851.GC22576@lst.de> MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: 'Christoph Hellwig' , Arnd Bergmann Cc: Linus Torvalds , "linux-arch@vger.kernel.org" , "linux-mm@kvack.org" , "linux-api@vger.kernel.org" , "arnd@arndb.de" , "linux-kernel@vger.kernel.org" , "viro@zeniv.linux.org.uk" , "linux@armlinux.org.uk" , "will@kernel.org" , "guoren@kernel.org" , "bcain@codeaurora.org" , "geert@linux-m68k.org" , "monstr@monstr.eu" , "tsbogend@alpha.franken.de" , "nickhu@andestech.com" , "green.hu@gmail.com" , "dinguyen@kernel.org" , "shorne@gmail.com" , "deller@gmx.de" , "mpe@ellerman.id.au" , "peterz@infradead.org" , "mingo@redhat.com" , "mark.rutland@arm.com" , "hca@linux.ibm.com" , "dalias@libc.org" , "davem@davemloft.net" , "richard@nod.at" , "x86@kernel.org" , "jcmvbkbc@gmail.com" , "ebiederm@xmission.com" , "akpm@linux-foundation.org" , "ardb@kernel.org" , "linux-alpha@vger.kernel.org" , "linux-snps-arc@lists.infradead.org" , "linux-csky@vger.kernel.org" , "linux-hexagon@vger.kernel.org" , "linux-ia64@vger.kernel.org" , "linux-m68k@lists.linux-m68k.org" , "linux-mips@vger.kernel.org" , "openrisc@lists.librecores.org" , "linux-parisc@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-riscv@lists.infradead.org" , "linux-s390@vger.kernel.org" , "linux-sh@vger.kernel.org" , "sparclinux@vger.kernel.org" , "linux-um@lists.infradead.org" , "linux-xtensa@linux-xtensa.org" , Christoph Hellwig List-ID: From: Christoph Hellwig > Sent: 18 February 2022 06:29 ... >=20 > > diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.= c > > index 15b058eefc4e..ee117fcf46ed 100644 > > --- a/arch/x86/kernel/stacktrace.c > > +++ b/arch/x86/kernel/stacktrace.c > > @@ -90,7 +90,7 @@ copy_stack_frame(const struct stack_frame_user __user= *fp, > > { > > =09int ret; > > > > -=09if (__range_not_ok(fp, sizeof(*frame), TASK_SIZE)) > > +=09if (!__access_ok(fp, sizeof(*frame))) > > =09=09return 0; >=20 > Just switch the __get_user calls below to get_user instead. Is this worth doing at all? How much userspace code is actually compiled with stack frames? Won't work well for a 32bit process on a 64bit kernel either. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)