Skip to contentSkip to conversation

io_uring/register: fix comment about task_no_new_privs

PATCH Applied Jann Horn 2 participants 3 messages Mar 9 io_uring

lore
Share & tools
lore

Jann Horn

author
#0 lore raw

PATCH 1/1 io_uring/register: fix comment about task_no_new_privs

The actual code is right, but the comment is the wrong way around.

Fixes ed82f35b926b ("io_uring: allow registration of per-task restrictions")
---
 io_uring/register.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
io_uring/register.c +2 -2
index 6015a3e9ce69..3378014e51fb 100644
@@ -202,7 +202,7 @@ static int io_register_restrictions_task(void __user *arg, unsigned int nr_args)
 		return -EPERM;
 	/*
 	 * Similar to seccomp, disallow setting a filter if task_no_new_privs
-	 * is true and we're not CAP_SYS_ADMIN.
+	 * is false and we're not CAP_SYS_ADMIN.
 	 */
 	if (!task_no_new_privs(current) &&
 	    !ns_capable_noaudit(current_user_ns(), CAP_SYS_ADMIN))
@@ -238,7 +238,7 @@ static int io_register_bpf_filter_task(void __user *arg, unsigned int nr_args)
 
 	/*
 	 * Similar to seccomp, disallow setting a filter if task_no_new_privs
-	 * is true and we're not CAP_SYS_ADMIN.
+	 * is false and we're not CAP_SYS_ADMIN.
 	 */
 	if (!task_no_new_privs(current) &&
 	    !ns_capable_noaudit(current_user_ns(), CAP_SYS_ADMIN))

---
base-commit: 55a6202e7bbea301c06ad1bb0e18f7799cac383e
change-id: 20260309-uring-nnp-comment-fix-2d33b61cee0a

Signature · 1 line
Jann Horn <[email protected]>
maintainer
#1 lore raw
Quoted 1 line · Jann Horn

The actual code is right, but the comment is the wrong way around.

Huh indeed, wonder how that happened. Thanks for spotting that, will get it added.

Signature · 1 line
Jens Axboe
maintainer Applied
#2 lore raw
In reply to Jann Horn
Quoted 3 lines · Jann Horn

The actual code is right, but the comment is the wrong way around.

Applied, thanks!

[1/1] io_uring/register: fix comment about task_no_new_privs

      commit: 3306a589e598b50a5bbdfe837371670b507043c0

Best regards,

Signature · 1 line
Jens Axboe