1
0
Fork 0
alistair23-linux/arch/um/include/asm
Johannes Berg dd350f3918 Revert "um: Enable CONFIG_CONSTRUCTORS"
commit 87c9366e17 upstream.

This reverts commit 786b2384bf ("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: 786b2384bf ("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>
2020-02-01 09:34:53 +00:00
..
Kbuild um: Don't use generic barrier.h 2019-09-15 21:37:14 +02:00
asm-prototypes.h um: Restore symbol versions for __memcpy and memcpy 2018-02-19 19:38:51 +01:00
bugs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
common.lds.S Revert "um: Enable CONFIG_CONSTRUCTORS" 2020-02-01 09:34:53 +00:00
dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fixmap.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hardirq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
irq.h um: drivers: Add virtio vhost-user driver 2019-09-15 21:37:15 +02:00
irqflags.h um: Remove misleading #define ARCh_IRQ_ENABLED 2019-09-15 21:37:11 +02:00
kmap_types.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
kvm_para.h kvmclock: Add functions to check if the host has stopped the vm 2012-04-08 12:48:59 +03:00
mmu.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
mmu_context.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
page.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
pgalloc.h mm: treewide: clarify pgtable_page_{ctor,dtor}() naming 2019-09-26 10:10:44 -07:00
pgtable-2level.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
pgtable-3level.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
pgtable.h mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
processor-generic.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
ptrace-generic.h um: Implement copy_thread_tls 2020-01-14 20:08:35 +01:00
sections.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
setup.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
smp.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stacktrace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
syscall-generic.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sysrq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
thread_info.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
timex.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tlb.h um/tlb: Convert to generic mmu_gather 2019-04-03 10:32:52 +02:00
tlbflush.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
uaccess.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
unwind.h x86/unwind: Add the ORC unwinder 2017-07-26 13:18:20 +02:00
vmlinux.lds.h Construct init thread stack in the linker script rather than by union 2018-01-09 23:21:02 +00:00