Received: by 10.223.185.116 with SMTP id b49csp6566206wrg; Thu, 8 Mar 2018 09:28:11 -0800 (PST) X-Google-Smtp-Source: AG47ELsW8gBwIy4nbJTt/EKAlnyUJyuvXd4tZx2yEqECyICQ/zxBL4F3lmlpBbbiTduKvPgUreAz X-Received: by 2002:a17:902:48:: with SMTP id 66-v6mr23972576pla.288.1520530091225; Thu, 08 Mar 2018 09:28:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520530091; cv=none; d=google.com; s=arc-20160816; b=UHN/XCsTTKnj783Sj8mhnK58XurarDml9s3OumSli0EBredxpmMWr4wrFpyKkBpY9B BV8JFChJRNsi7Jk7ET0wSS4+Rc7RmrCmqAl7X0kPjLDyJqDCg9e7gHZphVDe0Tiqaapl dz9EFw146eAcYkNawnuKug809GWqMKcsD4udH03pVob/JyWBMCtU+XPD36rYoXtKLiOP oqfjWhSbhYRnlBQY1klCMLEhY0MR4P/LUzbGTyN38YWTpnzPQ3TZpkdsPcLaEQFDVniT FLJp4hQkL/+Gn4NW8/JYsnqwrPis7o9aRxlhhuLDcqRtJptuSIJBx+Bd2stI3+xy79Iz TMQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=4whsE+NqU0CbLo7Yf82M4SsC4hYmBoF654j7VVZZ72c=; b=QWivNcqsdhOhUNFfAYk0ZNrDFvMwfyPiG5PLKE/Dzvr2c/lu7LVR6lXxt9axuLN4lp qIZo6R5z9G9zA9um/sNB/RwJqgtIBarN3oX3YO0eQndpM/XG8puZpX+UblmBr7bdN0+y hL1VJdaCKQCKMK0p8UJ4zy7ikdadQ32Wr5zykx0X7UZp2T/xg1c6xqzih6yW6XMAziks 4stFmbK1AbqlvZNokNOBRFC1UAQdrhuOI6AzEf1VI8/L4Bbqp+eZPFoZ89pd24LTykzT xuzKsv/lYy1GwJHjbVNlyochZygWEA8aYkeB4eB+GUVQJwXVQ1mDP86udLtlRgM5vlNP V+9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BidRg1L0; dkim=fail header.i=@linux-foundation.org header.s=google header.b=bwsHATnA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9-v6si3983889pln.571.2018.03.08.09.27.56; Thu, 08 Mar 2018 09:28:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=BidRg1L0; dkim=fail header.i=@linux-foundation.org header.s=google header.b=bwsHATnA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752207AbeCHR0O (ORCPT + 99 others); Thu, 8 Mar 2018 12:26:14 -0500 Received: from mail-io0-f173.google.com ([209.85.223.173]:44858 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752100AbeCHR0M (ORCPT ); Thu, 8 Mar 2018 12:26:12 -0500 Received: by mail-io0-f173.google.com with SMTP id h23so466622iob.11 for ; Thu, 08 Mar 2018 09:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4whsE+NqU0CbLo7Yf82M4SsC4hYmBoF654j7VVZZ72c=; b=BidRg1L07HbuAdOdmUyl1pjLPzJckzbDs2xJX9F7Uq1TvmayY7exv5PDDWsr62WEG0 JkLz9vVp8hC38NCybtkBpTJyriOJ5nw7YsxJ8ZGXsK8MK+FYC1egU8wn6Bo3IraNw5WN R9rRXCwNIlTDdieDEzA8qUvT2QBRcQnz1acbZoSwKMUMpPEwLP/2iyIzEfbjlM/a/Us7 gphzKSH1NzD1X3ukL5zYs22hva0ZxOwAVKJKDsPN1b4DPdB1uTdD3p9z0t0JCGmLapL7 2ffAUmjxRwTQGZvgCTtk1T2lwL0/isucTFCels2KhLdQKDrqyaCpVkTzrN9/JD7MyEWB kzOQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4whsE+NqU0CbLo7Yf82M4SsC4hYmBoF654j7VVZZ72c=; b=bwsHATnA5VM561babru6AC/DR5zTMbccsTOZNdwLK7ejZXezkWVcVfOVKUqj3gqCbP dkHUZsg9aNlJHDMwj4XuYAZUsDaPUp4mxmtwj+QpA1avwPp2mb9HQEWwpzbNT+A4YEr8 TlPKsM769AC4IVpkG3pThvnHgaTvwJOCuhcOM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4whsE+NqU0CbLo7Yf82M4SsC4hYmBoF654j7VVZZ72c=; b=Xg1qyJrL6Jak/WjL9X6k0d4fCT9KseLfKx0vPKjyATO/PDAp3rXzr7zKLy77rduyQD oNXhWw2KA+OVpIXaMaKIKNQF4ejCNFyoVgrjiU/Tg6dCUOOhjFmsuYrGoI0Wsqb7+/Z0 Qdg//gDiG0kepz99NkxrUc6BRIpj84gZTM3W//SLCecREczF4H+2Bqkrwz3rn+iOwtfx Fg3g9Xg5GyK8ekyiQ7BcTsX9bELvFBFOIW+tRnbdsVgMgT2D2szyNHduuuRlvRdDTgAp VHzoRIaHCmqlUlt1R2F0GynoFRdgFYH6j1SrozzwhhYBaN1lJQMHUpmozjBrmwtdRHc1 BNEQ== X-Gm-Message-State: APf1xPCEFcmRfa6pGTX2B/+ZW8X7+n4GpbWHFhrnCKepA3wfNn6k4Dtf fDjMsr0AeIMU5/ltQplZE0zP56XupyFKW/nWr3c= X-Received: by 10.107.12.213 with SMTP id 82mr31329461iom.48.1520529971684; Thu, 08 Mar 2018 09:26:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Thu, 8 Mar 2018 09:26:11 -0800 (PST) In-Reply-To: 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 09:26:11 -0800 X-Google-Sender-Auth: wbzd96lAkSr_QRPLMzPXoiKzMCU 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 8, 2018 at 8:45 AM, Linus Torvalds wrote: > > 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 not only affects %p, but it also affects %pS and friends (sSfFB), Looking around at the x86 panic thing, %p doesn't matter that much, but %p[sSfFB] really do. We use %pS/%pB to print out the instruction pointer. And a fault might be due to the instruction pointer being bad. And then we very much need to see the value, which the current %pS-and-friends falls back to. So printing would actually be horrible, in addition to the extra page fault being wrong. In fact, _only_ NULL itself needs to be printed as (null), because we'd care if it's 0 or 8 or something. The other ones? The ones that would actually fault (%pI and friends) would not matter. The hex dumping one _might_ actually be useful if it got a buffer with 'probe_kernel_read()' and stopped half-way on problems. Maybe. The others I can't imagine really care. efault or hex address. Linus