diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-08 19:33:38 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-08 19:33:38 +0300 |
commit | 45820c294fe1b1a9df495d57f40585ef2d069a39 (patch) | |
tree | 2d0571307e1124aa5b76d27767f547e3c4d11578 /fs/udf | |
parent | d6ac4ffc61ace6ed6f183e9fd7f207c0ddafb897 (diff) | |
download | linux-45820c294fe1b1a9df495d57f40585ef2d069a39.tar.xz |
Fix broken audit tests for exec arg len
The "fix" in commit 0b08c5e5944 ("audit: Fix check of return value of
strnlen_user()") didn't fix anything, it broke things. As reported by
Steven Rostedt:
"Yes, strnlen_user() returns 0 on fault, but if you look at what len is
set to, than you would notice that on fault len would be -1"
because we just subtracted one from the return value. So testing
against 0 doesn't test for a fault condition, it tests against a
perfectly valid empty string.
Also fix up the usual braindamage wrt using WARN_ON() inside a
conditional - make it part of the conditional and remove the explicit
unlikely() (which is already part of the WARN_ON*() logic, exactly so
that you don't have to write unreadable code.
Reported-and-tested-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Paul Moore <pmoore@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf')
0 files changed, 0 insertions, 0 deletions