Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-04-01 Thread Kees Cook
On Thu, Apr 01, 2021 at 09:14:25AM +0200, Michal Hocko wrote: > On Wed 31-03-21 19:21:45, Kees Cook wrote: > > The sysfs interface to seq_file continues to be rather fragile > > (seq_get_buf() should not be used outside of seq_file), as seen with > > some recent exploits[1]. Move the seq_file buffe

Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-04-01 Thread Kees Cook
On Thu, Apr 01, 2021 at 09:10:05AM +0200, Greg Kroah-Hartman wrote: > On Wed, Mar 31, 2021 at 11:52:20PM -0700, Kees Cook wrote: > > On Thu, Apr 01, 2021 at 07:16:56AM +0200, Greg Kroah-Hartman wrote: > > > On Wed, Mar 31, 2021 at 07:21:45PM -0700, Kees Cook wrote: > > > > The sysfs interface to se

Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-04-01 Thread Michal Hocko
On Wed 31-03-21 19:21:45, Kees Cook wrote: > The sysfs interface to seq_file continues to be rather fragile > (seq_get_buf() should not be used outside of seq_file), as seen with > some recent exploits[1]. Move the seq_file buffer to the vmap area > (while retaining the accounting flag), since it h

Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-04-01 Thread Greg Kroah-Hartman
On Wed, Mar 31, 2021 at 11:52:20PM -0700, Kees Cook wrote: > On Thu, Apr 01, 2021 at 07:16:56AM +0200, Greg Kroah-Hartman wrote: > > On Wed, Mar 31, 2021 at 07:21:45PM -0700, Kees Cook wrote: > > > The sysfs interface to seq_file continues to be rather fragile > > > (seq_get_buf() should not be use

Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-03-31 Thread Kees Cook
On Thu, Apr 01, 2021 at 07:16:56AM +0200, Greg Kroah-Hartman wrote: > On Wed, Mar 31, 2021 at 07:21:45PM -0700, Kees Cook wrote: > > The sysfs interface to seq_file continues to be rather fragile > > (seq_get_buf() should not be used outside of seq_file), as seen with > > some recent exploits[1]. M

Re: [PATCH v3] sysfs: Unconditionally use vmalloc for buffer

2021-03-31 Thread Greg Kroah-Hartman
On Wed, Mar 31, 2021 at 07:21:45PM -0700, Kees Cook wrote: > The sysfs interface to seq_file continues to be rather fragile > (seq_get_buf() should not be used outside of seq_file), as seen with > some recent exploits[1]. Move the seq_file buffer to the vmap area > (while retaining the accounting f