From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) (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 EDDFC255F2C for ; Tue, 17 Mar 2026 17:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773768245; cv=none; b=aWcXbVxnrRGvtiPPZEmGD3p5w8j2PFgnodKvRYrw2JMXbz0J4+xQTubq0EG9A+aIcCdjULL5ZYzsQ54/Iz93babBjlF1WfChmsRAsZ5gKkDyeltEySNPiHeh+y6sep89tO4t2yxiz/m3KC5H5nhcOf80oyeWDQVCrL2lwoT40xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773768245; c=relaxed/simple; bh=cCQhRPNmvlO4X485HTE5JSAbe0dPb5/7/gzcen3toyU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eJgOG7VHnto09ODE/zqwVef7HqemVKY0cuHSDgUk6qTRUxh0o3I6hGyJ9UzE+aRdR5zDt60iklrYbaku3nkmpNDym/HGiBOJg4Kii6D+KSSAIck9csxCv10tEfgrl7V2uesO+ft6toFntAR9NqxtgTpde+XFseVOTF9RcJzdjUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6F9B85176F; Tue, 17 Mar 2026 17:24:02 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf06.hostedemail.com (Postfix) with ESMTPA id 68F0B2000E; Tue, 17 Mar 2026 17:24:00 +0000 (UTC) Date: Tue, 17 Mar 2026 13:24:21 -0400 From: Steven Rostedt To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Andy Shevchenko , Andrew Morton , Petr Mladek , Rasmus Villemoes , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH] lib/vsprintf: Validate sleepable context during restrictred pointer formatting Message-ID: <20260317132421.56cd3a12@gandalf.local.home> In-Reply-To: <20260317152004-c784ca6e-0a11-4f26-a550-c5e0ecab9f5d@linutronix.de> References: <20260317-restricted-pointers-final-v1-1-b4dca0ed6483@linutronix.de> <20260317152004-c784ca6e-0a11-4f26-a550-c5e0ecab9f5d@linutronix.de> 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspamout05 X-Rspamd-Queue-Id: 68F0B2000E X-Stat-Signature: 3ahokmyykrjb9obdgqy56479uojnc1cj X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX190iyADycLynOC8TJrpmCERoU3Iww+HIdQ= X-HE-Tag: 1773768240-708046 X-HE-Meta: U2FsdGVkX1+0PL+9YvTcnR5NUIo9QLbsPxK8OuuQK7x9zz2WNCQmDnE45CSoXBtReX2L+K9UwWWCgsV6lpg2cFwtuB+eCByo9LrFL/Tnnua6e6NYKhoN50p/hGHLB6Hrgmh+ertqd9VEIKgdc5b+uaMvVKiDJsKVRmt60u+PK3Vvcf/nERP16VNTyBpE7f+octN6xNbkgRsUIc1Yv17hGPZdyXg0p4rweBS2xRoaNsxVG0AsZniFQyZZpD/NgbOwnqLmt21tc7scqGIQaEe4p0cP490dKyLYaKf33MplkdPJvWqBGPQwdz3qWwMa4U/a On Tue, 17 Mar 2026 15:26:13 +0100 Thomas Wei=C3=9Fschuh wrote: > > =20 > > > + /* Only usable from task context, The call to has_capability_noaudi= t() might sleep. */ > > > + might_sleep(); =20 > >=20 > > Yeah, but for kptr_restrict !=3D 1 it's not true. Perhaps might_sleep_i= f() ? =20 >=20 > kptr_restrict can change any time at runtime. The whole point of this pat= ch > is to detect the API misuse independently from the system configuration. > Developers probably don't test against kptr_restrict =3D=3D 1 and therefo= re > it will only blow up on users system. Agreed. Those that add a printk with %pK in an atomic context may have kprt_restrict =3D=3D 0, and will not know they just added a potential bug. We want it to warn if it is used in any problematic way, even if the current settings do not trigger it. Similarly, like we have lockdep in tracepoints: include/linux/tracepoint.h: static inline void trace_##name(proto) \ { \ if (static_branch_unlikely(&__tracepoint_##name.key)) \ __do_trace_##name(args); \ if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ WARN_ONCE(!rcu_is_watching(), \ "RCU not watching for tracepoint"); \ } \ } Where lockdep will warn if RCU isn't watching at the call site of the tracepoint regardless if that tracepoint is enabled or not. -- Steve