linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, kernel test robot <rong.a.chen@intel.com>,
	Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrey Konovalov <andreyknvl@google.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>, Qian Cai <cai@lca.pw>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 5.4 096/111] kasan: disable branch tracing for core runtime
Date: Tue, 26 May 2020 20:53:54 +0200	[thread overview]
Message-ID: <20200526183942.024415645@linuxfoundation.org> (raw)
In-Reply-To: <20200526183932.245016380@linuxfoundation.org>

From: Marco Elver <elver@google.com>

commit 33cd65e73abd693c00c4156cf23677c453b41b3b upstream.

During early boot, while KASAN is not yet initialized, it is possible to
enter reporting code-path and end up in kasan_report().

While uninitialized, the branch there prevents generating any reports,
however, under certain circumstances when branches are being traced
(TRACE_BRANCH_PROFILING), we may recurse deep enough to cause kernel
reboots without warning.

To prevent similar issues in future, we should disable branch tracing
for the core runtime.

[elver@google.com: remove duplicate DISABLE_BRANCH_PROFILING, per Qian Cai]
  Link: https://lore.kernel.org/lkml/20200517011732.GE24705@shao2-debian/
  Link: http://lkml.kernel.org/r/20200522075207.157349-1-elver@google.com
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Qian Cai <cai@lca.pw>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r//20200517011732.GE24705@shao2-debian/
Link: http://lkml.kernel.org/r/20200519182459.87166-1-elver@google.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/kasan/Makefile  |    8 ++++----
 mm/kasan/generic.c |    1 -
 mm/kasan/tags.c    |    1 -
 3 files changed, 4 insertions(+), 6 deletions(-)

--- a/mm/kasan/Makefile
+++ b/mm/kasan/Makefile
@@ -14,10 +14,10 @@ CFLAGS_REMOVE_tags.o = $(CC_FLAGS_FTRACE
 # Function splitter causes unnecessary splits in __asan_load1/__asan_store1
 # see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63533
 
-CFLAGS_common.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
-CFLAGS_generic.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
-CFLAGS_generic_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
-CFLAGS_tags.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
+CFLAGS_common.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING
+CFLAGS_generic.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING
+CFLAGS_generic_report.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING
+CFLAGS_tags.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector) -DDISABLE_BRANCH_PROFILING
 
 obj-$(CONFIG_KASAN) := common.o init.o report.o
 obj-$(CONFIG_KASAN_GENERIC) += generic.o generic_report.o quarantine.o
--- a/mm/kasan/generic.c
+++ b/mm/kasan/generic.c
@@ -15,7 +15,6 @@
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#define DISABLE_BRANCH_PROFILING
 
 #include <linux/export.h>
 #include <linux/interrupt.h>
--- a/mm/kasan/tags.c
+++ b/mm/kasan/tags.c
@@ -12,7 +12,6 @@
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#define DISABLE_BRANCH_PROFILING
 
 #include <linux/export.h>
 #include <linux/interrupt.h>



  parent reply	other threads:[~2020-05-26 19:22 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-26 18:52 [PATCH 5.4 000/111] 5.4.43-rc1 review Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 001/111] i2c: dev: Fix the race between the release of i2c_dev and cdev Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 002/111] KVM: SVM: Fix potential memory leak in svm_cpu_init() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 003/111] ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 004/111] evm: Check also if *tfm is an error pointer in init_desc() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 005/111] ima: Fix return value of ima_write_policy() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 006/111] ubifs: fix wrong use of crypto_shash_descsize() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 007/111] ACPI: EC: PM: Avoid flushing EC work when EC GPE is inactive Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 008/111] mtd: spinand: Propagate ECC information to the MTD structure Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 009/111] fix multiplication overflow in copy_fdtable() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 010/111] ubifs: remove broken lazytime support Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 011/111] i2c: fix missing pm_runtime_put_sync in i2c_device_probe Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 012/111] iommu/amd: Fix over-read of ACPI UID from IVRS table Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 013/111] evm: Fix a small race in init_desc() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 014/111] i2c: mux: demux-pinctrl: Fix an error handling path in i2c_demux_pinctrl_probe() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 015/111] ubi: Fix seq_file usage in detailed_erase_block_info debugfs file Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 016/111] afs: Dont unlock fetched data pages until the op completes successfully Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 017/111] mtd: Fix mtd not registered due to nvmem name collision Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 018/111] kbuild: avoid concurrency issue in parallel building dtbs and dtbs_check Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 019/111] net: drop_monitor: use IS_REACHABLE() to guard net_dm_hw_report() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 020/111] gcc-common.h: Update for GCC 10 Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 021/111] HID: multitouch: add eGalaxTouch P80H84 support Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 022/111] HID: alps: Add AUI1657 device ID Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 023/111] HID: alps: ALPS_1657 is too specific; use U1_UNICORN_LEGACY instead Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 024/111] scsi: qla2xxx: Fix hang when issuing nvme disconnect-all in NPIV Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 025/111] scsi: qla2xxx: Delete all sessions before unregister local nvme port Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 026/111] configfs: fix config_item refcnt leak in configfs_rmdir() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 027/111] vhost/vsock: fix packet delivery order to monitoring devices Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 028/111] aquantia: Fix the media type of AQC100 ethernet controller in the driver Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 029/111] component: Silence bind error on -EPROBE_DEFER Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 030/111] net/ena: Fix build warning in ena_xdp_set() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 031/111] scsi: ibmvscsi: Fix WARN_ON during event pool release Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 032/111] HID: i2c-hid: reset Synaptics SYNA2393 on resume Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 033/111] x86/mm/cpa: Flush direct map alias during cpa Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 034/111] ibmvnic: Skip fatal error reset after passive init Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 035/111] ftrace/selftest: make unresolved cases cause failure if --fail-unresolved set Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 036/111] x86/apic: Move TSC deadline timer debug printk Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 037/111] gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 038/111] HID: quirks: Add HID_QUIRK_NO_INIT_REPORTS quirk for Dell K12A keyboard-dock Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 039/111] ceph: fix double unlock in handle_cap_export() Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 040/111] stmmac: fix pointer check after utilization in stmmac_interrupt Greg Kroah-Hartman
2020-05-26 18:52 ` [PATCH 5.4 041/111] USB: core: Fix misleading driver bug report Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 042/111] platform/x86: asus-nb-wmi: Do not load on Asus T100TA and T200TA Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 043/111] iommu/amd: Call domain_flush_complete() in update_domain() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 044/111] drm/amd/display: Prevent dpcd reads with passive dongles Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 045/111] KVM: selftests: Fix build for evmcs.h Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 046/111] ARM: futex: Address build warning Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 047/111] scripts/gdb: repair rb_first() and rb_last() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 048/111] ALSA: hda - constify and cleanup static NodeID tables Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 049/111] ALSA: hda: patch_realtek: fix empty macro usage in if block Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 050/111] ALSA: hda: Manage concurrent reg access more properly Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 051/111] ALSA: hda/realtek - Add supported new mute Led for HP Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 052/111] ALSA: hda/realtek - Add HP new mute led supported for ALC236 Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 053/111] ALSA: hda/realtek: Add quirk for Samsung Notebook Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 054/111] ALSA: hda/realtek - Enable headset mic of ASUS GL503VM with ALC295 Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 055/111] ALSA: hda/realtek - Enable headset mic of ASUS UX550GE " Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 056/111] ALSA: hda/realtek: Enable headset mic of ASUS UX581LV " Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 057/111] KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 058/111] ALSA: iec1712: Initialize STDSP24 properly when using the model=staudio option Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 059/111] ALSA: pcm: fix incorrect hw_base increase Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 060/111] ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Xtreme Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 061/111] ALSA: hda/realtek - Add more fixup entries for Clevo machines Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 062/111] scsi: qla2xxx: Do not log message when reading port speed via sysfs Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 063/111] scsi: target: Put lun_ref at end of tmr processing Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 064/111] arm64: Fix PTRACE_SYSEMU semantics Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 065/111] drm/etnaviv: fix perfmon domain interation Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 066/111] apparmor: Fix use-after-free in aa_audit_rule_init Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 067/111] apparmor: fix potential label refcnt leak in aa_change_profile Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 068/111] apparmor: Fix aa_label refcnt leak in policy_update Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 069/111] dmaengine: tegra210-adma: Fix an error handling path in tegra_adma_probe() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 070/111] drm/etnaviv: Fix a leak in submit_pin_objects() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 071/111] dmaengine: dmatest: Restore default for channel Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 072/111] dmaengine: owl: Use correct lock in owl_dma_get_pchan() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 073/111] vsprintf: dont obfuscate NULL and error pointers Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 074/111] drm/i915/gvt: Init DPLL/DDI vreg for virtual display instead of inheritance Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 075/111] drm/i915: Propagate error from completed fences Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 076/111] powerpc: Remove STRICT_KERNEL_RWX incompatibility with RELOCATABLE Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 077/111] powerpc/64s: Disable STRICT_KERNEL_RWX Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 078/111] bpf: Avoid setting bpf insns pages read-only when prog is jited Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 079/111] kbuild: Remove debug info from kallsyms linking Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 080/111] Revert "gfs2: Dont demote a glock until its revokes are written" Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 081/111] media: fdp1: Fix R-Car M3-N naming in debug message Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 082/111] staging: iio: ad2s1210: Fix SPI reading Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 083/111] staging: kpc2000: fix error return code in kp2000_pcie_probe() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 084/111] staging: greybus: Fix uninitialized scalar variable Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 085/111] iio: sca3000: Remove an erroneous get_device() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 086/111] iio: dac: vf610: Fix an error handling path in vf610_dac_probe() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 087/111] iio: adc: ti-ads8344: Fix channel selection Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 088/111] misc: rtsx: Add short delay after exit from ASPM Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 089/111] tty: serial: add missing spin_lock_init for SiFive serial console Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 090/111] mei: release me_cl object reference Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 091/111] ipack: tpci200: fix error return code in tpci200_register() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 092/111] s390/pci: Fix s390_mmio_read/write with MIO Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 093/111] s390/kaslr: add support for R_390_JMP_SLOT relocation type Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 094/111] device-dax: dont leak kernel memory to user space after unloading kmem Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 095/111] rapidio: fix an error in get_user_pages_fast() error handling Greg Kroah-Hartman
2020-05-26 18:53 ` Greg Kroah-Hartman [this message]
2020-05-26 18:53 ` [PATCH 5.4 097/111] rxrpc: Fix the excessive initial retransmission timeout Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 098/111] rxrpc: Fix a memory leak in rxkad_verify_response() Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 099/111] s390/kexec_file: fix initrd location for kdump kernel Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 100/111] flow_dissector: Drop BPF flow dissector prog ref on netns cleanup Greg Kroah-Hartman
2020-05-26 18:53 ` [PATCH 5.4 101/111] x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 102/111] iio: adc: stm32-adc: Use dma_request_chan() instead dma_request_slave_channel() Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 103/111] iio: adc: stm32-adc: fix device used to request dma Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 104/111] iio: adc: stm32-dfsdm: Use dma_request_chan() instead dma_request_slave_channel() Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 105/111] iio: adc: stm32-dfsdm: fix device used to request dma Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 106/111] rxrpc: Trace discarded ACKs Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 107/111] rxrpc: Fix ack discard Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 108/111] tpm: check event log version before reading final events Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 109/111] sched/fair: Reorder enqueue/dequeue_task_fair path Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 110/111] sched/fair: Fix reordering of enqueue/dequeue_task_fair() Greg Kroah-Hartman
2020-05-26 18:54 ` [PATCH 5.4 111/111] sched/fair: Fix enqueue_task_fair() warning some more Greg Kroah-Hartman
2020-05-27  8:25 ` [PATCH 5.4 000/111] 5.4.43-rc1 review Naresh Kamboju
2020-05-27  8:34 ` Jon Hunter
2020-05-27 13:53 ` Guenter Roeck
2020-05-27 16:34 ` shuah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200526183942.024415645@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=cai@lca.pw \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rong.a.chen@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).