seccomp: remove unnecessary unlikely()
Subsystems (2)
PATCH 1/1 seccomp: remove unnecessary unlikely()
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another.
--- kernel/seccomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/seccomp.c +2 -2
@@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd,READ_ONCE (current->seccomp.filter);/* Ensure unexpected behavior doesn't result in failing open. */ -if (unlikely (WARN_ON (f ==NULL ))) +if (WARN_ON (f ==NULL ))return SECCOMP_RET_KILL_PROCESS ;if (!sd) {
@@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void)/* Return the first thread that cannot be synchronized. */ failed =task_pid_vnr (thread);/* If the pid cannot be resolved, then return -ESRCH */ -if (unlikely (WARN_ON (failed ==0 ))) +if (WARN_ON (failed ==0 )) failed = -ESRCH ;return failed; }
Signature · 1 line
2.17.1
Quoted 5 lines · Igor Stoppa
WARN_ON()already contains anunlikely(), so it's not necessary to wrap it into another.Signed-off-by Igor Stoppa <[email protected]>Acked-by Kees Cook <[email protected]>
Should I take this, or is it part of your series going somewhere else?
-Kees
Quoted 31 lines
Cc linux-security-module at vger.kernel.orgCc linux-kernel at vger.kernel.org--- kernel/seccomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/seccomp.c +2
-3@@ -195,7 +195,7 @@ static u32 seccomp_run_filters(const struct seccomp_data *sd,READ_ONCE (current->seccomp.filter);/* Ensure unexpected behavior doesn't result in failing open. */ -if (unlikely (WARN_ON (f ==NULL ))) +if (WARN_ON (f ==NULL ))return SECCOMP_RET_KILL_PROCESS ;if (!sd) {@@ -297,7 +297,7 @@ static inline pid_t seccomp_can_sync_threads(void)/* Return the first thread that cannot be synchronized. */ failed =task_pid_vnr (thread);/* If the pid cannot be resolved, then return -ESRCH */ -if (unlikely (WARN_ON (failed ==0 ))) +if (WARN_ON (failed ==0 )) failed = -ESRCH ;return failed; } --2.17.1
Signature · 2 lines
Kees Cook Pixel Security
Quoted 1 line · Kees Cook
Should I take this, or is it part of your series going somewhere else?
It turned out it doesn't really work to have a generic series against 20 trees :-/
I'm submitting them individually to each subsystem. So this one is just for security.
--
thanks, igor
Quoted 9 lines · Igor Stoppa
Quoted 1 line · Kees Cook
Should I take this, or is it part of your series going somewhere else?
It turned out it doesn't really work to have a generic series against 20 trees :-/
I know that pain very well!
Quoted 2 lines
I'm submitting them individually to each subsystem. So this one is just for security.
Sounds good.
James, can you take this directly, or would you prefer a pull request from me?
-Kees
Signature · 2 lines
Kees Cook Pixel Security
James Morris
maintainerQuoted 11 lines · Kees Cook
Quoted 9 lines · Igor Stoppa
Quoted 1 line · Kees Cook
Should I take this, or is it part of your series going somewhere else?
It turned out it doesn't really work to have a generic series against 20 trees :-/
Quoted 8 lines
I know that pain very well!
Quoted 2 lines
I'm submitting them individually to each subsystem. So this one is just for security.
Sounds good.
James, can you take this directly, or would you prefer a pull request from me?
I'll take it with your ack.
Signature · 2 lines
James Morris <[email protected]>
Kees Cook
Acked-byQuoted 15 lines · James Morris
Quoted 13 lines · Kees Cook
Quoted 9 lines · Igor Stoppa
Quoted 1 line · Kees Cook
Should I take this, or is it part of your series going somewhere else?
It turned out it doesn't really work to have a generic series against 20 trees :-/
I know that pain very well!
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
I'm submitting them individually to each subsystem. So this one is just for security.
Sounds good.
James, can you take this directly, or would you prefer a pull request from me?
I'll take it with your ack.
Already included! :) (This was a v2, split from a separate series, so Igor already included my Ack from the other thread.)
But, for completeness:
-Kees
Signature · 2 lines
Kees Cook Pixel Security
James Morris
maintainerQuoted 7 lines · Igor Stoppa
WARN_ON()already contains anunlikely(), so it's not necessary to wrap it into another.Signed-off-by Igor Stoppa <[email protected]>Acked-by Kees Cook <[email protected]>Cc linux-security-module at vger.kernel.orgCc linux-kernel at vger.kernel.org
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-general
and next-testing.
Thanks!
Signature · 2 lines
James Morris <[email protected]>