From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbeCHQpW (ORCPT ); Thu, 8 Mar 2018 11:45:22 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:46363 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052AbeCHQpV (ORCPT ); Thu, 8 Mar 2018 11:45:21 -0500 X-Google-Smtp-Source: AG47ELtFmEjR1xdHgWowlev0TbE2aJTYxYP5crSSsPyUDlIsHLfhOjvgreZ2J/K+v+mantNDnPVcjGPqMxmLc0ZnH84= MIME-Version: 1.0 In-Reply-To: <20180308141824.bfk2pr6wmjh4ytdi@pathway.suse.cz> References: <1519752950.10722.231.camel@linux.intel.com> <20180228100437.o4juwxbzomkqjvjx@pathway.suse.cz> <1519814544.10722.266.camel@linux.intel.com> <20180302125118.bjd3tbuu72vgfczo@pathway.suse.cz> <20180302125359.szbin2kznxvoq7sc@pathway.suse.cz> <20180306092513.ibodfsnv4xrxdlub@pathway.suse.cz> <1520330185.10722.401.camel@linux.intel.com> <20180307155244.b45c3fb5vcxb4q2l@pathway.suse.cz> <20180308141824.bfk2pr6wmjh4ytdi@pathway.suse.cz> From: Linus Torvalds Date: Thu, 8 Mar 2018 08:45:19 -0800 X-Google-Sender-Auth: 1sbSPSNTvpESP1XhKc80Zt0lZko Message-ID: Subject: Re: [PATCH] vsprintf: Make "null" pointer dereference more robust To: Petr Mladek Cc: Andy Shevchenko , Rasmus Villemoes , "Tobin C . Harding" , Joe Perches , Linux Kernel Mailing List , Andrew Morton , Michal Hocko Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 8, 2018 at 6:18 AM, Petr Mladek wrote: > On Wed 2018-03-07 10:34:17, Linus Torvalds wrote: >> >> Guess what happens now to any crash report if it uses %p and there is >> anything wrong with the VM? > > This patch does _not_ affect plain %p, %px, and %pK! Umm. Look again. It _does_ affect plain %p. You're correct that it doesn't affect %px and %pK, since those never printed out (null) in the first place. > It affects %s and %p* modifiers that need to read data from the > given address. _If_ that was what the patch did, it would be fine. But it isn't. It not only affects %p, but it also affects %pS and friends (sSfFB), that do not access the location (well, on some architectures those might, to dereference a function descriptor, but then they will check the address range). So that patch really is completely broken for the reasons I outlined. Now, if it was fixed to what you apparently *intended* to do, then that would be ok. Linus