Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-06-10 Thread Salvatore Mesoraca
2018-06-04 18:57 GMT+02:00 Steve Kemp : >> A configurable LSM is probably the right way to do this. > > I wonder how many out of tree LSM there are? Looking at the mainline > kernel the only "small" LSM bundled is YAMA, and it seems that most of > the patches proposing new ones eventually die out.

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-06-04 Thread Casey Schaufler
On 6/4/2018 9:57 AM, Steve Kemp wrote: >> A configurable LSM is probably the right way to do this. > I wonder how many out of tree LSM there are? Looking at the mainline > kernel the only "small" LSM bundled is YAMA, and it seems that most of > the patches proposing new ones eventually die out. L

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-06-04 Thread Steve Kemp
> A configurable LSM is probably the right way to do this. I wonder how many out of tree LSM there are? Looking at the mainline kernel the only "small" LSM bundled is YAMA, and it seems that most of the patches proposing new ones eventually die out. I appreciate that there are probably a lot of

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-28 Thread Salvatore Mesoraca
2018-05-28 11:06 GMT+02:00 Jann Horn : > On Sat, May 26, 2018 at 4:50 PM, Salvatore Mesoraca > wrote: >> Prevent a task from opening, in "write" mode, any /proc/*/mem >> file that operates on the task's mm. >> /proc/*/mem is mainly a debugging means and, as such, it shouldn't >> be used by the ins

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-28 Thread Salvatore Mesoraca
2018-05-27 3:33 GMT+02:00 Linus Torvalds : > On Sat, May 26, 2018 at 5:32 PM Kees Cook wrote: > >> I went through some old threads from 2012 when e268337dfe26 was >> introduced, and later when things got looked at during DirtyCOW. There >> was discussion about removing FOLL_FORCE (in order to bloc

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-28 Thread Jann Horn
On Sat, May 26, 2018 at 4:50 PM, Salvatore Mesoraca wrote: > Prevent a task from opening, in "write" mode, any /proc/*/mem > file that operates on the task's mm. > /proc/*/mem is mainly a debugging means and, as such, it shouldn't > be used by the inspected process itself. > Current implementation

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-27 Thread Kees Cook
On Sat, May 26, 2018 at 6:33 PM, Linus Torvalds wrote: > Thus commit f511c0b17b08 "Yes, people use FOLL_FORCE ;)" > > Side note, that very sam ecommit f511c0b17b08 is also the explanation for > why the patch under discussion now seems broken. > > People really do use "write to /proc/self/mem" as a

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Linus Torvalds
On Sat, May 26, 2018 at 5:32 PM Kees Cook wrote: > I went through some old threads from 2012 when e268337dfe26 was > introduced, and later when things got looked at during DirtyCOW. There > was discussion about removing FOLL_FORCE (in order to block writes on > a read-only memory region). Side n

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Kees Cook
On Sat, May 26, 2018 at 7:50 AM, Salvatore Mesoraca wrote: > Prevent a task from opening, in "write" mode, any /proc/*/mem > file that operates on the task's mm. > /proc/*/mem is mainly a debugging means and, as such, it shouldn't > be used by the inspected process itself. > Current implementation

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Alexey Dobriyan
On Sat, May 26, 2018 at 07:30:47PM +0200, Salvatore Mesoraca wrote: > 2018-05-26 17:48 GMT+02:00 Alexey Dobriyan : > > On Sat, May 26, 2018 at 04:50:46PM +0200, Salvatore Mesoraca wrote: > >> Prevent a task from opening, in "write" mode, any /proc/*/mem > >> file that operates on the task's mm. > >

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Casey Schaufler
On 5/26/2018 10:30 AM, Salvatore Mesoraca wrote: > 2018-05-26 17:48 GMT+02:00 Alexey Dobriyan : >> On Sat, May 26, 2018 at 04:50:46PM +0200, Salvatore Mesoraca wrote: >>> Prevent a task from opening, in "write" mode, any /proc/*/mem >>> file that operates on the task's mm. >>> /proc/*/mem is mainly

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Salvatore Mesoraca
2018-05-26 17:48 GMT+02:00 Alexey Dobriyan : > On Sat, May 26, 2018 at 04:50:46PM +0200, Salvatore Mesoraca wrote: >> Prevent a task from opening, in "write" mode, any /proc/*/mem >> file that operates on the task's mm. >> /proc/*/mem is mainly a debugging means and, as such, it shouldn't >> be use

Re: [PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Alexey Dobriyan
On Sat, May 26, 2018 at 04:50:46PM +0200, Salvatore Mesoraca wrote: > Prevent a task from opening, in "write" mode, any /proc/*/mem > file that operates on the task's mm. > /proc/*/mem is mainly a debugging means and, as such, it shouldn't > be used by the inspected process itself. > Current implem

[PATCH] proc: prevent a task from writing on its own /proc/*/mem

2018-05-26 Thread Salvatore Mesoraca
Prevent a task from opening, in "write" mode, any /proc/*/mem file that operates on the task's mm. /proc/*/mem is mainly a debugging means and, as such, it shouldn't be used by the inspected process itself. Current implementation always allow a task to access its own /proc/*/mem file. A process can