+6
−0
+10
−0
Loading
mainline inclusion from mainline-v6.10-rc1 commit 6bd23e0c2bb6c65d4f5754d1456bc9a4427fc59b category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IACT4T CVE: CVE-2024-40966 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6bd23e0c2bb6c65d4f5754d1456bc9a4427fc59b -------------------------------- ... and use it to limit the virtual terminals to just N_TTY. They are kind of special, and in particular, the "con_write()" routine violates the "writes cannot sleep" rule that some ldiscs rely on. This avoids the BUG: sleeping function called from invalid context at kernel/printk/printk.c:2659 when N_GSM has been attached to a virtual console, and gsmld_write() calls con_write() while holding a spinlock, and con_write() then tries to get the console lock. Tested-by:Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Daniel Starke <daniel.starke@siemens.com> Reported-by:
syzbot <syzbot+dbac96d8e73b61aa559c@syzkaller.appspotmail.com> Closes: https://syzkaller.appspot.com/bug?extid=dbac96d8e73b61aa559c Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/20240423163339.59780-1-torvalds@linux-foundation.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Conflicts: include/linux/tty_driver.h [Not merge commit 1fe18309 ("tty: add kernel-doc for tty_operations"),and context conflicts] Signed-off-by:
Yi Yang <yiyang13@huawei.com>