Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-18 Thread Vlastimil Babka
On 1/17/21 3:59 AM, Xiaoming Ni wrote: > On 2021/1/12 19:42, Vlastimil Babka wrote: >> On 1/12/21 8:24 AM, Michal Hocko wrote: >> >> If we're going to do a separate "patch: make process_sysctl_arg() >> return an errno instead of 0" then fine, we can discuss that.  But it's >>

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-16 Thread Xiaoming Ni
On 2021/1/12 19:42, Vlastimil Babka wrote: On 1/12/21 8:24 AM, Michal Hocko wrote: If we're going to do a separate "patch: make process_sysctl_arg() return an errno instead of 0" then fine, we can discuss that. But it's conceptually a different work from fixing this situation. . However,

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-12 Thread Vlastimil Babka
On 1/12/21 8:24 AM, Michal Hocko wrote: >> > > >> > > If we're going to do a separate "patch: make process_sysctl_arg() >> > > return an errno instead of 0" then fine, we can discuss that. But it's >> > > conceptually a different work from fixing this situation. >> > > . >> > > >> > However,

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Michal Hocko
On Mon 11-01-21 22:28:45, Andrew Morton wrote: > On Tue, 12 Jan 2021 14:24:05 +0800 Xiaoming Ni wrote: > > > On 2021/1/12 12:33, Andrew Morton wrote: > > > On Tue, 12 Jan 2021 11:31:55 +0800 Xiaoming Ni > > > wrote: > > > > > >> The process_sysctl_arg() does not check whether val is empty

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Andrew Morton
On Tue, 12 Jan 2021 14:24:05 +0800 Xiaoming Ni wrote: > On 2021/1/12 12:33, Andrew Morton wrote: > > On Tue, 12 Jan 2021 11:31:55 +0800 Xiaoming Ni > > wrote: > > > >> The process_sysctl_arg() does not check whether val is empty before > >> invoking strlen(val). If the command line

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Xiaoming Ni
On 2021/1/12 12:33, Andrew Morton wrote: On Tue, 12 Jan 2021 11:31:55 +0800 Xiaoming Ni wrote: The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrectly configured and val is empty, oops is triggered. ---

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Andrew Morton
On Tue, 12 Jan 2021 11:31:55 +0800 Xiaoming Ni wrote: > The process_sysctl_arg() does not check whether val is empty before > invoking strlen(val). If the command line parameter () is incorrectly > configured and val is empty, oops is triggered. > > --- a/fs/proc/proc_sysctl.c > +++

[PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Xiaoming Ni
The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrectly configured and val is empty, oops is triggered. For example: "hung_task_panic=1" is incorrectly written as "hung_task_panic", oops is triggered. The call