Messages in this thread | | | Date | Thu, 26 Mar 2020 00:21:30 -0700 | From | Kees Cook <> | Subject | Re: [RFC v2 1/2] kernel/sysctl: support setting sysctl parameters from kernel command line |
| |
On Thu, Mar 26, 2020 at 07:58:29AM +0100, Michal Hocko wrote: > On Wed 25-03-20 17:20:40, Eric W. Biederman wrote: > > Vlastimil Babka <vbabka@suse.cz> writes: > [...] > > > + if (strncmp(param, "sysctl.", sizeof("sysctl.") - 1)) > > > + return 0; > > > > Is there any way we can use a slash separated path. I know > > in practice there are not any sysctl names that don't have > > a '.' in them but why should we artifically limit ourselves? > > Because this is the normal userspace interface? Why should it be any > different from calling sysctl?
Right. The common method from userspace is dot-separated (which I agree is weird, but it's been like this for ages: see manpages sysctl(8) and sysctl.conf(5) for the details and examples). While "/" is accepted by sysctl, the files shipped in /etc/sysctl.d/ are all using "." separators.
-- Kees Cook
| |