diff options
author | Tycho Andersen <[email protected]> | 2020-09-02 08:09:53 -0600 |
---|---|---|
committer | Kees Cook <[email protected]> | 2020-09-08 11:30:16 -0700 |
commit | e839317900e9f13c83d8711d684de88c625b307a (patch) | |
tree | 2b62afa93e55a872f5fa56e6f36bbd48a8b080e7 /tools/perf/util/trace-event-scripting.c | |
parent | 19d1d49f2a8ce7adb10d93ff31909b0932c0d628 (diff) |
seccomp: don't leave dangling ->notif if file allocation fails
Christian and Kees both pointed out that this is a bit sloppy to open-code
both places, and Christian points out that we leave a dangling pointer to
->notif if file allocation fails. Since we check ->notif for null in order
to determine if it's ok to install a filter, this means people won't be
able to install a filter if the file allocation fails for some reason, even
if they subsequently should be able to.
To fix this, let's hoist this free+null into its own little helper and use
it.
Reported-by: Kees Cook <[email protected]>
Reported-by: Christian Brauner <[email protected]>
Signed-off-by: Tycho Andersen <[email protected]>
Acked-by: Christian Brauner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions