From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 208EF3E1205 for ; Tue, 17 Mar 2026 14:08:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773756483; cv=none; b=r/oLF3oULS72Zj0s5QQBJX525N16H52KSIAEio3gxGAlx5UgTwyP1FcfgbaSNm7oox/C0Is/IJZ7gsxu+XTWglyE/cNd2j2dIi0lCCHP10nE6Siudd8i3FLsltBGIi8hG0gI9ZdKNpgLuouDpFmeSk0EparlxPus8oD4M66SBLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773756483; c=relaxed/simple; bh=PHP2uxKNCjur103J0rWSK8nuYI7UR7EdwMU5LXdaal8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Vyf03w0KQFhs/QUZzL26yg5tVAox4gNAJjsnVOBbmQRJUAlR20FkVy3AdDw/Lalk8/f1X07dZTQJQdxcouyehxxrYmAcW2CEq0MbQOLM6i1JmmiVGCu2UgtObrPQgZwCfuZgoIM1jXpkg6pGj1egEViGw2ZbbovLmFN1IybHJas= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=BjxbHWFY; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BjxbHWFY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773756482; x=1805292482; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=PHP2uxKNCjur103J0rWSK8nuYI7UR7EdwMU5LXdaal8=; b=BjxbHWFYOJH7tCBNz4QzpV8DSscxcQHQ7h5RKLAfh9xw4jNfQGGmcNrK VBgqk7B6tSnFP98Vxtkg0oaZ1woaEJ28sxpBU7hJShFhDUIUE0Ar/zy0k Z4RtfdWsHwrIIyRkC2vvXl3uW8h9wPtnwWPu1vzHhYvz3XGo6oVwuZsdx kZ8JCSeHdDRWAAotaOZOM2QByDJdr0bVpqUxp7/tNy605enOgQX6xvZmB k8twMRqY6ij13mYfhbFO3SbkQLlpp5jaYMSNJayugMyWMgUmvE8AxrvOY kpqIiMcZ+J07BNQF568NoHKKC6dCN7YDmL8XiwfRs7GHtzK5mfxyQzW/T A==; X-CSE-ConnectionGUID: CdgI7UCOQi+/d/7m+qwpTA== X-CSE-MsgGUID: jG64kO1BRmWc3pBFpuMpRw== X-IronPort-AV: E=McAfee;i="6800,10657,11732"; a="86142491" X-IronPort-AV: E=Sophos;i="6.23,124,1770624000"; d="scan'208";a="86142491" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2026 07:08:01 -0700 X-CSE-ConnectionGUID: uiusZAM0TqqDXm3ccQr8PA== X-CSE-MsgGUID: fR9GMC5oSKutawpgFKKpbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,124,1770624000"; d="scan'208";a="252761423" Received: from abityuts-desk.ger.corp.intel.com (HELO localhost) ([10.245.245.97]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2026 07:07:59 -0700 Date: Tue, 17 Mar 2026 16:07:56 +0200 From: Andy Shevchenko To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Andrew Morton , Petr Mladek , Steven Rostedt , Rasmus Villemoes , Sergey Senozhatsky , linux-kernel@vger.kernel.org Subject: Re: [PATCH] lib/vsprintf: Validate sleepable context during restrictred pointer formatting Message-ID: References: <20260317-restricted-pointers-final-v1-1-b4dca0ed6483@linutronix.de> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260317-restricted-pointers-final-v1-1-b4dca0ed6483@linutronix.de> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Mar 17, 2026 at 12:41:23PM +0100, Thomas Weißschuh wrote: > Depending on the system configuration, the restricted pointer formatting > might call into the security subsystem which might sleep. > As %pK is intended to be only used from read handlers of virtual files, > which always run in task context, this should never happen in practice. > However, developers have used %pK before from atomic context without > realizing this restriction. While all existing user of %pK through > printk() have been removed, new ones might be reintroduced accidentally > in the future. > > Add a might_sleep(), so that misuse of %pK from atomic context is > detected right away. ... > + /* Only usable from task context, The call to has_capability_noaudit() might sleep. */ > + might_sleep(); Yeah, but for kptr_restrict != 1 it's not true. Perhaps might_sleep_if() ? -- With Best Regards, Andy Shevchenko