Commit 91bcca24 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] proper error cleanup on security_acct hook

Noted by Stephen Smalley: sys_acct does not properly clean up the open
file when the security_acct hook returns an error.

Fixed thus.
parent c1b1d258
...@@ -235,8 +235,11 @@ asmlinkage long sys_acct(const char *name) ...@@ -235,8 +235,11 @@ asmlinkage long sys_acct(const char *name)
} }
error = security_acct(file); error = security_acct(file);
if (error) if (error) {
if (file)
filp_close(file, NULL);
return error; return error;
}
spin_lock(&acct_globals.lock); spin_lock(&acct_globals.lock);
acct_file_reopen(file); acct_file_reopen(file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment