security: remove dead hook acct
Unused hook. Remove. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -1254,13 +1254,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
|
|||||||
* @cap contains the capability <include/linux/capability.h>.
|
* @cap contains the capability <include/linux/capability.h>.
|
||||||
* @audit: Whether to write an audit message or not
|
* @audit: Whether to write an audit message or not
|
||||||
* Return 0 if the capability is granted for @tsk.
|
* Return 0 if the capability is granted for @tsk.
|
||||||
* @acct:
|
|
||||||
* Check permission before enabling or disabling process accounting. If
|
|
||||||
* accounting is being enabled, then @file refers to the open file used to
|
|
||||||
* store accounting records. If accounting is being disabled, then @file
|
|
||||||
* is NULL.
|
|
||||||
* @file contains the file structure for the accounting file (may be NULL).
|
|
||||||
* Return 0 if permission is granted.
|
|
||||||
* @sysctl:
|
* @sysctl:
|
||||||
* Check permission before accessing the @table sysctl variable in the
|
* Check permission before accessing the @table sysctl variable in the
|
||||||
* manner specified by @op.
|
* manner specified by @op.
|
||||||
@@ -1383,7 +1376,6 @@ struct security_operations {
|
|||||||
const kernel_cap_t *permitted);
|
const kernel_cap_t *permitted);
|
||||||
int (*capable) (struct task_struct *tsk, const struct cred *cred,
|
int (*capable) (struct task_struct *tsk, const struct cred *cred,
|
||||||
int cap, int audit);
|
int cap, int audit);
|
||||||
int (*acct) (struct file *file);
|
|
||||||
int (*sysctl) (struct ctl_table *table, int op);
|
int (*sysctl) (struct ctl_table *table, int op);
|
||||||
int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
|
int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
|
||||||
int (*quota_on) (struct dentry *dentry);
|
int (*quota_on) (struct dentry *dentry);
|
||||||
@@ -1665,7 +1657,6 @@ int security_capset(struct cred *new, const struct cred *old,
|
|||||||
int security_capable(int cap);
|
int security_capable(int cap);
|
||||||
int security_real_capable(struct task_struct *tsk, int cap);
|
int security_real_capable(struct task_struct *tsk, int cap);
|
||||||
int security_real_capable_noaudit(struct task_struct *tsk, int cap);
|
int security_real_capable_noaudit(struct task_struct *tsk, int cap);
|
||||||
int security_acct(struct file *file);
|
|
||||||
int security_sysctl(struct ctl_table *table, int op);
|
int security_sysctl(struct ctl_table *table, int op);
|
||||||
int security_quotactl(int cmds, int type, int id, struct super_block *sb);
|
int security_quotactl(int cmds, int type, int id, struct super_block *sb);
|
||||||
int security_quota_on(struct dentry *dentry);
|
int security_quota_on(struct dentry *dentry);
|
||||||
@@ -1883,11 +1874,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int security_acct(struct file *file)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int security_sysctl(struct ctl_table *table, int op)
|
static inline int security_sysctl(struct ctl_table *table, int op)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -216,7 +216,6 @@ static int acct_on(char *name)
|
|||||||
{
|
{
|
||||||
struct file *file;
|
struct file *file;
|
||||||
struct vfsmount *mnt;
|
struct vfsmount *mnt;
|
||||||
int error;
|
|
||||||
struct pid_namespace *ns;
|
struct pid_namespace *ns;
|
||||||
struct bsd_acct_struct *acct = NULL;
|
struct bsd_acct_struct *acct = NULL;
|
||||||
|
|
||||||
@@ -244,13 +243,6 @@ static int acct_on(char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error = security_acct(file);
|
|
||||||
if (error) {
|
|
||||||
kfree(acct);
|
|
||||||
filp_close(file, NULL);
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
spin_lock(&acct_lock);
|
spin_lock(&acct_lock);
|
||||||
if (ns->bacct == NULL) {
|
if (ns->bacct == NULL) {
|
||||||
ns->bacct = acct;
|
ns->bacct = acct;
|
||||||
@@ -281,7 +273,7 @@ static int acct_on(char *name)
|
|||||||
*/
|
*/
|
||||||
SYSCALL_DEFINE1(acct, const char __user *, name)
|
SYSCALL_DEFINE1(acct, const char __user *, name)
|
||||||
{
|
{
|
||||||
int error;
|
int error = 0;
|
||||||
|
|
||||||
if (!capable(CAP_SYS_PACCT))
|
if (!capable(CAP_SYS_PACCT))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
@@ -299,13 +291,11 @@ SYSCALL_DEFINE1(acct, const char __user *, name)
|
|||||||
if (acct == NULL)
|
if (acct == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error = security_acct(NULL);
|
spin_lock(&acct_lock);
|
||||||
if (!error) {
|
acct_file_reopen(acct, NULL, NULL);
|
||||||
spin_lock(&acct_lock);
|
spin_unlock(&acct_lock);
|
||||||
acct_file_reopen(acct, NULL, NULL);
|
|
||||||
spin_unlock(&acct_lock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,11 +12,6 @@
|
|||||||
|
|
||||||
#include <linux/security.h>
|
#include <linux/security.h>
|
||||||
|
|
||||||
static int cap_acct(struct file *file)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int cap_sysctl(ctl_table *table, int op)
|
static int cap_sysctl(ctl_table *table, int op)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
@@ -865,7 +860,6 @@ void security_fixup_ops(struct security_operations *ops)
|
|||||||
set_to_cap_if_null(ops, ptrace_traceme);
|
set_to_cap_if_null(ops, ptrace_traceme);
|
||||||
set_to_cap_if_null(ops, capget);
|
set_to_cap_if_null(ops, capget);
|
||||||
set_to_cap_if_null(ops, capset);
|
set_to_cap_if_null(ops, capset);
|
||||||
set_to_cap_if_null(ops, acct);
|
|
||||||
set_to_cap_if_null(ops, capable);
|
set_to_cap_if_null(ops, capable);
|
||||||
set_to_cap_if_null(ops, quotactl);
|
set_to_cap_if_null(ops, quotactl);
|
||||||
set_to_cap_if_null(ops, quota_on);
|
set_to_cap_if_null(ops, quota_on);
|
||||||
|
@@ -190,11 +190,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int security_acct(struct file *file)
|
|
||||||
{
|
|
||||||
return security_ops->acct(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
int security_sysctl(struct ctl_table *table, int op)
|
int security_sysctl(struct ctl_table *table, int op)
|
||||||
{
|
{
|
||||||
return security_ops->sysctl(table, op);
|
return security_ops->sysctl(table, op);
|
||||||
|
Reference in New Issue
Block a user