diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-21 17:26:42 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-27 09:33:54 +0200 |
commit | c9b31a7e672630051e815d70ca8697ed34078951 (patch) | |
tree | 544d06b8b26617cc755e9ae129981bc90de84d31 /drivers/tty/tty_io.c | |
parent | c3e76f072adbcc426fbeef5d7469f847a2f700d6 (diff) | |
download | linux-stable-c9b31a7e672630051e815d70ca8697ed34078951.tar.gz linux-stable-c9b31a7e672630051e815d70ca8697ed34078951.tar.bz2 linux-stable-c9b31a7e672630051e815d70ca8697ed34078951.zip |
tty: ldisc: add sysctl to prevent autoloading of ldiscs
commit 7c0cca7c847e6e019d67b7d793efbbe3b947d004 upstream.
By default, the kernel will automatically load the module of any line
dicipline that is asked for. As this sometimes isn't the safest thing
to do, provide a sysctl to disable this feature.
By default, we set this to 'y' as that is the historical way that Linux
has worked, and we do not want to break working systems. But in the
future, perhaps this can default to 'n' to prevent this functionality.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 5b86ebc76a8a..b7effcfee91d 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -513,6 +513,8 @@ void proc_clear_tty(struct task_struct *p) tty_kref_put(tty); } +extern void tty_sysctl_init(void); + /** * proc_set_tty - set the controlling terminal * @@ -3689,6 +3691,7 @@ void console_sysfs_notify(void) */ int __init tty_init(void) { + tty_sysctl_init(); cdev_init(&tty_cdev, &tty_fops); if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) |