Re: [PATCH v2] clear file privilege bits when mmap writing

2015-12-09 Thread Kees Cook
On Wed, Dec 9, 2015 at 12:26 AM, Jan Kara wrote: > On Mon 07-12-15 16:40:14, Kees Cook wrote: >> On Mon, Dec 7, 2015 at 2:42 PM, Kees Cook wrote: >> > On Thu, Dec 3, 2015 at 5:45 PM, yalin wang >> > wrote: >> >> >> >>> On Dec 2, 2015, at 16:03, Kees Cook wrote: >> >>> >> >>> Normally, when a u

Re: [PATCH v2] clear file privilege bits when mmap writing

2015-12-09 Thread Jan Kara
On Mon 07-12-15 16:40:14, Kees Cook wrote: > On Mon, Dec 7, 2015 at 2:42 PM, Kees Cook wrote: > > On Thu, Dec 3, 2015 at 5:45 PM, yalin wang wrote: > >> > >>> On Dec 2, 2015, at 16:03, Kees Cook wrote: > >>> > >>> Normally, when a user can modify a file that has setuid or setgid bits, > >>> thos

Re: [PATCH v2] clear file privilege bits when mmap writing

2015-12-07 Thread Kees Cook
On Mon, Dec 7, 2015 at 2:42 PM, Kees Cook wrote: > On Thu, Dec 3, 2015 at 5:45 PM, yalin wang wrote: >> >>> On Dec 2, 2015, at 16:03, Kees Cook wrote: >>> >>> Normally, when a user can modify a file that has setuid or setgid bits, >>> those bits are cleared when they are not the file owner or a

Re: [PATCH v2] clear file privilege bits when mmap writing

2015-12-07 Thread Kees Cook
On Thu, Dec 3, 2015 at 5:45 PM, yalin wang wrote: > >> On Dec 2, 2015, at 16:03, Kees Cook wrote: >> >> Normally, when a user can modify a file that has setuid or setgid bits, >> those bits are cleared when they are not the file owner or a member >> of the group. This is enforced when using write

Re: [PATCH v2] clear file privilege bits when mmap writing

2015-12-03 Thread yalin wang
> On Dec 2, 2015, at 16:03, Kees Cook wrote: > > Normally, when a user can modify a file that has setuid or setgid bits, > those bits are cleared when they are not the file owner or a member > of the group. This is enforced when using write and truncate but not > when writing to a shared mmap on