Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-31 Thread Serge E. Hallyn
Quoting Alan Cox (gno...@lxorguk.ukuu.org.uk): > > Alan is right. CAP_SYS_ADMIN allows crossing the tty barrier. > > I don't need CAP_ anything to mmap your frame buffer, or use selection to > cut and paste text into the terminal. > > > Broken applications that you can wrap in a pty/tty pair as

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-31 Thread Alan Cox
> Alan is right. CAP_SYS_ADMIN allows crossing the tty barrier. I don't need CAP_ anything to mmap your frame buffer, or use selection to cut and paste text into the terminal. > Broken applications that you can wrap in a pty/tty pair as the lxc > application does would be defeated if those appl

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-31 Thread Peter Dolding
On Wed, May 31, 2017 at 7:52 AM, Alan Cox wrote: >> > So tty stuff should under a tty capabilities. >> >> (last reply on this) >> >> Currently capabilities.7 says >> >> * employ the TIOCSTI ioctl(2) to insert characters into the >> input queue of a >> terminal othe

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-30 Thread Alan Cox
> > So tty stuff should under a tty capabilities. > > (last reply on this) > > Currently capabilities.7 says > > * employ the TIOCSTI ioctl(2) to insert characters into the > input queue of a > terminal other than the caller's controlling terminal; > > for CAP

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-30 Thread Serge E. Hallyn
Quoting Peter Dolding (oia...@gmail.com): > On Sat, May 20, 2017 at 12:33 AM, Serge E. Hallyn wrote: > > On Fri, May 19, 2017 at 12:48:17PM +1000, Peter Dolding wrote: > >> Using cap_sys_admin as fix is like removing car windsheld because > >> vision is being blocked by a rock hitting it. > > > >

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-29 Thread Peter Dolding
On Sat, May 20, 2017 at 12:33 AM, Serge E. Hallyn wrote: > On Fri, May 19, 2017 at 12:48:17PM +1000, Peter Dolding wrote: >> Using cap_sys_admin as fix is like removing car windsheld because >> vision is being blocked by a rock hitting it. > > Nonsense. If the application has cap_sys_admin then i

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-19 Thread Serge E. Hallyn
On Fri, May 19, 2017 at 12:48:17PM +1000, Peter Dolding wrote: > Using cap_sys_admin as fix is like removing car windsheld because > vision is being blocked by a rock hitting it. Nonsense. If the application has cap_sys_admin then it is less contained and more trusted anyway. If I went to the tr

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-18 Thread Peter Dolding
On Thu, May 18, 2017 at 1:18 PM, Kees Cook wrote: > On Wed, May 17, 2017 at 11:25 AM, Daniel Micay wrote: >> On Wed, 2017-05-17 at 17:41 +0100, Alan Cox wrote: >>> > If we're adjusting applications, they should be made to avoid >>> > TIOSCTI >>> > completely. This looks to me a lot like the symli

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-17 Thread Kees Cook
On Wed, May 17, 2017 at 11:25 AM, Daniel Micay wrote: > On Wed, 2017-05-17 at 17:41 +0100, Alan Cox wrote: >> > If we're adjusting applications, they should be made to avoid >> > TIOSCTI >> > completely. This looks to me a lot like the symlink restrictions: >> > yes, >> > userspace should be fixed

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-17 Thread Daniel Micay
On Wed, 2017-05-17 at 17:41 +0100, Alan Cox wrote: > > If we're adjusting applications, they should be made to avoid > > TIOSCTI > > completely. This looks to me a lot like the symlink restrictions: > > yes, > > userspace should be fixed to the do the right thing, but why not > > provide support to

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-16 Thread Peter Dolding
On Wed, May 17, 2017 at 1:48 AM, Serge E. Hallyn wrote: > Quoting Kees Cook (keesc...@chromium.org): >> On Tue, May 16, 2017 at 5:22 AM, Matt Brown wrote: >> > On 05/16/2017 05:01 AM, Peter Dolding wrote: >> >>> >> >>> >> >>> I could see a case being make for CAP_SYS_TTY_CONFIG. However I still >

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-16 Thread Serge E. Hallyn
Quoting Kees Cook (keesc...@chromium.org): > On Tue, May 16, 2017 at 5:22 AM, Matt Brown wrote: > > On 05/16/2017 05:01 AM, Peter Dolding wrote: > >>> > >>> > >>> I could see a case being make for CAP_SYS_TTY_CONFIG. However I still > >>> choose to do with CAP_SYS_ADMIN because it is already in us

Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN

2017-05-10 Thread Daniel Micay
On Wed, 2017-05-10 at 21:29 +0100, Alan Cox wrote: > > In addition your change to allow it to be used by root in the guest > completely invalidates any protection you have because I can push > > "rm -rf /\n" > > as root in my namespace and exit > > The tty buffers are not flushed across the con