From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753833AbdEJVCT (ORCPT ); Wed, 10 May 2017 17:02:19 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:35669 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751755AbdEJVCR (ORCPT ); Wed, 10 May 2017 17:02:17 -0400 Message-ID: <1494450134.28559.2.camel@gmail.com> Subject: Re: [kernel-hardening] Re: [PATCH v6 0/2] security: tty: make TIOCSTI ioctl require CAP_SYS_ADMIN From: Daniel Micay To: Alan Cox , Matt Brown Cc: serge@hallyn.com, gregkh@linuxfoundation.org, jslaby@suse.com, akpm@linux-foundation.org, jannh@google.com, keescook@chromium.org, jmorris@namei.org, kernel-hardening@lists.openwall.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 10 May 2017 17:02:14 -0400 In-Reply-To: <20170510212920.7f6bc5e6@alans-desktop> References: <20170505232018.28846-1-matt@nmatt.com> <20170510212920.7f6bc5e6@alans-desktop> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 context change so the shell > you return to gets the input and oh dear.... > > Alan I might be missing something, but it looks like the patch tracks where the tty was created and only allows this with CAP_SYS_ADMIN in the ns where the tty came from.