Received: by 10.213.65.68 with SMTP id h4csp3429039imn; Tue, 3 Apr 2018 04:58:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx48y0bx/JipiSC9h5Ty3jRcPsVUGSr3N8J0z9SHEwYSdpDKTp2cGOiZrQaNndY7NpU1H5dUx X-Received: by 10.98.67.141 with SMTP id l13mr10306977pfi.166.1522756692211; Tue, 03 Apr 2018 04:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522756692; cv=none; d=google.com; s=arc-20160816; b=kT+2tMHWlf8njeZpeE722kQC4qu30Otpkv06dZPa/zfQy8jtSr3h6rCmamaXC/X57v ETihIKLQE15kYFNGmlX2EOq1qhrORerjz39T0FxPGC5l5DxViR2U+NgWDah1m33Ehcya MWt8Y61o96S9U30DfGZzIhvJo9zWwKX524Pm/Ol1kl149BGlILjMXu5QQa0WWj4rnw7X mQFw+dz4dltx9dGmL/dnoZDqiYTxXcWxhDNr5vSnzXNsKzDmd2a+j+3nYxMnQjUK8oUn PrkKfIPZNMj4YbNFPWQIYaH9jIs3i8R1YeQXdazn7WdMS9MselCp+vmCrnRgvMe8xVjF +Qxg== 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=PUf6YARrsuO0HubuwZhQX51pDrqaKGPXotoZtWL0kVY=; b=bAubfVA92iZOiL8bZhFZgXSykxgjjfdxgfl+d3MlPKMGdsmuUWSnUgvIs81coufUF7 rTFy5OnSQHGhLFsELXXi93hWX9lhc592Prox00k6aOV25dJafHfpVUfbqKukGt52+paX v0Fx7ed16GafghwhB6/ty/58P5gnRNeS7SBRf3oLe9EykoQ65CgXWmvz9+ZAjKYt1jvm 8CxAAOJp9RAMaGdS+qkbudJ1T6MjiQ8nMsAaKM8nsVd85GdmFx80EL4wy6BkIl6J1fxm sJT7sFDLisFtSUq43yTmubULZSbGwg26AePLZbrE8b1hqrCSKX03lCTbNv88cyVRZHEI QgGg== 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 p13-v6si370760pll.416.2018.04.03.04.57.58; Tue, 03 Apr 2018 04:58:12 -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 S1755498AbeDCL4b (ORCPT + 99 others); Tue, 3 Apr 2018 07:56:31 -0400 Received: from mga03.intel.com ([134.134.136.65]:4692 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755300AbeDCL43 (ORCPT ); Tue, 3 Apr 2018 07:56:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 04:56:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,400,1517904000"; d="scan'208";a="42999881" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga004.fm.intel.com with ESMTP; 03 Apr 2018 04:56:26 -0700 Message-ID: <1522756585.21176.316.camel@linux.intel.com> Subject: Re: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers From: Andy Shevchenko To: Petr Mladek , Sergey Senozhatsky Cc: Linus Torvalds , Rasmus Villemoes , "Tobin C . Harding" , Joe Perches , Linux Kernel Mailing List , Andrew Morton , Michal Hocko , Sergey Senozhatsky , Steven Rostedt Date: Tue, 03 Apr 2018 14:56:25 +0300 In-Reply-To: <20180403115216.mgq3omvl4up24uic@pathway.suse.cz> References: <20180309150153.3sxbbpd6jdn2d5yy@pathway.suse.cz> <20180314140947.rs3b6i5gguzzu5wi@pathway.suse.cz> <1521119343.10722.665.camel@linux.intel.com> <20180315152607.xgzjmj5as6lg42dy@pathway.suse.cz> <1521224375.23017.41.camel@linux.intel.com> <20180329145312.4uqygrjqy3fqyl26@pathway.suse.cz> <1522678523.21176.178.camel@linux.intel.com> <20180403011237.GA7129@jagdpanzerIV> <20180403115216.mgq3omvl4up24uic@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 Tue, 2018-04-03 at 13:52 +0200, Petr Mladek wrote: > On Tue 2018-04-03 10:12:37, Sergey Senozhatsky wrote: > > On (04/02/18 17:15), Andy Shevchenko wrote: > > > > > > > > Hmm, I have never seen the error code in this form. > > > > > > We have limited space to print it and error numbers currently can > > > be up > > > to 0xfff (4095). So, I have no better idea how to squeeze them > > > while > > > thinking that "(efault)" is much harder to parse in case of error > > > > 'efault' looks to me like a misspelled 'default', for some reason. > > I wonder if (-efault) would help a bit. It's 9 characters, not going to satisfy sizeof(void *) * 2 on 32-bit systems. > Even better might be (-EFAULT). But then it would be better to use > (NULL). It already was but it was explicitly changed to the lowercase > variant by the commit 0f4f81dce93774a447da3c ("vsprintf: factorize > "(null)" string"). -- Andy Shevchenko Intel Finland Oy