From patchwork Mon Apr 17 06:07:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Brown X-Patchwork-Id: 9683611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7863C600C5 for ; Mon, 17 Apr 2017 06:08:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A8C7275A2 for ; Mon, 17 Apr 2017 06:08:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ECF427C05; Mon, 17 Apr 2017 06:08:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 8B43A275A2 for ; Mon, 17 Apr 2017 06:08:20 +0000 (UTC) Received: (qmail 3561 invoked by uid 550); 17 Apr 2017 06:08:02 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 3435 invoked from network); 17 Apr 2017 06:08:00 -0000 X-Virus-Scanned: Debian amavisd-new at mfilter16-d.gandi.net X-Originating-IP: 72.66.113.207 From: Matt Brown To: jmorris@namei.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org Cc: linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Matt Brown Date: Mon, 17 Apr 2017 02:07:06 -0400 Message-Id: <20170417060706.28674-5-matt@nmatt.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170417060706.28674-1-matt@nmatt.com> References: <20170417060706.28674-1-matt@nmatt.com> Subject: [kernel-hardening] [PATCH 4/4] added kernel.tiocsti_restrict sysctl X-Virus-Scanned: ClamAV using ClamSMTP this patch depends on patches 1, 2 and 3 Allow CONFIG_SECURITY_TIOCSTI_RESTRICT to be controlled via sysctl Signed-off-by: Matt Brown --- kernel/sysctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index acf0a5a..68d1363 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include @@ -833,6 +834,17 @@ static struct ctl_table kern_table[] = { .extra2 = &two, }, #endif +#if defined CONFIG_TTY + { + .procname = "tiocsti_restrict", + .data = &tiocsti_restrict, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax_sysadmin, + .extra1 = &zero, + .extra2 = &one, + }, +#endif { .procname = "ngroups_max", .data = &ngroups_max,