From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6232636CE19; Wed, 20 May 2026 17:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297826; cv=none; b=noubFZyMFvFI4A5Cjjpkc38nc9fDwyEJvpJEtAoe2Iu4Jl326lUqinOmFj6tWrWDT4Iw8a94EX/Nuglh/eG4V2l4DCcmg7/9/IdbiwSEtHjQeSUbHMGzJCDg/S9Dm2NNdFBIMF5FRCC9OmeSFgJOO78oACiR3IziXJU9rT1VXxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297826; c=relaxed/simple; bh=yTOY8mIYJcsaRR02K89hQ7blU8faFRK4SGH0yTVXm7E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f2rh/iTRg7wtAU3/sh0OQGrvHMLU7665j7S8yta25lz9iD0Z/4xVDmA+wcnMwjn7U9c2t/dWR+C7VBtJZRCWm8Y/ldGVaUFHP19cu2mPAFsYJrIwq/0HlCb3d+8aHBflLIc70F64w67rriJPXG5FK9CGsZzIFNlDYYCN9V+8pAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=o2c1fuoB; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="o2c1fuoB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFA181F000E9; Wed, 20 May 2026 17:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779297825; bh=57U100keaI/Orqok+JKKI+5TqVldj7CmL9c4pONu0dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o2c1fuoBSvVr2OzAvtEgxGjX1TGAu/lho/6vhG1Y1j9PtLw6LpPQAQkMHXrsSBVvQ PknZRP0rBrU31axwT2lEAtRN6Ti4SlEEt4hNSWMIWZeCogpHArlo1sY2tOoQdhvEsV FTzLTk2en25vPu5v1li3rNpnrZ5y3PZzSZk1sjLk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Quan Sun <2022090917019@std.uestc.edu.cn>, Yinhao Hu , Kaiyan Mei , Dongliang Mu , Jiayuan Chen , Alexei Starovoitov , Sasha Levin Subject: [PATCH 6.18 127/957] bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks Date: Wed, 20 May 2026 18:10:10 +0200 Message-ID: <20260520162137.309836478@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiayuan Chen [ Upstream commit beaf0e96b1da74549a6cabd040f9667d83b2e97e ] bpf_lsm_task_to_inode() is called under rcu_read_lock() and bpf_lsm_inet_conn_established() is called from softirq context, so neither hook can be used by sleepable LSM programs. Fixes: 423f16108c9d8 ("bpf: Augment the set of sleepable LSM hooks") Reported-by: Quan Sun <2022090917019@std.uestc.edu.cn> Reported-by: Yinhao Hu Reported-by: Kaiyan Mei Reported-by: Dongliang Mu Closes: https://lore.kernel.org/bpf/3ab69731-24d1-431a-a351-452aafaaf2a5@std.uestc.edu.cn/T/#u Signed-off-by: Jiayuan Chen Link: https://lore.kernel.org/r/20260407122334.344072-1-jiayuan.chen@linux.dev Signed-off-by: Alexei Starovoitov Signed-off-by: Sasha Levin --- kernel/bpf/bpf_lsm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c index 0a59df1c550a0..2eead789b898b 100644 --- a/kernel/bpf/bpf_lsm.c +++ b/kernel/bpf/bpf_lsm.c @@ -357,8 +357,6 @@ BTF_ID(func, bpf_lsm_sb_umount) BTF_ID(func, bpf_lsm_settime) #ifdef CONFIG_SECURITY_NETWORK -BTF_ID(func, bpf_lsm_inet_conn_established) - BTF_ID(func, bpf_lsm_socket_accept) BTF_ID(func, bpf_lsm_socket_bind) BTF_ID(func, bpf_lsm_socket_connect) @@ -379,7 +377,6 @@ BTF_ID(func, bpf_lsm_syslog) BTF_ID(func, bpf_lsm_task_alloc) BTF_ID(func, bpf_lsm_task_prctl) BTF_ID(func, bpf_lsm_task_setscheduler) -BTF_ID(func, bpf_lsm_task_to_inode) BTF_ID(func, bpf_lsm_userns_create) BTF_SET_END(sleepable_lsm_hooks) -- 2.53.0