From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D8651547D2 for ; Tue, 7 Jan 2025 02:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736216883; cv=none; b=MHAT1APjDU34F4Nfc4WFregdhz/LnlWMLhQ/qcJpAMpAny6rN08yLi9J/N9u58r2quzq7k/YHtXWEGGO/33H3lYjrz3i/Uz88q8mPD9QTTNngtfQymOdE74CRUT4Q62BTGhhtqtBfnSfPexqa36xjx+9xwKiMVEIT6dSnFykt3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736216883; c=relaxed/simple; bh=aVAKMB5FjMFj8afThMkUuEzt+BwDx8F29f+5i2bCmA8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZotKYs+PyfYyMSe2fxes0Wd71WzBrBcIcYGRbPVbowyK8yqfBfpSmgrvKGO2luKeWAN4AjI3Q3BMTQXqfCoreq5TsyfBzJDzcTjmx0SDjSquGtqaFgjJzXTOHC22Ey6a0mJ1o2o0URz9NvE8y+R1jvRlq1SKR3m/MR5y07Ccupk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C54EAC4CED2; Tue, 7 Jan 2025 02:28:01 +0000 (UTC) Date: Mon, 6 Jan 2025 21:29:28 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Andrew Morton , Petr Mladek , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Kees Cook Subject: Re: [RFC][PATCH] printf: Harden accessing pointer dereference in vsprintf() Message-ID: <20250106212928.7b836da9@gandalf.local.home> In-Reply-To: References: <20250106172722.5b6032e5@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 6 Jan 2025 15:29:01 -0800 Linus Torvalds wrote: > On Mon, 6 Jan 2025 at 14:25, Steven Rostedt wrote: > > > > Linus had suggested adding this kind of check[1]. This is a bit different > > than Linus's solution as it utilizes copy_from_kernel_nofault() and doesn't > > require calls to pagefault_disable() and extra labels. > > Yeah, and it generates horrendous code as a result. > I guess the question is do we prefer horrendous code generated or what we see? vsprintf() is used in critical paths, but I wonder how much these two versions actually make a difference in performance? If they do, then yeah, the open coded version would be better. -- Steve