From: Kees Cook Date: Thu, 8 Sep 2016 22:35:59 +0000 (-0700) Subject: pty: make ptmx file ops read-only after init X-Git-Tag: v4.9-rc1~147^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2ec3f77de8e67b7a3dab3ec827467e0fd797c86;p=platform%2Fkernel%2Flinux-amlogic.git pty: make ptmx file ops read-only after init The ptmx_fops structure is only changed during init, so mark it as such. Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 51e0d32..a23fa5e 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) {