]> www.infradead.org Git - nvme.git/commitdiff
tty: ldsic: fix tty_ldisc_autoload sysctl's proc_handler
authorNicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>
Tue, 12 Nov 2024 13:13:31 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Nov 2024 14:12:19 +0000 (15:12 +0100)
Commit 7c0cca7c847e ("tty: ldisc: add sysctl to prevent autoloading of
ldiscs") introduces the tty_ldisc_autoload sysctl with the wrong
proc_handler. .extra1 and .extra2 parameters are set to avoid other values
thant SYSCTL_ZERO or SYSCTL_ONE to be set but proc_dointvec do not uses
them.

This commit fixes this by using proc_dointvec_minmax instead of
proc_dointvec.

Fixes: 7c0cca7c847e ("tty: ldisc: add sysctl to prevent autoloading of ldiscs")
Cc: stable <stable@kernel.org>
Signed-off-by: Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>
Reviewed-by: Lin Feng <linf@wangsu.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20241112131357.49582-4-nicolas.bouchinet@clip-os.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c

index 9771072da177cb4ee1a486e6c156735fce6bbbec..dcb1769c3625cd0f7d1555260adfe6051139a305 100644 (file)
@@ -3631,7 +3631,7 @@ static struct ctl_table tty_table[] = {
                .data           = &tty_ldisc_autoload,
                .maxlen         = sizeof(tty_ldisc_autoload),
                .mode           = 0644,
-               .proc_handler   = proc_dointvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = SYSCTL_ZERO,
                .extra2         = SYSCTL_ONE,
        },