public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Kui-Feng Lee <thinker.li@gmail.com>,
	Kui-Feng Lee <kuifeng@meta.com>,
	Andrii Nakryiko <andrii@kernel.org>, Yonghong Song <yhs@fb.com>,
	Sasha Levin <sashal@kernel.org>,
	ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org
Subject: [PATCH AUTOSEL 6.3 02/22] bpf: Print a warning only if writing to unprivileged_bpf_disabled.
Date: Sun,  9 Jul 2023 11:13:36 -0400	[thread overview]
Message-ID: <20230709151356.513279-2-sashal@kernel.org> (raw)
In-Reply-To: <20230709151356.513279-1-sashal@kernel.org>

From: Kui-Feng Lee <thinker.li@gmail.com>

[ Upstream commit fedf99200ab086c42a572fca1d7266b06cdc3e3f ]

Only print the warning message if you are writing to
"/proc/sys/kernel/unprivileged_bpf_disabled".

The kernel may print an annoying warning when you read
"/proc/sys/kernel/unprivileged_bpf_disabled" saying

  WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible
  via Spectre v2 BHB attacks!

However, this message is only meaningful when the feature is
disabled or enabled.

Signed-off-by: Kui-Feng Lee <kuifeng@meta.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20230502181418.308479-1-kuifeng@meta.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/syscall.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index adc83cb82f379..4ae74b8ded867 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -5314,7 +5314,8 @@ static int bpf_unpriv_handler(struct ctl_table *table, int write,
 		*(int *)table->data = unpriv_enable;
 	}
 
-	unpriv_ebpf_notify(unpriv_enable);
+	if (write)
+		unpriv_ebpf_notify(unpriv_enable);
 
 	return ret;
 }
-- 
2.39.2


  reply	other threads:[~2023-07-09 15:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-09 15:13 [PATCH AUTOSEL 6.3 01/22] wifi: ath11k: fix registration of 6Ghz-only phy without the full channel range Sasha Levin
2023-07-09 15:13 ` Sasha Levin [this message]
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 03/22] wifi: rtw89: 8851be: add 8851BE PCI entry and fill PCI capabilities Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 04/22] spi: s3c64xx: change polling mode to optional Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 05/22] bpf: Address KCSAN report on bpf_lru_list Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 06/22] bpf: tcp: Avoid taking fast sock lock in iterator Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 07/22] bpf: Silence a warning in btf_type_id_size() Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 08/22] devlink: make health report on unregistered instance warn just once Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 09/22] wifi: ath11k: add support default regdb while searching board-2.bin for WCN6855 Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 10/22] wifi: mac80211_hwsim: Fix possible NULL dereference Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 11/22] spi: dw: Add compatible for Intel Mount Evans SoC Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 12/22] wifi: ath12k: Avoid NULL pointer access during management transmit cleanup Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 13/22] wifi: ath11k: fix memory leak in WMI firmware stats Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 14/22] wifi: iwlwifi: mvm: fix potential array out of bounds access Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 15/22] net: ethernet: litex: add support for 64 bit stats Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 16/22] devlink: report devlink_port_type_warn source device Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 17/22] wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point() Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 18/22] wifi: iwlwifi: Add support for new PCI Id Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 19/22] wifi: iwlwifi: mvm: avoid baid size integer overflow Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 20/22] wifi: iwlwifi: pcie: add device id 51F1 for killer 1675 Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 21/22] igb: Fix igb_down hung on surprise removal Sasha Levin
2023-07-09 15:13 ` [PATCH AUTOSEL 6.3 22/22] net: hns3: fix strncpy() not using dest-buf length as length issue Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230709151356.513279-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kuifeng@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thinker.li@gmail.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox