Received: by 10.213.65.68 with SMTP id h4csp555372imn; Fri, 16 Mar 2018 11:20:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELu3ZxK23WUU4FymHsIZPkYA5PWVG8aSRHm2fVerqcSP5RgfNaJUu925VcSUGLPhKRmAMkW/ X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr3186943plg.23.1521224450063; Fri, 16 Mar 2018 11:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521224450; cv=none; d=google.com; s=arc-20160816; b=yPmgvaWoO6/uBqw+A/prFvAQ475m6WJwxS3iv3sFBmCp/vFVasENAG5WmNsA44e+Vm 16ggX9RaUP2/LDKFG4bpuWAhN4Yd3+y/OuhSZfI6ypkhBNQAC/nZiacc0YSt4RssW4Ny c16j73CWN62+ueEDNhFBSgDTS5m3MAxCTfjZKvfsyK5fMWGxe5Lmafym96p9a+CcT/9s 72H9AJaKqAyKZetJ8qgV2bSeg3SwbVcTkU1BPdEMMsURqVZZWzknW+Hr2QUBcRFtyUc0 gIXmLiDTcHIcbKOBYaU0u087AKU12q9+RaVIN8juhjLcdQZ5bFx9O4uglhFGSCYIQ6vg ut4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=kwbKptVbw5zieanuq7OjDaHDGNT79YbM+Apvht9TXbs=; b=eDWt+GOWyJceN8juFFOIOtDrZ8ZxpQ4N12xjDsXPCX9bzsWaW2p2BHT6BwSaVPZuPW G2EnB1xbwbHAEXBkGFdPUM0FVv4nB3vxWURgsKu9AIa9yNVbGB0l5OYx9LCurH/Xayn5 oih0OeIHG8bP5SF+litxqS+y5cEMb/qXBRkwu9Gc5UDIkO9sR1jmMQgcW1INejf/Nabk vI6hmVmvC+ARnrOJ/N3TnjpocEAZJ/f5A6tkSb7sl7tgYWAJftilQDKhOL1l4/cPpn1c Gud2SDV3pEkRx0kBmo4ar0wfj/s6pDmOpJM4g36sTkqANkwfshqF5dk1WOUwmoAbnId6 gF4g== ARC-Authentication-Results: i=1; mx.google.com; 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 a8-v6si6705767ple.435.2018.03.16.11.20.35; Fri, 16 Mar 2018 11:20:50 -0700 (PDT) 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; 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 S1752163AbeCPSTl (ORCPT + 99 others); Fri, 16 Mar 2018 14:19:41 -0400 Received: from mga11.intel.com ([192.55.52.93]:53019 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbeCPSTj (ORCPT ); Fri, 16 Mar 2018 14:19:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2018 11:19:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,317,1517904000"; d="scan'208";a="212277278" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga005.fm.intel.com with ESMTP; 16 Mar 2018 11:19:36 -0700 Message-ID: <1521224375.23017.41.camel@linux.intel.com> Subject: Re: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers From: Andy Shevchenko To: Petr Mladek Cc: Linus Torvalds , Rasmus Villemoes , "Tobin C . Harding" , Joe Perches , Linux Kernel Mailing List , Andrew Morton , Michal Hocko , Sergey Senozhatsky , Steven Rostedt , Sergey Senozhatsky Date: Fri, 16 Mar 2018 20:19:35 +0200 In-Reply-To: <20180315152607.xgzjmj5as6lg42dy@pathway.suse.cz> References: <1520330185.10722.401.camel@linux.intel.com> <20180307155244.b45c3fb5vcxb4q2l@pathway.suse.cz> <20180308141824.bfk2pr6wmjh4ytdi@pathway.suse.cz> <20180309150153.3sxbbpd6jdn2d5yy@pathway.suse.cz> <20180314140947.rs3b6i5gguzzu5wi@pathway.suse.cz> <1521119343.10722.665.camel@linux.intel.com> <20180315152607.xgzjmj5as6lg42dy@pathway.suse.cz> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-03-15 at 16:26 +0100, Petr Mladek wrote: > On Thu 2018-03-15 15:09:03, Andy Shevchenko wrote: > > On Wed, 2018-03-14 at 15:09 +0100, Petr Mladek wrote: > > > We already prevent crash when dereferencing some obviously broken > > > pointers. But the handling is not consistent. Sometimes we print > > > "(null)" > > > only for pure NULL pointer, sometimes for pointers in the first > > > page and > > > > > > > sometimes also for pointers in the last page (error codes). > > > > I still think that printing a hex value of the error code is much > > better > > than some odd "(efault)". > > Do you mean (err:0e)? Google gives rather confusing answers for this. More like "(0xHHHH)" (we have already more than 512 error code numbers. > I am not super excited about (efault). But it seems to be less > cryptic and the style is more similar to (null). > > Best Regards, > Petr -- Andy Shevchenko Intel Finland Oy