Commit Graph

2024 Commits

Author SHA1 Message Date
Daniel Borkmann
508711cf30 UPSTREAM: bpf: Add kconfig knob for disabling unpriv bpf by default
commit 08389d888287c3823f80b0216766b71e17f0aba5 upstream.

Add a kconfig knob which allows for unprivileged bpf to be disabled by default.
If set, the knob sets /proc/sys/kernel/unprivileged_bpf_disabled to value of 2.

This still allows a transition of 2 -> {0,1} through an admin. Similarly,
this also still keeps 1 -> {1} behavior intact, so that once set to permanently
disabled, it cannot be undone aside from a reboot.

We've also added extra2 with max of 2 for the procfs handler, so that an admin
still has a chance to toggle between 0 <-> 2.

Either way, as an additional alternative, applications can make use of CAP_BPF
that we added a while ago.

Bug: 215557547
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net
[fllinden@amazon.com: backported to 5.4]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c230f6ba10)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6d80853f0bd2c8618d956d967681c97b931a6137
2022-03-14 12:47:00 +01:00
Greg Kroah-Hartman
e8365b472c This is the 5.4.125 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmDB+Z8ACgkQONu9yGCS
 aT5qig//WVut449WUeYQLKD8rAB5CUVm2Xl3509Ts8W6LSzYGHiYv1SRVeH2y1lS
 QnfCnBciopl2UyYxqXGQwoRYdY1T2E/MWUmwGUk0/qlZYOzg5xQ368Shm0lvohJI
 DsywZrYqJDUCoeyXoWJYrq/3RiAvMK30teKDcn1A2HhhWdo0nsGLp1GUX396ptcV
 3xw2ZvCVwuikwxq5jlQKUEkH59TD/ZkCzvn9gfd86FY1R0ohApLJckhGIuT3wA1c
 Tfekgvfngx1HcEWIAzWFqZPoB8mOF5pn06yZhuPdMKa8UUq78ckN7kbchERj2wJD
 cDFSQQrMI3nL9sA8ryYV1YFl3fyGX5Epm4O465whzjKWoZ9HwN+iwl6Qv+kOmX41
 YUmpUplhsPN+I7+cX1jF7Ohw583uDbFPw6XbyZ0ArZr03JVVv4Vjrv5QA9fVHR06
 OP7+zEUlBtu/g3k0Bj5MU8UKem0shXavkPqukrtB+MhrXh2VngEXEVOvKMOFgA4b
 BnBEga4SrCR/wB+SucIV4fqzV0tq4HD/cPpy67OafrWoqhwlnBsMCQUd+puxkCnM
 y+eEoRwTzRSW+U9y8KdAERW8qSR/vCyKCUoaKxOV3Jj0v8xp0Y6VHKlKmb//w5Gn
 Lk7sNjD60Um3Au53A5pJvh8qNg+OsNc46sEmGGndE4Mrada93gE=
 =O2C+
 -----END PGP SIGNATURE-----

Merge 5.4.125 into android11-5.4-lts

Changes in 5.4.125
	btrfs: tree-checker: do not error out if extent ref hash doesn't match
	net: usb: cdc_ncm: don't spew notifications
	ALSA: usb: update old-style static const declaration
	nl80211: validate key indexes for cfg80211_registered_device
	hwmon: (dell-smm-hwmon) Fix index values
	netfilter: conntrack: unregister ipv4 sockopts on error unwind
	efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared
	efi: cper: fix snprintf() use in cper_dimm_err_location()
	vfio/pci: Fix error return code in vfio_ecap_init()
	vfio/pci: zap_vma_ptes() needs MMU
	samples: vfio-mdev: fix error handing in mdpy_fb_probe()
	vfio/platform: fix module_put call in error flow
	ipvs: ignore IP_VS_SVC_F_HASHED flag when adding service
	HID: pidff: fix error return code in hid_pidff_init()
	HID: i2c-hid: fix format string mismatch
	net/sched: act_ct: Fix ct template allocation for zone 0
	ACPICA: Clean up context mutex during object deletion
	netfilter: nft_ct: skip expectations for confirmed conntrack
	netfilter: nfnetlink_cthelper: hit EBUSY on updates if size mismatches
	ieee802154: fix error return code in ieee802154_add_iface()
	ieee802154: fix error return code in ieee802154_llsec_getparams()
	ixgbevf: add correct exception tracing for XDP
	ipv6: Fix KASAN: slab-out-of-bounds Read in fib6_nh_flush_exceptions
	ice: write register with correct offset
	ice: Fix VFR issues for AVF drivers that expect ATQLEN cleared
	ice: Allow all LLDP packets from PF to Tx
	i2c: qcom-geni: Add shutdown callback for i2c
	i40e: optimize for XDP_REDIRECT in xsk path
	i40e: add correct exception tracing for XDP
	arm64: dts: ls1028a: fix memory node
	arm64: dts: zii-ultra: fix 12V_MAIN voltage
	ARM: dts: imx7d-meerkat96: Fix the 'tuning-step' property
	ARM: dts: imx7d-pico: Fix the 'tuning-step' property
	ARM: dts: imx: emcon-avari: Fix nxp,pca8574 #gpio-cells
	bus: ti-sysc: Fix flakey idling of uarts and stop using swsup_sidle_act
	tipc: add extack messages for bearer/media failure
	tipc: fix unique bearer names sanity check
	Bluetooth: fix the erroneous flush_work() order
	Bluetooth: use correct lock to prevent UAF of hdev object
	net: caif: added cfserl_release function
	net: caif: add proper error handling
	net: caif: fix memory leak in caif_device_notify
	net: caif: fix memory leak in cfusbl_device_notify
	HID: i2c-hid: Skip ELAN power-on command after reset
	HID: magicmouse: fix NULL-deref on disconnect
	HID: multitouch: require Finger field to mark Win8 reports as MT
	ALSA: timer: Fix master timer notification
	ALSA: hda: Fix for mute key LED for HP Pavilion 15-CK0xx
	ARM: dts: imx6dl-yapp4: Fix RGMII connection to QCA8334 switch
	ARM: dts: imx6q-dhcom: Add PU,VDD1P1,VDD2P5 regulators
	ext4: fix bug on in ext4_es_cache_extent as ext4_split_extent_at failed
	usb: dwc2: Fix build in periphal-only mode
	pid: take a reference when initializing `cad_pid`
	ocfs2: fix data corruption by fallocate
	nfc: fix NULL ptr dereference in llcp_sock_getname() after failed connect
	drm/amdgpu: Don't query CE and UE errors
	drm/amdgpu: make sure we unpin the UVD BO
	x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing
	btrfs: mark ordered extent and inode with error if we fail to finish
	btrfs: fix error handling in btrfs_del_csums
	btrfs: return errors from btrfs_del_csums in cleanup_ref_head
	btrfs: fixup error handling in fixup_inode_link_counts
	mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY
	bnxt_en: Remove the setting of dev_port.
	mm: add thp_order
	XArray: add xa_get_order
	XArray: add xas_split
	mm/filemap: fix storing to a THP shadow entry
	btrfs: fix unmountable seed device after fstrim
	KVM: SVM: Truncate GPR value for DR and CR accesses in !64-bit mode
	KVM: arm64: Fix debug register indexing
	x86/kvm: Teardown PV features on boot CPU as well
	x86/kvm: Disable kvmclock on all CPUs on shutdown
	x86/kvm: Disable all PV features on crash
	lib/lz4: explicitly support in-place decompression
	xen-pciback: redo VF placement in the virtual topology
	i2c: qcom-geni: Suspend and resume the bus during SYSTEM_SLEEP_PM ops
	neighbour: allow NUD_NOARP entries to be forced GCed
	Linux 5.4.125

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I7228d64dfff6856a9a277bf07acf84a87f947466
2021-06-10 15:12:14 +02:00
Mark Rutland
2cd6eedfa6 pid: take a reference when initializing cad_pid
commit 0711f0d7050b9e07c44bc159bbc64ac0a1022c7f upstream.

During boot, kernel_init_freeable() initializes `cad_pid` to the init
task's struct pid.  Later on, we may change `cad_pid` via a sysctl, and
when this happens proc_do_cad_pid() will increment the refcount on the
new pid via get_pid(), and will decrement the refcount on the old pid
via put_pid().  As we never called get_pid() when we initialized
`cad_pid`, we decrement a reference we never incremented, can therefore
free the init task's struct pid early.  As there can be dangling
references to the struct pid, we can later encounter a use-after-free
(e.g.  when delivering signals).

This was spotted when fuzzing v5.13-rc3 with Syzkaller, but seems to
have been around since the conversion of `cad_pid` to struct pid in
commit 9ec52099e4 ("[PATCH] replace cad_pid by a struct pid") from the
pre-KASAN stone age of v2.6.19.

Fix this by getting a reference to the init task's struct pid when we
assign it to `cad_pid`.

Full KASAN splat below.

   ==================================================================
   BUG: KASAN: use-after-free in ns_of_pid include/linux/pid.h:153 [inline]
   BUG: KASAN: use-after-free in task_active_pid_ns+0xc0/0xc8 kernel/pid.c:509
   Read of size 4 at addr ffff23794dda0004 by task syz-executor.0/273

   CPU: 1 PID: 273 Comm: syz-executor.0 Not tainted 5.12.0-00001-g9aef892b2d15 #1
   Hardware name: linux,dummy-virt (DT)
   Call trace:
    ns_of_pid include/linux/pid.h:153 [inline]
    task_active_pid_ns+0xc0/0xc8 kernel/pid.c:509
    do_notify_parent+0x308/0xe60 kernel/signal.c:1950
    exit_notify kernel/exit.c:682 [inline]
    do_exit+0x2334/0x2bd0 kernel/exit.c:845
    do_group_exit+0x108/0x2c8 kernel/exit.c:922
    get_signal+0x4e4/0x2a88 kernel/signal.c:2781
    do_signal arch/arm64/kernel/signal.c:882 [inline]
    do_notify_resume+0x300/0x970 arch/arm64/kernel/signal.c:936
    work_pending+0xc/0x2dc

   Allocated by task 0:
    slab_post_alloc_hook+0x50/0x5c0 mm/slab.h:516
    slab_alloc_node mm/slub.c:2907 [inline]
    slab_alloc mm/slub.c:2915 [inline]
    kmem_cache_alloc+0x1f4/0x4c0 mm/slub.c:2920
    alloc_pid+0xdc/0xc00 kernel/pid.c:180
    copy_process+0x2794/0x5e18 kernel/fork.c:2129
    kernel_clone+0x194/0x13c8 kernel/fork.c:2500
    kernel_thread+0xd4/0x110 kernel/fork.c:2552
    rest_init+0x44/0x4a0 init/main.c:687
    arch_call_rest_init+0x1c/0x28
    start_kernel+0x520/0x554 init/main.c:1064
    0x0

   Freed by task 270:
    slab_free_hook mm/slub.c:1562 [inline]
    slab_free_freelist_hook+0x98/0x260 mm/slub.c:1600
    slab_free mm/slub.c:3161 [inline]
    kmem_cache_free+0x224/0x8e0 mm/slub.c:3177
    put_pid.part.4+0xe0/0x1a8 kernel/pid.c:114
    put_pid+0x30/0x48 kernel/pid.c:109
    proc_do_cad_pid+0x190/0x1b0 kernel/sysctl.c:1401
    proc_sys_call_handler+0x338/0x4b0 fs/proc/proc_sysctl.c:591
    proc_sys_write+0x34/0x48 fs/proc/proc_sysctl.c:617
    call_write_iter include/linux/fs.h:1977 [inline]
    new_sync_write+0x3ac/0x510 fs/read_write.c:518
    vfs_write fs/read_write.c:605 [inline]
    vfs_write+0x9c4/0x1018 fs/read_write.c:585
    ksys_write+0x124/0x240 fs/read_write.c:658
    __do_sys_write fs/read_write.c:670 [inline]
    __se_sys_write fs/read_write.c:667 [inline]
    __arm64_sys_write+0x78/0xb0 fs/read_write.c:667
    __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
    invoke_syscall arch/arm64/kernel/syscall.c:49 [inline]
    el0_svc_common.constprop.1+0x16c/0x388 arch/arm64/kernel/syscall.c:129
    do_el0_svc+0xf8/0x150 arch/arm64/kernel/syscall.c:168
    el0_svc+0x28/0x38 arch/arm64/kernel/entry-common.c:416
    el0_sync_handler+0x134/0x180 arch/arm64/kernel/entry-common.c:432
    el0_sync+0x154/0x180 arch/arm64/kernel/entry.S:701

   The buggy address belongs to the object at ffff23794dda0000
    which belongs to the cache pid of size 224
   The buggy address is located 4 bytes inside of
    224-byte region [ffff23794dda0000, ffff23794dda00e0)
   The buggy address belongs to the page:
   page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4dda0
   head:(____ptrval____) order:1 compound_mapcount:0
   flags: 0x3fffc0000010200(slab|head)
   raw: 03fffc0000010200 dead000000000100 dead000000000122 ffff23794d40d080
   raw: 0000000000000000 0000000000190019 00000001ffffffff 0000000000000000
   page dumped because: kasan: bad access detected

   Memory state around the buggy address:
    ffff23794dd9ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
    ffff23794dd9ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
   >ffff23794dda0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
    ffff23794dda0080: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
    ffff23794dda0100: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
   ==================================================================

Link: https://lkml.kernel.org/r/20210524172230.38715-1-mark.rutland@arm.com
Fixes: 9ec52099e4 ("[PATCH] replace cad_pid by a struct pid")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Christian Brauner <christian@brauner.io>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Kees Cook <keescook@chromium.org
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-10 13:37:11 +02:00
Greg Kroah-Hartman
c06f6ce987 This is the 5.4.111 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmBxjW0ACgkQONu9yGCS
 aT7YXhAAgvMi31rBZgwqvhd30kyYM/LeF39HzkY9jj33it1YilR6j+BChXG3pikq
 4lq8DCyFbfGza55g1QJ2TZQpa1bvDxYV4V02xW9ur2gDQtFATVdg5QP+JKjm2/b9
 hROnNW8yemfZLsjf4J3QevuFzBMWUuIxyh5tsqTE2O2B2/SbsZF1nd+R7nvN4w2X
 U1EOSMQ5i+EqIKG/Fy1yklnmEdp71Ven+otQeoHXzbB3fhJNqDq0YYyFyHtQaset
 +1muetkmMG1rDAWUwuq2+0u1pJsNyBoIqllrXAZsV68tI2PKil0NBKooW2OPfJw4
 AYSjzRlLwQ3z12thBP9vtuK/3nVP9i4D3ymgWbDqdfEOYow/lLsZ/KQ6P4aTHhxO
 e0OPUD0fPd326Hfh3FwyoZVAe9/t3lK8me1GSXJmHKXIkEsQuOrXS7XnEU8w6u9g
 N4kamYpmb97LLrtg021phpkx6iRCHsbEw1CJJj8Se1VVf8Zrm0x5FgmDq+XxuECT
 7ylnAh1I0ruR+yDTG3BGINS7YppLYOWgt6HrnEryhW67ereHj7M2HeficsX/lV8p
 80w0xUFCQieFi4LO6vPoP2kyQlXsLpZQoxtPUfe3xTpAW9mJpOj8DY9Afmfg78As
 3ysPWDmofgWm7TTiAF5BMTNd1yhJ9YhepWFssuYuLNkwqfrmtNE=
 =x0/5
 -----END PGP SIGNATURE-----

Merge 5.4.111 into android11-5.4-lts

Changes in 5.4.111
	ARM: dts: am33xx: add aliases for mmc interfaces
	bus: ti-sysc: Fix warning on unbind if reset is not deasserted
	platform/x86: intel-hid: Support Lenovo ThinkPad X1 Tablet Gen 2
	bpf, x86: Use kvmalloc_array instead kmalloc_array in bpf_jit_comp
	net/mlx5e: Enforce minimum value check for ICOSQ size
	net: pxa168_eth: Fix a potential data race in pxa168_eth_remove
	mISDN: fix crash in fritzpci
	mac80211: choose first enabled channel for monitor
	drm/msm/adreno: a5xx_power: Don't apply A540 lm_setup to other GPUs
	drm/msm: Ratelimit invalid-fence message
	netfilter: conntrack: Fix gre tunneling over ipv6
	platform/x86: thinkpad_acpi: Allow the FnLock LED to change state
	x86/build: Turn off -fcf-protection for realmode targets
	scsi: target: pscsi: Clean up after failure in pscsi_map_sg()
	ia64: mca: allocate early mca with GFP_ATOMIC
	ia64: fix format strings for err_inject
	cifs: revalidate mapping when we open files for SMB1 POSIX
	cifs: Silently ignore unknown oplock break handle
	bpf, x86: Validate computation of branch displacements for x86-64
	bpf, x86: Validate computation of branch displacements for x86-32
	nvme-mpath: replace direct_make_request with generic_make_request
	init/Kconfig: make COMPILE_TEST depend on !S390
	init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
	Linux 5.4.111

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I6dfa5d8bd699bada25e8012a7f51a2687372b584
2021-04-10 14:20:50 +02:00
Masahiro Yamada
45f540622d init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM
commit ea29b20a828511de3348334e529a3d046a180416 upstream.

I read the commit log of the following two:

- bc083a64b6 ("init/Kconfig: make COMPILE_TEST depend on !UML")
- 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390")

Both are talking about HAS_IOMEM dependency missing in many drivers.

So, 'depends on HAS_IOMEM' seems the direct, sensible solution to me.

This does not change the behavior of UML. UML still cannot enable
COMPILE_TEST because it does not provide HAS_IOMEM.

The current dependency for S390 is too strong. Under the condition of
CONFIG_PCI=y, S390 provides HAS_IOMEM, hence can enable COMPILE_TEST.

I also removed the meaningless 'default n'.

Link: https://lkml.kernel.org/r/20210224140809.1067582-1-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KP Singh <kpsingh@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Quentin Perret <qperret@google.com>
Cc: Valentin Schneider <valentin.schneider@arm.com>
Cc: "Enrico Weigelt, metux IT consult" <lkml@metux.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-10 13:34:32 +02:00
Heiko Carstens
43dd03f088 init/Kconfig: make COMPILE_TEST depend on !S390
commit 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e upstream.

While allmodconfig and allyesconfig build for s390 there are also
various bots running compile tests with randconfig, where PCI is
disabled. This reveals that a lot of drivers should actually depend on
HAS_IOMEM.
Adding this to each device driver would be a never ending story,
therefore just disable COMPILE_TEST for s390.

The reasoning is more or less the same as described in
commit bc083a64b6 ("init/Kconfig: make COMPILE_TEST depend on !UML").

Reported-by: kernel test robot <lkp@intel.com>
Suggested-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-10 13:34:32 +02:00
Greg Kroah-Hartman
4aa66e99aa Merge branch 'android11-5.4' into 'android11-5.4-lts'
Sync up with android11-5.4 for the following commits:

8aa2c72ddf ANDROID: android/OWNERS: drop gki-abi-approvers@
9b465a062d ANDROID: Add OWNERS files referring to the respective android-mainline OWNERS
884688fe0c ANDROID: Make vsock virtio packet buff size configurable
ae37e86392 ANDROID: refresh ABI XML to new version
35b7fe6c12 ANDROID: Refresh GKI ABI XML
d71d55b76b ANDROID: ABI: Update symbol list for cuttlefish
a5dc6e5d9e ANDROID: GKI: enable CONFIG_SONY_FF
e01b338f5e ANDROID: ABI: update symbols to unisoc whitelist to android11-k5.4
c9c1aa8cfe ANDROID: ABI: Update allowed list for QCOM
408366e170 ANDROID: GKI: Enable DRM_GEM_SHMEM_HELPER
a7c0b02b68 ANDROID: GKI: Update abi_gki_aarch64_qcom
4a669f5150 ANDROID: clang: update to 12.0.4
3c6774301d FROMGIT: configfs: fix a use-after-free in __configfs_open_file
b0cd259c16 ANDROID: GKI: enable hid-playstation driver/rumble
fb66b3f219 UPSTREAM: HID: playstation: add DualSense player LED support.
faff2c6cd8 UPSTREAM: HID: playstation: add microphone mute support for DualSense.
669066bd53 UPSTREAM: HID: playstation: add initial DualSense lightbar support.
6f239ba207 UPSTREAM: HID: playstation: fix array size comparison (off-by-one)
8e0061c2c3 UPSTREAM: HID: playstation: fix unused variable in ps_battery_get_property.
6c0bf9e6af BACKPORT: HID: playstation: report DualSense hardware and firmware version.
8d5f8d63af UPSTREAM: HID: playstation: add DualSense classic rumble support.
ea8ed83665 UPSTREAM: HID: playstation: add DualSense Bluetooth support.
3dd150cf16 UPSTREAM: HID: playstation: track devices in list.
a4a27b5d2a UPSTREAM: HID: playstation: add DualSense accelerometer and gyroscope support.
bd87612ff7 UPSTREAM: HID: playstation: add DualSense touchpad support.
f8e26f21e9 UPSTREAM: HID: playstation: add DualSense battery support.
69844f8c10 UPSTREAM: HID: playstation: use DualSense MAC address as unique identifier.
e694a1fc90 UPSTREAM: HID: playstation: initial DualSense USB support.
ce582b2960 ANDROID: GKI: Add IMX KMI symbol list
c6c9823ce8 BACKPORT: binder: move structs from core file to header file

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I066b0a352e06728856d725c3ef6bebb65bab8932
2021-04-10 11:51:05 +02:00
Xiaowen Wu
408366e170 ANDROID: GKI: Enable DRM_GEM_SHMEM_HELPER
DRM_GEM_SHMEM_HELPER is needed by DRM driver to support large
shared memory allocation.

Bug: 183221396
Change-Id: I76d58abc357f1685e65fc8dd5e2568e1d307cc38
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
2021-03-20 12:02:49 +00:00
Greg Kroah-Hartman
1187a992b3 This is the 5.4.97 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIyBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAjmR0ACgkQONu9yGCS
 aT6y/A/3f4yvZr4VWRdsX9eWC5snc9jx+QSd/t+LzdRTJa8gCHQcEp9TTGiZHr7/
 DSM5c32BXesBDs2Ctb5jUYRfp1SgPH5pen7/HUREG0qCG+u2lY6I3/Nc0thCQNcH
 xCOHlBMx1bJ9Dy4Z39YpwqGbGRldFM+/UoAke1/mGvqxVBeQyx4bwKg94qdKRugb
 XRwKRcihNgL2NfWdGQ+yy+G4msjrUoswdpns5CWOjWXxkObfeg3clnQipw6mSloR
 q+NCcwgPXUC1jbzH0nXQwzfHpD+mcFU8/ueUgN/1Q6OGkZ5uDv2vdSK4PtzTyUSN
 SNlcCl5D1hQdml9+Vh+/ScVCwzpKHmCzyWY/e17Fe1mMXGYIrOkexNcgrfld6Hfz
 1yQ/9UfBZ2gAUTsecOvZS+l/ejh5NkOJX5CtMlQDA4wtn6JjMWLVddksXxAcbIIP
 PWdLlfH+vfGfxrGJ/g3L0ALlppx0ezDCMvz6X2mVn1w7ifXcW+mnucypmDoQQ57j
 Ckc+YRluLxrBdLJsS98iLOkoTFxRJXZArJSI/lDW3LqPaFhFX5SMg/ilArefas78
 62y8gIPdIlMt2sjJ12xnY4G4cod5Ec29YpMorIbl2CZve5OC5e5MiUxubU0C7noz
 zEGP9+bqp0WVd5Ir2yAvSyvmkNPOSOoBsrKuw0Gw1M1p3gxKLg==
 =BMmj
 -----END PGP SIGNATURE-----

Merge 5.4.97 into android11-5.4-lts

Changes in 5.4.97
	USB: serial: cp210x: add pid/vid for WSDA-200-USB
	USB: serial: cp210x: add new VID/PID for supporting Teraoka AD2000
	USB: serial: option: Adding support for Cinterion MV31
	arm64: dts: qcom: c630: keep both touchpad devices enabled
	Input: i8042 - unbreak Pegatron C15B
	arm64: dts: amlogic: meson-g12: Set FL-adj property value
	arm64: dts: rockchip: fix vopl iommu irq on px30
	bpf, cgroup: Fix optlen WARN_ON_ONCE toctou
	bpf, cgroup: Fix problematic bounds check
	um: virtio: free vu_dev only with the contained struct device
	rxrpc: Fix deadlock around release of dst cached on udp tunnel
	arm64: dts: ls1046a: fix dcfg address range
	igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr
	igc: check return value of ret_val in igc_config_fc_after_link_up
	i40e: Revert "i40e: don't report link up for a VF who hasn't enabled queues"
	net/mlx5: Fix leak upon failure of rule creation
	net: lapb: Copy the skb before sending a packet
	net: mvpp2: TCAM entry enable should be written after SRAM data
	r8169: fix WoL on shutdown if CONFIG_DEBUG_SHIRQ is set
	ARM: dts: sun7i: a20: bananapro: Fix ethernet phy-mode
	nvmet-tcp: fix out-of-bounds access when receiving multiple h2cdata PDUs
	memblock: do not start bottom-up allocations with kernel_end
	USB: gadget: legacy: fix an error code in eth_bind()
	USB: usblp: don't call usb_set_interface if there's a single alt
	usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop()
	usb: dwc2: Fix endpoint direction check in ep_from_windex
	usb: dwc3: fix clock issue during resume in OTG mode
	usb: xhci-mtk: fix unreleased bandwidth data
	usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints
	usb: xhci-mtk: break loop when find the endpoint to drop
	usb: host: xhci-plat: add priv quirk for skip PHY initialization
	ovl: fix dentry leak in ovl_get_redirect
	mac80211: fix station rate table updates on assoc
	fgraph: Initialize tracing_graph_pause at task creation
	kretprobe: Avoid re-registration of the same kretprobe earlier
	libnvdimm/dimm: Avoid race between probe and available_slots_show()
	genirq/msi: Activate Multi-MSI early when MSI_FLAG_ACTIVATE_EARLY is set
	xhci: fix bounce buffer usage for non-sg list case
	cifs: report error instead of invalid when revalidating a dentry fails
	smb3: Fix out-of-bounds bug in SMB2_negotiate()
	smb3: fix crediting for compounding when only one request in flight
	mmc: core: Limit retries when analyse of SDIO tuples fails
	drm/amd/display: Revert "Fix EDID parsing after resume from suspend"
	nvme-pci: avoid the deepest sleep state on Kingston A2000 SSDs
	KVM: SVM: Treat SVM as unsupported when running as an SEV guest
	KVM: x86: Update emulator context mode if SYSENTER xfers to 64-bit mode
	ARM: footbridge: fix dc21285 PCI configuration accessors
	mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page
	mm: hugetlb: fix a race between freeing and dissolving the page
	mm: hugetlb: fix a race between isolating and freeing page
	mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active
	mm, compaction: move high_pfn to the for loop scope
	mm: thp: fix MADV_REMOVE deadlock on shmem THP
	x86/build: Disable CET instrumentation in the kernel
	x86/apic: Add extra serialization for non-serializing MSRs
	iwlwifi: mvm: don't send RFH_QUEUE_CONFIG_CMD with no queues
	Input: xpad - sync supported devices with fork on GitHub
	iommu/vt-d: Do not use flush-queue when caching-mode is on
	md: Set prev_flush_start and flush_bio in an atomic way
	igc: Report speed and duplex as unknown when device is runtime suspended
	neighbour: Prevent a dead entry from updating gc_list
	net: ip_tunnel: fix mtu calculation
	net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add
	net: sched: replaced invalid qdisc tree flush helper in qdisc_replace
	usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720
	Linux 5.4.97

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic972908fac1b16b4b01a63e2c23b2dd2f528143b
2021-02-10 11:43:52 +01:00
Steven Rostedt (VMware)
e80f9021d5 fgraph: Initialize tracing_graph_pause at task creation
commit 7e0a9220467dbcfdc5bc62825724f3e52e50ab31 upstream.

On some archs, the idle task can call into cpu_suspend(). The cpu_suspend()
will disable or pause function graph tracing, as there's some paths in
bringing down the CPU that can have issues with its return address being
modified. The task_struct structure has a "tracing_graph_pause" atomic
counter, that when set to something other than zero, the function graph
tracer will not modify the return address.

The problem is that the tracing_graph_pause counter is initialized when the
function graph tracer is enabled. This can corrupt the counter for the idle
task if it is suspended in these architectures.

   CPU 1				CPU 2
   -----				-----
  do_idle()
    cpu_suspend()
      pause_graph_tracing()
          task_struct->tracing_graph_pause++ (0 -> 1)

				start_graph_tracing()
				  for_each_online_cpu(cpu) {
				    ftrace_graph_init_idle_task(cpu)
				      task-struct->tracing_graph_pause = 0 (1 -> 0)

      unpause_graph_tracing()
          task_struct->tracing_graph_pause-- (0 -> -1)

The above should have gone from 1 to zero, and enabled function graph
tracing again. But instead, it is set to -1, which keeps it disabled.

There's no reason that the field tracing_graph_pause on the task_struct can
not be initialized at boot up.

Cc: stable@vger.kernel.org
Fixes: 380c4b1411 ("tracing/function-graph-tracer: append the tracing_graph_flag")
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211339
Reported-by: pierre.gondois@arm.com
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-10 09:25:29 +01:00
Greg Kroah-Hartman
7c6aaa0349 Revert "exec: Add exec_update_mutex to replace cred_guard_mutex"
This reverts commit b796d94921 which is
commit eea9673250db4e854e9998ef9da6d4584857f0ea.

It breaks the API and we don't need it right now in the 5.4 tree.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id9ad3c76420db75d11b0276ec89668b9a0809436
2021-01-11 14:35:30 +01:00
Greg Kroah-Hartman
116bf1afff Revert "exec: Transform exec_update_mutex into a rw_semaphore"
This reverts commit 117433236a which is
commit f7cfd871ae0c5008d94b6f66834e7845caa93c15 upstream.

It breaks the API and we don't need it right now in the 5.4 tree.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia4d89b6dfbb92d6bd48b36b1f85559a8dfb331c6
2021-01-11 14:32:43 +01:00
Greg Kroah-Hartman
51e9c21c50 This is the 5.4.88 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl/5pXIACgkQONu9yGCS
 aT5t7hAAqNuPKftShc3L/8QXk8m1K46Bx3J1s3o+P5vDFiAMVFNq+dKeN4XK9dnQ
 ePKTdLNW4woYp9laZREfImr4rJADG+AOQ0qVX06XQUkqgvqxBgIbCVWPngB6lUxV
 ojxjanoIAODo7IMZi2QfzaUVBlZaOpbKJa/Z9cju303k/vp+DJxhNpZ7RUfRiZIH
 nh3U6FnkTRAyPTi3H7iZteSTOQg4Av+zrDODqK1N9RL9qXwbMxQG9U9pl9XLD0Nb
 XaQ++ydGEB0dprix3WEe9pe1A1hIKlZ8lslSFYSt5DA3IY3YkKoAQPyhVcsG85YO
 1HPiVa71kd4pLhJM3MlWAkunG8ZGf/Bx4Rvjac887HeyhQ8oxu3gFvNZDk2EFIv0
 5GDfTOqZEv0Yp32GetM7hcMml3uH1dIG9Ib0iLkuNa6Kopus+Jor7YKrfy93iP2B
 nlB4LJorSRYNbOA/kEjToKEwA+v8ub4MHO8qBRJpkVtRVGHkR/jKLIyIYdXVXXFi
 C1emjB3qoRvbKed5mkkWpUhZG1mBDzmTK0Y/XqtbNlZktlolvRS/HTbOmke3G2C6
 QWcbXtUZ+SlUM8uMYa0Z8lMMcl2rMHOj+ELg7D2XLOpViMIWbiRxYdLTlFAfKUUu
 kgwHOUuZa0iouvnmKE8tyypgiR+VAz+k74LOsHn3hHKV5U7203U=
 =/YH9
 -----END PGP SIGNATURE-----

Merge 5.4.88 into android11-5.4-lts

Changes in 5.4.88
	Revert "drm/amd/display: Fix memory leaks in S3 resume"
	Revert "mtd: spinand: Fix OOB read"
	dmaengine: at_hdmac: Substitute kzalloc with kmalloc
	dmaengine: at_hdmac: add missing put_device() call in at_dma_xlate()
	dmaengine: at_hdmac: add missing kfree() call in at_dma_xlate()
	kdev_t: always inline major/minor helper functions
	iio:imu:bmi160: Fix alignment and data leak issues
	fuse: fix bad inode
	perf: Break deadlock involving exec_update_mutex
	rwsem: Implement down_read_killable_nested
	rwsem: Implement down_read_interruptible
	exec: Transform exec_update_mutex into a rw_semaphore
	mwifiex: Fix possible buffer overflows in mwifiex_cmd_802_11_ad_hoc_start
	Linux 5.4.88

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2e7792fc0001b7df699b4477fabf97914c0aeceb
2021-01-11 14:29:58 +01:00
Greg Kroah-Hartman
b7a78bdbef Revert "Revert "exec: Add exec_update_mutex to replace cred_guard_mutex""
This reverts commit dffe35b180 which is
commit eea9673250db4e854e9998ef9da6d4584857f0ea upstream.  We want it
back for a bit to help with merges only.  It will be dropped again
afterward...

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I04b431e3bb571b5661e89de1bef8a9a941ac1cb8
2021-01-11 14:26:56 +01:00
Eric W. Biederman
117433236a exec: Transform exec_update_mutex into a rw_semaphore
[ Upstream commit f7cfd871ae0c5008d94b6f66834e7845caa93c15 ]

Recently syzbot reported[0] that there is a deadlock amongst the users
of exec_update_mutex.  The problematic lock ordering found by lockdep
was:

   perf_event_open  (exec_update_mutex -> ovl_i_mutex)
   chown            (ovl_i_mutex       -> sb_writes)
   sendfile         (sb_writes         -> p->lock)
     by reading from a proc file and writing to overlayfs
   proc_pid_syscall (p->lock           -> exec_update_mutex)

While looking at possible solutions it occured to me that all of the
users and possible users involved only wanted to state of the given
process to remain the same.  They are all readers.  The only writer is
exec.

There is no reason for readers to block on each other.  So fix
this deadlock by transforming exec_update_mutex into a rw_semaphore
named exec_update_lock that only exec takes for writing.

Cc: Jann Horn <jannh@google.com>
Cc: Vasiliy Kulikov <segoon@openwall.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Bernd Edlinger <bernd.edlinger@hotmail.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Christopher Yeoh <cyeoh@au1.ibm.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Sargun Dhillon <sargun@sargun.me>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Fixes: eea9673250db ("exec: Add exec_update_mutex to replace cred_guard_mutex")
[0] https://lkml.kernel.org/r/00000000000063640c05ade8e3de@google.com
Reported-by: syzbot+db9cdf3dd1f64252c6ef@syzkaller.appspotmail.com
Link: https://lkml.kernel.org/r/87ft4mbqen.fsf@x220.int.ebiederm.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-01-09 13:44:55 +01:00
Greg Kroah-Hartman
d45416b62b This is the 5.4.86 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl/sW9MACgkQONu9yGCS
 aT5SwBAAo6dgHqwmPfuf98/8oVeVqTxcmE7GpzpVRH2+yI7Zwk2ez29tAflcM7lT
 LKtR2WFGAxoCL4DUKXeO7Ubwpue5NoBIsJ8/dAYBesojps3WDaFGL55PvJLWwFJ7
 5gPtPzynITaqIC1JCFcrJ7OTp7REiCUZRc1CJXJINWAYL1VbEbH8pH904xfFcivy
 XnNyL9UiWp1lSB8oF3CRJOaK5M5gY1+wdCFaLVqQn306XDEM8PvZK4G3at/jXWgH
 jQjArdtC8M8NwjyTwtqW9JAMV+6CD0/HXk0QboTZg6yiaRrtUsfzMqJ1cvhKcQgO
 kLE3rwdnr3/MxuzSnGWbswflG2WCutoah58g0uN8H0nCiui5mKN6x5K+emgDZIoO
 ndDnh+/5OE247EK+3CGn/0N8i/fOymrLAnLL4wCXVdlQLMCalnL37ibdfGbAptXi
 N3GOGZ2iEglvTsEr5w0r86+AzNskm5EqA7mFGFiAyf9viR2xwYk3RrWf2ZyMRos2
 2S7mKcZmw7voDu2TIDIhqydToBKxmYI/mUn3mFFme1h3lwzM3zYG1aovVLfd5NkY
 Gx5E/CA/ut/3n0u/dXJ8SxEitBWkqImp5UdYcElQNxQoXnVU4yKmjf6dDL9Wqh+1
 ujCiaCUJd3PY0uXXIb6RWWGs2VaL4xiEnk+ZBm0VI9WEUWksSx0=
 =jnmv
 -----END PGP SIGNATURE-----

Merge 5.4.86 into android11-5.4-lts

Changes in 5.4.86
	ARM: dts: sun7i: bananapi: Enable RGMII RX/TX delay on Ethernet PHY
	ARM: dts: sun8i: r40: bananapi-m2-berry: Fix dcdc1 regulator
	ARM: dts: sun8i: v40: bananapi-m2-berry: Fix ethernet node
	pinctrl: merrifield: Set default bias in case no particular value given
	pinctrl: baytrail: Avoid clearing debounce value when turning it off
	ARM: dts: sun8i: v3s: fix GIC node memory range
	ARM: dts: sun7i: pcduino3-nano: enable RGMII RX/TX delay on PHY
	ARM: dts: imx6qdl-wandboard-revd1: Remove PAD_GPIO_6 from enetgrp
	ARM: dts: imx6qdl-kontron-samx6i: fix I2C_PM scl pin
	PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter
	gpio: zynq: fix reference leak in zynq_gpio functions
	gpio: mvebu: fix potential user-after-free on probe
	scsi: bnx2i: Requires MMU
	xsk: Fix xsk_poll()'s return type
	xsk: Replace datagram_poll by sock_poll_wait
	can: softing: softing_netdev_open(): fix error handling
	clk: renesas: r9a06g032: Drop __packed for portability
	block: Simplify REQ_OP_ZONE_RESET_ALL handling
	block: factor out requeue handling from dispatch code
	blk-mq: In blk_mq_dispatch_rq_list() "no budget" is a reason to kick
	pinctrl: aspeed: Fix GPIO requests on pass-through banks
	netfilter: x_tables: Switch synchronization to RCU
	netfilter: nft_compat: make sure xtables destructors have run
	netfilter: nft_dynset: fix timeouts later than 23 days
	afs: Fix memory leak when mounting with multiple source parameters
	Revert "gpio: eic-sprd: Use devm_platform_ioremap_resource()"
	gpio: eic-sprd: break loop when getting NULL device resource
	netfilter: nft_ct: Remove confirmation check for NFT_CT_ID
	selftests/bpf/test_offload.py: Reset ethtool features after failed setting
	RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
	i40e: Refactor rx_bi accesses
	i40e: optimise prefetch page refcount
	i40e: avoid premature Rx buffer reuse
	ixgbe: avoid premature Rx buffer reuse
	selftests: fix poll error in udpgro.sh
	net: mvpp2: add mvpp2_phylink_to_port() helper
	drm/tegra: replace idr_init() by idr_init_base()
	kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
	drm/tegra: sor: Disable clocks on error in tegra_sor_init()
	habanalabs: put devices before driver removal
	arm64: syscall: exit userspace before unmasking exceptions
	vxlan: Add needed_headroom for lower device
	vxlan: Copy needed_tailroom from lowerdev
	scsi: mpt3sas: Increase IOCInit request timeout to 30s
	dm table: Remove BUG_ON(in_interrupt())
	iwlwifi: pcie: add one missing entry for AX210
	drm/amd/display: Init clock value by current vbios CLKs
	perf/x86/intel: Check PEBS status correctly
	kbuild: avoid split lines in .mod files
	soc/tegra: fuse: Fix index bug in get_process_id
	usb: mtu3: fix memory corruption in mtu3_debugfs_regset()
	USB: serial: option: add interface-number sanity check to flag handling
	USB: gadget: f_acm: add support for SuperSpeed Plus
	USB: gadget: f_midi: setup SuperSpeed Plus descriptors
	usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
	USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
	usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
	ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU
	ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410
	ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU
	coresight: tmc-etf: Fix NULL ptr dereference in tmc_enable_etf_sink_perf()
	coresight: tmc-etr: Check if page is valid before dma_map_page()
	coresight: tmc-etr: Fix barrier packet insertion for perf buffer
	coresight: etb10: Fix possible NULL ptr dereference in etb_enable_perf()
	scsi: megaraid_sas: Check user-provided offsets
	HID: i2c-hid: add Vero K147 to descriptor override
	serial_core: Check for port state when tty is in error state
	Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
	quota: Sanity-check quota file headers on load
	media: msi2500: assign SPI bus number dynamically
	crypto: af_alg - avoid undefined behavior accessing salg_name
	md: fix a warning caused by a race between concurrent md_ioctl()s
	drm/gma500: fix double free of gma_connector
	drm/aspeed: Fix Kconfig warning & subsequent build errors
	drm/mcde: Fix handling of platform_get_irq() error
	drm/tve200: Fix handling of platform_get_irq() error
	arm64: dts: renesas: hihope-rzg2-ex: Drop rxc-skew-ps from ethernet-phy node
	arm64: dts: renesas: cat875: Remove rxc-skew-ps from ethernet-phy node
	soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
	soc: mediatek: Check if power domains can be powered on at boot time
	soc: qcom: geni: More properly switch to DMA mode
	Revert "i2c: i2c-qcom-geni: Fix DMA transfer race"
	RDMA/bnxt_re: Set queue pair state when being queried
	rtc: pcf2127: fix pcf2127_nvmem_read/write() returns
	selinux: fix error initialization in inode_doinit_with_dentry()
	ARM: dts: aspeed: s2600wf: Fix VGA memory region location
	RDMA/rxe: Compute PSN windows correctly
	x86/mm/ident_map: Check for errors from ident_pud_init()
	ARM: p2v: fix handling of LPAE translation in BE mode
	x86/apic: Fix x2apic enablement without interrupt remapping
	sched/deadline: Fix sched_dl_global_validate()
	sched: Reenable interrupts in do_sched_yield()
	drm/amdgpu: fix incorrect enum type
	crypto: talitos - Endianess in current_desc_hdr()
	crypto: talitos - Fix return type of current_desc_hdr()
	crypto: inside-secure - Fix sizeof() mismatch
	ASoC: sun4i-i2s: Fix lrck_period computation for I2S justified mode
	ARM: dts: aspeed: tiogapass: Remove vuart
	drm/amdgpu: fix build_coefficients() argument
	powerpc/64: Set up a kernel stack for secondaries before cpu_restore()
	spi: img-spfi: fix reference leak in img_spfi_resume
	f2fs: call f2fs_get_meta_page_retry for nat page
	drm/msm/dsi_pll_10nm: restore VCO rate during restore_state
	spi: spi-mem: fix reference leak in spi_mem_access_start
	ASoC: pcm: DRAIN support reactivation
	selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
	spi: stm32: fix reference leak in stm32_spi_resume
	brcmfmac: Fix memory leak for unpaired brcmf_{alloc/free}
	arm64: dts: exynos: Include common syscon restart/poweroff for Exynos7
	arm64: dts: exynos: Correct psci compatible used on Exynos7
	Bluetooth: Fix null pointer dereference in hci_event_packet()
	Bluetooth: hci_h5: fix memory leak in h5_close
	spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
	spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
	spi: tegra20-slink: fix reference leak in slink ops of tegra20
	spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
	spi: tegra114: fix reference leak in tegra spi ops
	spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume
	mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
	selftest/bpf: Add missed ip6ip6 test back
	ASoC: wm8998: Fix PM disable depth imbalance on error
	spi: sprd: fix reference leak in sprd_spi_remove
	ASoC: arizona: Fix a wrong free in wm8997_probe
	RDMa/mthca: Work around -Wenum-conversion warning
	MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
	crypto: qat - fix status check in qat_hal_put_rel_rd_xfer()
	staging: greybus: codecs: Fix reference counter leak in error handling
	staging: gasket: interrupt: fix the missed eventfd_ctx_put() in gasket_interrupt.c
	media: tm6000: Fix sizeof() mismatches
	media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm()
	media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
	media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm()
	media: v4l2-fwnode: Return -EINVAL for invalid bus-type
	ASoC: meson: fix COMPILE_TEST error
	scsi: core: Fix VPD LUN ID designator priorities
	media: solo6x10: fix missing snd_card_free in error handling case
	video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init()
	drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
	Input: ads7846 - fix race that causes missing releases
	Input: ads7846 - fix integer overflow on Rt calculation
	Input: ads7846 - fix unaligned access on 7845
	usb/max3421: fix return error code in max3421_probe()
	spi: mxs: fix reference leak in mxs_spi_probe
	selftests/bpf: Fix broken riscv build
	powerpc: Avoid broken GCC __attribute__((optimize))
	powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
	EDAC/mce_amd: Use struct cpuinfo_x86.cpu_die_id for AMD NodeId
	crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd
	crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
	spi: fix resource leak for drivers without .remove callback
	soc: ti: knav_qmss: fix reference leak in knav_queue_probe
	soc: ti: Fix reference imbalance in knav_dma_probe
	drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
	Input: omap4-keypad - fix runtime PM error handling
	clk: meson: Kconfig: fix dependency for G12A
	RDMA/cxgb4: Validate the number of CQEs
	memstick: fix a double-free bug in memstick_check
	ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
	ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
	mmc: pxamci: Fix error return code in pxamci_probe
	orinoco: Move context allocation after processing the skb
	qtnfmac: fix error return code in qtnf_pcie_probe()
	rsi: fix error return code in rsi_reset_card()
	cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
	dmaengine: mv_xor_v2: Fix error return code in mv_xor_v2_probe()
	arm64: tegra: Fix DT binding for IO High Voltage entry
	media: siano: fix memory leak of debugfs members in smsdvb_hotplug
	platform/x86: mlx-platform: Remove PSU EEPROM from default platform configuration
	platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration
	samples: bpf: Fix lwt_len_hist reusing previous BPF map
	media: imx214: Fix stop streaming
	mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
	media: max2175: fix max2175_set_csm_mode() error code
	slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
	HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
	ARM: dts: Remove non-existent i2c1 from 98dx3236
	arm64: dts: armada-3720-turris-mox: update ethernet-phy handle name
	arm64: dts: rockchip: Set dr_mode to "host" for OTG on rk3328-roc-cc
	power: supply: axp288_charger: Fix HP Pavilion x2 10 DMI matching
	power: supply: bq24190_charger: fix reference leak
	genirq/irqdomain: Don't try to free an interrupt that has no mapping
	arm64: dts: ls1028a: fix ENETC PTP clock input
	arm64: dts: qcom: c630: Polish i2c-hid devices
	PCI: Bounds-check command-line resource alignment requests
	PCI: Fix overflow in command-line resource alignment requests
	PCI: iproc: Fix out-of-bound array accesses
	arm64: dts: meson: fix spi-max-frequency on Khadas VIM2
	arm64: dts: meson-sm1: fix typo in opp table
	soc: amlogic: canvas: add missing put_device() call in meson_canvas_get()
	ARM: dts: at91: at91sam9rl: fix ADC triggers
	platform/x86: dell-smbios-base: Fix error return code in dell_smbios_init
	ath10k: Fix the parsing error in service available event
	ath10k: Fix an error handling path
	ath10k: Release some resources in an error handling path
	SUNRPC: rpc_wake_up() should wake up tasks in the correct order
	NFSv4.2: condition READDIR's mask for security label based on LSM state
	SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
	NFSv4: Fix the alignment of page data in the getdeviceinfo reply
	net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs'
	lockd: don't use interval-based rebinding over TCP
	NFS: switch nfsiod to be an UNBOUND workqueue.
	selftests/seccomp: Update kernel config
	vfio-pci: Use io_remap_pfn_range() for PCI IO memory
	hwmon: (ina3221) Fix PM usage counter unbalance in ina3221_write_enable
	media: saa7146: fix array overflow in vidioc_s_audio()
	powerpc/perf: Fix crash with is_sier_available when pmu is not set
	powerpc/64: Fix an EMIT_BUG_ENTRY in head_64.S
	clocksource/drivers/orion: Add missing clk_disable_unprepare() on error path
	clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
	iio: hrtimer-trigger: Mark hrtimer to expire in hard interrupt context
	ARM: dts: at91: sama5d2: map securam as device
	bpf: Fix bpf_put_raw_tracepoint()'s use of __module_address()
	pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
	arm64: dts: rockchip: Fix UART pull-ups on rk3328
	memstick: r592: Fix error return in r592_probe()
	MIPS: Don't round up kernel sections size for memblock_add()
	net/mlx5: Properly convey driver version to firmware
	ASoC: jz4740-i2s: add missed checks for clk_get()
	dm ioctl: fix error return code in target_message
	phy: renesas: rcar-gen3-usb2: disable runtime pm in case of failure
	clocksource/drivers/arm_arch_timer: Use stable count reader in erratum sne
	clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
	cpufreq: ap806: Add missing MODULE_DEVICE_TABLE
	cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
	cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
	cpufreq: qcom: Add missing MODULE_DEVICE_TABLE
	cpufreq: st: Add missing MODULE_DEVICE_TABLE
	cpufreq: sun50i: Add missing MODULE_DEVICE_TABLE
	cpufreq: loongson1: Add missing MODULE_ALIAS
	cpufreq: scpi: Add missing MODULE_ALIAS
	Bluetooth: btusb: Add the missed release_firmware() in btusb_mtk_setup_firmware()
	Bluetooth: btmtksdio: Add the missed release_firmware() in mtk_setup_firmware()
	arm64: dts: meson: fix PHY deassert timing requirements
	ARM: dts: meson: fix PHY deassert timing requirements
	arm64: dts: meson: g12a: x96-max: fix PHY deassert timing requirements
	scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
	scsi: pm80xx: Fix error return in pm8001_pci_probe()
	seq_buf: Avoid type mismatch for seq_buf_init
	scsi: fnic: Fix error return code in fnic_probe()
	platform/x86: mlx-platform: Fix item counter assignment for MSN2700, MSN24xx systems
	powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
	powerpc/pseries/hibernation: remove redundant cacheinfo update
	drm/mediatek: avoid dereferencing a null hdmi_phy on an error message
	ASoC: amd: change clk_get() to devm_clk_get() and add missed checks
	powerpc/mm: sanity_check_fault() should work for all, not only BOOK3S
	usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
	usb: oxu210hp-hcd: Fix memory leak in oxu_create
	speakup: fix uninitialized flush_lock
	nfsd: Fix message level for normal termination
	nfs_common: need lock during iterate through the list
	x86/kprobes: Restore BTF if the single-stepping is cancelled
	platform/chrome: cros_ec_spi: Don't overwrite spi::mode
	bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
	s390/cio: fix use-after-free in ccw_device_destroy_console
	iwlwifi: mvm: hook up missing RX handlers
	erofs: avoid using generic_block_bmap
	can: m_can: m_can_config_endisable(): remove double clearing of clock stop request bit
	RDMA/core: Do not indicate device ready when device enablement fails
	remoteproc: q6v5-mss: fix error handling in q6v5_pds_enable
	remoteproc: qcom: fix reference leak in adsp_start
	remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()
	clk: tegra: Fix duplicated SE clock entry
	mtd: rawnand: gpmi: fix reference count leak in gpmi ops
	mtd: rawnand: meson: Fix a resource leak in init
	mtd: rawnand: gpmi: Fix the random DMA timeout issue
	extcon: max77693: Fix modalias string
	crypto: atmel-i2c - select CONFIG_BITREVERSE
	mac80211: don't set set TDLS STA bandwidth wider than possible
	ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
	irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
	watchdog: armada_37xx: Add missing dependency on HAS_IOMEM
	watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
	watchdog: sprd: remove watchdog disable from resume fail path
	watchdog: sprd: check busy bit before new loading rather than after that
	watchdog: Fix potential dereferencing of null pointer
	ubifs: Fix error return code in ubifs_init_authentication()
	um: Monitor error events in IRQ controller
	um: tty: Fix handling of close in tty lines
	um: chan_xterm: Fix fd leak
	sunrpc: fix xs_read_xdr_buf for partial pages receive
	RDMA/cma: Don't overwrite sgid_attr after device is released
	nfc: s3fwrn5: Release the nfc firmware
	powerpc/ps3: use dma_mapping_error()
	sparc: fix handling of page table constructor failure
	mm: don't wake kswapd prematurely when watermark boosting is disabled
	checkpatch: fix unescaped left brace
	lan743x: fix rx_napi_poll/interrupt ping-pong
	net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
	net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
	net: korina: fix return value
	libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
	watchdog: qcom: Avoid context switch in restart handler
	watchdog: coh901327: add COMMON_CLK dependency
	clk: ti: Fix memleak in ti_fapll_synth_setup
	pwm: zx: Add missing cleanup in error path
	pwm: lp3943: Dynamically allocate PWM chip base
	perf record: Fix memory leak when using '--user-regs=?' to list registers
	qlcnic: Fix error code in probe
	virtio_ring: Cut and paste bugs in vring_create_virtqueue_packed()
	virtio_net: Fix error code in probe()
	virtio_ring: Fix two use after free bugs
	clk: at91: sam9x60: remove atmel,osc-bypass support
	clk: s2mps11: Fix a resource leak in error handling paths in the probe function
	clk: sunxi-ng: Make sure divider tables have sentinel
	kconfig: fix return value of do_error_if()
	perf probe: Fix memory leak when synthesizing SDT probes
	ARM: sunxi: Add machine match for the Allwinner V3 SoC
	cfg80211: initialize rekey_data
	fix namespaced fscaps when !CONFIG_SECURITY
	lwt: Disable BH too in run_lwt_bpf()
	drm/amd/display: Prevent bandwidth overflow
	drm/amdkfd: Fix leak in dmabuf import
	Input: cros_ec_keyb - send 'scancodes' in addition to key events
	initramfs: fix clang build failure
	Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
	vfio/pci/nvlink2: Do not attempt NPU2 setup on POWER8NVL NPU
	media: gspca: Fix memory leak in probe
	media: sunxi-cir: ensure IR is handled when it is continuous
	media: netup_unidvb: Don't leak SPI master in probe error path
	media: ipu3-cio2: Remove traces of returned buffers
	media: ipu3-cio2: Return actual subdev format
	media: ipu3-cio2: Serialise access to pad format
	media: ipu3-cio2: Validate mbus format in setting subdev format
	media: ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE
	Input: cyapa_gen6 - fix out-of-bounds stack access
	ALSA: hda/ca0132 - Change Input Source enum strings.
	PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
	Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
	ACPI: PNP: compare the string length in the matching_id()
	ALSA: hda: Fix regressions on clear and reconfig sysfs
	ALSA: hda/ca0132 - Fix AE-5 rear headphone pincfg.
	ALSA: hda/realtek: make bass spk volume adjustable on a yoga laptop
	ALSA: hda/realtek - Enable headset mic of ASUS X430UN with ALC256
	ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
	ALSA: hda/realtek - Add supported for more Lenovo ALC285 Headset Button
	ALSA: pcm: oss: Fix a few more UBSAN fixes
	ALSA/hda: apply jack fixup for the Acer Veriton N4640G/N6640G/N2510G
	ALSA: hda/realtek: Add quirk for MSI-GP73
	ALSA: hda/realtek: Apply jack fixup for Quanta NL3
	ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
	ALSA: usb-audio: Disable sample read check if firmware doesn't give back
	ALSA: core: memalloc: add page alignment for iram
	s390/smp: perform initial CPU reset also for SMT siblings
	s390/kexec_file: fix diag308 subcode when loading crash kernel
	s390/dasd: fix hanging device offline processing
	s390/dasd: prevent inconsistent LCU device data
	s390/dasd: fix list corruption of pavgroup group list
	s390/dasd: fix list corruption of lcu list
	binder: add flag to clear buffer on txn complete
	ASoC: cx2072x: Fix doubly definitions of Playback and Capture streams
	staging: comedi: mf6x4: Fix AI end-of-conversion detection
	perf/x86/intel: Add event constraint for CYCLE_ACTIVITY.STALLS_MEM_ANY
	perf/x86/intel: Fix rtm_abort_event encoding on Ice Lake
	powerpc/perf: Exclude kernel samples while counting events in user space.
	crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
	crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata
	EDAC/i10nm: Use readl() to access MMIO registers
	EDAC/amd64: Fix PCI component registration
	cpuset: fix race between hotplug work and later CPU offline
	USB: serial: mos7720: fix parallel-port state restore
	USB: serial: digi_acceleport: fix write-wakeup deadlocks
	USB: serial: keyspan_pda: fix dropped unthrottle interrupts
	USB: serial: keyspan_pda: fix write deadlock
	USB: serial: keyspan_pda: fix stalled writes
	USB: serial: keyspan_pda: fix write-wakeup use-after-free
	USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
	USB: serial: keyspan_pda: fix write unthrottling
	btrfs: do not shorten unpin len for caching block groups
	btrfs: trim: fix underflow in trim length to prevent access beyond device boundary
	ext4: fix a memory leak of ext4_free_data
	ext4: fix deadlock with fs freezing and EA inodes
	KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
	ARM: dts: pandaboard: fix pinmux for gpio user button of Pandaboard ES
	ARM: dts: at91: sama5d2: fix CAN message ram offset and size
	xprtrdma: Fix XDRBUF_SPARSE_PAGES support
	powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at
	powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
	powerpc/feature: Add CPU_FTR_NOEXECUTE to G2_LE
	powerpc/xmon: Change printk() to pr_cont()
	powerpc/8xx: Fix early debug when SMC1 is relocated
	powerpc/mm: Fix verification of MMU_FTR_TYPE_44x
	powerpc/powernv/npu: Do not attempt NPU2 setup on POWER8NVL NPU
	powerpc/powernv/memtrace: Don't leak kernel memory to user space
	powerpc/powernv/memtrace: Fix crashing the kernel when enabling concurrently
	ima: Don't modify file descriptor mode on the fly
	um: Remove use of asprinf in umid.c
	ceph: fix race in concurrent __ceph_remove_cap invocations
	SMB3: avoid confusing warning message on mount to Azure
	ubifs: wbuf: Don't leak kernel memory to flash
	jffs2: Fix GC exit abnormally
	jffs2: Fix ignoring mounting options problem during remounting
	jfs: Fix array index bounds check in dbAdjTree
	platform/x86: mlx-platform: remove an unused variable
	drm/amd/display: Fix memory leaks in S3 resume
	drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor()
	drm/i915: Fix mismatch between misplaced vma check and vma insert
	spi: pxa2xx: Fix use-after-free on unbind
	spi: spi-sh: Fix use-after-free on unbind
	spi: atmel-quadspi: Fix use-after-free on unbind
	spi: davinci: Fix use-after-free on unbind
	spi: fsl: fix use of spisel_boot signal on MPC8309
	spi: gpio: Don't leak SPI master in probe error path
	spi: mxic: Don't leak SPI master in probe error path
	spi: pic32: Don't leak DMA channels in probe error path
	spi: rb4xx: Don't leak SPI master in probe error path
	spi: sc18is602: Don't leak SPI master in probe error path
	spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path
	spi: synquacer: Disable clock in probe error path
	spi: mt7621: Disable clock in probe error path
	spi: mt7621: Don't leak SPI master in probe error path
	spi: atmel-quadspi: Disable clock in probe error path
	spi: atmel-quadspi: Fix AHB memory accesses
	soc: qcom: smp2p: Safely acquire spinlock without IRQs
	mtd: spinand: Fix OOB read
	mtd: parser: cmdline: Fix parsing of part-names with colons
	mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read
	mtd: rawnand: meson: fix meson_nfc_dma_buffer_release() arguments
	scsi: qla2xxx: Fix crash during driver load on big endian machines
	scsi: lpfc: Fix invalid sleeping context in lpfc_sli4_nvmet_alloc()
	scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()
	iio: buffer: Fix demux update
	iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
	iio:light:rpr0521: Fix timestamp alignment and prevent data leak.
	iio:light:st_uvis25: Fix timestamp alignment and prevent data leak.
	iio:magnetometer:mag3110: Fix alignment and data leak issues.
	iio:pressure:mpl3115: Force alignment of buffer
	iio:imu:bmi160: Fix too large a buffer.
	iio:adc:ti-ads124s08: Fix buffer being too long.
	iio:adc:ti-ads124s08: Fix alignment and data leak issues.
	md/cluster: block reshape with remote resync job
	md/cluster: fix deadlock when node is doing resync job
	pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler
	clk: ingenic: Fix divider calculation with div tables
	clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
	clk: tegra: Do not return 0 on failure
	device-dax/core: Fix memory leak when rmmod dax.ko
	dma-buf/dma-resv: Respect num_fences when initializing the shared fence list.
	xen-blkback: set ring->xenblkd to NULL after kthread_stop()
	xen/xenbus: Allow watches discard events before queueing
	xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
	xen/xenbus/xen_bus_type: Support will_handle watch callback
	xen/xenbus: Count pending messages for each watch
	xenbus/xenbus_backend: Disallow pending watch messages
	libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
	platform/x86: intel-vbtn: Allow switch events on Acer Switch Alpha 12
	PCI: Fix pci_slot_release() NULL pointer dereference
	regulator: axp20x: Fix DLDO2 voltage control register mask for AXP22x
	rtc: ep93xx: Fix NULL pointer dereference in ep93xx_rtc_read_time
	Revert: "ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS"
	x86/CPU/AMD: Save AMD NodeId as cpu_die_id
	Linux 5.4.86

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If271639b9a7c833718f8cfdfbacce5affe7f4189
2020-12-30 12:31:14 +01:00
Arnd Bergmann
070bd3a8ac initramfs: fix clang build failure
[ Upstream commit 55d5b7dd6451b58489ce384282ca5a4a289eb8d5 ]

There is only one function in init/initramfs.c that is in the .text
section, and it is marked __weak.  When building with clang-12 and the
integrated assembler, this leads to a bug with recordmcount:

  ./scripts/recordmcount  "init/initramfs.o"
  Cannot find symbol for section 2: .text.
  init/initramfs.o: failed

I'm not quite sure what exactly goes wrong, but I notice that this
function is only ever called from an __init function, and normally
inlined.  Marking it __init as well is clearly correct and it leads to
recordmcount no longer complaining.

Link: https://lkml.kernel.org/r/20201204165742.3815221-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Barret Rhoden <brho@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-30 11:51:30 +01:00
Greg Kroah-Hartman
eb78bdd479 This is the 5.4.75 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl+j2NoACgkQONu9yGCS
 aT5J8RAAnGBQDsYW32cIwCnEMAAzderx88BD1LWUh3VUzYkUkR/BZVzfR9oBCNNo
 3JnCXiJGAmxQqNmM4U4oll1qtDKSnkEL0d3x0dzoPU0jAK2DneZZeUceGXrCsACD
 07UmEJ+pg8YwHIDWjPl/XzsOFNDZGIri2ioW5sw0UMg5oSgei+pJsnr999198KoI
 3xae/qnkBgWhD2pghHQKHHXJnQTe9+JD+g+cMEWFK36Uxgpc2bpPeZtEaQBRaZZY
 CdPPwWuzWY6fBPOYCvrYHG86oPGuR3n03AM0nXWwRPkK2fAxsodr6UpZhQ+tjxJD
 gHGsQH1PrgH+wmiAgyaASdl+kvP0B2sRykeLcGLHT1t9Z3OGU3Jo0hxW6pGb85Da
 loF+OzhrI7Jlpk9XBJq81GdDGyNvco43gLGID2gTrNpLQ/WMW0slrCYE1WvLQ0ZQ
 3u9iUXd3X330W7cZTQgap03MNFrvruwdHnQL6uO73TKCofX15QWX86Vn16GLLlna
 etA2le4GSm0yTC9G4Z5YnAIUZdvcrT6iYbmsQ/NoGhu4aJSiQe5O9j+Tb9LoCZYs
 V2fYpUYUCsWoq+6KsPHKM0wOAHQkxkCPWDjIrqzWwrRBLfjytVEnc6JQS/ZIdap6
 GejH8CeiAnvOpD5MyVGCCih+7slQadG//+z3h7WNugZkVGqFDWc=
 =2fiZ
 -----END PGP SIGNATURE-----

Merge 5.4.75 into android11-5.4-lts

Changes in 5.4.75
	xen/events: avoid removing an event channel while handling it
	xen/events: add a proper barrier to 2-level uevent unmasking
	xen/events: fix race in evtchn_fifo_unmask()
	xen/events: add a new "late EOI" evtchn framework
	xen/blkback: use lateeoi irq binding
	xen/netback: use lateeoi irq binding
	xen/scsiback: use lateeoi irq binding
	xen/pvcallsback: use lateeoi irq binding
	xen/pciback: use lateeoi irq binding
	xen/events: switch user event channels to lateeoi model
	xen/events: use a common cpu hotplug hook for event channels
	xen/events: defer eoi in case of excessive number of events
	xen/events: block rogue events for some time
	firmware: arm_scmi: Fix ARCH_COLD_RESET
	firmware: arm_scmi: Add missing Rx size re-initialisation
	x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels
	mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish()
	RDMA/qedr: Fix memory leak in iWARP CM
	ata: sata_nv: Fix retrieving of active qcs
	futex: Fix incorrect should_fail_futex() handling
	powerpc/powernv/smp: Fix spurious DBG() warning
	mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
	powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
	sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
	f2fs: add trace exit in exception path
	f2fs: fix uninit-value in f2fs_lookup
	f2fs: fix to check segment boundary during SIT page readahead
	s390/startup: avoid save_area_sync overflow
	um: change sigio_spinlock to a mutex
	f2fs: handle errors of f2fs_get_meta_page_nofail
	ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
	NFS4: Fix oops when copy_file_range is attempted with NFS4.0 source
	power: supply: bq27xxx: report "not charging" on all types
	xfs: fix realtime bitmap/summary file truncation when growing rt volume
	video: fbdev: pvr2fb: initialize variables
	ath10k: start recovery process when payload length exceeds max htc length for sdio
	ath10k: fix VHT NSS calculation when STBC is enabled
	drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly
	selftests/x86/fsgsbase: Reap a forgotten child
	media: videodev2.h: RGB BT2020 and HSV are always full range
	media: platform: Improve queue set up flow for bug fixing
	usb: typec: tcpm: During PR_SWAP, source caps should be sent only after tSwapSourceStart
	media: tw5864: check status of tw5864_frameinterval_get
	media: imx274: fix frame interval handling
	mmc: via-sdmmc: Fix data race bug
	drm/bridge/synopsys: dsi: add support for non-continuous HS clock
	arm64: topology: Stop using MPIDR for topology information
	printk: reduce LOG_BUF_SHIFT range for H8300
	ia64: kprobes: Use generic kretprobe trampoline handler
	kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
	bpf: Permit map_ptr arithmetic with opcode add and offset 0
	media: uvcvideo: Fix dereference of out-of-bound list iterator
	selftests/bpf: Define string const as global for test_sysctl_prog.c
	samples/bpf: Fix possible deadlock in xdpsock
	riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
	cpufreq: sti-cpufreq: add stih418 support
	USB: adutux: fix debugging
	uio: free uio id after uio file node is freed
	coresight: Make sysfs functional on topologies with per core sink
	usb: xhci: omit duplicate actions when suspending a runtime suspended host.
	SUNRPC: Mitigate cond_resched() in xprt_transmit()
	arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
	can: flexcan: disable clocks during stop mode
	xfs: don't free rt blocks when we're doing a REMAP bunmapi call
	ACPI: Add out of bounds and numa_off protections to pxm_to_node()
	brcmfmac: Fix warning message after dongle setup failed
	drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values
	bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
	ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
	power: supply: test_power: add missing newlines when printing parameters by sysfs
	drm/amd/display: HDMI remote sink need mode validation for Linux
	ARC: [dts] fix the errors detected by dtbs_check
	btrfs: fix replace of seed device
	md/bitmap: md_bitmap_get_counter returns wrong blocks
	bnxt_en: Log unknown link speed appropriately.
	rpmsg: glink: Use complete_all for open states
	clk: ti: clockdomain: fix static checker warning
	net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
	drivers: watchdog: rdc321x_wdt: Fix race condition bugs
	ext4: Detect already used quota file early
	KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest
	gfs2: use-after-free in sysfs deregistration
	gfs2: add validation checks for size of superblock
	cifs: handle -EINTR in cifs_setattr
	arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes
	ARM: dts: omap4: Fix sgx clock rate for 4430
	memory: emif: Remove bogus debugfs error handling
	ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschema warnings
	ARM: dts: s5pv210: move fixed clocks under root node
	ARM: dts: s5pv210: move PMU node out of clock controller
	ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node
	nbd: make the config put is called before the notifying the waiter
	sgl_alloc_order: fix memory leak
	nvme-rdma: fix crash when connect rejected
	md/raid5: fix oops during stripe resizing
	mmc: sdhci: Add LTR support for some Intel BYT based controllers
	mmc: sdhci-acpi: AMDI0040: Set SDHCI_QUIRK2_PRESET_VALUE_BROKEN
	seccomp: Make duplicate listener detection non-racy
	selftests/x86/fsgsbase: Test PTRACE_PEEKUSER for GSBASE with invalid LDT GS
	perf/x86/intel: Fix Ice Lake event constraint table
	perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
	perf/x86/amd/ibs: Fix raw sample data accumulation
	spi: sprd: Release DMA channel also on probe deferral
	extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips
	leds: bcm6328, bcm6358: use devres LED registering function
	media: uvcvideo: Fix uvc_ctrl_fixup_xu_info() not having any effect
	fs: Don't invalidate page buffers in block_write_full_page()
	NFS: fix nfs_path in case of a rename retry
	ACPI: button: fix handling lid state changes when input device closed
	ACPI / extlog: Check for RDMSR failure
	ACPI: video: use ACPI backlight for HP 635 Notebook
	ACPI: debug: don't allow debugging when ACPI is disabled
	PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
	ACPI: EC: PM: Flush EC work unconditionally after wakeup
	ACPI: EC: PM: Drop ec_no_wakeup check from acpi_ec_dispatch_gpe()
	acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
	w1: mxc_w1: Fix timeout resolution problem leading to bus error
	scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
	scsi: qla2xxx: Fix crash on session cleanup with unload
	PM: runtime: Remove link state checks in rpm_get/put_supplier()
	btrfs: qgroup: fix wrong qgroup metadata reserve for delayed inode
	btrfs: improve device scanning messages
	btrfs: reschedule if necessary when logging directory items
	btrfs: send, orphanize first all conflicting inodes when processing references
	btrfs: send, recompute reference path after orphanization of a directory
	btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()
	btrfs: tree-checker: fix false alert caused by legacy btrfs root item
	btrfs: cleanup cow block on error
	btrfs: tree-checker: validate number of chunk stripes and parity
	btrfs: fix use-after-free on readahead extent after failure to create it
	btrfs: fix readahead hang and use-after-free after removing a device
	usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
	usb: dwc3: pci: Allow Elkhart Lake to utilize DSM method for PM functionality
	usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
	usb: dwc3: gadget: Check MPS of the request length
	usb: dwc3: core: add phy cleanup for probe error handling
	usb: dwc3: core: don't trigger runtime pm when remove driver
	usb: dwc3: gadget: Resume pending requests after CLEAR_STALL
	usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command
	usb: cdc-acm: fix cooldown mechanism
	usb: typec: tcpm: reset hard_reset_count for any disconnect
	usb: host: fsl-mph-dr-of: check return of dma_set_mask()
	drm/i915: Force VT'd workarounds when running as a guest OS
	vt: keyboard, simplify vt_kdgkbsent
	vt: keyboard, extend func_buf_lock to readers
	HID: wacom: Avoid entering wacom_wac_pen_report for pad / battery
	udf: Fix memory leak when mounting
	dmaengine: dma-jz4780: Fix race in jz4780_dma_tx_status
	iio:light:si1145: Fix timestamp alignment and prevent data leak.
	iio: adc: gyroadc: fix leak of device node iterator
	iio:adc:ti-adc0832 Fix alignment issue with timestamp
	iio:adc:ti-adc12138 Fix alignment issue with timestamp
	iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
	powerpc/drmem: Make lmb_size 64 bit
	MIPS: DEC: Restore bootmem reservation for firmware working memory area
	s390/stp: add locking to sysfs functions
	powerpc/rtas: Restrict RTAS requests from userspace
	powerpc: Warn about use of smt_snooze_delay
	powerpc/memhotplug: Make lmb size 64bit
	powerpc/powernv/elog: Fix race while processing OPAL error log event.
	powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP
	powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation
	NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE
	NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag
	NFSD: Add missing NFSv2 .pc_func methods
	ubifs: dent: Fix some potential memory leaks while iterating entries
	ubifs: xattr: Fix some potential memory leaks while iterating entries
	ubifs: journal: Make sure to not dirty twice for auth nodes
	ubifs: Fix a memleak after dumping authentication mount options
	ubifs: Don't parse authentication mount options in remount process
	ubifs: mount_ubifs: Release authentication resource in error handling path
	perf python scripting: Fix printable strings in python3 scripts
	ARC: perf: redo the pct irq missing in device-tree handling
	ubi: check kthread_should_stop() after the setting of task state
	ia64: fix build error with !COREDUMP
	rtc: rx8010: don't modify the global rtc ops
	i2c: imx: Fix external abort on interrupt in exit paths
	drm/amdgpu: don't map BO in reserved region
	drm/amd/display: Increase timeout for DP Disable
	drm/amdgpu: correct the gpu reset handling for job != NULL case
	drm/amdkfd: Use same SQ prefetch setting as amdgpu
	drm/amd/display: Avoid MST manager resource leak.
	drm/amdgpu: increase the reserved VM size to 2MB
	drm/amd/display: Don't invoke kgdb_breakpoint() unconditionally
	drm/amd/display: Fix kernel panic by dal_gpio_open() error
	ceph: promote to unsigned long long before shifting
	libceph: clear con->out_msg on Policy::stateful_server faults
	9P: Cast to loff_t before multiplying
	ring-buffer: Return 0 on success from ring_buffer_resize()
	vringh: fix __vringh_iov() when riov and wiov are different
	ext4: fix leaking sysfs kobject after failed mount
	ext4: fix error handling code in add_new_gdb
	ext4: fix invalid inode checksum
	drm/ttm: fix eviction valuable range check.
	mmc: sdhci-of-esdhc: set timeout to max before tuning
	mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
	drm/amd/pm: increase mclk switch threshold to 200 us
	tty: make FONTX ioctl use the tty pointer they were actually passed
	arm64: berlin: Select DW_APB_TIMER_OF
	cachefiles: Handle readpage error correctly
	hil/parisc: Disable HIL driver when it gets stuck
	arm: dts: mt7623: add missing pause for switchport
	ARM: samsung: fix PM debug build with DEBUG_LL but !MMU
	ARM: s3c24xx: fix missing system reset
	device property: Keep secondary firmware node secondary by type
	device property: Don't clear secondary pointer for shared primary firmware node
	KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
	staging: fieldbus: anybuss: jump to correct label in an error path
	staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
	staging: octeon: repair "fixed-link" support
	staging: octeon: Drop on uncorrectable alignment or FCS error
	Linux 5.4.75

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3c571dc0389df541b6abc5c4eb1add78b2b1d1a6
2020-11-05 13:27:24 +01:00
John Ogness
b3142fe7ff printk: reduce LOG_BUF_SHIFT range for H8300
[ Upstream commit 550c10d28d21bd82a8bb48debbb27e6ed53262f6 ]

The .bss section for the h8300 is relatively small. A value of
CONFIG_LOG_BUF_SHIFT that is larger than 19 will create a static
printk ringbuffer that is too large. Limit the range appropriately
for the H8300.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20200812073122.25412-1-john.ogness@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-11-05 11:43:16 +01:00
Greg Kroah-Hartman
cb547a4e01 Merge branch 'android11-5.4' into 'android11-5.4-lts'
Sync up with android11-5.4 for the following commits:

a2114d2456 ANDROID: Update KMI_GENERATION after KMI change
9bb683349b ANDROID: GKI: update the .xml file with the October 15 ABI breakages
b7d30a3293 ANDROID: GKI: fs.h: add Android ABI padding to struct file
3b300ff4c5 ANDROID: vendor_hooks: Add a vendor data to file struct
e89b05984d ANDROID: vendor_hooks: Extend the vendor data array in task_struct
7ee8b58cc1 ANDROID: GKI: add fields required to enable CONFIG_TRANSPARENT_HUGEPAGE
0ce2100bcf ANDROID: Drop abi_gki_aarch64_workarounds
f0c4a768cf UPSTREAM: ehci-hcd: Move include to keep CRC stable
5427f8b72f ANDROID: GKI: update xiaomi symbol list
ecb88922f5 ANDROID: GKI: update Vivo symbol list
32b2423372 ANDROID: sysrq: add vendor hook for sysrq crash information

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia8ac3109c49a4866904c4419a17e2379156a8f77
2020-10-16 08:10:38 +02:00
Suren Baghdasaryan
7ee8b58cc1 ANDROID: GKI: add fields required to enable CONFIG_TRANSPARENT_HUGEPAGE
Devices with plenty of RAM might benefit from THP usage. Added fields
would allow to enable CONFIG_TRANSPARENT_HUGEPAGE without affecting ABI.

Bug: 168269341
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ieb644a8da5377383d514197ee02d7bfd6f1d346d
2020-10-15 17:21:03 +02:00
Greg Kroah-Hartman
dffe35b180 Revert "exec: Add exec_update_mutex to replace cred_guard_mutex"
This reverts commit b796d94921 which is
commit eea9673250db4e854e9998ef9da6d4584857f0ea.

It breaks the API and we don't need it right now in the 5.4 tree.

Bug: 161946584
Change-Id: I28f98480e9f4a8599b7cfe887401d7515bf5360e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2020-10-01 20:29:38 +02:00
Greg Kroah-Hartman
e772bef401 This is the 5.4.69 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl91u0cACgkQONu9yGCS
 aT7KmhAAvuW3edfAfzD/F5h4vHaa9rMRmtvp2/FwefBoE4LEi3F6p2gBrUZMA3ds
 DNQ8Nheafeqd63wFkfE//TXYR0rYTxTxa0jTrhtuJCUZ4+anRyG00fEbHPOxvMnJ
 aPwQQVNOfCaUAvRbFdQ4RbuIm5chhX8Bml0ZtqvsAAFJ9XkCh1UPF0VHtSrS7PRL
 lRMBlamLgZqU72naaJaFY2nMp+pvMFPZrzkR7tpv0Z1bqxuJp6L2n/EmcHpmTOJy
 Ze+Wvt1wKk8Ep5Vql5ekXt5lEiInjacwsJZXbb5HfHO++Y+1b+ABt1kSjJx+R3/q
 2Qdztq+9Eoj0N1A4gXdVFoZHqKihhbD49k8YqX4qO5ujTzqgnNyHGSEXyIKvaU6z
 b3b12IvjbcMhM1zm3qvFfrVbbQI3kJf66zSi9NAwsZHlsvxRzslALR8I7mila4r5
 fVOyfGoZxFs44FNW9JG7I85/isAxgg0ogYraMZbk8gmhTtb1ZaN+r7kJeXuTpzOg
 UBAIDYPclMyZeny6tn1/qFuzNGYQQ0R9kxFcTC21Cf2zNLWHNfwCL1vE3Ob+ROIS
 IHcsce6IqWQKGlD8UPjkZiXTLfqCAVi51PsGTVrnidXfa1IBOuvDsVqlghPsjHSD
 30N4VB++9Gbw7LFEP4e33cOZLBLjDEdYd4VuoQFYywDZ3cy6xXo=
 =OoZD
 -----END PGP SIGNATURE-----

Merge 5.4.69 into android11-5.4-lts

Changes in 5.4.69
	kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()
	scsi: lpfc: Fix pt2pt discovery on SLI3 HBAs
	scsi: mpt3sas: Free diag buffer without any status check
	selinux: allow labeling before policy is loaded
	media: mc-device.c: fix memleak in media_device_register_entity
	drm/amd/display: Do not double-buffer DTO adjustments
	drm/amdkfd: Fix race in gfx10 context restore handler
	dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling)
	scsi: qla2xxx: Add error handling for PLOGI ELS passthrough
	ath10k: fix array out-of-bounds access
	ath10k: fix memory leak for tpc_stats_final
	PCI/IOV: Serialize sysfs sriov_numvfs reads vs writes
	mm: fix double page fault on arm64 if PTE_AF is cleared
	scsi: aacraid: fix illegal IO beyond last LBA
	m68k: q40: Fix info-leak in rtc_ioctl
	xfs: fix inode fork extent count overflow
	gma/gma500: fix a memory disclosure bug due to uninitialized bytes
	ASoC: kirkwood: fix IRQ error handling
	soundwire: intel/cadence: fix startup sequence
	media: smiapp: Fix error handling at NVM reading
	drm/amd/display: Free gamma after calculating legacy transfer function
	xfs: properly serialise fallocate against AIO+DIO
	leds: mlxreg: Fix possible buffer overflow
	dm table: do not allow request-based DM to stack on partitions
	PM / devfreq: tegra30: Fix integer overflow on CPU's freq max out
	scsi: fnic: fix use after free
	scsi: lpfc: Fix kernel crash at lpfc_nvme_info_show during remote port bounce
	powerpc/64s: Always disable branch profiling for prom_init.o
	net: silence data-races on sk_backlog.tail
	dax: Fix alloc_dax_region() compile warning
	iomap: Fix overflow in iomap_page_mkwrite
	f2fs: avoid kernel panic on corruption test
	clk/ti/adpll: allocate room for terminating null
	drm/amdgpu/powerplay: fix AVFS handling with custom powerplay table
	ice: Fix to change Rx/Tx ring descriptor size via ethtool with DCBx
	mtd: cfi_cmdset_0002: don't free cfi->cfiq in error path of cfi_amdstd_setup()
	mfd: mfd-core: Protect against NULL call-back function pointer
	drm/amdgpu/powerplay/smu7: fix AVFS handling with custom powerplay table
	tpm_crb: fix fTPM on AMD Zen+ CPUs
	tracing: Verify if trace array exists before destroying it.
	tracing: Adding NULL checks for trace_array descriptor pointer
	bcache: fix a lost wake-up problem caused by mca_cannibalize_lock
	dmaengine: mediatek: hsdma_probe: fixed a memory leak when devm_request_irq fails
	x86/kdump: Always reserve the low 1M when the crashkernel option is specified
	RDMA/qedr: Fix potential use after free
	RDMA/i40iw: Fix potential use after free
	PCI: Avoid double hpmemsize MMIO window assignment
	fix dget_parent() fastpath race
	xfs: fix attr leaf header freemap.size underflow
	RDMA/iw_cgxb4: Fix an error handling path in 'c4iw_connect()'
	ubi: Fix producing anchor PEBs
	mmc: core: Fix size overflow for mmc partitions
	gfs2: clean up iopen glock mess in gfs2_create_inode
	scsi: pm80xx: Cleanup command when a reset times out
	mt76: do not use devm API for led classdev
	mt76: add missing locking around ampdu action
	debugfs: Fix !DEBUG_FS debugfs_create_automount
	SUNRPC: Capture completion of all RPC tasks
	CIFS: Use common error handling code in smb2_ioctl_query_info()
	CIFS: Properly process SMB3 lease breaks
	f2fs: stop GC when the victim becomes fully valid
	ASoC: max98090: remove msleep in PLL unlocked workaround
	xtensa: fix system_call interaction with ptrace
	s390: avoid misusing CALL_ON_STACK for task stack setup
	xfs: fix realtime file data space leak
	drm/amdgpu: fix calltrace during kmd unload(v3)
	arm64: insn: consistently handle exit text
	selftests/bpf: De-flake test_tcpbpf
	kernel/notifier.c: intercept duplicate registrations to avoid infinite loops
	kernel/sys.c: avoid copying possible padding bytes in copy_to_user
	KVM: arm/arm64: vgic: Fix potential double free dist->spis in __kvm_vgic_destroy()
	module: Remove accidental change of module_enable_x()
	xfs: fix log reservation overflows when allocating large rt extents
	ALSA: hda: enable regmap internal locking
	tipc: fix link overflow issue at socket shutdown
	vcc_seq_next should increase position index
	neigh_stat_seq_next() should increase position index
	rt_cpu_seq_next should increase position index
	ipv6_route_seq_next should increase position index
	drm/mcde: Handle pending vblank while disabling display
	seqlock: Require WRITE_ONCE surrounding raw_seqcount_barrier
	drm/scheduler: Avoid accessing freed bad job.
	media: ti-vpe: cal: Restrict DMA to avoid memory corruption
	opp: Replace list_kref with a local counter
	scsi: qla2xxx: Fix stuck session in GNL
	scsi: lpfc: Fix incomplete NVME discovery when target
	sctp: move trace_sctp_probe_path into sctp_outq_sack
	ACPI: EC: Reference count query handlers under lock
	scsi: ufs: Make ufshcd_add_command_trace() easier to read
	scsi: ufs: Fix a race condition in the tracing code
	drm/amd/display: Initialize DSC PPS variables to 0
	i2c: tegra: Prevent interrupt triggering after transfer timeout
	btrfs: tree-checker: Check leaf chunk item size
	dmaengine: zynqmp_dma: fix burst length configuration
	s390/cpum_sf: Use kzalloc and minor changes
	nfsd: Fix a soft lockup race in nfsd_file_mark_find_or_create()
	powerpc/eeh: Only dump stack once if an MMIO loop is detected
	Bluetooth: btrtl: Use kvmalloc for FW allocations
	tracing: Set kernel_stack's caller size properly
	ARM: 8948/1: Prevent OOB access in stacktrace
	ar5523: Add USB ID of SMCWUSBT-G2 wireless adapter
	ceph: ensure we have a new cap before continuing in fill_inode
	selftests/ftrace: fix glob selftest
	tools/power/x86/intel_pstate_tracer: changes for python 3 compatibility
	Bluetooth: Fix refcount use-after-free issue
	mm/swapfile.c: swap_next should increase position index
	mm: pagewalk: fix termination condition in walk_pte_range()
	Bluetooth: prefetch channel before killing sock
	KVM: fix overflow of zero page refcount with ksm running
	ALSA: hda: Clear RIRB status before reading WP
	skbuff: fix a data race in skb_queue_len()
	nfsd: Fix a perf warning
	drm/amd/display: fix workaround for incorrect double buffer register for DLG ADL and TTU
	audit: CONFIG_CHANGE don't log internal bookkeeping as an event
	selinux: sel_avc_get_stat_idx should increase position index
	scsi: lpfc: Fix RQ buffer leakage when no IOCBs available
	scsi: lpfc: Fix release of hwq to clear the eq relationship
	scsi: lpfc: Fix coverity errors in fmdi attribute handling
	drm/omap: fix possible object reference leak
	locking/lockdep: Decrement IRQ context counters when removing lock chain
	clk: stratix10: use do_div() for 64-bit calculation
	crypto: chelsio - This fixes the kernel panic which occurs during a libkcapi test
	mt76: clear skb pointers from rx aggregation reorder buffer during cleanup
	mt76: fix handling full tx queues in mt76_dma_tx_queue_skb_raw
	ALSA: usb-audio: Don't create a mixer element with bogus volume range
	perf test: Fix test trace+probe_vfs_getname.sh on s390
	RDMA/rxe: Fix configuration of atomic queue pair attributes
	KVM: x86: fix incorrect comparison in trace event
	KVM: nVMX: Hold KVM's srcu lock when syncing vmcs12->shadow
	dmaengine: stm32-mdma: use vchan_terminate_vdesc() in .terminate_all
	media: staging/imx: Missing assignment in imx_media_capture_device_register()
	x86/pkeys: Add check for pkey "overflow"
	bpf: Remove recursion prevention from rcu free callback
	dmaengine: stm32-dma: use vchan_terminate_vdesc() in .terminate_all
	dmaengine: tegra-apb: Prevent race conditions on channel's freeing
	soundwire: bus: disable pm_runtime in sdw_slave_delete
	drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic
	drm/omap: dss: Cleanup DSS ports on initialisation failure
	iavf: use tc_cls_can_offload_and_chain0() instead of chain check
	firmware: arm_sdei: Use cpus_read_lock() to avoid races with cpuhp
	random: fix data races at timer_rand_state
	bus: hisi_lpc: Fixup IO ports addresses to avoid use-after-free in host removal
	ASoC: SOF: ipc: check ipc return value before data copy
	media: go7007: Fix URB type for interrupt handling
	Bluetooth: guard against controllers sending zero'd events
	timekeeping: Prevent 32bit truncation in scale64_check_overflow()
	powerpc/book3s64: Fix error handling in mm_iommu_do_alloc()
	drm/amd/display: fix image corruption with ODM 2:1 DSC 2 slice
	ext4: fix a data race at inode->i_disksize
	perf jevents: Fix leak of mapfile memory
	mm: avoid data corruption on CoW fault into PFN-mapped VMA
	drm/amdgpu: increase atombios cmd timeout
	ARM: OMAP2+: Handle errors for cpu_pm
	drm/amd/display: Stop if retimer is not available
	clk: imx: Fix division by zero warning on pfdv2
	cpu-topology: Fix the potential data corruption
	s390/irq: replace setup_irq() by request_irq()
	perf cs-etm: Swap packets for instruction samples
	perf cs-etm: Correct synthesizing instruction samples
	ath10k: use kzalloc to read for ath10k_sdio_hif_diag_read
	scsi: aacraid: Disabling TM path and only processing IOP reset
	Bluetooth: L2CAP: handle l2cap config request during open state
	media: tda10071: fix unsigned sign extension overflow
	tty: sifive: Finish transmission before changing the clock
	xfs: don't ever return a stale pointer from __xfs_dir3_free_read
	xfs: mark dir corrupt when lookup-by-hash fails
	ext4: mark block bitmap corrupted when found instead of BUGON
	tpm: ibmvtpm: Wait for buffer to be set before proceeding
	rtc: sa1100: fix possible race condition
	rtc: ds1374: fix possible race condition
	nfsd: Don't add locks to closed or closing open stateids
	RDMA/cm: Remove a race freeing timewait_info
	intel_th: Disallow multi mode on devices where it's broken
	KVM: PPC: Book3S HV: Treat TM-related invalid form instructions on P9 like the valid ones
	drm/msm: fix leaks if initialization fails
	drm/msm/a5xx: Always set an OPP supported hardware value
	tracing: Use address-of operator on section symbols
	thermal: rcar_thermal: Handle probe error gracefully
	KVM: LAPIC: Mark hrtimer for period or oneshot mode to expire in hard interrupt context
	perf parse-events: Fix 3 use after frees found with clang ASAN
	btrfs: do not init a reloc root if we aren't relocating
	btrfs: free the reloc_control in a consistent way
	r8169: improve RTL8168b FIFO overflow workaround
	serial: 8250_port: Don't service RX FIFO if throttled
	serial: 8250_omap: Fix sleeping function called from invalid context during probe
	serial: 8250: 8250_omap: Terminate DMA before pushing data on RX timeout
	perf cpumap: Fix snprintf overflow check
	net: axienet: Convert DMA error handler to a work queue
	net: axienet: Propagate failure of DMA descriptor setup
	cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn
	tools: gpio-hammer: Avoid potential overflow in main
	exec: Add exec_update_mutex to replace cred_guard_mutex
	exec: Fix a deadlock in strace
	selftests/ptrace: add test cases for dead-locks
	kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve
	proc: Use new infrastructure to fix deadlocks in execve
	proc: io_accounting: Use new infrastructure to fix deadlocks in execve
	perf: Use new infrastructure to fix deadlocks in execve
	nvme-multipath: do not reset on unknown status
	nvme: Fix ctrl use-after-free during sysfs deletion
	nvme: Fix controller creation races with teardown flow
	brcmfmac: Fix double freeing in the fmac usb data path
	xfs: prohibit fs freezing when using empty transactions
	RDMA/rxe: Set sys_image_guid to be aligned with HW IB devices
	IB/iser: Always check sig MR before putting it to the free pool
	scsi: hpsa: correct race condition in offload enabled
	SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()'
	svcrdma: Fix leak of transport addresses
	netfilter: nf_tables: silence a RCU-list warning in nft_table_lookup()
	PCI: Use ioremap(), not phys_to_virt() for platform ROM
	ubifs: ubifs_jnl_write_inode: Fix a memory leak bug
	ubifs: ubifs_add_orphan: Fix a memory leak bug
	ubifs: Fix out-of-bounds memory access caused by abnormal value of node_len
	ALSA: usb-audio: Fix case when USB MIDI interface has more than one extra endpoint descriptor
	PCI: pciehp: Fix MSI interrupt race
	NFS: Fix races nfs_page_group_destroy() vs nfs_destroy_unlinked_subrequests()
	drm/amdgpu/vcn2.0: stall DPG when WPTR/RPTR reset
	powerpc/perf: Implement a global lock to avoid races between trace, core and thread imc events.
	mm/kmemleak.c: use address-of operator on section symbols
	mm/filemap.c: clear page error before actual read
	mm/swapfile: fix data races in try_to_unuse()
	mm/vmscan.c: fix data races using kswapd_classzone_idx
	SUNRPC: Don't start a timer on an already queued rpc task
	nvmet-rdma: fix double free of rdma queue
	workqueue: Remove the warning in wq_worker_sleeping()
	drm/amdgpu/sriov add amdgpu_amdkfd_pre_reset in gpu reset
	mm/mmap.c: initialize align_offset explicitly for vm_unmapped_area
	ALSA: hda: Skip controller resume if not needed
	scsi: qedi: Fix termination timeouts in session logout
	serial: uartps: Wait for tx_empty in console setup
	btrfs: fix setting last_trans for reloc roots
	KVM: Remove CREATE_IRQCHIP/SET_PIT2 race
	perf stat: Force error in fallback on :k events
	bdev: Reduce time holding bd_mutex in sync in blkdev_close()
	drivers: char: tlclk.c: Avoid data race between init and interrupt handler
	KVM: arm64: vgic-v3: Retire all pending LPIs on vcpu destroy
	KVM: arm64: vgic-its: Fix memory leak on the error path of vgic_add_lpi()
	net: openvswitch: use u64 for meter bucket
	scsi: aacraid: Fix error handling paths in aac_probe_one()
	staging:r8188eu: avoid skb_clone for amsdu to msdu conversion
	sparc64: vcc: Fix error return code in vcc_probe()
	arm64: cpufeature: Relax checks for AArch32 support at EL[0-2]
	sched/fair: Eliminate bandwidth race between throttling and distribution
	dpaa2-eth: fix error return code in setup_dpni()
	dt-bindings: sound: wm8994: Correct required supplies based on actual implementaion
	devlink: Fix reporter's recovery condition
	atm: fix a memory leak of vcc->user_back
	media: venus: vdec: Init registered list unconditionally
	perf mem2node: Avoid double free related to realloc
	mm/slub: fix incorrect interpretation of s->offset
	i2c: tegra: Restore pinmux on system resume
	power: supply: max17040: Correct voltage reading
	phy: samsung: s5pv210-usb2: Add delay after reset
	Bluetooth: Handle Inquiry Cancel error after Inquiry Complete
	USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()
	KVM: x86: handle wrap around 32-bit address space
	tipc: fix memory leak in service subscripting
	tty: serial: samsung: Correct clock selection logic
	ALSA: hda: Fix potential race in unsol event handler
	drm/exynos: dsi: Remove bridge node reference in error handling path in probe function
	ipmi:bt-bmc: Fix error handling and status check
	powerpc/traps: Make unrecoverable NMIs die instead of panic
	svcrdma: Fix backchannel return code
	fuse: don't check refcount after stealing page
	fuse: update attr_version counter on fuse_notify_inval_inode()
	USB: EHCI: ehci-mv: fix less than zero comparison of an unsigned int
	coresight: etm4x: Fix use-after-free of per-cpu etm drvdata
	arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work
	scsi: cxlflash: Fix error return code in cxlflash_probe()
	arm64/cpufeature: Drop TraceFilt feature exposure from ID_DFR0 register
	drm/amdkfd: fix restore worker race condition
	e1000: Do not perform reset in reset_task if we are already down
	drm/nouveau/debugfs: fix runtime pm imbalance on error
	drm/nouveau: fix runtime pm imbalance on error
	drm/nouveau/dispnv50: fix runtime pm imbalance on error
	printk: handle blank console arguments passed in.
	usb: dwc3: Increase timeout for CmdAct cleared by device controller
	btrfs: don't force read-only after error in drop snapshot
	btrfs: fix double __endio_write_update_ordered in direct I/O
	gpio: rcar: Fix runtime PM imbalance on error
	vfio/pci: fix memory leaks of eventfd ctx
	KVM: PPC: Book3S HV: Close race with page faults around memslot flushes
	perf evsel: Fix 2 memory leaks
	perf trace: Fix the selection for architectures to generate the errno name tables
	perf stat: Fix duration_time value for higher intervals
	perf util: Fix memory leak of prefix_if_not_in
	perf metricgroup: Free metric_events on error
	perf kcore_copy: Fix module map when there are no modules loaded
	PCI: tegra194: Fix runtime PM imbalance on error
	ASoC: img-i2s-out: Fix runtime PM imbalance on error
	wlcore: fix runtime pm imbalance in wl1271_tx_work
	wlcore: fix runtime pm imbalance in wlcore_regdomain_config
	mtd: rawnand: gpmi: Fix runtime PM imbalance on error
	mtd: rawnand: omap_elm: Fix runtime PM imbalance on error
	PCI: tegra: Fix runtime PM imbalance on error
	ceph: fix potential race in ceph_check_caps
	mm/swap_state: fix a data race in swapin_nr_pages
	mm: memcontrol: fix stat-corrupting race in charge moving
	rapidio: avoid data race between file operation callbacks and mport_cdev_add().
	mtd: parser: cmdline: Support MTD names containing one or more colons
	x86/speculation/mds: Mark mds_user_clear_cpu_buffers() __always_inline
	NFS: nfs_xdr_status should record the procedure name
	vfio/pci: Clear error and request eventfd ctx after releasing
	cifs: Fix double add page to memcg when cifs_readpages
	nvme: fix possible deadlock when I/O is blocked
	mac80211: skip mpath lookup also for control port tx
	scsi: libfc: Handling of extra kref
	scsi: libfc: Skip additional kref updating work event
	selftests/x86/syscall_nt: Clear weird flags after each test
	vfio/pci: fix racy on error and request eventfd ctx
	btrfs: qgroup: fix data leak caused by race between writeback and truncate
	perf tests: Fix test 68 zstd compression for s390
	scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure
	ubi: fastmap: Free unused fastmap anchor peb during detach
	mt76: fix LED link time failure
	opp: Increase parsed_static_opps in _of_add_opp_table_v1()
	perf parse-events: Use strcmp() to compare the PMU name
	ALSA: hda: Always use jackpoll helper for jack update after resume
	ALSA: hda: Workaround for spurious wakeups on some Intel platforms
	net: openvswitch: use div_u64() for 64-by-32 divisions
	nvme: explicitly update mpath disk capacity on revalidation
	device_cgroup: Fix RCU list debugging warning
	ASoC: pcm3168a: ignore 0 Hz settings
	ASoC: wm8994: Skip setting of the WM8994_MICBIAS register for WM1811
	ASoC: wm8994: Ensure the device is resumed in wm89xx_mic_detect functions
	ASoC: Intel: bytcr_rt5640: Add quirk for MPMAN Converter9 2-in-1
	RISC-V: Take text_mutex in ftrace_init_nop()
	i2c: aspeed: Mask IRQ status to relevant bits
	s390/init: add missing __init annotations
	lockdep: fix order in trace_hardirqs_off_caller()
	EDAC/ghes: Check whether the driver is on the safe list correctly
	drm/amdkfd: fix a memory leak issue
	drm/amd/display: update nv1x stutter latencies
	drm/amdgpu/dc: Require primary plane to be enabled whenever the CRTC is
	i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
	objtool: Fix noreturn detection for ignored functions
	ieee802154: fix one possible memleak in ca8210_dev_com_init
	ieee802154/adf7242: check status of adf7242_read_reg
	clocksource/drivers/h8300_timer8: Fix wrong return value in h8300_8timer_init()
	mwifiex: Increase AES key storage size to 256 bits
	batman-adv: bla: fix type misuse for backbone_gw hash indexing
	atm: eni: fix the missed pci_disable_device() for eni_init_one()
	batman-adv: mcast/TT: fix wrongly dropped or rerouted packets
	netfilter: conntrack: nf_conncount_init is failing with IPv6 disabled
	mac802154: tx: fix use-after-free
	bpf: Fix clobbering of r2 in bpf_gen_ld_abs
	drm/vc4/vc4_hdmi: fill ASoC card owner
	net: qed: Disable aRFS for NPAR and 100G
	net: qede: Disable aRFS for NPAR and 100G
	net: qed: RDMA personality shouldn't fail VF load
	drm/sun4i: sun8i-csc: Secondary CSC register correction
	batman-adv: Add missing include for in_interrupt()
	nvme-tcp: fix kconfig dependency warning when !CRYPTO
	batman-adv: mcast: fix duplicate mcast packets in BLA backbone from LAN
	batman-adv: mcast: fix duplicate mcast packets in BLA backbone from mesh
	batman-adv: mcast: fix duplicate mcast packets from BLA backbone to mesh
	bpf: Fix a rcu warning for bpffs map pretty-print
	lib80211: fix unmet direct dependendices config warning when !CRYPTO
	ALSA: asihpi: fix iounmap in error handler
	regmap: fix page selection for noinc reads
	regmap: fix page selection for noinc writes
	MIPS: Add the missing 'CPU_1074K' into __get_cpu_type()
	regulator: axp20x: fix LDO2/4 description
	KVM: x86: Reset MMU context if guest toggles CR4.SMAP or CR4.PKE
	KVM: SVM: Add a dedicated INVD intercept routine
	mm: validate pmd after splitting
	arch/x86/lib/usercopy_64.c: fix __copy_user_flushcache() cache writeback
	x86/ioapic: Unbreak check_timer()
	scsi: lpfc: Fix initial FLOGI failure due to BBSCN not supported
	ALSA: usb-audio: Add delay quirk for H570e USB headsets
	ALSA: hda/realtek - Couldn't detect Mic if booting with headset plugged
	ALSA: hda/realtek: Enable front panel headset LED on Lenovo ThinkStation P520
	lib/string.c: implement stpcpy
	tracing: fix double free
	s390/dasd: Fix zero write for FBA devices
	kprobes: Fix to check probe enabled before disarm_kprobe_ftrace()
	kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
	btrfs: fix overflow when copying corrupt csums for a message
	dmabuf: fix NULL pointer dereference in dma_buf_release()
	mm, THP, swap: fix allocating cluster for swapfile by mistake
	mm/gup: fix gup_fast with dynamic page table folding
	s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl
	KVM: arm64: Assume write fault on S1PTW permission fault on instruction fetch
	dm: fix bio splitting and its bio completion order for regular IO
	kprobes: Fix compiler warning for !CONFIG_KPROBES_ON_FTRACE
	ata: define AC_ERR_OK
	ata: make qc_prep return ata_completion_errors
	ata: sata_mv, avoid trigerrable BUG_ON
	Linux 5.4.69

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2a26b4f6fd89b641fa80e339ee72089da51a1415
2020-10-01 18:00:35 +02:00
Masami Hiramatsu
c4ab0a8370 kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
commit 82d083ab60c3693201c6f5c7a5f23a6ed422098d upstream.

Since kprobe_event= cmdline option allows user to put kprobes on the
functions in initmem, kprobe has to make such probes gone after boot.
Currently the probes on the init functions in modules will be handled
by module callback, but the kernel init text isn't handled.
Without this, kprobes may access non-exist text area to disable or
remove it.

Link: https://lkml.kernel.org/r/159972810544.428528.1839307531600646955.stgit@devnote2

Fixes: 970988e19e ("tracing/kprobe: Add kprobe_event= boot parameter")
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-01 13:18:23 +02:00
Eric W. Biederman
b796d94921 exec: Add exec_update_mutex to replace cred_guard_mutex
[ Upstream commit eea9673250db4e854e9998ef9da6d4584857f0ea ]

The cred_guard_mutex is problematic as it is held over possibly
indefinite waits for userspace.  The possible indefinite waits for
userspace that I have identified are: The cred_guard_mutex is held in
PTRACE_EVENT_EXIT waiting for the tracer.  The cred_guard_mutex is
held over "put_user(0, tsk->clear_child_tid)" in exit_mm().  The
cred_guard_mutex is held over "get_user(futex_offset, ...")  in
exit_robust_list.  The cred_guard_mutex held over copy_strings.

The functions get_user and put_user can trigger a page fault which can
potentially wait indefinitely in the case of userfaultfd or if
userspace implements part of the page fault path.

In any of those cases the userspace process that the kernel is waiting
for might make a different system call that winds up taking the
cred_guard_mutex and result in deadlock.

Holding a mutex over any of those possibly indefinite waits for
userspace does not appear necessary.  Add exec_update_mutex that will
just cover updating the process during exec where the permissions and
the objects pointed to by the task struct may be out of sync.

The plan is to switch the users of cred_guard_mutex to
exec_update_mutex one by one.  This lets us move forward while still
being careful and not introducing any regressions.

Link: https://lore.kernel.org/lkml/20160921152946.GA24210@dhcp22.suse.cz/
Link: https://lore.kernel.org/lkml/AM6PR03MB5170B06F3A2B75EFB98D071AE4E60@AM6PR03MB5170.eurprd03.prod.outlook.com/
Link: https://lore.kernel.org/linux-fsdevel/20161102181806.GB1112@redhat.com/
Link: https://lore.kernel.org/lkml/20160923095031.GA14923@redhat.com/
Link: https://lore.kernel.org/lkml/20170213141452.GA30203@redhat.com/
Ref: 45c1a159b85b ("Add PTRACE_O_TRACEVFORKDONE and PTRACE_O_TRACEEXIT facilities.")
Ref: 456f17cd1a28 ("[PATCH] user-vm-unlock-2.5.31-A2")
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:17:47 +02:00
Masahiro Yamada
bc93285fae UPSTREAM: kbuild: use CONFIG_CC_VERSION_TEXT to construct LINUX_COMPILER macro
scripts/mkcompile_h runs $(CC) just for getting the version string.
Reuse CONFIG_CC_VERSION_TEXT for optimization.

For GCC, this slightly changes the version string. I do not think it
is a big deal as we do not have the defined format for LINUX_COMPILER.
In fact, the recent commit 4831f7ad6c ("kbuild: mkcompile_h:
Include $LD version in /proc/version") added the linker version.

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit 9a950154668729a472d17b8e307d92e7c60f45f7)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: I66bac5b44bf764e7c0e432ae17bcdf06d79c96d0
2020-09-24 10:02:57 +00:00
Masahiro Yamada
68aee2bc3d UPSTREAM: kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
scripts/mkcompile_h uses $(CC) only for getting the version string.

I suspected there was a specific reason why the additional flags were
needed, and dug the commit history. This code dates back to at least
2002 [1], but I could not get any more clue.

Just get rid of it.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=29f3df7eba8ddf91a55183f9967f76fbcc3ab742

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
(cherry picked from commit 01a6126b5f7efdf75480a2b970377f5724cb885a)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: If887ea1e9e43b9ce83bf8fe9cc0db809818c3bb8
2020-09-24 10:02:48 +00:00
Masahiro Yamada
eed9382d52 UPSTREAM: kbuild: ensure full rebuild when the compiler is updated
Commit 21c54b7747 ("kconfig: show compiler version text in the top
comment") added the environment variable, CC_VERSION_TEXT in the comment
of the top Kconfig file. It can detect the compiler update, and invoke
the syncconfig because all environment variables referenced in Kconfig
files are recorded in include/config/auto.conf.cmd

This commit makes it a CONFIG option in order to ensure the full rebuild
when the compiler is updated.

This works like follows:

include/config/kconfig.h contains "CONFIG_CC_VERSION_TEXT" in the comment
block.

The top Makefile specifies "-include $(srctree)/include/linux/kconfig.h"
to guarantee it is included from all kernel source files.

fixdep parses every source file and all headers included from it,
searching for words prefixed with "CONFIG_". Then, fixdep finds
CONFIG_CC_VERSION_TEXT in include/config/kconfig.h and adds
include/config/cc/version/text.h into every .*.cmd file.

When the compiler is updated, syncconfig is invoked because init/Kconfig
contains the reference to the environment variable CC_VERTION_TEXT.
CONFIG_CC_VERSION_TEXT is updated to the new version string, and
include/config/cc/version/text.h is touched.

In the next rebuild, Make will rebuild every files since the timestamp
of include/config/cc/version/text.h is newer than that of target.

Bug: 168274246

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit 8b59cd81dc5e724eaea283fa6006985891c7bff4)
Signed-off-by: Mars Lin <marslin@google.com>
Change-Id: Ie52bb8e33b95d0e97998024d28c0d8d7caf8aa59
2020-09-24 10:02:38 +00:00
glider@google.com
1b6a6a2efe UPSTREAM: security: allow using Clang's zero initialization for stack variables
Upstream commit f0fe00d4972a8cd4b98cc2c29758615e4d51cdfe.

In addition to -ftrivial-auto-var-init=pattern (used by
CONFIG_INIT_STACK_ALL now) Clang also supports zero initialization for
locals enabled by -ftrivial-auto-var-init=zero. The future of this flag
is still being debated (see https://bugs.llvm.org/show_bug.cgi?id=45497).
Right now it is guarded by another flag,
-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang,
which means it may not be supported by future Clang releases. Another
possible resolution is that -ftrivial-auto-var-init=zero will persist
(as certain users have already started depending on it), but the name
of the guard flag will change.

In the meantime, zero initialization has proven itself as a good
production mitigation measure against uninitialized locals. Unlike pattern
initialization, which has a higher chance of triggering existing bugs,
zero initialization provides safe defaults for strings, pointers, indexes,
and sizes. On the other hand, pattern initialization remains safer for
return values. Chrome OS and Android are moving to using zero
initialization for production builds.

Performance-wise, the difference between pattern and zero initialization
is usually negligible, although the generated code for zero
initialization is more compact.

This patch renames CONFIG_INIT_STACK_ALL to CONFIG_INIT_STACK_ALL_PATTERN
and introduces another config option, CONFIG_INIT_STACK_ALL_ZERO, that
enables zero initialization for locals if the corresponding flags are
supported by Clang.

Cc: Kees Cook <keescook@chromium.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Alexander Potapenko <glider@google.com>
Link: https://lore.kernel.org/r/20200616083435.223038-1-glider@google.com
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: I3c69570e7e3d3bbb666709de6feb531000bce2bf
2020-09-08 15:12:44 +00:00
Chun-Hung Wu
af38fd3120 ANDROID: net: enable wireless core features with GKI_LEGACY_WEXT_ALLCONFIG
In embedded environments the requirements are to be able to pick and
chose which features one requires built into the kernel.  If an
embedded environment wants to supports loading modules that have been
kbuilt out of tree, there is a need to enable hidden configurations
for legacy wireless core features to provide the API surface for
them to load.

Introduce CONFIG_GKI_LEGACY_WEXT_ALLCONFIG to select all legacy wireless
extension core features by activating in turn all the associated
hidden configuration options, without having to specifically select
any wireless module(s).

This reverts commit c2f96db077.
(rejected upstream commit url https://lkml.org/lkml/2019/9/6/878)
Bug: 140250271
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Change-Id: I7ca31317df82cf3a349ba6cc2dc42c37090625be
Signed-off-by: Mark Salyzyn <salyzyn@google.com>
2020-08-28 12:19:22 -07:00
Alistair Delva
9c97bcd075 ANDROID: GKI: Build CEC_{CORE,NOTIFIER,PIN} in
CEC_{CORE,NOTIFIER,PIN} are hidden options which are selected by
drivers. Select them here so the ABI surface is available to
modules.

Bug: 162507365
Bug: 164180803
Change-Id: Idf8d072388b387442d967bf1c6d3be1f9a734ab6
Signed-off-by: Alistair Delva <adelva@google.com>
2020-08-18 00:56:35 +00:00
John Stultz
6b20d301a3 ANDROID: Kconfig.gki: Remove GKI_QCOM_CLKS_CONFIGS and QCOM_RPMHPD from GKI_HACKS config option
This removes GKI_QCOM_CLKS_CONFIGS and the one QCOM_RPMHPD
config it selects from the GKI_HACKS config entry, as
we will move it to being a module.

Bug: 161478631
Bug: 161128971
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: Idc2eedf3ed3bfd3e88f9a577934943f86df16ab3
2020-07-17 08:47:41 -07:00
Mark Salyzyn
c2f96db077 Revert "ANDROID: net: enable wireless core features with GKI_LEGACY_WEXT_ALLCONFIG"
This reverts commit 8a167346a3.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 140761827
Test: build
Change-Id: Ia0704189e93f7c5d0fc8623bae121434a6936090
2020-07-16 12:40:54 +00:00
zhang sanshan
dd17237d72 ANDROID: gki: build-in DMA_VIRTUAL_CHANNELS
audio driver us edma to instore data.
fsl-edma used api in virt-dma, like vchan_init to dma opt.
There is not hardware involved. build-in DMA_VIRTUAL_CHANNELS

Bug: 160627323
Change-Id: I2a6bc2281af18a99f46870ed3fc2efc1798b72f2
Signed-off-by: zhang sanshan <pete.zhang@nxp.com>
2020-07-07 14:53:10 +00:00
zhang sanshan
955057dfd7 ANDROID: GKI: make VIDEOBUF2_DMA_CONTIG under GKI_HIDDEN_MEDIA_CONFIGS
it use vb2_dma_contig_memops as default mem_ops in csi driver
drivers/media/platform/mxc/capture/mx6s_capture.c still not upstream to linux community.
q->mem_ops = &vb2_dma_contig_memops;

mem_ops is need in videobuf2-core.c to operate dma buffer.
videobuf2-dma-contig.c is common code which have no hardware involved

Bug: 160195378
Signed-off-by: zhang sanshan <pete.zhang@nxp.com>
Change-Id: Ib084ff96bd4f92aa36f8abb8d4b62a0e9be62e6c
2020-07-07 14:34:20 +00:00
Todd Kjos
191e77e387 ANDROID: GKI: Enable INTERVAL_TREE
Needed by some GPU/DRM drivers that are built out-of-tree

Bug: 159733980
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ia156d1b0a74c82d9f15b144131aff2ddeead0672
2020-06-26 14:53:44 -07:00
Prasad Sodagudi
8bd3ec8eab ANDROID: GKI: Remove PINCTRL_MSM as built in driver
PINCTRL_MSM driver can be enabled as module, so remove
PINCTRL_MSM from hidden configs.

Bug: 158125476
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I11c5f0265e0068a0d21711344b9a44e1b41266e1
2020-06-23 18:41:42 +00:00
Alistair Delva
2068976fd7 ANDROID: GKI: Enable SYS_HYPERVISOR
Used by some Linux hypervisor support to tell userspace which hypervisor
it is being run under.

Bug: 157224726
Change-Id: Ia1cb56e665af6b60f6a51b5e81dd7abed240f812
Signed-off-by: Alistair Delva <adelva@google.com>
2020-06-04 09:24:42 -07:00
Greg Kroah-Hartman
a93d8ad9ba This is the 5.4.42 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl7EzDkACgkQONu9yGCS
 aT6E0Q//dzSQiIdz+a06TLKzcXyxzY+FIIy/OVZAYSGxeM3Kt6GDUzUWnlAPOSbo
 9UVcQdHllNKuJXXBOTkjEmFLEdJ+AFaJ2M7tjh5PKd7Y1am5xY2t7w4z5ohFaJto
 lPxakRXXPh4Yrf8n+ANyR9Dz69uLC+qfHi2wbQ6v8ly07Fgr034X7Pl+BMewNYM8
 QCcsS2a7+qmsvRGTheWhiFTZhEbHzEK5GB4EWIaYTEEsrTet1htwvtRLZ7TEvAma
 2jnapJBQBGkxxMoo9D1GAzA9MI7p7XqUvCmRpMtXiMaPUhFmOgHYtGZ4x3Iu/TmK
 dIeWOZjyHlosIHtbf7m2hrNPedaErjnZCM97gjOi9TjupndBveikYuynnbLthfbZ
 1mrrXHJew/FjILFE1GL1zVI6LMsFRUyWA7H3R8xQkBUXBKhoIzGl4263bugSO2Hk
 Gvn+cSTUBvou15yZPEm0WFqUiM0kBO3A1x9YcF9yKYuzGtpGF5GEQlriNCLLvfWf
 kihgOM4yIaFFYVL+CCbN6uHBVFhfI+Ts9/7PzLgoGtwshw9EK2Gn/FBn2NJetC1Q
 1wHlNlavLoYvI9RZ0kCuD/jcVxG2hvOjvo/RCYg+ETujjhkhWwcWZxhZQsG1Kel3
 a2/DMrx52RnhNMVDGecgRGKIADtqI4x6XZzk0gvgDG1ib3u77Ng=
 =dmPo
 -----END PGP SIGNATURE-----

Merge 5.4.42 into android-5.4-stable

Changes in 5.4.42
	net: dsa: Do not make user port errors fatal
	shmem: fix possible deadlocks on shmlock_user_lock
	net: phy: microchip_t1: add lan87xx_phy_init to initialize the lan87xx phy.
	KVM: arm: vgic: Synchronize the whole guest on GIC{D,R}_I{S,C}ACTIVER read
	gpio: pca953x: Fix pca953x_gpio_set_config
	SUNRPC: Add "@len" parameter to gss_unwrap()
	SUNRPC: Fix GSS privacy computation of auth->au_ralign
	net/sonic: Fix a resource leak in an error handling path in 'jazz_sonic_probe()'
	net: moxa: Fix a potential double 'free_irq()'
	ftrace/selftests: workaround cgroup RT scheduling issues
	drop_monitor: work around gcc-10 stringop-overflow warning
	virtio-blk: handle block_device_operations callbacks after hot unplug
	sun6i: dsi: fix gcc-4.8
	net_sched: fix tcm_parent in tc filter dump
	scsi: sg: add sg_remove_request in sg_write
	selftests/bpf: fix goto cleanup label not defined
	mmc: sdhci-acpi: Add SDHCI_QUIRK2_BROKEN_64_BIT_DMA for AMDI0040
	dpaa2-eth: properly handle buffer size restrictions
	net: fix a potential recursive NETDEV_FEAT_CHANGE
	netlabel: cope with NULL catmap
	net: phy: fix aneg restart in phy_ethtool_set_eee
	net: stmmac: fix num_por initialization
	pppoe: only process PADT targeted at local interfaces
	Revert "ipv6: add mtu lock check in __ip6_rt_update_pmtu"
	tcp: fix error recovery in tcp_zerocopy_receive()
	tcp: fix SO_RCVLOWAT hangs with fat skbs
	virtio_net: fix lockdep warning on 32 bit
	dpaa2-eth: prevent array underflow in update_cls_rule()
	hinic: fix a bug of ndo_stop
	net: dsa: loop: Add module soft dependency
	net: ipv4: really enforce backoff for redirects
	netprio_cgroup: Fix unlimited memory leak of v2 cgroups
	net: tcp: fix rx timestamp behavior for tcp_recvmsg
	nfp: abm: fix error return code in nfp_abm_vnic_alloc()
	r8169: re-establish support for RTL8401 chip version
	umh: fix memory leak on execve failure
	riscv: fix vdso build with lld
	dmaengine: pch_dma.c: Avoid data race between probe and irq handler
	dmaengine: mmp_tdma: Do not ignore slave config validation errors
	dmaengine: mmp_tdma: Reset channel error on release
	selftests/ftrace: Check the first record for kprobe_args_type.tc
	cpufreq: intel_pstate: Only mention the BIOS disabling turbo mode once
	ALSA: hda/hdmi: fix race in monitor detection during probe
	drm/amd/powerplay: avoid using pm_en before it is initialized revised
	drm/amd/display: check if REFCLK_CNTL register is present
	drm/amd/display: Update downspread percent to match spreadsheet for DCN2.1
	drm/qxl: lost qxl_bo_kunmap_atomic_page in qxl_image_init_helper()
	drm/amdgpu: simplify padding calculations (v2)
	drm/amdgpu: invalidate L2 before SDMA IBs (v2)
	ipc/util.c: sysvipc_find_ipc() incorrectly updates position index
	ALSA: hda/realtek - Fix S3 pop noise on Dell Wyse
	gfs2: Another gfs2_walk_metadata fix
	mmc: sdhci-pci-gli: Fix no irq handler from suspend
	IB/hfi1: Fix another case where pq is left on waitlist
	ACPI: EC: PM: Avoid premature returns from acpi_s2idle_wake()
	pinctrl: sunrisepoint: Fix PAD lock register offset for SPT-H
	pinctrl: baytrail: Enable pin configuration setting for GPIO chip
	pinctrl: qcom: fix wrong write in update_dual_edge
	pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler
	bpf: Fix error return code in map_lookup_and_delete_elem()
	ALSA: firewire-lib: fix 'function sizeof not defined' error of tracepoints format
	i40iw: Fix error handling in i40iw_manage_arp_cache()
	drm/i915: Don't enable WaIncreaseLatencyIPCEnabled when IPC is disabled
	bpf, sockmap: msg_pop_data can incorrecty set an sge length
	bpf, sockmap: bpf_tcp_ingress needs to subtract bytes from sg.size
	mmc: alcor: Fix a resource leak in the error path for ->probe()
	mmc: sdhci-pci-gli: Fix can not access GL9750 after reboot from Windows 10
	mmc: core: Check request type before completing the request
	mmc: core: Fix recursive locking issue in CQE recovery path
	mmc: block: Fix request completion in the CQE timeout path
	gfs2: More gfs2_find_jhead fixes
	fork: prevent accidental access to clone3 features
	drm/amdgpu: force fbdev into vram
	NFS: Fix fscache super_cookie index_key from changing after umount
	nfs: fscache: use timespec64 in inode auxdata
	NFSv4: Fix fscache cookie aux_data to ensure change_attr is included
	netfilter: conntrack: avoid gcc-10 zero-length-bounds warning
	drm/i915/gvt: Fix kernel oops for 3-level ppgtt guest
	arm64: fix the flush_icache_range arguments in machine_kexec
	nfs: fix NULL deference in nfs4_get_valid_delegation
	SUNRPC: Signalled ASYNC tasks need to exit
	netfilter: nft_set_rbtree: Introduce and use nft_rbtree_interval_start()
	netfilter: nft_set_rbtree: Add missing expired checks
	RDMA/rxe: Always return ERR_PTR from rxe_create_mmap_info()
	IB/mlx4: Test return value of calls to ib_get_cached_pkey
	IB/core: Fix potential NULL pointer dereference in pkey cache
	RDMA/core: Fix double put of resource
	RDMA/iw_cxgb4: Fix incorrect function parameters
	hwmon: (da9052) Synchronize access with mfd
	s390/ism: fix error return code in ism_probe()
	mm, memcg: fix inconsistent oom event behavior
	NFSv3: fix rpc receive buffer size for MOUNT call
	pnp: Use list_for_each_entry() instead of open coding
	net/rds: Use ERR_PTR for rds_message_alloc_sgs()
	Stop the ad-hoc games with -Wno-maybe-initialized
	gcc-10: disable 'zero-length-bounds' warning for now
	gcc-10: disable 'array-bounds' warning for now
	gcc-10: disable 'stringop-overflow' warning for now
	gcc-10: disable 'restrict' warning for now
	gcc-10 warnings: fix low-hanging fruit
	gcc-10: mark more functions __init to avoid section mismatch warnings
	gcc-10: avoid shadowing standard library 'free()' in crypto
	usb: usbfs: correct kernel->user page attribute mismatch
	USB: usbfs: fix mmap dma mismatch
	ALSA: hda/realtek - Limit int mic boost for Thinkpad T530
	ALSA: hda/realtek - Add COEF workaround for ASUS ZenBook UX431DA
	ALSA: rawmidi: Fix racy buffer resize under concurrent accesses
	ALSA: usb-audio: Add control message quirk delay for Kingston HyperX headset
	usb: core: hub: limit HUB_QUIRK_DISABLE_AUTOSUSPEND to USB5534B
	usb: host: xhci-plat: keep runtime active when removing host
	usb: cdns3: gadget: prev_req->trb is NULL for ep0
	USB: gadget: fix illegal array access in binding with UDC
	usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list
	Make the "Reducing compressed framebufer size" message be DRM_INFO_ONCE()
	ARM: dts: dra7: Fix bus_dma_limit for PCIe
	ARM: dts: imx27-phytec-phycard-s-rdk: Fix the I2C1 pinctrl entries
	ARM: dts: imx6dl-yapp4: Fix Ursa board Ethernet connection
	drm/amd/display: add basic atomic check for cursor plane
	powerpc/32s: Fix build failure with CONFIG_PPC_KUAP_DEBUG
	cifs: fix leaked reference on requeued write
	x86: Fix early boot crash on gcc-10, third try
	x86/unwind/orc: Fix error handling in __unwind_start()
	exec: Move would_dump into flush_old_exec
	clk: rockchip: fix incorrect configuration of rk3228 aclk_gpu* clocks
	dwc3: Remove check for HWO flag in dwc3_gadget_ep_reclaim_trb_sg()
	fanotify: fix merging marks masks with FAN_ONDIR
	usb: gadget: net2272: Fix a memory leak in an error handling path in 'net2272_plat_probe()'
	usb: gadget: audio: Fix a missing error return value in audio_bind()
	usb: gadget: legacy: fix error return code in gncm_bind()
	usb: gadget: legacy: fix error return code in cdc_bind()
	Revert "ALSA: hda/realtek: Fix pop noise on ALC225"
	clk: Unlink clock if failed to prepare or enable
	arm64: dts: meson-g12b-khadas-vim3: add missing frddr_a status property
	arm64: dts: meson-g12-common: fix dwc2 clock names
	arm64: dts: rockchip: Replace RK805 PMIC node name with "pmic" on rk3328 boards
	arm64: dts: rockchip: Rename dwc3 device nodes on rk3399 to make dtc happy
	arm64: dts: imx8mn: Change SDMA1 ahb clock for imx8mn
	ARM: dts: r8a73a4: Add missing CMT1 interrupts
	arm64: dts: renesas: r8a77980: Fix IPMMU VIP[01] nodes
	ARM: dts: r8a7740: Add missing extal2 to CPG node
	SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()")
	bpf: Fix sk_psock refcnt leak when receiving message
	KVM: x86: Fix off-by-one error in kvm_vcpu_ioctl_x86_setup_mce
	Makefile: disallow data races on gcc-10 as well
	libbpf: Extract and generalize CPU mask parsing logic
	selftest/bpf: fix backported test_select_reuseport selftest changes
	bpf: Test_progs, fix test_get_stack_rawtp_err.c build
	Linux 5.4.42

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I15318d0b2611dec3962b1db1cbca8ae5dea2ff60
2020-05-20 12:49:59 +02:00
Borislav Petkov
91b9ce04ff x86: Fix early boot crash on gcc-10, third try
commit a9a3ed1eff3601b63aea4fb462d8b3b92c7c1e7e upstream.

... or the odyssey of trying to disable the stack protector for the
function which generates the stack canary value.

The whole story started with Sergei reporting a boot crash with a kernel
built with gcc-10:

  Kernel panic — not syncing: stack-protector: Kernel stack is corrupted in: start_secondary
  CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.0-rc5—00235—gfffb08b37df9 #139
  Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./H77M—D3H, BIOS F12 11/14/2013
  Call Trace:
    dump_stack
    panic
    ? start_secondary
    __stack_chk_fail
    start_secondary
    secondary_startup_64
  -—-[ end Kernel panic — not syncing: stack—protector: Kernel stack is corrupted in: start_secondary

This happens because gcc-10 tail-call optimizes the last function call
in start_secondary() - cpu_startup_entry() - and thus emits a stack
canary check which fails because the canary value changes after the
boot_init_stack_canary() call.

To fix that, the initial attempt was to mark the one function which
generates the stack canary with:

  __attribute__((optimize("-fno-stack-protector"))) ... start_secondary(void *unused)

however, using the optimize attribute doesn't work cumulatively
as the attribute does not add to but rather replaces previously
supplied optimization options - roughly all -fxxx options.

The key one among them being -fno-omit-frame-pointer and thus leading to
not present frame pointer - frame pointer which the kernel needs.

The next attempt to prevent compilers from tail-call optimizing
the last function call cpu_startup_entry(), shy of carving out
start_secondary() into a separate compilation unit and building it with
-fno-stack-protector, was to add an empty asm("").

This current solution was short and sweet, and reportedly, is supported
by both compilers but we didn't get very far this time: future (LTO?)
optimization passes could potentially eliminate this, which leads us
to the third attempt: having an actual memory barrier there which the
compiler cannot ignore or move around etc.

That should hold for a long time, but hey we said that about the other
two solutions too so...

Reported-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Tested-by: Kalle Valo <kvalo@codeaurora.org>
Cc: <stable@vger.kernel.org>
Link: https://lkml.kernel.org/r/20200314164451.346497-1-slyfox@gentoo.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:34 +02:00
Linus Torvalds
6cbb91bdd3 gcc-10: mark more functions __init to avoid section mismatch warnings
commit e99332e7b4cda6e60f5b5916cf9943a79dbef902 upstream.

It seems that for whatever reason, gcc-10 ends up not inlining a couple
of functions that used to be inlined before.  Even if they only have one
single callsite - it looks like gcc may have decided that the code was
unlikely, and not worth inlining.

The code generation difference is harmless, but caused a few new section
mismatch errors, since the (now no longer inlined) function wasn't in
the __init section, but called other init functions:

   Section mismatch in reference from the function kexec_free_initrd() to the function .init.text:free_initrd_mem()
   Section mismatch in reference from the function tpm2_calc_event_log_size() to the function .init.text:early_memremap()
   Section mismatch in reference from the function tpm2_calc_event_log_size() to the function .init.text:early_memunmap()

So add the appropriate __init annotation to make modpost not complain.
In both cases there were trivially just a single callsite from another
__init function.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:29 +02:00
Linus Torvalds
8f6a84167e Stop the ad-hoc games with -Wno-maybe-initialized
commit 78a5255ffb6a1af189a83e493d916ba1c54d8c75 upstream.

We have some rather random rules about when we accept the
"maybe-initialized" warnings, and when we don't.

For example, we consider it unreliable for gcc versions < 4.9, but also
if -O3 is enabled, or if optimizing for size.  And then various kernel
config options disabled it, because they know that they trigger that
warning by confusing gcc sufficiently (ie PROFILE_ALL_BRANCHES).

And now gcc-10 seems to be introducing a lot of those warnings too, so
it falls under the same heading as 4.9 did.

At the same time, we have a very straightforward way to _enable_ that
warning when wanted: use "W=2" to enable more warnings.

So stop playing these ad-hoc games, and just disable that warning by
default, with the known and straight-forward "if you want to work on the
extra compiler warnings, use W=123".

Would it be great to have code that is always so obvious that it never
confuses the compiler whether a variable is used initialized or not?
Yes, it would.  In a perfect world, the compilers would be smarter, and
our source code would be simpler.

That's currently not the world we live in, though.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:28 +02:00
Greg Kroah-Hartman
ae0dae9ffc This is the 5.4.37 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAl6tF/4ACgkQONu9yGCS
 aT7GdA//U9Nzp0upthsH5IMqIOwaJQBEwXF83fTResLKPSNjq6wAYO6kQwdTBMZ1
 PUo/ZEmOnDigdHM3PCGw+Z779UCb9/2laH+KPnPTnst9LcM0sLJMsgoCIuqsyl8J
 mPDLCbx4f7/ffkw/cSb+JrqCn/2mFib3uCwktTSqxVWm9S7EcE3CRxSTEE1XP/z6
 FzDPCjeNijNa3U96NnHFcKXEo/vcaEKHIB9bgdR7kUuRKGBhXSjv7LWUV/940F2w
 eyGgW5A+o94dsCORx2aOgBwOoujAto/DxDihv4jm/S5HTg68hqWQxqWerlsy0PFP
 k7j854aaHamIJjt5SE2MTm9YxnvWh4rpbXjuYDLYLM1jLaACZ+5mIj+w18yrpmOs
 7vjlHBBBTt4xNbODML4KLrj+fCdXk4uEBy7sWi/qYPUmrV3CLK1DqcqRQ9toS+yh
 o22JwyVYuD2os0YMYikqSVRlCe4UwJcW0ZZfOFg2cpB9anG7i+DrzW9Lc6CuPsHo
 ZC9rdVNEHLh9Ti9zcXrs8AFjxoIbP/m0n+ZH7bQPo1/rWE4+fzj14wtKslGtkT0B
 00/Vo9mtmmBC0MVBignbWsq5aE3bFLWTOveJppjgAVXYJ7mQhtnvw4eFSJahtBa0
 s+SB9M6kGNvWpL11cokqIaVfklDjaMo0Jeakd78KdobeNOgBvug=
 =TNyS
 -----END PGP SIGNATURE-----

Merge 5.4.37 into android-5.4-stable

Changes in 5.4.37
	remoteproc: Fix wrong rvring index computation
	ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()
	printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
	ASoC: stm32: sai: fix sai probe
	usb: dwc3: gadget: Do link recovery for SS and SSP
	kbuild: fix DT binding schema rule again to avoid needless rebuilds
	usb: gadget: udc: bdc: Remove unnecessary NULL checks in bdc_req_complete
	usb: gadget: udc: atmel: Fix vbus disconnect handling
	afs: Make record checking use TASK_UNINTERRUPTIBLE when appropriate
	afs: Fix to actually set AFS_SERVER_FL_HAVE_EPOCH
	iio:ad7797: Use correct attribute_group
	propagate_one(): mnt_set_mountpoint() needs mount_lock
	counter: 104-quad-8: Add lock guards - generic interface
	s390/ftrace: fix potential crashes when switching tracers
	ASoC: q6dsp6: q6afe-dai: add missing channels to MI2S DAIs
	ASoC: tas571x: disable regulators on failed probe
	ASoC: meson: axg-card: fix codec-to-codec link setup
	ASoC: wm8960: Fix wrong clock after suspend & resume
	drivers: soc: xilinx: fix firmware driver Kconfig dependency
	nfsd: memory corruption in nfsd4_lock()
	bpf: Forbid XADD on spilled pointers for unprivileged users
	i2c: altera: use proper variable to hold errno
	rxrpc: Fix DATA Tx to disable nofrag for UDP on AF_INET6 socket
	net/cxgb4: Check the return from t4_query_params properly
	xfs: acquire superblock freeze protection on eofblocks scans
	svcrdma: Fix trace point use-after-free race
	svcrdma: Fix leak of svc_rdma_recv_ctxt objects
	net/mlx5e: Don't trigger IRQ multiple times on XSK wakeup to avoid WQ overruns
	net/mlx5e: Get the latest values from counters in switchdev mode
	PCI: Avoid ASMedia XHCI USB PME# from D0 defect
	PCI: Add ACS quirk for Zhaoxin multi-function devices
	PCI: Make ACS quirk implementations more uniform
	PCI: Unify ACS quirk desired vs provided checking
	PCI: Add Zhaoxin Vendor ID
	PCI: Add ACS quirk for Zhaoxin Root/Downstream Ports
	PCI: Move Apex Edge TPU class quirk to fix BAR assignment
	ARM: dts: bcm283x: Disable dsi0 node
	cpumap: Avoid warning when CONFIG_DEBUG_PER_CPU_MAPS is enabled
	s390/pci: do not set affinity for floating irqs
	net/mlx5: Fix failing fw tracer allocation on s390
	sched/core: Fix reset-on-fork from RT with uclamp
	perf/core: fix parent pid/tid in task exit events
	netfilter: nat: fix error handling upon registering inet hook
	PM: sleep: core: Switch back to async_schedule_dev()
	blk-iocost: Fix error on iocost_ioc_vrate_adj
	um: ensure `make ARCH=um mrproper` removes arch/$(SUBARCH)/include/generated/
	bpf, x86_32: Fix incorrect encoding in BPF_LDX zero-extension
	bpf, x86_32: Fix clobbering of dst for BPF_JSET
	bpf, x86_32: Fix logic error in BPF_LDX zero-extension
	mm: shmem: disable interrupt when acquiring info->lock in userfaultfd_copy path
	xfs: clear PF_MEMALLOC before exiting xfsaild thread
	bpf, x86: Fix encoding for lower 8-bit registers in BPF_STX BPF_B
	libbpf: Initialize *nl_pid so gcc 10 is happy
	net: fec: set GPR bit on suspend by DT configuration.
	x86: hyperv: report value of misc_features
	signal: check sig before setting info in kill_pid_usb_asyncio
	afs: Fix length of dump of bad YFSFetchStatus record
	xfs: fix partially uninitialized structure in xfs_reflink_remap_extent
	ALSA: hda: Release resources at error in delayed probe
	ALSA: hda: Keep the controller initialization even if no codecs found
	ALSA: hda: Explicitly permit using autosuspend if runtime PM is supported
	scsi: target: fix PR IN / READ FULL STATUS for FC
	scsi: target: tcmu: reset_ring should reset TCMU_DEV_BIT_BROKEN
	objtool: Fix CONFIG_UBSAN_TRAP unreachable warnings
	objtool: Support Clang non-section symbols in ORC dump
	xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status
	ALSA: hda: call runtime_allow() for all hda controllers
	net: stmmac: socfpga: Allow all RGMII modes
	mac80211: fix channel switch trigger from unknown mesh peer
	arm64: Delete the space separator in __emit_inst
	ext4: use matching invalidatepage in ext4_writepage
	ext4: increase wait time needed before reuse of deleted inode numbers
	ext4: convert BUG_ON's to WARN_ON's in mballoc.c
	blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget
	hwmon: (jc42) Fix name to have no illegal characters
	taprio: do not use BIT() in TCA_TAPRIO_ATTR_FLAG_* definitions
	qed: Fix race condition between scheduling and destroying the slowpath workqueue
	Crypto: chelsio - Fixes a hang issue during driver registration
	net: use indirect call wrappers for skb_copy_datagram_iter()
	qed: Fix use after free in qed_chain_free
	ext4: check for non-zero journal inum in ext4_calculate_overhead
	ASoC: soc-core: disable route checks for legacy devices
	ASoC: stm32: spdifrx: fix regmap status check
	Linux 5.4.37

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ice2ab2e77117b798ed22e9442f72a44f39be28dc
2020-05-02 09:01:51 +02:00
Sergey Senozhatsky
4a5c9ae67b printk: queue wake_up_klogd irq_work only if per-CPU areas are ready
commit ab6f762f0f53162d41497708b33c9a3236d3609e upstream.

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 <l.perczak@camlintechnologies.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Tested-by: Jann Horn <jannh@google.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 08:48:42 +02:00
Alistair Delva
478f57776e ANDROID: GKI: Enable GENERIC_IRQ_CHIP
This feature is only used by arm/arm64 boards but it builds on x86 too
so enable it everywhere for build coverage.

Bug: 153699377
Bug: 154880035
Change-Id: I30c78c394c7d95a02d75d39101c414d37b824024
Signed-off-by: Alistair Delva <adelva@google.com>
2020-04-27 16:00:17 +00:00
Yiwei Zhang
e5d4e9f071 ANDROID: init: GKI: enable hidden configs for GPU
Add hidden configs to GKI_HACKS_TO_FIX so they are enabled for loadable
GPU modules built out-of-tree.

Bug: 154525079
Test: rebuild kernel binary and pass checkvintf
Change-Id: I51871132b6a0bd1a55f5db7a9f90177cbc20ef86
Signed-off-by: Yiwei Zhang <zzyiwei@google.com>
2020-04-22 20:40:03 +00:00
John Stultz
2c4bb3b054 ANDROID: Switch CONFIG_QCOM_PDC CONFIG_QCOM_SCM and CONFIG_ARM_SMMU to be loaded as modules
To switch the QCOM_SCM driver to be loaded from a module,
we need to also switch QCOM_PDC and QCOM_ARM_SMMU to also
load from a module.

Bug: 153049053
Signed-off-by: John Stultz <john.stultz@linaro.org>
Change-Id: I0509628322b20dea5f7e16e973d93d369c0c2bff
2020-04-16 18:15:28 +00:00
Lingfeng Yang
95a3c8a5f4 ANDROID: GKI: Add DRM_TTM config to GKI
When certain DRM drivers, such as virtio-gpu, are built out of tree,
they might depend on parts of DRM, such as DRM_TTM, that are not
included in all configs.

This CL adds the config to GKI_HACKS_TO_FIX, allowing DRM drivers that
use DRM_TTM to link successfully against GKI.

Test: Build and run virtio-gpu as an external module
Change-Id: I1ae869b7394a6059c0f3880bdc65a0b3ceb3e004
Bug: 153580313
Signed-off-by: Lingfeng Yang <lfy@google.com>
2020-04-16 17:56:20 +00:00
Gyeongtaek Lee
39d04aa080 ANDROID: Kconfig.gki Add SND_SOC_TOPOLOGY
Enable hidden config SND_SOC_TOPOLOGY need by SND_SOC=m

Bug: 153682187
Change-Id: I47dabfaa6f0d138f78fbc1c9fc0d4ac3c7c73986
Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
2020-04-10 17:00:52 +09:00
Kees Cook
4831f7ad6c FROMGIT: kbuild: mkcompile_h: Include $LD version in /proc/version
When doing Clang builds of the kernel, it is possible to link with
either ld.bfd (binutils) or ld.lld (LLVM), but it is not possible to
discover this from a running kernel. Add the "$LD -v" output to
/proc/version.

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Fangrui Song <maskray@google.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Bug: 153484457
(cherry picked from commit 6f04f056df3c
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
 for-next)
Change-Id: Ifa5a98fe159392862e8d07a733c0f141fa9c7715
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2020-04-08 16:27:24 +00:00