Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
  security/tomoyo: Remove now unnecessary handling of security_sysctl.
  security/tomoyo: Add a special case to handle accesses through the internal proc mount.
  sysctl: Drop & in front of every proc_handler.
  sysctl: Remove CTL_NONE and CTL_UNNUMBERED
  sysctl: kill dead ctl_handler definitions.
  sysctl: Remove the last of the generic binary sysctl support
  sysctl net: Remove unused binary sysctl code
  sysctl security/tomoyo: Don't look at ctl_name
  sysctl arm: Remove binary sysctl support
  sysctl x86: Remove dead binary sysctl support
  sysctl sh: Remove dead binary sysctl support
  sysctl powerpc: Remove dead binary sysctl support
  sysctl ia64: Remove dead binary sysctl support
  sysctl s390: Remove dead sysctl binary support
  sysctl frv: Remove dead binary sysctl support
  sysctl mips/lasat: Remove dead binary sysctl support
  sysctl drivers: Remove dead binary sysctl support
  sysctl crypto: Remove dead binary sysctl support
  sysctl security/keys: Remove dead binary sysctl support
  sysctl kernel: Remove binary sysctl logic
  ...
  • Loading branch information
torvalds committed Dec 8, 2009
2 parents 6ec22f9 + c656ae9 commit 1557d33
Show file tree
Hide file tree
Showing 135 changed files with 2,183 additions and 4,748 deletions.
22 changes: 0 additions & 22 deletions Documentation/sysctl/ctl_unnumbered.txt

This file was deleted.

17 changes: 6 additions & 11 deletions arch/arm/kernel/isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;

static ctl_table ctl_isa_vars[4] = {
{
.ctl_name = BUS_ISA_MEM_BASE,
.procname = "membase",
.data = &isa_membase,
.maxlen = sizeof(isa_membase),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
}, {
.ctl_name = BUS_ISA_PORT_BASE,
.procname = "portbase",
.data = &isa_portbase,
.maxlen = sizeof(isa_portbase),
.mode = 0444,
.proc_handler = &proc_dointvec,
.proc_handler = proc_dointvec,
}, {
.ctl_name = BUS_ISA_PORT_SHIFT,
.procname = "portshift",
.data = &isa_portshift,
.maxlen = sizeof(isa_portshift),
.mode = 0444,
.proc_handler = &proc_dointvec,
}, {0}
.proc_handler = proc_dointvec,
}, {}
};

static struct ctl_table_header *isa_sysctl_header;

static ctl_table ctl_isa[2] = {
{
.ctl_name = CTL_BUS_ISA,
.procname = "isa",
.mode = 0555,
.child = ctl_isa_vars,
}, {0}
}, {}
};

static ctl_table ctl_bus[2] = {
{
.ctl_name = CTL_BUS,
.procname = "bus",
.mode = 0555,
.child = ctl_isa,
}, {0}
}, {}
};

void __init
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-bcmring/arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,23 @@ HW_DECLARE_SPINLOCK(gpio)
EXPORT_SYMBOL(bcmring_gpio_reg_lock);
#endif

/* FIXME: temporary solution */
#define BCM_SYSCTL_REBOOT_WARM 1
#define CTL_BCM_REBOOT 112

/* sysctl */
int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */

static struct ctl_table_header *bcmring_sysctl_header;

static struct ctl_table bcmring_sysctl_warm_reboot[] = {
{
.ctl_name = BCM_SYSCTL_REBOOT_WARM,
.procname = "warm",
.data = &bcmring_arch_warm_reboot,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec},
.proc_handler = proc_dointvec},
{}
};

static struct ctl_table bcmring_sysctl_reboot[] = {
{
.ctl_name = CTL_BCM_REBOOT,
.procname = "reboot",
.mode = 0555,
.child = bcmring_sysctl_warm_reboot},
Expand Down
114 changes: 6 additions & 108 deletions arch/frv/kernel/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
return try_set_cmode(new_cmode)?:*lenp;
}

static int cmode_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;

if (get_user(oldlen, oldlenp))
return -EFAULT;

if (oldlen != sizeof(int))
return -EINVAL;

if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cmode;

if (newlen != sizeof(int))
return -EINVAL;

if (get_user(new_cmode, (int __user *)newval))
return -EFAULT;

return try_set_cmode(new_cmode)?:1;
}
return 1;
}

static int try_set_p0(int new_p0)
{
unsigned long flags, clkc;
Expand Down Expand Up @@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
return try_set_p0(new_p0)?:*lenp;
}

static int p0_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;

if (get_user(oldlen, oldlenp))
return -EFAULT;

if (oldlen != sizeof(int))
return -EINVAL;

if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_p0;

if (newlen != sizeof(int))
return -EINVAL;

if (get_user(new_p0, (int __user *)newval))
return -EFAULT;

return try_set_p0(new_p0)?:1;
}
return 1;
}

static int cm_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos)
{
Expand All @@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write,
return try_set_cm(new_cm)?:*lenp;
}

static int cm_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;

if (get_user(oldlen, oldlenp))
return -EFAULT;

if (oldlen != sizeof(int))
return -EINVAL;

if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cm;

if (newlen != sizeof(int))
return -EINVAL;

if (get_user(new_cm, (int __user *)newval))
return -EFAULT;

return try_set_cm(new_cm)?:1;
}
return 1;
}


static struct ctl_table pm_table[] =
{
{
.ctl_name = CTL_PM_SUSPEND,
.procname = "suspend",
.data = NULL,
.maxlen = 0,
.mode = 0200,
.proc_handler = &sysctl_pm_do_suspend,
.proc_handler = sysctl_pm_do_suspend,
},
{
.ctl_name = CTL_PM_CMODE,
.procname = "cmode",
.data = &clock_cmode_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cmode_procctl,
.strategy = &cmode_sysctl,
.proc_handler = cmode_procctl,
},
{
.ctl_name = CTL_PM_P0,
.procname = "p0",
.data = &clock_p0_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &p0_procctl,
.strategy = &p0_sysctl,
.proc_handler = p0_procctl,
},
{
.ctl_name = CTL_PM_CM,
.procname = "cm",
.data = &clock_cm_current,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &cm_procctl,
.strategy = &cm_sysctl,
.proc_handler = cm_procctl,
},
{ .ctl_name = 0}
{ }
};

static struct ctl_table pm_dir_table[] =
{
{
.ctl_name = CTL_PM,
.procname = "pm",
.mode = 0555,
.child = pm_table,
},
{ .ctl_name = 0}
{ }
};

/*
Expand Down
7 changes: 2 additions & 5 deletions arch/frv/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
static struct ctl_table frv_table[] =
{
{
.ctl_name = 1,
.procname = "cache-mode",
.data = NULL,
.maxlen = 0,
.mode = 0644,
.proc_handler = &procctl_frv_cachemode,
.proc_handler = procctl_frv_cachemode,
},
#ifdef CONFIG_MMU
{
.ctl_name = 2,
.procname = "pin-cxnr",
.data = NULL,
.maxlen = 0,
.mode = 0644,
.proc_handler = &procctl_frv_pin_cxnr
.proc_handler = procctl_frv_pin_cxnr
},
#endif
{}
Expand All @@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
static struct ctl_table frv_dir_table[] =
{
{
.ctl_name = CTL_FRV,
.procname = "frv",
.mode = 0555,
.child = frv_table
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/ia32/ia32_entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ ia32_syscall_table:
data8 compat_sys_writev
data8 sys_getsid
data8 sys_fdatasync
data8 sys32_sysctl
data8 compat_sys_sysctl
data8 sys_mlock /* 150 */
data8 sys_munlock
data8 sys_mlockall
Expand Down
55 changes: 0 additions & 55 deletions arch/ia64/ia32/sys_ia32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
return sys_msync(addr, len + (start - addr), flags);
}

struct sysctl32 {
unsigned int name;
int nlen;
unsigned int oldval;
unsigned int oldlenp;
unsigned int newval;
unsigned int newlen;
unsigned int __unused[4];
};

#ifdef CONFIG_SYSCTL_SYSCALL
asmlinkage long
sys32_sysctl (struct sysctl32 __user *args)
{
struct sysctl32 a32;
mm_segment_t old_fs = get_fs ();
void __user *oldvalp, *newvalp;
size_t oldlen;
int __user *namep;
long ret;

if (copy_from_user(&a32, args, sizeof(a32)))
return -EFAULT;

/*
* We need to pre-validate these because we have to disable address checking
* before calling do_sysctl() because of OLDLEN but we can't run the risk of the
* user specifying bad addresses here. Well, since we're dealing with 32 bit
* addresses, we KNOW that access_ok() will always succeed, so this is an
* expensive NOP, but so what...
*/
namep = (int __user *) compat_ptr(a32.name);
oldvalp = compat_ptr(a32.oldval);
newvalp = compat_ptr(a32.newval);

if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
|| !access_ok(VERIFY_WRITE, namep, 0)
|| !access_ok(VERIFY_WRITE, oldvalp, 0)
|| !access_ok(VERIFY_WRITE, newvalp, 0))
return -EFAULT;

set_fs(KERNEL_DS);
lock_kernel();
ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
newvalp, (size_t) a32.newlen);
unlock_kernel();
set_fs(old_fs);

if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
return -EFAULT;

return ret;
}
#endif

asmlinkage long
sys32_newuname (struct new_utsname __user *name)
{
Expand Down
Loading

0 comments on commit 1557d33

Please sign in to comment.