Received: by 10.213.65.68 with SMTP id h4csp82657imn; Thu, 15 Mar 2018 10:11:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELtmqlW3rs9qna+2TVIGh7GIpzhqW8il26WmRrOihrdwakSLfbCy0KEvA6u304FW0jIj+Uf7 X-Received: by 2002:a17:902:47c2:: with SMTP id d2-v6mr8911294plh.253.1521133889602; Thu, 15 Mar 2018 10:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521133889; cv=none; d=google.com; s=arc-20160816; b=wXzYoBUOyr30ZNWKRz4hHIc6vZ8E4Bc4nDl3zmHpywGdVLWZA0SH8RQB8d//XsJYwL n9esX8Ljdg/10P05pvgU/1u0x4VxsChwAGRBf8mE+iG/8oKSA9ByBEWnCTMaOvwm8iAF D6h6V8kv0stVpBwg5GOaMApqZuKWyka+CwZ03Mo33kn0a369LPuoQJZkUds0qctjc9ns HrhvdUXxuKLeVNUN5aHmU9CrvHC9BEWlEWA7VwTxAq3FpXRm20BVTIODQW/jePlZZtpd MeUll0PyHgvS9aq2pF7lNeY2rAVQeCjuFU3f03MEVqbkJh33RuCZkSmhcBgZBQYoBtor Hxcg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=SWUQ8W4zVya/7XdqnMeKafDW14b9nXzq0XYvMKJL/vY=; b=wtRZYg7jeMWyn5UuSq0UarOpeXS0kd8yMK0N4NAIPmqbVeq70h2g/0R0zaimeUaYFy /DrCYrpm1O9oSIIFQZrUSjZNTmhB3EGBBKJ+vp5HIj4imK3kR07RzM5U+ARTup4Bs/PB qmmjRg4YYFkgfIF6ARKNskMvsKYMXGiDBjOJ4Vr2BcH4+/AWgOqKFVk4ZwFkEJQBdUPn 8PA1o1xmVDI/cSP+DCeKFJZYldUQrUl2FnxxtAHHj7IGbD4xpCYSzcL582SuIx5x7aoW FRKbS8ayGRy1yY48zem0Nx/0gsh62uC40KV36HGw7HjPqyyVY3aRcw3kNH8dQFas7NOZ 89IA== 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 a34-v6si4317631pld.505.2018.03.15.10.10.45; Thu, 15 Mar 2018 10:11:29 -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 S1752674AbeCORHU (ORCPT + 99 others); Thu, 15 Mar 2018 13:07:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:45254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbeCORHT (ORCPT ); Thu, 15 Mar 2018 13:07:19 -0400 Received: from vmware.local.home (ip-64-134-136-2.public.wayport.net [64.134.136.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8F61E21742; Thu, 15 Mar 2018 17:07:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F61E21742 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Thu, 15 Mar 2018 13:07:17 -0400 From: Steven Rostedt To: Petr Mladek Cc: Rasmus Villemoes , Linus Torvalds , Andy Shevchenko , "Tobin C . Harding" , Joe Perches , Linux Kernel Mailing List , Andrew Morton , Michal Hocko , Sergey Senozhatsky , Sergey Senozhatsky Subject: Re: [PATCH v3] vsprintf: Prevent crash when dereferencing invalid pointers Message-ID: <20180315130717.3435b71c@vmware.local.home> In-Reply-To: <20180315150754.qeshnhmtnob2jhxs@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> <0c52c2f1-60d8-bb8a-80f2-c699d47659d3@rasmusvillemoes.dk> <20180315150754.qeshnhmtnob2jhxs@pathway.suse.cz> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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, 15 Mar 2018 16:07:54 +0100 Petr Mladek wrote: > Good point. The following should do the job: > > static const char *check_pointer_access(const void *ptr) > { > char c; > > if (!ptr) > return "(null)"; > > if ((unsigned long)ptr < TASK_SIZE || probe_kernel_address(ptr, c)) Please don't. -- Steve > return "(efault)"; > > return 0; > }