isdn/capi: check message length in capi_write()syzbot reported: BUG: KMSAN: uninit-value in capi_write+0x791/0xa90 drivers/isdn/capi/capi.c:700 CPU: 0 PID: 10025 Comm: syz-executor379 Not
isdn/capi: check message length in capi_write()syzbot reported: BUG: KMSAN: uninit-value in capi_write+0x791/0xa90 drivers/isdn/capi/capi.c:700 CPU: 0 PID: 10025 Comm: syz-executor379 Not tainted 4.20.0-rc7+ #2 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:313 capi_write+0x791/0xa90 drivers/isdn/capi/capi.c:700 do_loop_readv_writev fs/read_write.c:703 [inline] do_iter_write+0x83e/0xd80 fs/read_write.c:961 vfs_writev fs/read_write.c:1004 [inline] do_writev+0x397/0x840 fs/read_write.c:1039 __do_sys_writev fs/read_write.c:1112 [inline] __se_sys_writev+0x9b/0xb0 fs/read_write.c:1109 __x64_sys_writev+0x4a/0x70 fs/read_write.c:1109 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 [...]The problem is that capi_write() is reading past the end of the message.Fix it by checking the message's length in the needed places.Reported-and-tested-by: [email protected]Signed-off-by: Eric Biggers <[email protected]>Signed-off-by: David S. Miller <[email protected]>
show more ...
License cleanup: add SPDX license identifier to uapi header files with a licenseMany user space API headers have licensing information, which is eitherincomplete, badly formatted or just a shortha
License cleanup: add SPDX license identifier to uapi header files with a licenseMany user space API headers have licensing information, which is eitherincomplete, badly formatted or just a shorthand for referring to thelicense under which the file is supposed to be. This makes it hard forcompliance tools to determine the correct license.Update these files with an SPDX license identifier. The identifier waschosen based on the license information in the file.GPL/LGPL licensed headers get the matching GPL/LGPL SPDX licenseidentifier with the added 'WITH Linux-syscall-note' exception, which isthe officially assigned exception identifier for the kernel syscallexception: NOTE! This copyright does *not* cover user programs that use kernel services by normal system calls - this is merely considered normal use of the kernel, and does *not* fall under the heading of "derived work".This exception makes it possible to include GPL headers into non GPLcode, without confusing license compliance tools.Headers which have either explicit dual licensing or are just licensedunder a non GPL license are updated with the corresponding SPDXidentifier and the GPLv2 with syscall exception identifier. The formatis: ((GPL-2.0 WITH Linux-syscall-note) OR SPDX-ID-OF-OTHER-LICENSE)SPDX license identifiers are a legally binding shorthand, which can beused instead of the full boiler plate text. The update does not removeexisting license information as this has to be done on a case by casebasis and the copyright holders might have to be consulted. This willhappen in a separate step.This patch is based on work done by Thomas Gleixner and Kate Stewart andPhilippe Ombredanne. See the previous patch in this series for themethodology of how this patch was researched.Reviewed-by: Kate Stewart <[email protected]>Reviewed-by: Philippe Ombredanne <[email protected]>Reviewed-by: Thomas Gleixner <[email protected]>Signed-off-by: Greg Kroah-Hartman <[email protected]>
uapi: export all headers under uapi directoriesRegularly, when a new header is created in include/uapi/, the developerforgets to add it in the corresponding Kbuild file. This error is usuallydete
uapi: export all headers under uapi directoriesRegularly, when a new header is created in include/uapi/, the developerforgets to add it in the corresponding Kbuild file. This error is usuallydetected after the release is out.In fact, all headers under uapi directories should be exported, thus it'suseless to have an exhaustive list.After this patch, the following files, which were not exported, are nowexported (with make headers_install_all):asm-arc/kvm_para.hasm-arc/ucontext.hasm-blackfin/shmparam.hasm-blackfin/ucontext.hasm-c6x/shmparam.hasm-c6x/ucontext.hasm-cris/kvm_para.hasm-h8300/shmparam.hasm-h8300/ucontext.hasm-hexagon/shmparam.hasm-m32r/kvm_para.hasm-m68k/kvm_para.hasm-m68k/shmparam.hasm-metag/kvm_para.hasm-metag/shmparam.hasm-metag/ucontext.hasm-mips/hwcap.hasm-mips/reg.hasm-mips/ucontext.hasm-nios2/kvm_para.hasm-nios2/ucontext.hasm-openrisc/shmparam.hasm-parisc/kvm_para.hasm-powerpc/perf_regs.hasm-sh/kvm_para.hasm-sh/ucontext.hasm-tile/shmparam.hasm-unicore32/shmparam.hasm-unicore32/ucontext.hasm-x86/hwcap2.hasm-xtensa/kvm_para.hdrm/armada_drm.hdrm/etnaviv_drm.hdrm/vgem_drm.hlinux/aspeed-lpc-ctrl.hlinux/auto_dev-ioctl.hlinux/bcache.hlinux/btrfs_tree.hlinux/can/vxcan.hlinux/cifs/cifs_mount.hlinux/coresight-stm.hlinux/cryptouser.hlinux/fsmap.hlinux/genwqe/genwqe_card.hlinux/hash_info.hlinux/kcm.hlinux/kcov.hlinux/kfd_ioctl.hlinux/lightnvm.hlinux/module.hlinux/nbd-netlink.hlinux/nilfs2_api.hlinux/nilfs2_ondisk.hlinux/nsfs.hlinux/pr.hlinux/qrtr.hlinux/rpmsg.hlinux/sched/types.hlinux/sed-opal.hlinux/smc.hlinux/smc_diag.hlinux/stm.hlinux/switchtec_ioctl.hlinux/vfio_ccw.hlinux/wil6210_uapi.hrdma/bnxt_re-abi.hNote that I have removed from this list the files which are generated in everyexported directories (like .install or .install.cmd).Thanks to Julien Floret <[email protected]> for the tip to get allsubdirs with a pure makefile command.For the record, note that exported files for asm directories are a mix offiles listed by: - include/uapi/asm-generic/Kbuild.asm; - arch/<arch>/include/uapi/asm/Kbuild; - arch/<arch>/include/asm/Kbuild.Signed-off-by: Nicolas Dichtel <[email protected]>Acked-by: Daniel Vetter <[email protected]>Acked-by: Russell King <[email protected]>Acked-by: Mark Salter <[email protected]>Acked-by: Michael Ellerman <[email protected]> (powerpc)Signed-off-by: Masahiro Yamada <[email protected]>
UAPI: (Scripted) Disintegrate include/linux/isdnSigned-off-by: David Howells <[email protected]>Acked-by: Arnd Bergmann <[email protected]>Acked-by: Thomas Gleixner <[email protected]>Acked-by: M
UAPI: (Scripted) Disintegrate include/linux/isdnSigned-off-by: David Howells <[email protected]>Acked-by: Arnd Bergmann <[email protected]>Acked-by: Thomas Gleixner <[email protected]>Acked-by: Michael Kerrisk <[email protected]>Acked-by: Paul E. McKenney <[email protected]>Acked-by: Dave Jones <[email protected]>
UAPI: (Scripted) Set up UAPI Kbuild filesSet up empty UAPI Kbuild files to be populated by the header splitter.Signed-off-by: David Howells <[email protected]>Acked-by: Arnd Bergmann <arnd@arn
UAPI: (Scripted) Set up UAPI Kbuild filesSet up empty UAPI Kbuild files to be populated by the header splitter.Signed-off-by: David Howells <[email protected]>Acked-by: Arnd Bergmann <[email protected]>Acked-by: Thomas Gleixner <[email protected]>Acked-by: Paul E. McKenney <[email protected]>Acked-by: Dave Jones <[email protected]>