summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-15 06:49:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-08-07 14:40:08 -0400
commit9df7fa16ee956bf0cdf4a711eac827be92d584bc (patch)
treef1f64e028f1b6c43c0fb52b367f739c0311a0c2d /kernel
parent795a2f22a8eaf749e20a11271a8821bf04ac6d90 (diff)
downloadop-kernel-dev-9df7fa16ee956bf0cdf4a711eac827be92d584bc.zip
op-kernel-dev-9df7fa16ee956bf0cdf4a711eac827be92d584bc.tar.gz
acct: serialize acct_on()
brute-force - on a global mutex that isn't nested into anything. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/acct.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index 8777372..08963a2 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -241,6 +241,8 @@ static int acct_on(struct filename *pathname)
return 0;
}
+static DEFINE_MUTEX(acct_on_mutex);
+
/**
* sys_acct - enable/disable process accounting
* @name: file name for accounting records or NULL to shutdown accounting
@@ -263,7 +265,9 @@ SYSCALL_DEFINE1(acct, const char __user *, name)
struct filename *tmp = getname(name);
if (IS_ERR(tmp))
return PTR_ERR(tmp);
+ mutex_lock(&acct_on_mutex);
error = acct_on(tmp);
+ mutex_unlock(&acct_on_mutex);
putname(tmp);
} else {
struct bsd_acct_struct *acct;
OpenPOWER on IntegriCloud