Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-05 Thread Kees Cook
On Tue, May 05, 2020 at 10:03:27PM +, Luis Chamberlain wrote: > On Tue, May 05, 2020 at 01:41:44PM -0700, Kees Cook wrote: > > Right -- while it'd be nice if the developer noticed it, it is _usually_ > > an unsuspecting end user (or fuzzer), in which case we absolutely want a > > WARN (and not

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-05 Thread Luis Chamberlain
On Tue, May 05, 2020 at 01:41:44PM -0700, Kees Cook wrote: > On Tue, May 05, 2020 at 08:34:41AM +0200, Greg KH wrote: > > On Mon, May 04, 2020 at 09:59:03PM +, Luis Chamberlain wrote: > > > On Mon, May 04, 2020 at 01:32:07PM -0700, Kees Cook wrote: > > > > On Mon, May 04, 2020 at 07:59:37PM +00

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-05 Thread Kees Cook
On Tue, May 05, 2020 at 08:34:41AM +0200, Greg KH wrote: > On Mon, May 04, 2020 at 09:59:03PM +, Luis Chamberlain wrote: > > On Mon, May 04, 2020 at 01:32:07PM -0700, Kees Cook wrote: > > > On Mon, May 04, 2020 at 07:59:37PM +, Luis Chamberlain wrote: > > > > On Mon, May 04, 2020 at 12:08:5

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Greg KH
On Mon, May 04, 2020 at 09:59:03PM +, Luis Chamberlain wrote: > On Mon, May 04, 2020 at 01:32:07PM -0700, Kees Cook wrote: > > On Mon, May 04, 2020 at 07:59:37PM +, Luis Chamberlain wrote: > > > On Mon, May 04, 2020 at 12:08:55PM -0700, Kees Cook wrote: > > > > Just as a precaution, make su

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Christoph Hellwig
On Mon, May 04, 2020 at 12:08:55PM -0700, Kees Cook wrote: > Just as a precaution, make sure that proc handlers don't accidentally > grow "count" beyond the allocated kbuf size. > > Signed-off-by: Kees Cook > --- > This applies to hch's sysctl cleanup tree... This looks ok o me. You should prob

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Luis Chamberlain
On Mon, May 04, 2020 at 01:32:07PM -0700, Kees Cook wrote: > On Mon, May 04, 2020 at 07:59:37PM +, Luis Chamberlain wrote: > > On Mon, May 04, 2020 at 12:08:55PM -0700, Kees Cook wrote: > > > Just as a precaution, make sure that proc handlers don't accidentally > > > grow "count" beyond the all

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Kees Cook
On Mon, May 04, 2020 at 07:59:37PM +, Luis Chamberlain wrote: > On Mon, May 04, 2020 at 12:08:55PM -0700, Kees Cook wrote: > > Just as a precaution, make sure that proc handlers don't accidentally > > grow "count" beyond the allocated kbuf size. > > > > Signed-off-by: Kees Cook > > --- > > Th

Re: [PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Luis Chamberlain
On Mon, May 04, 2020 at 12:08:55PM -0700, Kees Cook wrote: > Just as a precaution, make sure that proc handlers don't accidentally > grow "count" beyond the allocated kbuf size. > > Signed-off-by: Kees Cook > --- > This applies to hch's sysctl cleanup tree... > --- > fs/proc/proc_sysctl.c | 3 ++

[PATCH] sysctl: Make sure proc handlers can't expose heap memory

2020-05-04 Thread Kees Cook
Just as a precaution, make sure that proc handlers don't accidentally grow "count" beyond the allocated kbuf size. Signed-off-by: Kees Cook --- This applies to hch's sysctl cleanup tree... --- fs/proc/proc_sysctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/proc_sysctl.c b/fs