From patchwork Thu Sep 8 22:35:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9322229 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 8CBF760231 for ; Thu, 8 Sep 2016 22:36:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85AFE29A19 for ; Thu, 8 Sep 2016 22:36:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 781F829A2B; Thu, 8 Sep 2016 22:36:19 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 8FA3E29A19 for ; Thu, 8 Sep 2016 22:36:17 +0000 (UTC) Received: (qmail 11540 invoked by uid 550); 8 Sep 2016 22:36:15 -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: Reply-To: kernel-hardening@lists.openwall.com Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 11514 invoked from network); 8 Sep 2016 22:36:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=06v6SqOhA3v0E405RJjaJmee+SHoApFmjbOFweSh4rI=; b=CUbflj7svB0Nuvbi3mHXMYFdAhZt05dyNYqq+eUxZdZgVHDNRcmqsQ6P3pFEPkwcjb 2hLBimR2fAbP7AqJpBtTNtH37PLX0m+cDKWEOIkXZpZDVTlRnGdIDft/n046FCgVkvlS /UBFq3XtvoZ2hHmGTFQwO3FjCks0nGCCGCul0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=06v6SqOhA3v0E405RJjaJmee+SHoApFmjbOFweSh4rI=; b=EXXnbCaJ3kKlbH0OBG7MGob25Od/mx3bWYsCscpVhJKHIdag43nHe4RfNq4t2JatVh xqznTG5NgC1qrODOWvCRszqhm6nC99aP/qAPZvyHN9gou+Tu6Kz6OH/jI7XJmm0ycr+N eOdfd2szH7bS7AHkKINsG7ykLQuD7jMuehcYneLMWkYkO9Y41XCGMwYHubWPm4+l0n4K /9rqeTbU2Be+9Y28AzFY4owj7RDN05EIqW8rbcquruml14jMenPXFAx+yhi74L9iDELR uzpUaMcgepk4fDpn9Kc53eY/g/KRg60ZJb6FGOt4ylSUjSvlGUt651QQ1OiNidX8DYcJ IKnw== X-Gm-Message-State: AE9vXwNAPce/sTo2/ElDMb4TrQlSj9juqW0YFXZlW45z88pxhOggfG56RWnEDHpSiFkscxSf X-Received: by 10.66.151.173 with SMTP id ur13mr672438pab.70.1473374161779; Thu, 08 Sep 2016 15:36:01 -0700 (PDT) Date: Thu, 8 Sep 2016 15:35:59 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com Message-ID: <20160908223558.GA11742@www.outflux.net> MIME-Version: 1.0 Content-Disposition: inline Subject: [kernel-hardening] [PATCH] pty: make ptmx file ops read-only after init X-Virus-Scanned: ClamAV using ClamSMTP The ptmx_fops structure is only changed during init, so mark it as such. Signed-off-by: Kees Cook --- drivers/tty/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 51e0d32883ba..a23fa5ed1d67 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -800,7 +800,7 @@ out_free_file: return retval; } -static struct file_operations ptmx_fops; +static struct file_operations ptmx_fops __ro_after_init; static void __init unix98_pty_init(void) {