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,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Anton Ivanov <anton.ivanov@cambridgegreys.co.uk>,
	Richard Weinberger <richard@nod.at>
Subject: [PATCH 5.4 109/110] Revert "um: Enable CONFIG_CONSTRUCTORS"
Date: Thu, 30 Jan 2020 19:39:25 +0100	[thread overview]
Message-ID: <20200130183626.212910444@linuxfoundation.org> (raw)
In-Reply-To: <20200130183613.810054545@linuxfoundation.org>

From: Johannes Berg <johannes.berg@intel.com>

commit 87c9366e17259040a9118e06b6dc8de986e5d3d1 upstream.

This reverts commit 786b2384bf1c ("um: Enable CONFIG_CONSTRUCTORS").

There are two issues with this commit, uncovered by Anton in tests
on some (Debian) systems:

1) I completely forgot to call any constructors if CONFIG_CONSTRUCTORS
   isn't set. Don't recall now if it just wasn't needed on my system, or
   if I never tested this case.

2) With that fixed, it works - with CONFIG_CONSTRUCTORS *unset*. If I
   set CONFIG_CONSTRUCTORS, it fails again, which isn't totally
   unexpected since whatever wanted to run is likely to have to run
   before the kernel init etc. that calls the constructors in this case.

Basically, some constructors that gcc emits (libc has?) need to run
very early during init; the failure mode otherwise was that the ptrace
fork test already failed:

----------------------
$ ./linux mem=512M
Core dump limits :
	soft - 0
	hard - NONE
Checking that ptrace can change system call numbers...check_ptrace : child exited with exitcode 6, while expecting 0; status 0x67f
Aborted
----------------------

Thinking more about this, it's clear that we simply cannot support
CONFIG_CONSTRUCTORS in UML. All the cases we need now (gcov, kasan)
involve not use of the __attribute__((constructor)), but instead
some constructor code/entry generated by gcc. Therefore, we cannot
distinguish between kernel constructors and system constructors.

Thus, revert this commit.

Cc: stable@vger.kernel.org [5.4+]
Fixes: 786b2384bf1c ("um: Enable CONFIG_CONSTRUCTORS")
Reported-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Richard Weinberger <richard@nod.at>

---
 arch/um/include/asm/common.lds.S |    2 +-
 arch/um/kernel/dyn.lds.S         |    1 +
 init/Kconfig                     |    1 +
 kernel/gcov/Kconfig              |    2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -83,8 +83,8 @@
 	__preinit_array_end = .;
   }
   .init_array : {
-        /* dummy - we call this ourselves */
 	__init_array_start = .;
+	*(.init_array)
 	__init_array_end = .;
   }
   .fini_array : {
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -103,6 +103,7 @@ SECTIONS
      be empty, which isn't pretty.  */
   . = ALIGN(32 / 8);
   .preinit_array     : { *(.preinit_array) }
+  .init_array     : { *(.init_array) }
   .fini_array     : { *(.fini_array) }
   .data           : {
     INIT_TASK_DATA(KERNEL_STACK_SIZE)
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -54,6 +54,7 @@ config CC_DISABLE_WARN_MAYBE_UNINITIALIZ
 
 config CONSTRUCTORS
 	bool
+	depends on !UML
 
 config IRQ_WORK
 	bool
--- a/kernel/gcov/Kconfig
+++ b/kernel/gcov/Kconfig
@@ -4,7 +4,7 @@ menu "GCOV-based kernel profiling"
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
 	depends on DEBUG_FS
-	select CONSTRUCTORS
+	select CONSTRUCTORS if !UML
 	default n
 	---help---
 	This option enables gcov-based code profiling (e.g. for code coverage



  parent reply	other threads:[~2020-01-30 18:50 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 18:37 [PATCH 5.4 000/110] 5.4.17-stable review Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 001/110] Bluetooth: btusb: fix non-atomic allocation in completion handler Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 002/110] orinoco_usb: fix interface sanity check Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 003/110] rsi_91x_usb: " Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 004/110] usb: dwc3: pci: add ID for the Intel Comet Lake -V variant Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 005/110] usb: host: xhci-tegra: set MODULE_FIRMWARE for tegra186 Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 006/110] USB: serial: ir-usb: add missing endpoint sanity check Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 007/110] USB: serial: ir-usb: fix link-speed handling Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 008/110] USB: serial: ir-usb: fix IrLAP framing Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 009/110] usb: dwc3: turn off VBUS when leaving host mode Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 010/110] usb: typec: wcove: fix "op-sink-microwatt" default that was in mW Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 011/110] usb: typec: fusb302: " Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 012/110] staging: most: net: fix buffer overflow Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 013/110] staging: wlan-ng: ensure error return is actually returned Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 014/110] staging: vt6656: correct packet types for CTS protect, mode Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 015/110] staging: vt6656: use NULLFUCTION stack on mac80211 Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 016/110] staging: vt6656: Fix false Tx excessive retries reporting Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 017/110] serial: 8250_bcm2835aux: Fix line mismatch on driver unbind Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 018/110] serial: imx: fix a race condition in receive path Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 019/110] debugfs: Return -EPERM when locked down Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 020/110] component: do not dereference opaque pointer in debugfs Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 021/110] binder: fix log spam for existing debugfs file creation Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 022/110] mei: hdcp: bind only with i915 on the same PCH Greg Kroah-Hartman
2020-01-30 18:37 ` [PATCH 5.4 023/110] mei: me: add comet point (lake) H device ids Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 024/110] iio: adc: stm32-dfsdm: fix single conversion Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 025/110] iio: st_gyro: Correct data for LSM9DS0 gyro Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 026/110] driver core: Fix test_async_driver_probe if NUMA is disabled Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 027/110] crypto: chelsio - fix writing tfm flags to wrong place Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 028/110] CIFS: Fix task struct use-after-free on reconnect Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 029/110] cifs: set correct max-buffer-size for smb2_ioctl_init() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 030/110] cifs: Fix memory allocation in __smb2_handle_cancelled_cmd() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 031/110] ath9k: fix storage endpoint lookup Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 032/110] brcmfmac: fix interface sanity check Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 033/110] rtl8xxxu: " Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 034/110] zd1211rw: fix storage endpoint lookup Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 035/110] net_sched: ematch: reject invalid TCF_EM_SIMPLE Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 036/110] net_sched: fix ops->bind_class() implementations Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 037/110] net_sched: walk through all child classes in tc_bind_tclass() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 038/110] net: socionext: fix possible user-after-free in netsec_process_rx Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 039/110] net: socionext: fix xdp_result initialization " Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 040/110] udp: segment looped gso packets correctly Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 041/110] mlxsw: minimal: Fix an error handling path in mlxsw_m_port_create() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 042/110] net: include struct nhmsg size in nh nlmsg size Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 043/110] rxrpc: Fix use-after-free in rxrpc_receive_data() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 044/110] HID: multitouch: Add LG MELF0410 I2C touchscreen support Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 045/110] arc: eznps: fix allmodconfig kconfig warning Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 046/110] HID: Add quirk for Xin-Mo Dual Controller Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 047/110] HID: ite: Add USB id match for Acer SW5-012 keyboard dock Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 048/110] HID: asus: Ignore Asus vendor-page usage-code 0xff events Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 049/110] HID: Add quirk for incorrect input length on Lenovo Y720 Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 050/110] HID: intel-ish-hid: ipc: add CMP device id Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 051/110] HID: wacom: Recognize new MobileStudio Pro PID Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 052/110] ASoC: SOF: fix fault at driver unload after failed probe Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 053/110] ASoC: SOF: Intel: hda: hda-dai: fix oops on hda_link .hw_free Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 054/110] drivers/hid/hid-multitouch.c: fix a possible null pointer access Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 055/110] phy: qcom-qmp: Increase PHY ready timeout Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 056/110] ASoC: fsl_audmix: add missed pm_runtime_disable Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 057/110] ASoC: topology: Prevent use-after-free in snd_soc_get_pcm_runtime() Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 058/110] phy: cpcap-usb: Prevent USB line glitches from waking up modem Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 059/110] HID: intel-ish-hid: ipc: Add Tiger Lake PCI device ID Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 060/110] watchdog: max77620_wdt: fix potential build errors Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 061/110] watchdog: rn5t618_wdt: fix module aliases Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 062/110] watchdog: orion: fix platform_get_irq() complaints Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 063/110] usb: musb: jz4740: Silence error if code is -EPROBE_DEFER Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 064/110] can: tcan4x5x: tcan4x5x_parse_config(): reset device before register access Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 065/110] spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 066/110] net: Google gve: Remove dma_wmb() before ringing doorbell Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 067/110] drivers/net/b44: Change to non-atomic bit operations on pwol_mask Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 068/110] net: wan: sdla: Fix cast from pointer to integer of different size Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 069/110] gpio: max77620: Add missing dependency on GPIOLIB_IRQCHIP Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 070/110] iommu/dma: fix variable cookie set but not used Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 071/110] drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 072/110] stmmac: debugfs entry name is not be changed when udev rename device name Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 073/110] atm: eni: fix uninitialized variable warning Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 074/110] HID: steam: Fix input device disappearing Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 075/110] extcon-intel-cht-wc: Dont reset USB data connection at probe Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 076/110] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0 Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 077/110] drm/amdgpu/SRIOV: add navi12 pci id for SRIOV (v2) Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 078/110] libbpf: Fix BTF-defined maps __type macro handling of arrays Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 079/110] staging: mt7621-pci: add quirks for E2 revision using soc_device_attribute Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 080/110] platform/x86: dell-laptop: disable kbd backlight on Inspiron 10xx Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 081/110] PCI: Add DMA alias quirk for Intel VCA NTB Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 082/110] media: dvbsky: add support for eyeTV Geniatech T2 lite Greg Kroah-Hartman
2020-01-30 18:38 ` [PATCH 5.4 083/110] bus: ti-sysc: Handle mstandby quirk and use it for musb Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 084/110] bus: ti-sysc: Use swsup quirks also for am335x musb Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 085/110] spi: pxa2xx: Add support for Intel Comet Lake-H Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 086/110] iommu/amd: Support multiple PCI DMA aliases in device table Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 087/110] iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 088/110] perf/imx_ddr: Add enhanced AXI ID filter support Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 089/110] mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 090/110] ARM: config: aspeed-g5: Enable 8250_DW quirks Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 091/110] ARM: OMAP2+: SmartReflex: add omap_sr_pdata definition Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 092/110] mmc: sdhci-pci: Quirk for AMD SDHC Device 0x7906 Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 093/110] mmc: sdhci-pci: Add support for Intel JSL Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 094/110] bus: ti-sysc: Add module enable quirk for audio AESS Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 095/110] usb-storage: Disable UAS on JMicron SATA enclosure Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 096/110] ALSA: hda/realtek - Move some alc236 pintbls to fallback table Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 097/110] Bluetooth: Allow combination of BDADDR_PROPERTY and INVALID_BDADDR quirks Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 098/110] Bluetooth: btbcm: Use the BDADDR_PROPERTY quirk Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 099/110] bus: ti-sysc: Fix missing force mstandby quirk handling Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 100/110] rsi: fix use-after-free on failed probe and unbind Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 101/110] rsi: fix use-after-free on probe errors Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 102/110] rsi: fix memory leak on failed URB submission Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 103/110] rsi: fix non-atomic allocation in completion handler Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 104/110] crypto: af_alg - Use bh_lock_sock in sk_destruct Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 105/110] crypto: vmx - reject xts inputs that are too short Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 106/110] crypto: caam - do not reset pointer size from MCFGR register Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 107/110] crypto: pcrypt - Fix user-after-free on module unload Greg Kroah-Hartman
2020-01-30 18:39 ` [PATCH 5.4 108/110] KVM: arm64: Write arch.mdcr_el2 changes since last vcpu_load on VHE Greg Kroah-Hartman
2020-01-30 18:39 ` Greg Kroah-Hartman [this message]
2020-01-30 18:39 ` [PATCH 5.4 110/110] power/supply: ingenic-battery: Dont change scale if theres only one Greg Kroah-Hartman
2020-01-31  4:39 ` [PATCH 5.4 000/110] 5.4.17-stable review shuah
2020-01-31 11:03 ` Jon Hunter
2020-01-31 14:42 ` Naresh Kamboju
2020-01-31 17:32 ` Guenter Roeck
2020-01-31 19:44 ` Jeffrin Jose

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=20200130183626.212910444@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=anton.ivanov@cambridgegreys.co.uk \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.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).