Re: [PATCH] sysctl: Deprecate sys_sysctl in a user space visible fashion.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton <[email protected]> writes:

> On Tue, 28 Aug 2007 16:40:15 -0600 [email protected] (Eric W. Biederman)
> wrote:
>
>> +static int deprecated_sysctl_warning(struct __sysctl_args *args)
>> +{
>> +	static int msg_count;
>> +	int name[CTL_MAXNAME];
>> +	int i;
>> +
>> +	/* Read in the sysctl name for better debug message logging */
>> +	for (i = 0; i < args->nlen; i++)
>> +		if (get_user(name[i], args->name + i))
>> +			return -EFAULT;
>> +
>> +	/* Ignore accesses to kernel.version */
>> + if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
>> +		return 0;
>
> Do we want to do all the above if msg_count>=5?

Well.  It won't really change order of the algorithm because we have
to read the data in any way.  So an earlier short circuit exit
would speed things up by a little bit, but it really shouldn't
matter either way.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux