# git rev-parse -q --verify ab6f762f0f53162d41497708b33c9a3236d3609e^{commit} ab6f762f0f53162d41497708b33c9a3236d3609e already have revision, skipping fetch # git checkout -q -f -B kisskb ab6f762f0f53162d41497708b33c9a3236d3609e # git clean -qxdf # < git log -1 # commit ab6f762f0f53162d41497708b33c9a3236d3609e # Author: Sergey Senozhatsky # Date: Tue Mar 3 20:30:02 2020 +0900 # # printk: queue wake_up_klogd irq_work only if per-CPU areas are ready # # printk_deferred(), similarly to printk_safe/printk_nmi, does not # immediately attempt to print a new message on the consoles, avoiding # calls into non-reentrant kernel paths, e.g. scheduler or timekeeping, # which potentially can deadlock the system. # # Those printk() flavors, instead, rely on per-CPU flush irq_work to print # messages from safer contexts. For same reasons (recursive scheduler or # timekeeping calls) printk() uses per-CPU irq_work in order to wake up # user space syslog/kmsg readers. # # However, only printk_safe/printk_nmi do make sure that per-CPU areas # have been initialised and that it's safe to modify per-CPU irq_work. # This means that, for instance, should printk_deferred() be invoked "too # early", that is before per-CPU areas are initialised, printk_deferred() # will perform illegal per-CPU access. # # Lech Perczak [0] reports that after commit 1b710b1b10ef ("char/random: # silence a lockdep splat with printk()") user-space syslog/kmsg readers # are not able to read new kernel messages. # # The reason is printk_deferred() being called too early (as was pointed # out by Petr and John). # # Fix printk_deferred() and do not queue per-CPU irq_work before per-CPU # areas are initialized. # # Link: https://lore.kernel.org/lkml/aa0732c6-5c4e-8a8b-a1c1-75ebe3dca05b@camlintechnologies.com/ # Reported-by: Lech Perczak # Signed-off-by: Sergey Senozhatsky # Tested-by: Jann Horn # Reviewed-by: Petr Mladek # Cc: Greg Kroah-Hartman # Cc: Theodore Ts'o # Cc: John Ogness # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-gcc --version # < /opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux-ld --version # < git log --format=%s --max-count=1 ab6f762f0f53162d41497708b33c9a3236d3609e # < make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 allyesconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_KCOV=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_GCC_PLUGIN_CYC_COMPLEXITY=n # Added to kconfig CONFIG_GCC_PLUGIN_SANCOV=n # Added to kconfig CONFIG_GCC_PLUGIN_LATENT_ENTROPY=n # Added to kconfig CONFIG_GCC_PLUGIN_STRUCTLEAK=n # Added to kconfig CONFIG_GCC_PLUGIN_RANDSTRUCT=n # Added to kconfig CONFIG_UML_NET=n # Added to kconfig CONFIG_UML_NET_ETHERTAP=n # Added to kconfig CONFIG_UML_NET_TUNTAP=n # Added to kconfig CONFIG_UML_NET_SLIP=n # Added to kconfig CONFIG_UML_NET_DAEMON=n # Added to kconfig CONFIG_UML_NET_VDE=n # Added to kconfig CONFIG_UML_NET_MCAST=n # Added to kconfig CONFIG_UML_NET_PCAP=n # Added to kconfig CONFIG_UML_NET_SLIRP=n # Added to kconfig CONFIG_GCOV_KERNEL=n # Added to kconfig CONFIG_DEBUG_INFO_BTF=n # < make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 help # make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 olddefconfig .config:4246:warning: override: reassigning to symbol UML_NET_ETHERTAP .config:4248:warning: override: reassigning to symbol UML_NET_SLIP .config:4251:warning: override: reassigning to symbol UML_NET_MCAST .config:4253:warning: override: reassigning to symbol UML_NET_SLIRP # make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 /kisskb/src/arch/um/os-Linux/signal.c: In function 'sig_handler_common': /kisskb/src/arch/um/os-Linux/signal.c:51:1: warning: the frame size of 2976 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/arch/um/os-Linux/signal.c: In function 'timer_real_alarm_handler': /kisskb/src/arch/um/os-Linux/signal.c:95:1: warning: the frame size of 2960 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ /kisskb/src/security/apparmor/policy_unpack.c: In function 'unpack_profile': /kisskb/src/security/apparmor/policy_unpack.c:526:9: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized] str[pos] = ':'; ^ /kisskb/src/security/apparmor/policy_unpack.c:497:14: note: 'pos' was declared here int c, j, pos, size2 = unpack_strdup(e, &str, NULL); ^ /kisskb/src/kernel/futex.c: In function 'futex_atomic_op_inuser': /kisskb/src/kernel/futex.c:1686:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] return oldval > cmparg; ^ /kisskb/src/drivers/vdpa/vdpa_sim/vdpa_sim.c: In function 'vdpasim_create': /kisskb/src/drivers/vdpa/vdpa_sim/vdpa_sim.c:324:2: error: implicit declaration of function 'set_dma_ops' [-Werror=implicit-function-declaration] set_dma_ops(dev, &vdpasim_dma_ops); ^ cc1: some warnings being treated as errors make[4]: *** [/kisskb/src/scripts/Makefile.build:268: drivers/vdpa/vdpa_sim/vdpa_sim.o] Error 1 make[3]: *** [/kisskb/src/scripts/Makefile.build:505: drivers/vdpa/vdpa_sim] Error 2 make[2]: *** [/kisskb/src/scripts/Makefile.build:505: drivers/vdpa] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/lib/lz4/lz4hc_compress.c: In function 'LZ4HC_compress_generic': /kisskb/src/lib/lz4/lz4hc_compress.c:579:1: warning: the frame size of 2144 bytes is larger than 2048 bytes [-Wframe-larger-than=] } ^ make[1]: *** [/kisskb/src/Makefile:1702: drivers] Error 2 make[1]: *** Waiting for unfinished jobs.... In file included from /kisskb/src/crypto/xor.c:17:0: /kisskb/src/arch/um/include/asm/xor.h:3:35: fatal error: shared/timer-internal.h: No such file or directory compilation terminated. make[2]: *** [/kisskb/src/scripts/Makefile.build:268: crypto/xor.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [/kisskb/src/Makefile:1702: crypto] Error 2 /kisskb/src/fs/namei.c: In function 'handle_dots': /kisskb/src/fs/namei.c:1805:10: warning: 'inode' may be used uninitialized in this function [-Wmaybe-uninitialized] error = step_into(nd, WALK_NOFOLLOW, ^ /kisskb/src/net/mptcp/protocol.c: In function 'mptcp_sendmsg_frag': /kisskb/src/net/mptcp/protocol.c:611:6: warning: 'dfrag_collapsed' may be used uninitialized in this function [-Wmaybe-uninitialized] if (!dfrag_collapsed) { ^ make: *** [Makefile:180: sub-make] Error 2 Command 'make -s -j 48 ARCH=um O=/kisskb/build/linus_um-allyesconfig_um-x86_64 CROSS_COMPILE=/opt/cross/kisskb/fe-x86-64-core-i7-2017.05/bin/x86_64-linux- SUBARCH=x86_64 ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_um-allyesconfig_um-x86_64 # Build took: 0:04:23.954038