]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
vt: add permission check for KDSKBMETA ioctl
authorJoshua Rogers <linux@joshua.hu>
Fri, 31 Jul 2026 07:56:17 +0000 (09:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2026 14:31:14 +0000 (16:31 +0200)
KDSKBMETA modifies keyboard meta mode but lacks the !perm check that all
other keyboard setter ioctls in vt_k_ioctl() enforce, allowing a process
to change meta mode on a non-controlling console without authorization.

Assisted-by: AISLE:Snapshot
Cc: stable <stable@kernel.org>
Signed-off-by: Joshua Rogers <linux@joshua.hu>
Link: https://patch.msgid.link/20260731-tty-vt-stuff-v1-2-be99b9da8e30@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt_ioctl.c

index 28993a3d0acb639deec2aabab9c9b92cdd8c98e8..deb3b3f934616f07da686394fe8d8d0292d11100 100644 (file)
@@ -406,6 +406,8 @@ static int vt_k_ioctl(struct tty_struct *tty, unsigned int cmd,
        /* this could be folded into KDSKBMODE, but for compatibility
           reasons it is not so easy to fold KDGKBMETA into KDGKBMODE */
        case KDSKBMETA:
+               if (!perm)
+                       return -EPERM;
                return vt_do_kdskbmeta(console, arg);
 
        case KDGKBMETA: