]> git.karo-electronics.de Git - linux-beck.git/commitdiff
pty: make ptmx file ops read-only after init
authorKees Cook <keescook@chromium.org>
Thu, 8 Sep 2016 22:35:59 +0000 (15:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 10:47:03 +0000 (12:47 +0200)
The ptmx_fops structure is only changed during init, so mark it as such.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c

index 51e0d32883ba7d3bbb5b626dcb6314a49d210dff..a23fa5ed1d67f02dc269750f1d520d93ce009670 100644 (file)
@@ -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)
 {