Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Kees Cook and committed by
Greg Kroah-Hartman
d2ec3f77 a727b025

+1 -1
+1 -1
drivers/tty/pty.c
··· 800 800 return retval; 801 801 } 802 802 803 - static struct file_operations ptmx_fops; 803 + static struct file_operations ptmx_fops __ro_after_init; 804 804 805 805 static void __init unix98_pty_init(void) 806 806 {