Commit Graph

1299 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
1c5ec1e54d Merge 6.1.55 into android14-6.1-lts
Changes in 6.1.55
	autofs: fix memory leak of waitqueues in autofs_catatonic_mode
	btrfs: output extra debug info if we failed to find an inline backref
	locks: fix KASAN: use-after-free in trace_event_raw_event_filelock_lock
	ACPICA: Add AML_NO_OPERAND_RESOLVE flag to Timer
	kernel/fork: beware of __put_task_struct() calling context
	rcuscale: Move rcu_scale_writer() schedule_timeout_uninterruptible() to _idle()
	scftorture: Forgive memory-allocation failure if KASAN
	ACPI: video: Add backlight=native DMI quirk for Lenovo Ideapad Z470
	perf/smmuv3: Enable HiSilicon Erratum 162001900 quirk for HIP08/09
	perf/imx_ddr: speed up overflow frequency of cycle
	hw_breakpoint: fix single-stepping when using bpf_overflow_handler
	ACPI: x86: s2idle: Catch multiple ACPI_TYPE_PACKAGE objects
	selftests/nolibc: fix up kernel parameters support
	devlink: remove reload failed checks in params get/set callbacks
	crypto: lrw,xts - Replace strlcpy with strscpy
	ice: Don't tx before switchdev is fully configured
	wifi: ath9k: fix fortify warnings
	wifi: ath9k: fix printk specifier
	wifi: mwifiex: fix fortify warning
	mt76: mt7921: don't assume adequate headroom for SDIO headers
	wifi: wil6210: fix fortify warnings
	can: sun4i_can: Add acceptance register quirk
	can: sun4i_can: Add support for the Allwinner D1
	net: Use sockaddr_storage for getsockopt(SO_PEERNAME).
	net/ipv4: return the real errno instead of -EINVAL
	crypto: lib/mpi - avoid null pointer deref in mpi_cmp_ui()
	Bluetooth: Fix hci_suspend_sync crash
	netlink: convert nlk->flags to atomic flags
	tpm_tis: Resend command to recover from data transfer errors
	mmc: sdhci-esdhc-imx: improve ESDHC_FLAG_ERR010450
	alx: fix OOB-read compiler warning
	wifi: mac80211: check S1G action frame size
	netfilter: ebtables: fix fortify warnings in size_entry_mwt()
	wifi: cfg80211: reject auth/assoc to AP with our address
	wifi: cfg80211: ocb: don't leave if not joined
	wifi: mac80211: check for station first in client probe
	wifi: mac80211_hwsim: drop short frames
	libbpf: Free btf_vmlinux when closing bpf_object
	drm/bridge: tc358762: Instruct DSI host to generate HSE packets
	drm/edid: Add quirk for OSVR HDK 2.0
	arm64: dts: qcom: sm6125-pdx201: correct ramoops pmsg-size
	arm64: dts: qcom: sm6350: correct ramoops pmsg-size
	arm64: dts: qcom: sm8150-kumano: correct ramoops pmsg-size
	arm64: dts: qcom: sm8250-edo: correct ramoops pmsg-size
	samples/hw_breakpoint: Fix kernel BUG 'invalid opcode: 0000'
	drm/amd/display: Fix underflow issue on 175hz timing
	ASoC: SOF: topology: simplify code to prevent static analysis warnings
	ASoC: Intel: sof_sdw: Update BT offload config for soundwire config
	ALSA: hda: intel-dsp-cfg: add LunarLake support
	drm/amd/display: Use DTBCLK as refclk instead of DPREFCLK
	drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN31
	drm/amd/display: Blocking invalid 420 modes on HDMI TMDS for DCN314
	drm/exynos: fix a possible null-pointer dereference due to data race in exynos_drm_crtc_atomic_disable()
	drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer()
	bus: ti-sysc: Configure uart quirks for k3 SoC
	md: raid1: fix potential OOB in raid1_remove_disk()
	ext2: fix datatype of block number in ext2_xattr_set2()
	fs/jfs: prevent double-free in dbUnmount() after failed jfs_remount()
	jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount
	PCI: dwc: Provide deinit callback for i.MX
	ARM: 9317/1: kexec: Make smp stop calls asynchronous
	powerpc/pseries: fix possible memory leak in ibmebus_bus_init()
	PCI: vmd: Disable bridge window for domain reset
	PCI: fu740: Set the number of MSI vectors
	media: mdp3: Fix resource leaks in of_find_device_by_node
	media: dvb-usb-v2: af9035: Fix null-ptr-deref in af9035_i2c_master_xfer
	media: dw2102: Fix null-ptr-deref in dw2102_i2c_transfer()
	media: af9005: Fix null-ptr-deref in af9005_i2c_xfer
	media: anysee: fix null-ptr-deref in anysee_master_xfer
	media: az6007: Fix null-ptr-deref in az6007_i2c_xfer()
	media: dvb-usb-v2: gl861: Fix null-ptr-deref in gl861_i2c_master_xfer
	scsi: lpfc: Abort outstanding ELS cmds when mailbox timeout error is detected
	media: tuners: qt1010: replace BUG_ON with a regular error
	media: pci: cx23885: replace BUG with error return
	usb: cdns3: Put the cdns set active part outside the spin lock
	usb: gadget: fsl_qe_udc: validate endpoint index for ch9 udc
	tools: iio: iio_generic_buffer: Fix some integer type and calculation
	scsi: target: iscsi: Fix buffer overflow in lio_target_nacl_info_show()
	serial: cpm_uart: Avoid suspicious locking
	misc: open-dice: make OPEN_DICE depend on HAS_IOMEM
	usb: ehci: add workaround for chipidea PORTSC.PEC bug
	usb: chipidea: add workaround for chipidea PEC bug
	media: pci: ipu3-cio2: Initialise timing struct to avoid a compiler warning
	kobject: Add sanity check for kset->kobj.ktype in kset_register()
	interconnect: Fix locking for runpm vs reclaim
	printk: Keep non-panic-CPUs out of console lock
	printk: Consolidate console deferred printing
	dma-buf: Add unlocked variant of attachment-mapping functions
	misc: fastrpc: Prepare to dynamic dma-buf locking specification
	misc: fastrpc: Fix incorrect DMA mapping unmap request
	MIPS: Use "grep -E" instead of "egrep"
	btrfs: add a helper to read the superblock metadata_uuid
	btrfs: compare the correct fsid/metadata_uuid in btrfs_validate_super
	block: factor out a bvec_set_page helper
	nvmet: use bvec_set_page to initialize bvecs
	nvmet-tcp: pass iov_len instead of sg->length to bvec_set_page()
	drm: gm12u320: Fix the timeout usage for usb_bulk_msg()
	scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir()
	selftests: tracing: Fix to unmount tracefs for recovering environment
	x86/ibt: Suppress spurious ENDBR
	riscv: kexec: Align the kexeced kernel entry
	scsi: target: core: Fix target_cmd_counter leak
	scsi: lpfc: Fix the NULL vs IS_ERR() bug for debugfs_create_file()
	panic: Reenable preemption in WARN slowpath
	x86/boot/compressed: Reserve more memory for page tables
	x86/purgatory: Remove LTO flags
	samples/hw_breakpoint: fix building without module unloading
	md/raid1: fix error: ISO C90 forbids mixed declarations
	Revert "SUNRPC: Fail faster on bad verifier"
	attr: block mode changes of symlinks
	ovl: fix failed copyup of fileattr on a symlink
	ovl: fix incorrect fdput() on aio completion
	io_uring/net: fix iter retargeting for selected buf
	nvme: avoid bogus CRTO values
	md: Put the right device in md_seq_next
	Revert "drm/amd: Disable S/G for APUs when 64GB or more host memory"
	dm: don't attempt to queue IO under RCU protection
	btrfs: fix lockdep splat and potential deadlock after failure running delayed items
	btrfs: fix a compilation error if DEBUG is defined in btree_dirty_folio
	btrfs: release path before inode lookup during the ino lookup ioctl
	btrfs: check for BTRFS_FS_ERROR in pending ordered assert
	tracing: Have tracing_max_latency inc the trace array ref count
	tracing: Have event inject files inc the trace array ref count
	tracing: Increase trace array ref count on enable and filter files
	tracing: Have current_trace inc the trace array ref count
	tracing: Have option files inc the trace array ref count
	selinux: fix handling of empty opts in selinux_fs_context_submount()
	nfsd: fix change_info in NFSv4 RENAME replies
	tracefs: Add missing lockdown check to tracefs_create_dir()
	i2c: aspeed: Reset the i2c controller when timeout occurs
	ata: libata: disallow dev-initiated LPM transitions to unsupported states
	ata: libahci: clear pending interrupt status
	scsi: megaraid_sas: Fix deadlock on firmware crashdump
	scsi: pm8001: Setup IRQs on resume
	ext4: fix rec_len verify error
	drm/amd/display: fix the white screen issue when >= 64GB DRAM
	Revert "memcg: drop kmem.limit_in_bytes"
	drm/amdgpu: fix amdgpu_cs_p1_user_fence
	net/sched: Retire rsvp classifier
	interconnect: Teach lockdep about icc_bw_lock order
	Linux 6.1.55

Change-Id: I95193a57879a13b04b5ac8647a24e6d8304fcb0e
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-10-26 18:58:32 +00:00
Wander Lairson Costa
3b1107abdc kernel/fork: beware of __put_task_struct() calling context
[ Upstream commit d243b34459cea30cfe5f3a9b2feb44e7daff9938 ]

Under PREEMPT_RT, __put_task_struct() indirectly acquires sleeping
locks. Therefore, it can't be called from an non-preemptible context.

One practical example is splat inside inactive_task_timer(), which is
called in a interrupt context:

  CPU: 1 PID: 2848 Comm: life Kdump: loaded Tainted: G W ---------
   Hardware name: HP ProLiant DL388p Gen8, BIOS P70 07/15/2012
   Call Trace:
   dump_stack_lvl+0x57/0x7d
   mark_lock_irq.cold+0x33/0xba
   mark_lock+0x1e7/0x400
   mark_usage+0x11d/0x140
   __lock_acquire+0x30d/0x930
   lock_acquire.part.0+0x9c/0x210
   rt_spin_lock+0x27/0xe0
   refill_obj_stock+0x3d/0x3a0
   kmem_cache_free+0x357/0x560
   inactive_task_timer+0x1ad/0x340
   __run_hrtimer+0x8a/0x1a0
   __hrtimer_run_queues+0x91/0x130
   hrtimer_interrupt+0x10f/0x220
   __sysvec_apic_timer_interrupt+0x7b/0xd0
   sysvec_apic_timer_interrupt+0x4f/0xd0
   asm_sysvec_apic_timer_interrupt+0x12/0x20
   RIP: 0033:0x7fff196bf6f5

Instead of calling __put_task_struct() directly, we defer it using
call_rcu(). A more natural approach would use a workqueue, but since
in PREEMPT_RT, we can't allocate dynamic memory from atomic context,
the code would become more complex because we would need to put the
work_struct instance in the task_struct and initialize it when we
allocate a new task_struct.

The issue is reproducible with stress-ng:

  while true; do
      stress-ng --sched deadline --sched-period 1000000000 \
	      --sched-runtime 800000000 --sched-deadline \
	      1000000000 --mmapfork 23 -t 20
  done

Reported-by: Hu Chunyu <chuhu@redhat.com>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Suggested-by: Valentin Schneider <vschneid@redhat.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230614122323.37957-2-wander@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:11:00 +02:00
Greg Kroah-Hartman
f474c6446c Merge 6.1.44 into android14-6.1-lts
Changes in 6.1.44
	init: Provide arch_cpu_finalize_init()
	x86/cpu: Switch to arch_cpu_finalize_init()
	ARM: cpu: Switch to arch_cpu_finalize_init()
	ia64/cpu: Switch to arch_cpu_finalize_init()
	loongarch/cpu: Switch to arch_cpu_finalize_init()
	m68k/cpu: Switch to arch_cpu_finalize_init()
	mips/cpu: Switch to arch_cpu_finalize_init()
	sh/cpu: Switch to arch_cpu_finalize_init()
	sparc/cpu: Switch to arch_cpu_finalize_init()
	um/cpu: Switch to arch_cpu_finalize_init()
	init: Remove check_bugs() leftovers
	init: Invoke arch_cpu_finalize_init() earlier
	init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()
	x86/init: Initialize signal frame size late
	x86/fpu: Remove cpuinfo argument from init functions
	x86/fpu: Mark init functions __init
	x86/fpu: Move FPU initialization into arch_cpu_finalize_init()
	x86/speculation: Add Gather Data Sampling mitigation
	x86/speculation: Add force option to GDS mitigation
	x86/speculation: Add Kconfig option for GDS
	KVM: Add GDS_NO support to KVM
	x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build
	x86/xen: Fix secondary processors' FPU initialization
	x86/mm: fix poking_init() for Xen PV guests
	x86/mm: Use mm_alloc() in poking_init()
	mm: Move mm_cachep initialization to mm_init()
	x86/mm: Initialize text poking earlier
	Documentation/x86: Fix backwards on/off logic about YMM support
	x86/bugs: Increase the x86 bugs vector size to two u32s
	x86/cpu, kvm: Add support for CPUID_80000021_EAX
	x86/srso: Add a Speculative RAS Overflow mitigation
	x86/srso: Add IBPB_BRTYPE support
	x86/srso: Add SRSO_NO support
	x86/srso: Add IBPB
	x86/srso: Add IBPB on VMEXIT
	x86/srso: Fix return thunks in generated code
	x86/srso: Add a forgotten NOENDBR annotation
	x86/srso: Tie SBPB bit setting to microcode patch detection
	xen/netback: Fix buffer overrun triggered by unusual packet
	x86: fix backwards merge of GDS/SRSO bit
	Linux 6.1.44

Change-Id: Ia40e37c806ae2a2daf2127415aa28d0151660667
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-09-12 15:09:42 +00:00
Greg Kroah-Hartman
8b02e8901d Merge branch 'android14-6.1' into 'android14-6.1-lts'
Catches the android14-6.1-lts branch up with the android14-6.1 branch
which has had a lot of changes that are needed here to resolve future
LTS merges and to ensure that the ABI is kept stable.

It contains the following commits:

* 9fd41ac172 ANDROID: Delete build.config.gki.aarch64.16k.
* 073df44c36 FROMGIT: usb: typec: tcpm: Refactor the PPS APDO selection
* 078410e73f UPSTREAM: usb: typec: tcpm: Fix response to vsafe0V event
* 722f6cc09c ANDROID: Revert "ANDROID: allmodconfig: disable WERROR"
* c2611a04b9 ANDROID: GKI: update symbol list file for xiaomi
* 34fde9ec08 FROMGIT: usb: typec: tcpm: not sink vbus if operational current is 0mA
* 3ebafb7b46 BACKPORT: FROMGIT: mm: handle faults that merely update the accessed bit under the VMA lock
* 9e066d4b35 FROMLIST: mm: Allow fault_dirty_shared_page() to be called under the VMA lock
* 83ab986324 FROMGIT: mm: handle swap and NUMA PTE faults under the VMA lock
* ffcebdef16 FROMGIT: mm: run the fault-around code under the VMA lock
* 072c35fb69 FROMGIT: mm: move FAULT_FLAG_VMA_LOCK check down from do_fault()
* fa9a8adff0 FROMGIT: mm: move FAULT_FLAG_VMA_LOCK check down in handle_pte_fault()
* dd621869c1 BACKPORT: FROMGIT: mm: handle some PMD faults under the VMA lock
* 8594d6a30f BACKPORT: FROMGIT: mm: handle PUD faults under the VMA lock
* 66cbbe6b31 FROMGIT: mm: move FAULT_FLAG_VMA_LOCK check from handle_mm_fault()
* e26044769f BACKPORT: FROMGIT: mm: allow per-VMA locks on file-backed VMAs
* 4cb518a06f FROMGIT: mm: remove CONFIG_PER_VMA_LOCK ifdefs
* f4b32b7f15 FROMGIT: mm: fix a lockdep issue in vma_assert_write_locked
* 250f19771f FROMGIT: mm: handle userfaults under VMA lock
* e704d0e4f9 FROMGIT: mm: handle swap page faults under per-VMA lock
* f8a65b694b FROMGIT: mm: change folio_lock_or_retry to use vm_fault directly
* 693d905ec0 BACKPORT: FROMGIT: mm: drop per-VMA lock when returning VM_FAULT_RETRY or VM_FAULT_COMPLETED
* 939d4b1ccc BACKPORT: FROMGIT: mm: move vma locking out of vma_prepare and dup_anon_vma
* 0f0b09c02c BACKPORT: FROMGIT: mm: always lock new vma before inserting into vma tree
* a8a479ed96 FROMGIT: mm: lock vma explicitly before doing vm_flags_reset and vm_flags_reset_once
* ad18923856 FROMGIT: mm: replace mmap with vma write lock assertions when operating on a vma
* 5f0ca924aa FROMGIT: mm: for !CONFIG_PER_VMA_LOCK equate write lock assertion for vma and mmap
* abb0f2767e FROMGIT: mm: don't drop VMA locks in mm_drop_all_locks()
* 365af746f5 BACKPORT: riscv: mm: try VMA lock-based page fault handling first
* 3c187b4a12 BACKPORT: FROMGIT: mm: enable page walking API to lock vmas during the walk
* b6093c47fe BACKPORT: mm: lock VMA in dup_anon_vma() before setting ->anon_vma
* 0ee0062c94 UPSTREAM: mm: fix memory ordering for mm_lock_seq and vm_lock_seq
* 3378cbd264 FROMGIT: usb: host: ehci-sched: try to turn on io watchdog as long as periodic_count > 0
* 2d3351bd5e FROMGIT: BACKPORT: usb: ehci: add workaround for chipidea PORTSC.PEC bug
* 7fa8861130 UPSTREAM: tty: n_gsm: fix UAF in gsm_cleanup_mux
* 683966ac69 UPSTREAM: mm/mmap: Fix extra maple tree write
* f86c79eb86 FROMGIT: Multi-gen LRU: skip CMA pages when they are not eligible
* 7ae1e02abb UPSTREAM: mm: skip CMA pages when they are not available
* 7666325265 UPSTREAM: dma-buf: fix an error pointer vs NULL bug
* e61d76121f UPSTREAM: dma-buf: keep the signaling time of merged fences v3
* fda157ce15 UPSTREAM: netfilter: nf_tables: skip bound chain on rule flush
* 110a26edd1 UPSTREAM: net/sched: sch_qfq: account for stab overhead in qfq_enqueue
* 9db1437238 UPSTREAM: net/sched: sch_qfq: refactor parsing of netlink parameters
* 7688102949 UPSTREAM: netfilter: nft_set_pipapo: fix improper element removal
* 37f4509407 ANDROID: Add checkpatch target.
* d7dacaa439 UPSTREAM: USB: Gadget: core: Help prevent panic during UVC unconfigure
* 4dc009c3a8 ANDROID: GKI: Update symbols to symbol list
* fadc35923d ANDROID: vendor_hook: fix the error record position of mutex
* 3fc69d3f70 ANDROID: ABI: add allowed list for galaxy
* a5a662187f ANDROID: gfp: add __GFP_CMA in gfpflag_names
* b520b90913 ANDROID: ABI: Update to fix slab-out-of-bounds in xhci_vendor_get_ops
* c2cbb3cc24 ANDROID: usb: host: fix slab-out-of-bounds in xhci_vendor_get_ops
* 64787ee451 ANDROID: GKI: update pixel symbol list for xhci
* b0c06048a8 FROMGIT: fs: drop_caches: draining pages before dropping caches
* 2f76bb83b1 ANDROID: GKI: update symbol list file for xiaomi
* 8e86825eec ANDROID: uid_sys_stats: Use a single work for deferred updates
* 960d9828ee ANDROID: ABI: Update symbol for Exynos SoC
* 3926cc6ef8 ANDROID: GKI: Add symbols to symbol list for vivo
* dbb09068c1 ANDROID: vendor_hooks: Add tune scan type hook in get_scan_count()
* 5e1d25ac2a FROMGIT: BACKPORT: Multi-gen LRU: Fix can_swap in lru_gen_look_around()
* addf1a9a65 FROMGIT: Multi-gen LRU: Avoid race in inc_min_seq()
* a7adb98897 FROMGIT: Multi-gen LRU: Fix per-zone reclaim
* 03812b904e ANDROID: ABI: update symbol list for galaxy
* b283f9b41f ANDROID: oplus: Update the ABI xml and symbol list
* c3d26e2b5a ANDROID: vendor_hooks: Add hooks for lookaround
* 29e2f3e3d1 ANDROID: ABI: Update STG ABI to format version 2
* 3bd3d13701 ANDROID: ABI: Update symbol list for imx
* ad0b008167 FROMGIT: erofs: fix wrong primary bvec selection on deduplicated extents
* 126ef64cba UPSTREAM: media: Add ABGR64_12 video format
* 86e2e8fd05 BACKPORT: media: Add BGR48_12 video format
* 892293272c UPSTREAM: media: Add YUV48_12 video format
* b2cf7e4268 UPSTREAM: media: Add Y212 v4l2 format info
* 0f3f7a21af UPSTREAM: media: Add Y210, Y212 and Y216 formats
* ca7b45b128 UPSTREAM: media: Add Y012 video format
* 343b85ecad UPSTREAM: media: Add P012 and P012M video format
* 7beed73af0 ANDROID: GKI: Create symbol files in include/config
* 295e779e8f ANDROID: fuse-bpf: Use stored bpf for create_open
* 74d9daa59a ANDROID: fuse-bpf: Add bpf to negative fuse_dentry
* 6aef06abba ANDROID: fuse-bpf: Check inode not null
* 4bbda90bd8 ANDROID: fuse-bpf: Fix flock test compile error
* 84ac22a0d3 ANDROID: fuse-bpf: Add partial ioctl support
* e341d2312c ANDROID: ABI: Update oplus symbol list
* f5c707dc65 UPSTREAM: mm/mempolicy: Take VMA lock before replacing policy
* 890b1aabb1 BACKPORT: mm: lock_vma_under_rcu() must check vma->anon_vma under vma lock
* d3b37a712a BACKPORT: FROMGIT: irqchip/gic-v3: Workaround for GIC-700 erratum 2941627
* a89e2cbbc0 ANDROID: GKI: update xiaomi symbol list
* 371f8d901a UPSTREAM: mm: lock newly mapped VMA with corrected ordering
* 0d9960403c UPSTREAM: fork: lock VMAs of the parent process when forking
* e3601b25ae UPSTREAM: mm: lock newly mapped VMA which can be modified after it becomes visible
* 05f7c7fe72 UPSTREAM: mm: lock a vma before stack expansion
* c0ba567af1 ANDROID: GKI: bring back find_extend_vma()
* 188ce9572f BACKPORT: mm: always expand the stack with the mmap write lock held
* 74efdc0966 BACKPORT: execve: expand new process stack manually ahead of time
* c8ad906849 ANDROID: abi_gki_aarch64_qcom: ufshcd_mcq_poll_cqe_lock
* 1afccd4255 UPSTREAM: mm: make find_extend_vma() fail if write lock not held
* 4087cac574 UPSTREAM: powerpc/mm: convert coprocessor fault to lock_mm_and_find_vma()
* 6c33246824 UPSTREAM: mm/fault: convert remaining simple cases to lock_mm_and_find_vma()
* add0a1ea04 UPSTREAM: arm/mm: Convert to using lock_mm_and_find_vma()
* 9f136450af UPSTREAM: riscv/mm: Convert to using lock_mm_and_find_vma()
* 053053fc68 UPSTREAM: mips/mm: Convert to using lock_mm_and_find_vma()
* 9cdce804c0 UPSTREAM: powerpc/mm: Convert to using lock_mm_and_find_vma()
* 1016faf509 BACKPORT: arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault()
* 89298b8b3c BACKPORT: arm64/mm: Convert to using lock_mm_and_find_vma()
* cf70cb4f1f UPSTREAM: mm: make the page fault mmap locking killable
* 544ae28cf6 ANDROID: Inherit "user-aware property" across rtmutex.
* 5e4a5dc820 BACKPORT: blk-crypto: use dynamic lock class for blk_crypto_profile::lock
* db2c29e53d ANDROID: ABI: update symbol list for Xclipse GPU
* 7edb035c79 ANDROID: drm/ttm: export ttm_tt_unpopulate()
* b61f298c0d ANDROID: GKI: Add ABI symbol list(devlink) for MTK
* ec419af28f ANDROID: devlink: Select CONFIG_NET_DEVLINK in Kconfig.gki
* 1e114e6efa ANDROID: KVM: arm64: Fix memory ordering for pKVM module callbacks
* 3803ae4a28 BACKPORT: mm: introduce new 'lock_mm_and_find_vma()' page fault helper
* 66b5ad3507 BACKPORT: maple_tree: fix potential out-of-bounds access in mas_wr_end_piv()
* 19dd4101e0 UPSTREAM: x86/smp: Cure kexec() vs. mwait_play_dead() breakage
* 26260c4bd1 UPSTREAM: x86/smp: Use dedicated cache-line for mwait_play_dead()
* d8cb0365cb UPSTREAM: x86/smp: Remove pointless wmb()s from native_stop_other_cpus()
* 6744547e95 UPSTREAM: x86/smp: Dont access non-existing CPUID leaf
* ba2ccba863 UPSTREAM: x86/smp: Make stop_other_cpus() more robust
* 5c9836e66d UPSTREAM: x86/microcode/AMD: Load late on both threads too
* 53048f151c BACKPORT: mm, hwpoison: when copy-on-write hits poison, take page offline
* a2dff37b0c UPSTREAM: mm, hwpoison: try to recover from copy-on write faults
* 466448f55f BACKPORT: mm/mmap: Fix error return in do_vmi_align_munmap()
* 41b30362e9 BACKPORT: mm/mmap: Fix error path in do_vmi_align_munmap()
* d45a054f9c UPSTREAM: HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
* 0e477a82e6 UPSTREAM: HID: hidraw: fix data race on device refcount
* af2d741bf3 UPSTREAM: can: isotp: isotp_sendmsg(): fix return error fix on TX path
* 5887040491 UPSTREAM: fbdev: fix potential OOB read in fast_imageblit()
* 6c48edb9c9 ANDROID: GKI: add function symbols for unisoc
* 342aff08ae ANDROID: cgroup: Cleanup android_rvh_cgroup_force_kthread_migration
* fcdea346bb UPSTREAM: net/sched: cls_fw: Fix improper refcount update leads to use-after-free
* f091cc7434 UPSTREAM: netfilter: nf_tables: fix chain binding transaction logic
* 1bb5e7fb37 ANDROID: abi_gki_aarch64_qcom: update abi

Change-Id: I6f86301f218a60c00d03e09a4e3bfebe42bad0d5
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-08-23 18:31:43 +00:00
Peter Zijlstra
e0fd83a193 mm: Move mm_cachep initialization to mm_init()
commit af80602799681c78f14fbe20b6185a56020dedee upstream.

In order to allow using mm_alloc() much earlier, move initializing
mm_cachep into mm_init().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221025201057.751153381@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 20:03:49 +02:00
Peter Zijlstra
9ae15aaff3 x86/mm: Use mm_alloc() in poking_init()
commit 3f4c8211d982099be693be9aa7d6fc4607dff290 upstream.

Instead of duplicating init_mm, allocate a fresh mm. The advantage is
that mm_alloc() has much simpler dependencies. Additionally it makes
more conceptual sense, init_mm has no (and must not have) user state
to duplicate.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20221025201057.816175235@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-08 20:03:49 +02:00
Suren Baghdasaryan
0d9960403c UPSTREAM: fork: lock VMAs of the parent process when forking
When forking a child process, the parent write-protects anonymous pages
and COW-shares them with the child being forked using copy_present_pte().

We must not take any concurrent page faults on the source vma's as they
are being processed, as we expect both the vma and the pte's behind it
to be stable.  For example, the anon_vma_fork() expects the parents
vma->anon_vma to not change during the vma copy.

A concurrent page fault on a page newly marked read-only by the page
copy might trigger wp_page_copy() and a anon_vma_prepare(vma) on the
source vma, defeating the anon_vma_clone() that wasn't done because the
parent vma originally didn't have an anon_vma, but we now might end up
copying a pte entry for a page that has one.

Before the per-vma lock based changes, the mmap_lock guaranteed
exclusion with concurrent page faults.  But now we need to do a
vma_start_write() to make sure no concurrent faults happen on this vma
while it is being processed.

This fix can potentially regress some fork-heavy workloads.  Kernel
build time did not show noticeable regression on a 56-core machine while
a stress test mapping 10000 VMAs and forking 5000 times in a tight loop
shows ~5% regression.  If such fork time regression is unacceptable,
disabling CONFIG_PER_VMA_LOCK should restore its performance.  Further
optimizations are possible if this regression proves to be problematic.

Suggested-by: David Hildenbrand <david@redhat.com>
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Closes: https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.org/
Reported-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Closes: https://lore.kernel.org/all/b198d649-f4bf-b971-31d0-e8433ec2a34c@applied-asynchrony.com/
Reported-by: Jacob Young <jacobly.alt@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217624
Fixes: 0bff0aaea03e ("x86/mm: try VMA lock-based page fault handling first")
Cc: stable@vger.kernel.org
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit fb49c455323ff8319a123dd312be9082c49a23a5)
Change-Id: Ic5aa9dc51a888b5b0319ec4ec6d2941424573ca0
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-07-27 12:19:09 +00:00
Greg Kroah-Hartman
ee4c9c95ff Merge 6.1.34 into android14-6.1-lts
Changes in 6.1.34
	scsi: megaraid_sas: Add flexible array member for SGLs
	net: sfp: fix state loss when updating state_hw_mask
	spi: mt65xx: make sure operations completed before unloading
	platform/surface: aggregator: Allow completion work-items to be executed in parallel
	platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem
	spi: qup: Request DMA before enabling clocks
	afs: Fix setting of mtime when creating a file/dir/symlink
	wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
	bpf, sockmap: Avoid potential NULL dereference in sk_psock_verdict_data_ready()
	neighbour: fix unaligned access to pneigh_entry
	net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods
	net/ipv4: ping_group_range: allow GID from 2147483648 to 4294967294
	bpf: Fix UAF in task local storage
	bpf: Fix elem_size not being set for inner maps
	net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
	net/smc: Avoid to access invalid RMBs' MRs in SMCRv1 ADD LINK CONT
	net: enetc: correct the statistics of rx bytes
	net: enetc: correct rx_bytes statistics of XDP
	net/sched: fq_pie: ensure reasonable TCA_FQ_PIE_QUANTUM values
	drm/i915: Explain the magic numbers for AUX SYNC/precharge length
	drm/i915: Use 18 fast wake AUX sync len
	Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER
	Bluetooth: Fix l2cap_disconnect_req deadlock
	Bluetooth: ISO: don't try to remove CIG if there are bound CIS left
	Bluetooth: L2CAP: Add missing checks for invalid DCID
	wifi: mac80211: use correct iftype HE cap
	wifi: cfg80211: reject bad AP MLD address
	wifi: mac80211: mlme: fix non-inheritence element
	wifi: mac80211: don't translate beacon/presp addrs
	qed/qede: Fix scheduling while atomic
	wifi: cfg80211: fix locking in sched scan stop work
	selftests/bpf: Verify optval=NULL case
	selftests/bpf: Fix sockopt_sk selftest
	netfilter: nft_bitwise: fix register tracking
	netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper
	netfilter: ipset: Add schedule point in call_ad().
	netfilter: nf_tables: out-of-bound check in chain blob
	ipv6: rpl: Fix Route of Death.
	tcp: gso: really support BIG TCP
	rfs: annotate lockless accesses to sk->sk_rxhash
	rfs: annotate lockless accesses to RFS sock flow table
	net: sched: add rcu annotations around qdisc->qdisc_sleeping
	drm/i915/selftests: Stop using kthread_stop()
	drm/i915/selftests: Add some missing error propagation
	net: sched: move rtm_tca_policy declaration to include file
	net: sched: act_police: fix sparse errors in tcf_police_dump()
	net: sched: fix possible refcount leak in tc_chain_tmplt_add()
	bpf: Add extra path pointer check to d_path helper
	drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram
	lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
	net: bcmgenet: Fix EEE implementation
	bnxt_en: Don't issue AP reset during ethtool's reset operation
	bnxt_en: Query default VLAN before VNIC setup on a VF
	bnxt_en: Skip firmware fatal error recovery if chip is not accessible
	bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
	bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
	batman-adv: Broken sync while rescheduling delayed work
	Input: xpad - delete a Razer DeathAdder mouse VID/PID entry
	Input: psmouse - fix OOB access in Elantech protocol
	Input: fix open count when closing inhibited device
	ALSA: hda: Fix kctl->id initialization
	ALSA: ymfpci: Fix kctl->id initialization
	ALSA: gus: Fix kctl->id initialization
	ALSA: cmipci: Fix kctl->id initialization
	ALSA: hda/realtek: Add quirk for Clevo NS50AU
	ALSA: ice1712,ice1724: fix the kcontrol->id initialization
	ALSA: hda/realtek: Add a quirk for HP Slim Desktop S01
	ALSA: hda/realtek: Add Lenovo P3 Tower platform
	ALSA: hda/realtek: Add quirks for Asus ROG 2024 laptops using CS35L41
	drm/i915/gt: Use the correct error value when kernel_context() fails
	drm/amd/pm: conditionally disable pcie lane switching for some sienna_cichlid SKUs
	drm/amdgpu: fix xclk freq on CHIP_STONEY
	drm/amdgpu: change reserved vram info print
	drm/amd/pm: Fix power context allocation in SMU13
	drm/amd/display: Reduce sdp bw after urgent to 90%
	wifi: iwlwifi: mvm: Fix -Warray-bounds bug in iwl_mvm_wait_d3_notif()
	can: j1939: j1939_sk_send_loop_abort(): improved error queue handling in J1939 Socket
	can: j1939: change j1939_netdev_lock type to mutex
	can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
	mptcp: only send RM_ADDR in nl_cmd_remove
	mptcp: add address into userspace pm list
	mptcp: update userspace pm infos
	selftests: mptcp: update userspace pm addr tests
	selftests: mptcp: update userspace pm subflow tests
	ceph: fix use-after-free bug for inodes when flushing capsnaps
	s390/dasd: Use correct lock while counting channel queue length
	Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
	Bluetooth: fix debugfs registration
	Bluetooth: hci_qca: fix debugfs registration
	tee: amdtee: Add return_origin to 'struct tee_cmd_load_ta'
	rbd: move RBD_OBJ_FLAG_COPYUP_ENABLED flag setting
	rbd: get snapshot context after exclusive lock is ensured to be held
	virtio_net: use control_buf for coalesce params
	soc: qcom: icc-bwmon: fix incorrect error code passed to dev_err_probe()
	pinctrl: meson-axg: add missing GPIOA_18 gpio group
	usb: usbfs: Enforce page requirements for mmap
	usb: usbfs: Use consistent mmap functions
	mm: page_table_check: Make it dependent on EXCLUSIVE_SYSTEM_RAM
	mm: page_table_check: Ensure user pages are not slab pages
	arm64: dts: qcom: sc8280xp: Flush RSC sleep & wake votes
	ARM: at91: pm: fix imbalanced reference counter for ethernet devices
	ARM: dts: at91: sama7g5ek: fix debounce delay property for shdwc
	ASoC: codecs: wsa883x: do not set can_multi_write flag
	ASoC: codecs: wsa881x: do not set can_multi_write flag
	arm64: dts: qcom: sc7180-lite: Fix SDRAM freq for misidentified sc7180-lite boards
	arm64: dts: imx8qm-mek: correct GPIOs for USDHC2 CD and WP signals
	arm64: dts: imx8-ss-dma: assign default clock rate for lpuarts
	ASoC: mediatek: mt8195-afe-pcm: Convert to platform remove callback returning void
	ASoC: mediatek: mt8195: fix use-after-free in driver remove path
	ASoC: simple-card-utils: fix PCM constraint error check
	blk-mq: fix blk_mq_hw_ctx active request accounting
	arm64: dts: imx8mn-beacon: Fix SPI CS pinmux
	i2c: mv64xxx: Fix reading invalid status value in atomic mode
	firmware: arm_ffa: Set handle field to zero in memory descriptor
	gpio: sim: fix memory corruption when adding named lines and unnamed hogs
	i2c: sprd: Delete i2c adapter in .remove's error path
	riscv: mm: Ensure prot of VM_WRITE and VM_EXEC must be readable
	eeprom: at24: also select REGMAP
	soundwire: stream: Add missing clear of alloc_slave_rt
	riscv: fix kprobe __user string arg print fault issue
	vduse: avoid empty string for dev name
	vhost: support PACKED when setting-getting vring_base
	vhost_vdpa: support PACKED when setting-getting vring_base
	ksmbd: fix out-of-bound read in deassemble_neg_contexts()
	ksmbd: fix out-of-bound read in parse_lease_state()
	ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop
	Revert "ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled"
	ext4: only check dquot_initialize_needed() when debugging
	wifi: rtw89: correct PS calculation for SUPPORTS_DYNAMIC_PS
	wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS
	Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE"
	Linux 6.1.34

Note, commit 898c9a0ee7 ("bpf, sockmap: Avoid potential NULL
dereference in sk_psock_verdict_data_ready()") is merged away in this
merge, due to missing dependencies, it will come back in later.

Change-Id: I8e57d0914e6114822a8941a4663525d85377ca8a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-14 19:49:28 +00:00
KP Singh
d7612a922b bpf: Fix UAF in task local storage
[ Upstream commit b0fd1852bcc21accca6260ef245356d5c141ff66 ]

When task local storage was generalized for tracing programs, the
bpf_task_local_storage callback was moved from a BPF LSM hook
callback for security_task_free LSM hook to it's own callback. But a
failure case in bad_fork_cleanup_security was missed which, when
triggered, led to a dangling task owner pointer and a subsequent
use-after-free. Move the bpf_task_storage_free to the very end of
free_task to handle all failure cases.

This issue was noticed when a BPF LSM program was attached to the
task_alloc hook on a kernel with KASAN enabled. The program used
bpf_task_storage_get to copy the task local storage from the current
task to the new task being created.

Fixes: a10787e6d5 ("bpf: Enable task local storage for tracing programs")
Reported-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: KP Singh <kpsingh@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230602002612.1117381-1-kpsingh@kernel.org
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-14 11:15:16 +02:00
Suren Baghdasaryan
200745f46a UPSTREAM: mm: separate vma->lock from vm_area_struct
vma->lock being part of the vm_area_struct causes performance regression
during page faults because during contention its count and owner fields
are constantly updated and having other parts of vm_area_struct used
during page fault handling next to them causes constant cache line
bouncing.  Fix that by moving the lock outside of the vm_area_struct.

All attempts to keep vma->lock inside vm_area_struct in a separate cache
line still produce performance regression especially on NUMA machines.
Smallest regression was achieved when lock is placed in the fourth cache
line but that bloats vm_area_struct to 256 bytes.

Considering performance and memory impact, separate lock looks like the
best option.  It increases memory footprint of each VMA but that can be
optimized later if the new size causes issues.  Note that after this
change vma_init() does not allocate or initialize vma->lock anymore.  A
number of drivers allocate a pseudo VMA on the stack but they never use
the VMA's lock, therefore it does not need to be allocated.  The future
drivers which might need the VMA lock should use
vm_area_alloc()/vm_area_free() to allocate the VMA.

Link: https://lkml.kernel.org/r/20230227173632.3292573-34-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit c7f8f31c00d187a2c71a241c7f2bd6aa102a4e6f)

Bug: 161210518
Change-Id: I0c4dff518b74e1a9ea2b40636b436a122841564d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:25:02 +00:00
Suren Baghdasaryan
23fcd3167e UPSTREAM: mm/mmap: free vm_area_struct without call_rcu in exit_mmap
call_rcu() can take a long time when callback offloading is enabled.  Its
use in the vm_area_free can cause regressions in the exit path when
multiple VMAs are being freed.

Because exit_mmap() is called only after the last mm user drops its
refcount, the page fault handlers can't be racing with it.  Any other
possible user like oom-reaper or process_mrelease are already synchronized
using mmap_lock.  Therefore exit_mmap() can free VMAs directly, without
the use of call_rcu().

Expose __vm_area_free() and use it from exit_mmap() to avoid possible
call_rcu() floods and performance regressions caused by it.

Link: https://lkml.kernel.org/r/20230227173632.3292573-33-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 0d2ebf9c3f7822e7ba3e4792ea3b6b19aa2da34a)

Bug: 161210518
Change-Id: I4fbf3ef38fdb22a3c80dcc61125ec21d2c426100
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:25:02 +00:00
Suren Baghdasaryan
3d18d86ea9 UPSTREAM: kernel/fork: assert no VMA readers during its destruction
Assert there are no holders of VMA lock for reading when it is about to be
destroyed.

Link: https://lkml.kernel.org/r/20230227173632.3292573-21-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit f2e13784c16a98e269b3111ac02ae44446dd589c)

Bug: 161210518
Change-Id: I67fc318fd08575c9bcc54fd00b0304246b0cd279
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:25:00 +00:00
Suren Baghdasaryan
a9ea3113d4 UPSTREAM: mm: add per-VMA lock and helper functions to control it
Introduce per-VMA locking.  The lock implementation relies on a per-vma
and per-mm sequence counters to note exclusive locking:

  - read lock - (implemented by vma_start_read) requires the vma
    (vm_lock_seq) and mm (mm_lock_seq) sequence counters to differ.
    If they match then there must be a vma exclusive lock held somewhere.
  - read unlock - (implemented by vma_end_read) is a trivial vma->lock
    unlock.
  - write lock - (vma_start_write) requires the mmap_lock to be held
    exclusively and the current mm counter is assigned to the vma counter.
    This will allow multiple vmas to be locked under a single mmap_lock
    write lock (e.g. during vma merging). The vma counter is modified
    under exclusive vma lock.
  - write unlock - (vma_end_write_all) is a batch release of all vma
    locks held. It doesn't pair with a specific vma_start_write! It is
    done before exclusive mmap_lock is released by incrementing mm
    sequence counter (mm_lock_seq).
  - write downgrade - if the mmap_lock is downgraded to the read lock, all
    vma write locks are released as well (effectivelly same as write
    unlock).

Link: https://lkml.kernel.org/r/20230227173632.3292573-13-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 5e31275cc997f8ec5d9e8d65fe9840ebed89db19)

Bug: 161210518
Change-Id: I5e0db53a4b5562e59dd031fabbae4f97acc1bce1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:24:59 +00:00
Michel Lespinasse
e28a0a0e5c UPSTREAM: mm: rcu safe VMA freeing
This prepares for page faults handling under VMA lock, looking up VMAs
under protection of an rcu read lock, instead of the usual mmap read lock.

Link: https://lkml.kernel.org/r/20230227173632.3292573-11-surenb@google.com
Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 20cce633f4254cc0df39665449726e3172518f6c)

Bug: 161210518
Change-Id: Ic1262d00de9dc84ed2cc506b3bae7ef714efdfaa
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:24:58 +00:00
Suren Baghdasaryan
bf16383ebd UPSTREAM: mm: replace VM_LOCKED_CLEAR_MASK with VM_LOCKED_MASK
To simplify the usage of VM_LOCKED_CLEAR_MASK in vm_flags_clear(), replace
it with VM_LOCKED_MASK bitmask and convert all users.

Link: https://lkml.kernel.org/r/20230126193752.297968-4-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjun Roy <arjunroy@google.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Minchan Kim <minchan@google.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Oskolkov <posk@google.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit e430a95a04efc557bc4ff9b3035c7c85aee5d63f)

Bug: 161210518
Change-Id: I17bbcc01a133511dbfaf3d82fbc4b25ecdd0b376
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:24:57 +00:00
Suren Baghdasaryan
db341ea4da UPSTREAM: kernel/fork: convert vma assignment to a memcpy
Patch series "introduce vm_flags modifier functions", v4.

This patchset was originally published as a part of per-VMA locking [1]
and was split after suggestion that it's viable on its own and to
facilitate the review process.  It is now a preprequisite for the next
version of per-VMA lock patchset, which reuses vm_flags modifier functions
to lock the VMA when vm_flags are being updated.

VMA vm_flags modifications are usually done under exclusive mmap_lock
protection because this attrubute affects other decisions like VMA merging
or splitting and races should be prevented.  Introduce vm_flags modifier
functions to enforce correct locking.

This patch (of 7):

Convert vma assignment in vm_area_dup() to a memcpy() to prevent compiler
errors when we add a const modifier to vma->vm_flags.

Link: https://lkml.kernel.org/r/20230126193752.297968-1-surenb@google.com
Link: https://lkml.kernel.org/r/20230126193752.297968-2-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjun Roy <arjunroy@google.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Joel Fernandes <joelaf@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Laurent Dufour <ldufour@linux.ibm.com>
Cc: Liam R. Howlett <Liam.Howlett@Oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Minchan Kim <minchan@google.com>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Peter Oskolkov <posk@google.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Punit Agrawal <punit.agrawal@bytedance.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Soheil Hassas Yeganeh <soheil@google.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

(cherry picked from commit 06e78b614e3780f9ac32056f2861159fd19d9702)

Bug: 161210518
Change-Id: I8f0b92d5ed602d087316e99b29f59d75a644d0e4
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2023-06-07 14:24:57 +00:00
xiaofeng
ec196511bf ANDROID: vendor_hooks:vendor hook for mmput
add vendor hook in mmput while mm_users decreased to 0.

Bug: 238821038
Change-Id: I42a717cbeeb3176bac14b4b2391fdb2366c972d3
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2023-06-05 23:15:22 +00:00
Liangliang Li
3b573277d4 ANDROID: vendor_hooks: Add hooks to dup_task_struct
Add hook to dup_task_struct for vendor data fields initialisation.

Bug: 188004638

Change-Id: I4b58604ee822fb8d1e0cc37bec72e820e7318427
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
(cherry picked from commit f66d96b14aab5051fdf6b5054d87362c17a7b365)
(cherry picked from commit bafafe0ec46160573bef46d3d0f5d6c65fadaa3b)
2023-05-19 19:41:20 +00:00
Liujie Xie
e3e91e9f2a ANDROID: vendor_hooks: Export the tracepoints task_rename
Export the tracepoint task_rename to identify specific new task,
to customize task's util for power and performance, or optimize
task schedule parameters.

Bug: 189985971

Change-Id: I3bb71eae316e3096d361e7b47012ba46ea4be509
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 016d3f7b6986d0ca0acef18c59a47cf6eaa4f562)
(cherry picked from commit cfc14a391adb4d44d8186694b4884815bd85be6c)
2023-05-18 20:38:34 +00:00
Greg Kroah-Hartman
0fff48d6fe Merge 6.1.24 into android14-6.1
Changes in 6.1.24
	dm cache: Add some documentation to dm-cache-background-tracker.h
	dm integrity: Remove bi_sector that's only used by commented debug code
	dm: change "unsigned" to "unsigned int"
	dm: fix improper splitting for abnormal bios
	KVM: arm64: PMU: Align chained counter implementation with architecture pseudocode
	KVM: arm64: PMU: Distinguish between 64bit counter and 64bit overflow
	KVM: arm64: PMU: Sanitise PMCR_EL0.LP on first vcpu run
	KVM: arm64: PMU: Don't save PMCR_EL0.{C,P} for the vCPU
	gpio: GPIO_REGMAP: select REGMAP instead of depending on it
	Drivers: vmbus: Check for channel allocation before looking up relids
	ASoC: SOF: ipc4: Ensure DSP is in D0I0 during sof_ipc4_set_get_data()
	pwm: Make .get_state() callback return an error code
	pwm: hibvt: Explicitly set .polarity in .get_state()
	pwm: cros-ec: Explicitly set .polarity in .get_state()
	pwm: iqs620a: Explicitly set .polarity in .get_state()
	pwm: sprd: Explicitly set .polarity in .get_state()
	pwm: meson: Explicitly set .polarity in .get_state()
	ASoC: codecs: lpass: fix the order or clks turn off during suspend
	KVM: s390: pv: fix external interruption loop not always detected
	wifi: mac80211: fix the size calculation of ieee80211_ie_len_eht_cap()
	wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta
	net: qrtr: Fix a refcount bug in qrtr_recvmsg()
	net: phylink: add phylink_expects_phy() method
	net: stmmac: check if MAC needs to attach to a PHY
	net: stmmac: remove redundant fixup to support fixed-link mode
	l2tp: generate correct module alias strings
	wifi: brcmfmac: Fix SDIO suspend/resume regression
	NFSD: Avoid calling OPDESC() with ops->opnum == OP_ILLEGAL
	nfsd: call op_release, even when op_func returns an error
	icmp: guard against too small mtu
	ALSA: hda/hdmi: Preserve the previous PCM device upon re-enablement
	net: don't let netpoll invoke NAPI if in xmit context
	net: dsa: mv88e6xxx: Reset mv88e6393x force WD event bit
	sctp: check send stream number after wait_for_sndbuf
	net: qrtr: Do not do DEL_SERVER broadcast after DEL_CLIENT
	ipv6: Fix an uninit variable access bug in __ip6_make_skb()
	platform/x86: think-lmi: Fix memory leak when showing current settings
	platform/x86: think-lmi: Fix memory leaks when parsing ThinkStation WMI strings
	platform/x86: think-lmi: Clean up display of current_value on Thinkstation
	gpio: davinci: Do not clear the bank intr enable bit in save_context
	gpio: davinci: Add irq chip flag to skip set wake
	net: ethernet: ti: am65-cpsw: Fix mdio cleanup in probe
	net: stmmac: fix up RX flow hash indirection table when setting channels
	sunrpc: only free unix grouplist after RCU settles
	NFSD: callback request does not use correct credential for AUTH_SYS
	ice: fix wrong fallback logic for FDIR
	ice: Reset FDIR counter in FDIR init stage
	raw: use net_hash_mix() in hash function
	raw: Fix NULL deref in raw_get_next().
	ping: Fix potentail NULL deref for /proc/net/icmp.
	ethtool: reset #lanes when lanes is omitted
	netlink: annotate lockless accesses to nlk->max_recvmsg_len
	gve: Secure enough bytes in the first TX desc for all TCP pkts
	arm64: compat: Work around uninitialized variable warning
	net: stmmac: check fwnode for phy device before scanning for phy
	cxl/pci: Fix CDAT retrieval on big endian
	cxl/pci: Handle truncated CDAT header
	cxl/pci: Handle truncated CDAT entries
	cxl/pci: Handle excessive CDAT length
	PCI/DOE: Silence WARN splat with CONFIG_DEBUG_OBJECTS=y
	PCI/DOE: Fix memory leak with CONFIG_DEBUG_OBJECTS=y
	usb: xhci: tegra: fix sleep in atomic call
	xhci: Free the command allocated for setting LPM if we return early
	xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu
	usb: cdnsp: Fixes error: uninitialized symbol 'len'
	usb: dwc3: pci: add support for the Intel Meteor Lake-S
	USB: serial: cp210x: add Silicon Labs IFS-USB-DATACABLE IDs
	usb: typec: altmodes/displayport: Fix configure initial pin assignment
	USB: serial: option: add Telit FE990 compositions
	USB: serial: option: add Quectel RM500U-CN modem
	drivers: iio: adc: ltc2497: fix LSB shift
	iio: adis16480: select CONFIG_CRC32
	iio: adc: qcom-spmi-adc5: Fix the channel name
	iio: adc: ti-ads7950: Set `can_sleep` flag for GPIO chip
	iio: dac: cio-dac: Fix max DAC write value check for 12-bit
	iio: buffer: correctly return bytes written in output buffers
	iio: buffer: make sure O_NONBLOCK is respected
	iio: light: cm32181: Unregister second I2C client if present
	tty: serial: sh-sci: Fix transmit end interrupt handler
	tty: serial: sh-sci: Fix Rx on RZ/G2L SCI
	tty: serial: fsl_lpuart: avoid checking for transfer complete when UARTCTRL_SBK is asserted in lpuart32_tx_empty
	nilfs2: fix potential UAF of struct nilfs_sc_info in nilfs_segctor_thread()
	nilfs2: fix sysfs interface lifetime
	dt-bindings: serial: renesas,scif: Fix 4th IRQ for 4-IRQ SCIFs
	serial: 8250: Prevent starting up DMA Rx on THRI interrupt
	ksmbd: do not call kvmalloc() with __GFP_NORETRY | __GFP_NO_WARN
	ksmbd: fix slab-out-of-bounds in init_smb2_rsp_hdr
	ALSA: hda/realtek: Add quirk for Clevo X370SNW
	ALSA: hda/realtek: fix mute/micmute LEDs for a HP ProBook
	x86/acpi/boot: Correct acpi_is_processor_usable() check
	x86/ACPI/boot: Use FADT version to check support for online capable
	KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection
	KVM: nVMX: Do not report error code when synthesizing VM-Exit from Real Mode
	mm: kfence: fix PG_slab and memcg_data clearing
	mm: kfence: fix handling discontiguous page
	coresight: etm4x: Do not access TRCIDR1 for identification
	coresight-etm4: Fix for() loop drvdata->nr_addr_cmp range bug
	counter: 104-quad-8: Fix race condition between FLAG and CNTR reads
	counter: 104-quad-8: Fix Synapse action reported for Index signals
	blk-mq: directly poll requests
	iio: adc: ad7791: fix IRQ flags
	io_uring: fix return value when removing provided buffers
	io_uring: fix memory leak when removing provided buffers
	scsi: qla2xxx: Fix memory leak in qla2x00_probe_one()
	scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param()
	nvme: fix discard support without oncs
	cifs: sanitize paths in cifs_update_super_prepath.
	block: ublk: make sure that block size is set correctly
	block: don't set GD_NEED_PART_SCAN if scan partition failed
	perf/core: Fix the same task check in perf_event_set_output
	ftrace: Mark get_lock_parent_ip() __always_inline
	ftrace: Fix issue that 'direct->addr' not restored in modify_ftrace_direct()
	fs: drop peer group ids under namespace lock
	can: j1939: j1939_tp_tx_dat_new(): fix out-of-bounds memory access
	can: isotp: fix race between isotp_sendsmg() and isotp_release()
	can: isotp: isotp_ops: fix poll() to not report false EPOLLOUT events
	can: isotp: isotp_recvmsg(): use sock_recv_cmsgs() to get SOCK_RXQ_OVFL infos
	ACPI: video: Add auto_detect arg to __acpi_video_get_backlight_type()
	ACPI: video: Make acpi_backlight=video work independent from GPU driver
	ACPI: video: Add acpi_backlight=video quirk for Apple iMac14,1 and iMac14,2
	ACPI: video: Add acpi_backlight=video quirk for Lenovo ThinkPad W530
	net: stmmac: Add queue reset into stmmac_xdp_open() function
	tracing/synthetic: Fix races on freeing last_cmd
	tracing/timerlat: Notify new max thread latency
	tracing/osnoise: Fix notify new tracing_max_latency
	tracing: Free error logs of tracing instances
	ASoC: hdac_hdmi: use set_stream() instead of set_tdm_slots()
	tracing/synthetic: Make lastcmd_mutex static
	zsmalloc: document freeable stats
	mm: vmalloc: avoid warn_alloc noise caused by fatal signal
	wifi: mt76: ignore key disable commands
	ublk: read any SQE values upfront
	drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path
	drm/nouveau/disp: Support more modes by checking with lower bpc
	drm/i915: Fix context runtime accounting
	drm/i915: fix race condition UAF in i915_perf_add_config_ioctl
	ring-buffer: Fix race while reader and writer are on the same page
	mm/swap: fix swap_info_struct race between swapoff and get_swap_pages()
	mm/hugetlb: fix uffd wr-protection for CoW optimization path
	maple_tree: fix get wrong data_end in mtree_lookup_walk()
	maple_tree: fix a potential concurrency bug in RCU mode
	blk-throttle: Fix that bps of child could exceed bps limited in parent
	drm/amd/display: Clear MST topology if it fails to resume
	drm/amdgpu: for S0ix, skip SDMA 5.x+ suspend/resume
	drm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset
	drm/display/dp_mst: Handle old/new payload states in drm_dp_remove_payload()
	drm/i915/dp_mst: Fix payload removal during output disabling
	drm/bridge: lt9611: Fix PLL being unable to lock
	drm/i915: Use _MMIO_PIPE() for SKL_BOTTOM_COLOR
	drm/i915: Split icl_color_commit_noarm() from skl_color_commit_noarm()
	mm: take a page reference when removing device exclusive entries
	maple_tree: remove GFP_ZERO from kmem_cache_alloc() and kmem_cache_alloc_bulk()
	maple_tree: fix potential rcu issue
	maple_tree: reduce user error potential
	maple_tree: fix handle of invalidated state in mas_wr_store_setup()
	maple_tree: fix mas_prev() and mas_find() state handling
	maple_tree: be more cautious about dead nodes
	maple_tree: refine ma_state init from mas_start()
	maple_tree: detect dead nodes in mas_start()
	maple_tree: fix freeing of nodes in rcu mode
	maple_tree: remove extra smp_wmb() from mas_dead_leaves()
	maple_tree: add smp_rmb() to dead node detection
	maple_tree: add RCU lock checking to rcu callback functions
	mm: enable maple tree RCU mode by default.
	bpftool: Print newline before '}' for struct with padding only fields
	Linux 6.1.24

Change-Id: I475408e1166927565c7788e7095bdf2cb236c4b2
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-04-22 08:52:25 +00:00
Liam R. Howlett
1c87a6f82a mm: enable maple tree RCU mode by default.
commit 3dd4432549415f3c65dd52d5c687629efbf4ece1 upstream.

Use the maple tree in RCU mode for VMA tracking.

The maple tree tracks the stack and is able to update the pivot
(lower/upper boundary) in-place to allow the page fault handler to write
to the tree while holding just the mmap read lock.  This is safe as the
writes to the stack have a guard VMA which ensures there will always be
a NULL in the direction of the growth and thus will only update a pivot.

It is possible, but not recommended, to have VMAs that grow up/down
without guard VMAs.  syzbot has constructed a testcase which sets up a
VMA to grow and consume the empty space.  Overwriting the entire NULL
entry causes the tree to be altered in a way that is not safe for
concurrent readers; the readers may see a node being rewritten or one
that does not match the maple state they are using.

Enabling RCU mode allows the concurrent readers to see a stable node and
will return the expected result.

Link: https://lkml.kernel.org/r/20230227173632.3292573-9-surenb@google.com
Cc: stable@vger.kernel.org
Fixes: d4af56c5c7 ("mm: start tracking VMAs with maple tree")
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: syzbot+8d95422d3537159ca390@syzkaller.appspotmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-13 16:55:40 +02:00
Greg Kroah-Hartman
a22c3a8790 Merge 6.1.20 into android14-6.1
Changes in 6.1.20
	fs: prevent out-of-bounds array speculation when closing a file descriptor
	btrfs: fix unnecessary increment of read error stat on write error
	btrfs: fix percent calculation for bg reclaim message
	io_uring/uring_cmd: ensure that device supports IOPOLL
	erofs: fix wrong kunmap when using LZMA on HIGHMEM platforms
	perf inject: Fix --buildid-all not to eat up MMAP2
	fork: allow CLONE_NEWTIME in clone3 flags
	RISC-V: Stop emitting attributes
	x86/CPU/AMD: Disable XSAVES on AMD family 0x17
	drm/amdgpu: fix error checking in amdgpu_read_mm_registers for soc15
	drm/amdgpu: fix error checking in amdgpu_read_mm_registers for soc21
	drm/amdgpu: fix error checking in amdgpu_read_mm_registers for nv
	drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF
	drm/connector: print max_requested_bpc in state debugfs
	staging: rtl8723bs: Fix key-store index handling
	staging: rtl8723bs: Pass correct parameters to cfg80211_get_bss()
	ext4: fix cgroup writeback accounting with fs-layer encryption
	ext4: fix RENAME_WHITEOUT handling for inline directories
	ext4: fix another off-by-one fsmap error on 1k block filesystems
	ext4: move where set the MAY_INLINE_DATA flag is set
	ext4: fix WARNING in ext4_update_inline_data
	ext4: zero i_disksize when initializing the bootloader inode
	HID: core: Provide new max_buffer_size attribute to over-ride the default
	HID: uhid: Over-ride the default maximum data buffer value with our own
	nfc: change order inside nfc_se_io error path
	KVM: VMX: Reset eVMCS controls in VP assist page during hardware disabling
	KVM: VMX: Don't bother disabling eVMCS static key on module exit
	KVM: x86: Move guts of kvm_arch_init() to standalone helper
	KVM: VMX: Do _all_ initialization before exposing /dev/kvm to userspace
	fs: dlm: fix log of lowcomms vs midcomms
	fs: dlm: add midcomms init/start functions
	fs: dlm: start midcomms before scand
	fs: dlm: remove send repeat remove handling
	fs: dlm: use packet in dlm_mhandle
	fd: dlm: trace send/recv of dlm message and rcom
	fs: dlm: fix use after free in midcomms commit
	fs: dlm: use WARN_ON_ONCE() instead of WARN_ON()
	fs: dlm: be sure to call dlm_send_queue_flush()
	fs: dlm: fix race setting stop tx flag
	udf: Fix off-by-one error when discarding preallocation
	bus: mhi: ep: Power up/down MHI stack during MHI RESET
	bus: mhi: ep: Change state_lock to mutex
	Input: exc3000 - properly stop timer on shutdown
	ipmi:ssif: Remove rtc_us_timer
	ipmi:ssif: Increase the message retry time
	ipmi:ssif: Add a timer between request retries
	spi: intel: Check number of chip selects after reading the descriptor
	drm/i915: Introduce intel_panel_init_alloc()
	drm/i915: Do panel VBT init early if the VBT declares an explicit panel type
	drm/i915: Populate encoder->devdata for DSI on icl+
	block: Revert "block: Do not reread partition table on exclusively open device"
	block: fix scan partition for exclusively open device again
	riscv: Add header include guards to insn.h
	scsi: core: Remove the /proc/scsi/${proc_name} directory earlier
	ext4: Fix possible corruption when moving a directory
	cifs: improve checking of DFS links over STATUS_OBJECT_NAME_INVALID
	drm/nouveau/kms/nv50: fix nv50_wndw_new_ prototype
	drm/msm: Fix potential invalid ptr free
	drm/msm/a5xx: fix setting of the CP_PREEMPT_ENABLE_LOCAL register
	drm/msm/a5xx: fix highest bank bit for a530
	drm/msm/a5xx: fix the emptyness check in the preempt code
	drm/msm/a5xx: fix context faults during ring switch
	bgmac: fix *initial* chip reset to support BCM5358
	nfc: fdp: add null check of devm_kmalloc_array in fdp_nci_i2c_read_device_properties
	powerpc: dts: t1040rdb: fix compatible string for Rev A boards
	tls: rx: fix return value for async crypto
	drm/msm/dpu: disable features unsupported by QCM2290
	ila: do not generate empty messages in ila_xlat_nl_cmd_get_mapping()
	net: lan966x: Fix port police support using tc-matchall
	selftests: nft_nat: ensuring the listening side is up before starting the client
	netfilter: nft_last: copy content when cloning expression
	netfilter: nft_quota: copy content when cloning expression
	net: tls: fix possible race condition between do_tls_getsockopt_conf() and do_tls_setsockopt_conf()
	net: use indirect calls helpers for sk_exit_memory_pressure()
	perf stat: Fix counting when initial delay configured
	net: lan78xx: fix accessing the LAN7800's internal phy specific registers from the MAC driver
	net: caif: Fix use-after-free in cfusbl_device_notify()
	ice: copy last block omitted in ice_get_module_eeprom()
	bpf, sockmap: Fix an infinite loop error when len is 0 in tcp_bpf_recvmsg_parser()
	drm/msm/dpu: fix len of sc7180 ctl blocks
	drm/msm/dpu: drop DPU_DIM_LAYER from MIXER_MSM8998_MASK
	drm/msm/dpu: fix clocks settings for msm8998 SSPP blocks
	drm/msm/dpu: clear DSPP reservations in rm release
	net: stmmac: add to set device wake up flag when stmmac init phy
	net: phylib: get rid of unnecessary locking
	bnxt_en: Avoid order-5 memory allocation for TPA data
	netfilter: ctnetlink: revert to dumping mark regardless of event type
	netfilter: tproxy: fix deadlock due to missing BH disable
	m68k: mm: Move initrd phys_to_virt handling after paging_init()
	btrfs: fix extent map logging bit not cleared for split maps after dropping range
	bpf, test_run: fix &xdp_frame misplacement for LIVE_FRAMES
	btf: fix resolving BTF_KIND_VAR after ARRAY, STRUCT, UNION, PTR
	net: phy: smsc: fix link up detection in forced irq mode
	net: ethernet: mtk_eth_soc: fix RX data corruption issue
	net: tls: fix device-offloaded sendpage straddling records
	scsi: megaraid_sas: Update max supported LD IDs to 240
	scsi: sd: Fix wrong zone_write_granularity value during revalidate
	netfilter: conntrack: adopt safer max chain length
	platform: mellanox: select REGMAP instead of depending on it
	platform: x86: MLX_PLATFORM: select REGMAP instead of depending on it
	block: fix wrong mode for blkdev_put() from disk_scan_partitions()
	NFSD: Protect against filesystem freezing
	ice: Fix DSCP PFC TLV creation
	ethernet: ice: avoid gcc-9 integer overflow warning
	net/smc: fix fallback failed while sendmsg with fastopen
	octeontx2-af: Unlock contexts in the queue context cache in case of fault detection
	SUNRPC: Fix a server shutdown leak
	net: dsa: mt7530: permit port 5 to work without port 6 on MT7621 SoC
	af_unix: fix struct pid leaks in OOB support
	erofs: Revert "erofs: fix kvcalloc() misuse with __GFP_NOFAIL"
	riscv: Use READ_ONCE_NOCHECK in imprecise unwinding stack mode
	RISC-V: Don't check text_mutex during stop_machine
	drm/amdgpu: fix return value check in kfd
	ext4: Fix deadlock during directory rename
	drm/amdgpu/soc21: don't expose AV1 if VCN0 is harvested
	drm/amdgpu/soc21: Add video cap query support for VCN_4_0_4
	adreno: Shutdown the GPU properly
	drm/msm/adreno: fix runtime PM imbalance at unbind
	watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths
	tpm/eventlog: Don't abort tpm_read_log on faulty ACPI address
	MIPS: Fix a compilation issue
	powerpc/64: Don't recurse irq replay
	powerpc/iommu: fix memory leak with using debugfs_lookup()
	clk: renesas: rcar-gen3: Disable R-Car H3 ES1.*
	powerpc/bpf/32: Only set a stack frame when necessary
	powerpc/64: Fix task_cpu in early boot when booting non-zero cpuid
	powerpc/64: Move paca allocation to early_setup()
	powerpc/kcsan: Exclude udelay to prevent recursive instrumentation
	alpha: fix R_ALPHA_LITERAL reloc for large modules
	macintosh: windfarm: Use unsigned type for 1-bit bitfields
	PCI: Add SolidRun vendor ID
	scripts: handle BrokenPipeError for python scripts
	media: ov5640: Fix analogue gain control
	media: rc: gpio-ir-recv: add remove function
	drm/amd/display: Allow subvp on vactive pipes that are 2560x1440@60
	drm/amd/display: adjust MALL size available for DCN32 and DCN321
	filelocks: use mount idmapping for setlease permission check
	Revert "bpf, test_run: fix &xdp_frame misplacement for LIVE_FRAMES"
	UML: define RUNTIME_DISCARD_EXIT
	Linux 6.1.20

Change-Id: I2f92629ce02bc07295fea17b16f9bb567916a285
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-23 08:23:43 +00:00
Tobias Klauser
120f7a9287 fork: allow CLONE_NEWTIME in clone3 flags
commit a402f1e35313fc7ce2ca60f543c4402c2c7c3544 upstream.

Currently, calling clone3() with CLONE_NEWTIME in clone_args->flags
fails with -EINVAL. This is because CLONE_NEWTIME intersects with
CSIGNAL. However, CSIGNAL was deprecated when clone3 was introduced in
commit 7f192e3cd3 ("fork: add clone3"), allowing re-use of that part
of clone flags.

Fix this by explicitly allowing CLONE_NEWTIME in clone3_args_valid. This
is also in line with the respective check in check_unshare_flags which
allow CLONE_NEWTIME for unshare().

Fixes: 769071ac9f ("ns: Introduce Time Namespace")
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-17 08:50:14 +01:00
Greg Kroah-Hartman
2712923303 This is the 6.1.2 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmOwLA8ACgkQONu9yGCS
 aT6RYxAAhsnIlIBCtaca7Uio9TZdluV7Fzn3c9+QogVisrwVMTtP1iHX43ofFC89
 BCmiQOS9fForddjNP0vkqjZlshMYYSCDPX0s0mK6R4UoNPVg8oehZ9vJfOiR3MMX
 C3fApQQhYf5Bx/rC50i58ChdAw/Dqj0WNBZX/ZWod4B2JKUq7ORk7GjnorfuJxuP
 xO2K6KdpajZufkxtTyKtwqK8FG3dkZP9YF6MqFIvTfQ8qkLnQsrL3moFGU9giSH5
 swRCFH/QII+kumKS2bir87QHz0CmvtSa3Ob4DyKiJMkNN8tspE7nOMkds4usCov6
 +yM84sWp03j2RKFyadctAMKwdH16IGU0kdgqlhb9OmzGNRvX6/l5q4+QzqzPJHHQ
 F+v/PEJoKz3K6CK2ai8DPXoTUMgDDCaYDHg139Tv2Dj/ulDg9xzJ+CS6WBMQxMoU
 xO1OWhpLMDKT8soPogGY13yOsSbhPY6ef3+//eRczxLf8bg3qzoKo362PjqHVxlq
 IY01Ul+MB3M4NdFuFNMKM2/DBHn9qBeoZdQxnQ/vpxhBbpP2hIyEflyfsUQOmUYU
 lWBcnxbSLxf87CmJ3f1VSsms6kbgnxYJyNBgkXiU3WHFfcRZqoU/R+SFu2THRMPt
 ugor1zCHNxBBIdDEMRDWJvDTt34vRsT51Xbig+hH5BVdiKQzQ3k=
 =MYDV
 -----END PGP SIGNATURE-----

Merge 6.1.2 into android14-6.1

Changes in 6.1.2
	MIPS: DTS: CI20: fix reset line polarity of the ethernet controller
	usb: musb: remove extra check in musb_gadget_vbus_draw
	arm64: dts: renesas: r8a779g0: Fix HSCIF0 "brg_int" clock
	arm64: dts: qcom: ipq6018-cp01-c1: use BLSPI1 pins
	arm64: dts: qcom: sm8250-sony-xperia-edo: fix touchscreen bias-disable
	arm64: dts: qcom: sdm845-xiaomi-polaris: fix codec pin conf name
	arm64: dts: qcom: msm8996: Add MSM8996 Pro support
	arm64: dts: qcom: msm8996: fix supported-hw in cpufreq OPP tables
	arm64: dts: qcom: msm8996: fix GPU OPP table
	ARM: dts: qcom: apq8064: fix coresight compatible
	arm64: dts: qcom: sdm630: fix UART1 pin bias
	arm64: dts: qcom: sdm845-cheza: fix AP suspend pin bias
	arm64: dts: qcom: msm8916: Drop MSS fallback compatible
	arm64: dts: fsd: fix drive strength macros as per FSD HW UM
	arm64: dts: fsd: fix drive strength values as per FSD HW UM
	memory: renesas-rpc-if: Clear HS bit during hardware initialization
	objtool, kcsan: Add volatile read/write instrumentation to whitelist
	ARM: dts: stm32: Drop stm32mp15xc.dtsi from Avenger96
	ARM: dts: stm32: Fix AV96 WLAN regulator gpio property
	drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
	firmware: ti_sci: Fix polled mode during system suspend
	riscv: dts: microchip: fix memory node unit address for icicle
	arm64: dts: qcom: pm660: Use unique ADC5_VCOIN address in node name
	arm64: dts: qcom: sm8250: correct LPASS pin pull down
	arm64: dts: qcom: sc7180-trogdor-homestar: fully configure secondary I2S pins
	soc: qcom: llcc: make irq truly optional
	arm64: dts: qcom: sm8150: fix UFS PHY registers
	arm64: dts: qcom: sm8250: fix UFS PHY registers
	arm64: dts: qcom: sm8350: fix UFS PHY registers
	arm64: dts: qcom: sm8450: fix UFS PHY registers
	arm64: dts: qcom: msm8996: fix sound card reset line polarity
	arm64: dts: qcom: sm8250-mtp: fix reset line polarity
	arm64: dts: qcom: sc7280: fix codec reset line polarity for CRD 3.0/3.1
	arm64: dts: qcom: sc7280: fix codec reset line polarity for CRD 1.0/2.0
	arm64: dts: qcom: sm8250: drop bogus DP PHY clock
	arm64: dts: qcom: sm6350: drop bogus DP PHY clock
	soc: qcom: apr: Add check for idr_alloc and of_property_read_string_index
	arm64: dts: qcom: pm6350: Include header for KEY_POWER
	arm64: dts: qcom: sm6125: fix SDHCI CQE reg names
	arm64: dts: renesas: r8a779f0: Fix HSCIF "brg_int" clock
	arm64: dts: renesas: r8a779f0: Fix SCIF "brg_int" clock
	arm64: dts: renesas: r9a09g011: Fix unit address format error
	arm64: dts: renesas: r9a09g011: Fix I2C SoC specific strings
	dt-bindings: pwm: fix microchip corePWM's pwm-cells
	soc: sifive: ccache: fix missing iounmap() in error path in sifive_ccache_init()
	soc: sifive: ccache: fix missing free_irq() in error path in sifive_ccache_init()
	soc: sifive: ccache: fix missing of_node_put() in sifive_ccache_init()
	arm64: dts: mt7986: fix trng node name
	soc/tegra: cbb: Use correct master_id mask for CBB NOC in Tegra194
	soc/tegra: cbb: Update slave maps for Tegra234
	soc/tegra: cbb: Add checks for potential out of bound errors
	soc/tegra: cbb: Check firewall before enabling error reporting
	arm64: dts: qcom: sc7280: Mark all Qualcomm reference boards as LTE
	arm: dts: spear600: Fix clcd interrupt
	riscv: dts: microchip: fix the icicle's #pwm-cells
	soc: ti: knav_qmss_queue: Fix PM disable depth imbalance in knav_queue_probe
	soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
	arm64: mm: kfence: only handle translation faults
	perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
	drivers: perf: marvell_cn10k: Fix hotplug callback leak in tad_pmu_init()
	perf/arm_dmc620: Fix hotplug callback leak in dmc620_pmu_init()
	perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
	arm64: dts: ti: k3-am65-main: Drop dma-coherent in crypto node
	arm64: dts: ti: k3-j721e-main: Drop dma-coherent in crypto node
	arm64: dts: ti: k3-j7200-mcu-wakeup: Drop dma-coherent in crypto node
	arm64: dts: ti: k3-j721s2: Fix the interrupt ranges property for main & wkup gpio intr
	riscv: dts: microchip: remove pcie node from the sev kit
	ARM: dts: nuvoton: Remove bogus unit addresses from fixed-partition nodes
	arm64: dts: mediatek: mt8195: Fix CPUs capacity-dmips-mhz
	arm64: dts: mt7896a: Fix unit_address_vs_reg warning for oscillator
	arm64: dts: mt6779: Fix devicetree build warnings
	arm64: dts: mt2712e: Fix unit_address_vs_reg warning for oscillators
	arm64: dts: mt2712e: Fix unit address for pinctrl node
	arm64: dts: mt2712-evb: Fix vproc fixed regulators unit names
	arm64: dts: mt2712-evb: Fix usb vbus regulators unit names
	arm64: dts: mediatek: pumpkin-common: Fix devicetree warnings
	arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
	arm64: tegra: Fix Prefetchable aperture ranges of Tegra234 PCIe controllers
	arm64: tegra: Fix non-prefetchable aperture of PCIe C3 controller
	arm64: dts: mt7986: move wed_pcie node
	ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
	ARM: dts: turris-omnia: Add ethernet aliases
	ARM: dts: turris-omnia: Add switch port 6 node
	arm64: dts: armada-3720-turris-mox: Add missing interrupt for RTC
	soc: apple: sart: Stop casting function pointer signatures
	soc: apple: rtkit: Stop casting function pointer signatures
	drivers/perf: hisi: Fix some event id for hisi-pcie-pmu
	seccomp: Move copy_seccomp() to no failure path.
	pstore/ram: Fix error return code in ramoops_probe()
	ARM: mmp: fix timer_read delay
	pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
	arch: arm64: apple: t8103: Use standard "iommu" node name
	tpm: tis_i2c: Fix sanity check interrupt enable mask
	tpm: Add flag to use default cancellation policy
	tpm/tpm_ftpm_tee: Fix error handling in ftpm_mod_init()
	tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
	ovl: remove privs in ovl_copyfile()
	ovl: remove privs in ovl_fallocate()
	sched/uclamp: Fix relationship between uclamp and migration margin
	sched/uclamp: Make task_fits_capacity() use util_fits_cpu()
	sched/uclamp: Fix fits_capacity() check in feec()
	sched/uclamp: Make select_idle_capacity() use util_fits_cpu()
	sched/uclamp: Make asym_fits_capacity() use util_fits_cpu()
	sched/uclamp: Make cpu_overutilized() use util_fits_cpu()
	sched/uclamp: Cater for uclamp in find_energy_efficient_cpu()'s early exit condition
	cpuidle: dt: Return the correct numbers of parsed idle states
	alpha: fix TIF_NOTIFY_SIGNAL handling
	alpha: fix syscall entry in !AUDUT_SYSCALL case
	sched/psi: Fix possible missing or delayed pending event
	x86/sgx: Reduce delay and interference of enclave release
	PM: hibernate: Fix mistake in kerneldoc comment
	fs: don't audit the capability check in simple_xattr_list()
	cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()
	x86/split_lock: Add sysctl to control the misery mode
	ACPI: irq: Fix some kernel-doc issues
	selftests/ftrace: event_triggers: wait longer for test_event_enable
	perf: Fix possible memleak in pmu_dev_alloc()
	lib/debugobjects: fix stat count and optimize debug_objects_mem_init
	platform/x86: huawei-wmi: fix return value calculation
	timerqueue: Use rb_entry_safe() in timerqueue_getnext()
	proc: fixup uptime selftest
	lib/fonts: fix undefined behavior in bit shift for get_default_font
	ocfs2: fix memory leak in ocfs2_stack_glue_init()
	selftests: cgroup: fix unsigned comparison with less than zero
	cpufreq: qcom-hw: Fix the frequency returned by cpufreq_driver->get()
	MIPS: vpe-mt: fix possible memory leak while module exiting
	MIPS: vpe-cmp: fix possible memory leak while module exiting
	selftests/efivarfs: Add checking of the test return value
	PNP: fix name memory leak in pnp_alloc_dev()
	mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure
	ACPI: pfr_telemetry: use ACPI_FREE() to free acpi_object
	ACPI: pfr_update: use ACPI_FREE() to free acpi_object
	perf/x86/intel/uncore: Fix reference count leak in sad_cfg_iio_topology()
	perf/x86/intel/uncore: Fix reference count leak in hswep_has_limit_sbox()
	perf/x86/intel/uncore: Fix reference count leak in snr_uncore_mmio_map()
	perf/x86/intel/uncore: Fix reference count leak in __uncore_imc_init_box()
	platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init()
	thermal: core: fix some possible name leaks in error paths
	irqchip/loongson-pch-pic: Fix translate callback for DT path
	irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
	irqchip/wpcm450: Fix memory leak in wpcm450_aic_of_init()
	irqchip/loongson-liointc: Fix improper error handling in liointc_init()
	EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
	NFSD: Finish converting the NFSv2 GETACL result encoder
	NFSD: Finish converting the NFSv3 GETACL result encoder
	nfsd: don't call nfsd_file_put from client states seqfile display
	genirq/irqdesc: Don't try to remove non-existing sysfs files
	cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
	libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
	lib/notifier-error-inject: fix error when writing -errno to debugfs file
	debugfs: fix error when writing negative value to atomic_t debugfs file
	ocfs2: fix memory leak in ocfs2_mount_volume()
	rapidio: fix possible name leaks when rio_add_device() fails
	rapidio: rio: fix possible name leak in rio_register_mport()
	clocksource/drivers/sh_cmt: Access registers according to spec
	futex: Resend potentially swallowed owner death notification
	cpu/hotplug: Make target_store() a nop when target == state
	cpu/hotplug: Do not bail-out in DYING/STARTING sections
	clocksource/drivers/timer-ti-dm: Fix warning for omap_timer_match
	clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
	ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
	uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
	x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
	x86/xen: Fix memory leak in xen_init_lock_cpu()
	xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource()
	PM: runtime: Do not call __rpm_callback() from rpm_idle()
	erofs: check the uniqueness of fsid in shared domain in advance
	erofs: Fix pcluster memleak when its block address is zero
	erofs: fix missing unmap if z_erofs_get_extent_compressedlen() fails
	erofs: validate the extent length for uncompressed pclusters
	platform/chrome: cros_ec_typec: zero out stale pointers
	platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
	platform/x86: intel_scu_ipc: fix possible name leak in __intel_scu_ipc_register()
	MIPS: BCM63xx: Add check for NULL for clk in clk_enable
	MIPS: OCTEON: warn only once if deprecated link status is being used
	lockd: set other missing fields when unlocking files
	nfsd: return error if nfs4_setacl fails
	NFSD: pass range end to vfs_fsync_range() instead of count
	fs: sysv: Fix sysv_nblocks() returns wrong value
	rapidio: fix possible UAF when kfifo_alloc() fails
	eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
	relay: fix type mismatch when allocating memory in relay_create_buf()
	hfs: Fix OOB Write in hfs_asc2mac
	rapidio: devices: fix missing put_device in mport_cdev_open
	ipc: fix memory leak in init_mqueue_fs()
	platform/mellanox: mlxbf-pmc: Fix event typo
	selftests/bpf: Add missing bpf_iter_vma_offset__destroy call
	wifi: fix multi-link element subelement iteration
	wifi: mac80211: mlme: fix null-ptr deref on failed assoc
	wifi: mac80211: check link ID in auth/assoc continuation
	wifi: mac80211: fix ifdef symbol name
	drm/atomic-helper: Don't allocate new plane state in CRTC check
	wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
	wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
	wifi: rtl8xxxu: Fix reading the vendor of combo chips
	wifi: ath11k: fix firmware assert during bandwidth change for peer sta
	drm/bridge: adv7533: remove dynamic lane switching from adv7533 bridge
	libbpf: Fix use-after-free in btf_dump_name_dups
	libbpf: Fix memory leak in parse_usdt_arg()
	selftests/bpf: Fix memory leak caused by not destroying skeleton
	selftest/bpf: Fix memory leak in kprobe_multi_test
	selftests/bpf: Fix error failure of case test_xdp_adjust_tail_grow
	selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c
	libbpf: Use elf_getshdrnum() instead of e_shnum
	libbpf: Deal with section with no data gracefully
	libbpf: Fix null-pointer dereference in find_prog_by_sec_insn()
	drm: lcdif: Switch to limited range for RGB to YUV conversion
	ata: libata: fix NCQ autosense logic
	pinctrl: ocelot: add missing destroy_workqueue() in error path in ocelot_pinctrl_probe()
	ASoC: Intel: avs: Fix DMA mask assignment
	ASoC: Intel: avs: Fix potential RX buffer overflow
	ipmi: kcs: Poll OBF briefly to reduce OBE latency
	drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly"
	drm/amdgpu/powerplay/psm: Fix memory leak in power state init
	net: ethernet: adi: adin1110: Fix SPI transfers
	samples/bpf: Fix map iteration in xdp1_user
	samples/bpf: Fix MAC address swapping in xdp2_kern
	selftests/bpf: fix missing BPF object files
	drm/bridge: it6505: Initialize AUX channel in it6505_i2c_probe
	Input: iqs7222 - protect against undefined slider size
	media: v4l2-ctrls: Fix off-by-one error in integer menu control check
	media: coda: jpeg: Add check for kmalloc
	media: amphion: reset instance if it's aborted before codec header parsed
	media: adv748x: afe: Select input port when initializing AFE
	media: v4l2-ioctl.c: Unify YCbCr/YUV terms in format descriptions
	media: cedrus: hevc: Fix offset adjustments
	media: mediatek: vcodec: fix h264 cavlc bitstream fail
	drm/i915/guc: Limit scheduling properties to avoid overflow
	drm/i915: Fix compute pre-emption w/a to apply to compute engines
	media: i2c: hi846: Fix memory leak in hi846_parse_dt()
	media: i2c: ad5820: Fix error path
	venus: pm_helpers: Fix error check in vcodec_domains_get()
	soreuseport: Fix socket selection for SO_INCOMING_CPU.
	media: i2c: ov5648: Free V4L2 fwnode data on unbind
	media: exynos4-is: don't rely on the v4l2_async_subdev internals
	libbpf: Btf dedup identical struct test needs check for nested structs/arrays
	can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
	can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event
	can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
	can: kvaser_usb_leaf: Set Warning state even without bus errors
	can: kvaser_usb_leaf: Fix improved state not being reported
	can: kvaser_usb_leaf: Fix wrong CAN state after stopping
	can: kvaser_usb_leaf: Fix bogus restart events
	can: kvaser_usb: Add struct kvaser_usb_busparams
	can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming
	clk: renesas: r8a779f0: Fix SD0H clock name
	clk: renesas: r8a779a0: Fix SD0H clock name
	ASoC: dt-bindings: rt5682: Set sound-dai-cells to 1
	drm/i915/guc: Add error-capture init warnings when needed
	drm/i915/guc: Fix GuC error capture sizing estimation and reporting
	dw9768: Enable low-power probe on ACPI
	drm/amd/display: wait for vblank during pipe programming
	drm/rockchip: lvds: fix PM usage counter unbalance in poweron
	drm/i915: Handle all GTs on driver (un)load paths
	drm/i915: Refactor ttm ghost obj detection
	drm/i915: Encapsulate lmem rpm stuff in intel_runtime_pm
	drm/i915/dgfx: Grab wakeref at i915_ttm_unmap_virtual
	clk: renesas: r9a06g032: Repair grave increment error
	drm: lcdif: change burst size to 256B
	drm/panel/panel-sitronix-st7701: Fix RTNI calculation
	spi: Update reference to struct spi_controller
	drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
	drm/ttm: fix undefined behavior in bit shift for TTM_TT_FLAG_PRIV_POPULATED
	drm/msm/mdp5: stop overriding drvdata
	ima: Handle -ESTALE returned by ima_filter_rule_match()
	drm/msm/hdmi: use devres helper for runtime PM management
	bpf: Clobber stack slot when writing over spilled PTR_TO_BTF_ID
	bpf: Fix slot type check in check_stack_write_var_off
	drm/msm/dpu1: Account for DSC's bits_per_pixel having 4 fractional bits
	drm/msm/dsi: Remove useless math in DSC calculations
	drm/msm/dsi: Remove repeated calculation of slice_per_intf
	drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo
	drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size
	drm/msm/dsi: Appropriately set dsc->mux_word_size based on bpc
	drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()
	drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits
	drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values
	drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits
	media: platform: mtk-mdp3: fix error handling in mdp_cmdq_send()
	media: platform: mtk-mdp3: fix error handling about components clock_on
	media: platform: mtk-mdp3: fix error handling in mdp_probe()
	media: rkvdec: Add required padding
	media: vivid: fix compose size exceed boundary
	media: platform: exynos4-is: fix return value check in fimc_md_probe()
	bpf: propagate precision in ALU/ALU64 operations
	bpf: propagate precision across all frames, not just the last one
	clk: qcom: gcc-ipq806x: use parent_data for the last remaining entry
	clk: qcom: dispcc-sm6350: Add CLK_OPS_PARENT_ENABLE to pixel&byte src
	clk: qcom: gcc-sm8250: Use retention mode for USB GDSCs
	mtd: Fix device name leak when register device failed in add_mtd_device()
	mtd: core: fix possible resource leak in init_mtd()
	Input: joystick - fix Kconfig warning for JOYSTICK_ADC
	wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
	media: camss: Clean up received buffers on failed start of streaming
	media: camss: Do not attach an already attached power domain on MSM8916 platform
	clk: renesas: r8a779f0: Fix HSCIF parent clocks
	clk: renesas: r8a779f0: Fix SCIF parent clocks
	virt/sev-guest: Add a MODULE_ALIAS
	net, proc: Provide PROC_FS=n fallback for proc_create_net_single_write()
	rxrpc: Fix ack.bufferSize to be 0 when generating an ack
	drm: lcdif: Set and enable FIFO Panic threshold
	wifi: rtw89: use u32_encode_bits() to fill MAC quota value
	drm: rcar-du: Drop leftovers dependencies from Kconfig
	regmap-irq: Use the new num_config_regs property in regmap_add_irq_chip_fwnode
	drbd: use blk_queue_max_discard_sectors helper
	bfq: fix waker_bfqq inconsistency crash
	drm/radeon: Add the missed acpi_put_table() to fix memory leak
	dt-bindings: pinctrl: update uart/mmc bindings for MT7986 SoC
	pinctrl: mediatek: fix the pinconf register offset of some pins
	wifi: iwlwifi: mei: make sure ownership confirmed message is sent
	wifi: iwlwifi: mei: don't send SAP commands if AMT is disabled
	wifi: iwlwifi: mei: fix tx DHCP packet for devices with new Tx API
	wifi: iwlwifi: mei: avoid blocking sap messages handling due to rtnl lock
	wifi: iwlwifi: mei: fix potential NULL-ptr deref after clone
	module: Fix NULL vs IS_ERR checking for module_get_next_page
	ASoC: codecs: wsa883x: Use proper shutdown GPIO polarity
	ASoC: codecs: wsa883x: use correct header file
	selftests/bpf: Fix xdp_synproxy compilation failure in 32-bit arch
	selftests/bpf: Fix incorrect ASSERT in the tcp_hdr_options test
	drm/mediatek: Modify dpi power on/off sequence.
	ASoC: pxa: fix null-pointer dereference in filter()
	nvmet: only allocate a single slab for bvecs
	regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
	amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()
	nvme: return err on nvme_init_non_mdts_limits fail
	wifi: rtw89: Fix some error handling path in rtw89_core_sta_assoc()
	regulator: qcom-rpmh: Fix PMR735a S3 regulator spec
	drm/fourcc: Fix vsub/hsub for Q410 and Q401
	ALSA: memalloc: Allocate more contiguous pages for fallback case
	integrity: Fix memory leakage in keyring allocation error path
	ima: Fix misuse of dereference of pointer in template_desc_init_fields()
	block: clear ->slave_dir when dropping the main slave_dir reference
	dm: cleanup open_table_device
	dm: cleanup close_table_device
	dm: make sure create and remove dm device won't race with open and close table
	dm: track per-add_disk holder relations in DM
	selftests/bpf: fix memory leak of lsm_cgroup
	wifi: ath10k: Fix return value in ath10k_pci_init()
	drm/msm/a6xx: Fix speed-bin detection vs probe-defer
	mtd: lpddr2_nvm: Fix possible null-ptr-deref
	Input: elants_i2c - properly handle the reset GPIO when power is off
	ASoC: amd: acp: Fix possible UAF in acp_dma_open
	net: ethernet: mtk_eth_soc: do not overwrite mtu configuration running reset routine
	media: amphion: add lock around vdec_g_fmt
	media: amphion: apply vb2_queue_error instead of setting manually
	media: vidtv: Fix use-after-free in vidtv_bridge_dvb_init()
	media: solo6x10: fix possible memory leak in solo_sysfs_init()
	media: platform: exynos4-is: Fix error handling in fimc_md_init()
	media: amphion: Fix error handling in vpu_driver_init()
	media: videobuf-dma-contig: use dma_mmap_coherent
	net: ethernet: mtk_eth_soc: fix RSTCTRL_PPE{0,1} definitions
	udp: Clean up some functions.
	net: Return errno in sk->sk_prot->get_port().
	mtd: spi-nor: hide jedec_id sysfs attribute if not present
	mtd: spi-nor: Fix the number of bytes for the dummy cycles
	clk: imx93: correct the flexspi1 clock setting
	bpf: Pin the start cgroup in cgroup_iter_seq_init()
	HID: i2c: let RMI devices decide what constitutes wakeup event
	clk: imx93: unmap anatop base in error handling path
	clk: imx93: correct enet clock
	bpf: Move skb->len == 0 checks into __bpf_redirect
	HID: hid-sensor-custom: set fixed size for custom attributes
	clk: imx: imxrt1050: fix IMXRT1050_CLK_LCDIF_APB offsets
	pinctrl: k210: call of_node_put()
	wifi: rtw89: fix physts IE page check
	ASoC: Intel: Skylake: Fix Kconfig dependency
	ASoC: Intel: avs: Lock substream before snd_pcm_stop()
	ALSA: pcm: fix undefined behavior in bit shift for SNDRV_PCM_RATE_KNOT
	ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
	regulator: core: use kfree_const() to free space conditionally
	clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
	drm/amdgpu: fix pci device refcount leak
	drm/i915/guc: make default_lists const data
	selftests/bpf: Make sure zero-len skbs aren't redirectable
	selftests/bpf: Mount debugfs in setns_by_fd
	bonding: fix link recovery in mode 2 when updelay is nonzero
	clk: microchip: check for null return of devm_kzalloc()
	mtd: core: Fix refcount error in del_mtd_device()
	mtd: maps: pxa2xx-flash: fix memory leak in probe
	drbd: remove call to memset before free device/resource/connection
	drbd: destroy workqueue when drbd device was freed
	ASoC: qcom: Add checks for devm_kcalloc
	ASoC: qcom: cleanup and fix dependency of QCOM_COMMON
	ASoC: mediatek: mt8186: Correct I2S shared clocks
	media: vimc: Fix wrong function called when vimc_init() fails
	media: imon: fix a race condition in send_packet()
	media: imx: imx7-media-csi: Clear BIT_MIPI_DOUBLE_CMPNT for <16b formats
	media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from mt9p031_init_cfg()
	clk: imx8mn: rename vpu_pll to m7_alt_pll
	clk: imx: replace osc_hdmi with dummy
	clk: imx: rename video_pll1 to video_pll
	clk: imx8mn: fix imx8mn_sai2_sels clocks list
	clk: imx8mn: fix imx8mn_enet_phy_sels clocks list
	pinctrl: pinconf-generic: add missing of_node_put()
	media: dvb-core: Fix ignored return value in dvb_register_frontend()
	media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()
	x86/boot: Skip realmode init code when running as Xen PV guest
	media: sun6i-mipi-csi2: Require both pads to be connected for streaming
	media: sun8i-a83t-mipi-csi2: Require both pads to be connected for streaming
	media: sun6i-mipi-csi2: Register async subdev with no sensor attached
	media: sun8i-a83t-mipi-csi2: Register async subdev with no sensor attached
	media: amphion: try to wakeup vpu core to avoid failure
	media: amphion: cancel vpu before release instance
	media: amphion: lock and check m2m_ctx in event handler
	media: mediatek: vcodec: Fix getting NULL pointer for dst buffer
	media: mediatek: vcodec: Fix h264 set lat buffer error
	media: mediatek: vcodec: Setting lat buf to lat_list when lat decode error
	media: mediatek: vcodec: Core thread depends on core_list
	media: s5p-mfc: Add variant data for MFC v7 hardware for Exynos 3250 SoC
	drm/tegra: Add missing clk_disable_unprepare() in tegra_dc_probe()
	ASoC: dt-bindings: wcd9335: fix reset line polarity in example
	ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
	drm/msm/mdp5: fix reading hw revision on db410c platform
	NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding
	NFSv4.2: Always decode the security label
	NFSv4.2: Fix a memory stomp in decode_attr_security_label
	NFSv4.2: Fix initialisation of struct nfs4_label
	NFSv4: Fix a credential leak in _nfs4_discover_trunking()
	NFSv4: Fix a deadlock between nfs4_open_recover_helper() and delegreturn
	NFS: Fix an Oops in nfs_d_automount()
	ALSA: asihpi: fix missing pci_disable_device()
	wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx()
	wifi: rtl8xxxu: Fix use after rcu_read_unlock in rtl8xxxu_bss_info_changed
	wifi: iwlwifi: mvm: fix double free on tx path.
	ASoC: mediatek: mt8173: Enable IRQ when pdata is ready
	clk: mediatek: fix dependency of MT7986 ADC clocks
	drm/amd/pm/smu11: BACO is supported when it's in BACO state
	amdgpu/nv.c: Corrected typo in the video capabilities resolution
	drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
	drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
	drm/amdkfd: Fix memory leakage
	drm/i915/bios: fix a memory leak in generate_lfp_data_ptrs
	ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
	clk: visconti: Fix memory leak in visconti_register_pll()
	netfilter: conntrack: set icmpv6 redirects as RELATED
	Input: wistron_btns - disable on UML
	bpf, sockmap: Fix repeated calls to sock_put() when msg has more_data
	bpf, sockmap: Fix missing BPF_F_INGRESS flag when using apply_bytes
	bpf, sockmap: Fix data loss caused by using apply_bytes on ingress redirect
	bonding: uninitialized variable in bond_miimon_inspect()
	spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE
	wifi: nl80211: Add checks for nla_nest_start() in nl80211_send_iface()
	wifi: mac80211: fix memory leak in ieee80211_if_add()
	wifi: mac80211: fix maybe-unused warning
	wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails
	wifi: mt76: mt7921: fix antenna signal are way off in monitor mode
	wifi: mt76: mt7915: fix mt7915_mac_set_timing()
	wifi: mt76: mt7915: fix reporting of TX AGGR histogram
	wifi: mt76: mt7921: fix reporting of TX AGGR histogram
	wifi: mt76: mt7915: rework eeprom tx paths and streams init
	wifi: mt76: mt7915: Fix chainmask calculation on mt7915 DBDC
	wifi: mt76: mt7921: fix wrong power after multiple SAR set
	wifi: mt76: fix coverity overrun-call in mt76_get_txpower()
	wifi: mt76: mt7921: Add missing __packed annotation of struct mt7921_clc
	wifi: mt76: do not send firmware FW_FEATURE_NON_DL region
	mt76: mt7915: Fix PCI device refcount leak in mt7915_pci_init_hif2()
	regulator: core: fix module refcount leak in set_supply()
	clk: qcom: lpass-sc7280: Fix pm_runtime usage
	clk: qcom: lpass-sc7180: Fix pm_runtime usage
	clk: qcom: clk-krait: fix wrong div2 functions
	Revert "net: hsr: use hlist_head instead of list_head for mac addresses"
	hsr: Add a rcu-read lock to hsr_forward_skb().
	hsr: Avoid double remove of a node.
	hsr: Disable netpoll.
	hsr: Synchronize sending frames to have always incremented outgoing seq nr.
	hsr: Synchronize sequence number updates.
	configfs: fix possible memory leak in configfs_create_dir()
	regulator: core: fix resource leak in regulator_register()
	hwmon: (jc42) Convert register access and caching to regmap/regcache
	hwmon: (jc42) Restore the min/max/critical temperatures on resume
	bpf: Add dummy type reference to nf_conn___init to fix type deduplication
	bpf, sockmap: fix race in sock_map_free()
	ALSA: pcm: Set missing stop_operating flag at undoing trigger start
	media: saa7164: fix missing pci_disable_device()
	media: ov5640: set correct default link frequency
	ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt
	pinctrl: thunderbay: fix possible memory leak in thunderbay_build_functions()
	xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
	SUNRPC: Fix missing release socket in rpc_sockname()
	NFSv4.2: Set the correct size scratch buffer for decoding READ_PLUS
	NFS: Allow very small rsize & wsize again
	NFSv4.x: Fail client initialisation if state manager thread can't run
	riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC
	bpftool: Fix memory leak in do_build_table_cb
	hwmon: (emc2305) fix unable to probe emc2301/2/3
	hwmon: (emc2305) fix pwm never being able to set lower
	mmc: alcor: fix return value check of mmc_add_host()
	mmc: moxart: fix return value check of mmc_add_host()
	mmc: mxcmmc: fix return value check of mmc_add_host()
	mmc: pxamci: fix return value check of mmc_add_host()
	mmc: rtsx_pci: fix return value check of mmc_add_host()
	mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
	mmc: toshsd: fix return value check of mmc_add_host()
	mmc: vub300: fix return value check of mmc_add_host()
	mmc: wmt-sdmmc: fix return value check of mmc_add_host()
	mmc: litex_mmc: ensure `host->irq == 0` if polling
	mmc: atmel-mci: fix return value check of mmc_add_host()
	mmc: omap_hsmmc: fix return value check of mmc_add_host()
	mmc: meson-gx: fix return value check of mmc_add_host()
	mmc: via-sdmmc: fix return value check of mmc_add_host()
	mmc: wbsd: fix return value check of mmc_add_host()
	mmc: mmci: fix return value check of mmc_add_host()
	mmc: renesas_sdhi: alway populate SCC pointer
	memstick/ms_block: Add check for alloc_ordered_workqueue
	mmc: core: Normalize the error handling branch in sd_read_ext_regs()
	nvme: pass nr_maps explicitly to nvme_alloc_io_tag_set
	regulator: qcom-labibb: Fix missing of_node_put() in qcom_labibb_regulator_probe()
	media: c8sectpfe: Add of_node_put() when breaking out of loop
	media: coda: Add check for dcoda_iram_alloc
	media: coda: Add check for kmalloc
	media: staging: stkwebcam: Restore MEDIA_{USB,CAMERA}_SUPPORT dependencies
	clk: samsung: Fix memory leak in _samsung_clk_register_pll()
	spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode
	wifi: rtl8xxxu: Add __packed to struct rtl8723bu_c2h
	wifi: rtl8xxxu: Fix the channel width reporting
	wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
	blktrace: Fix output non-blktrace event when blk_classic option enabled
	bpf: Do not zero-extend kfunc return values
	clk: socfpga: Fix memory leak in socfpga_gate_init()
	net: vmw_vsock: vmci: Check memcpy_from_msg()
	net: defxx: Fix missing err handling in dfx_init()
	net: stmmac: selftests: fix potential memleak in stmmac_test_arpoffload()
	net: stmmac: fix possible memory leak in stmmac_dvr_probe()
	drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
	ipvs: use u64_stats_t for the per-cpu counters
	of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop()
	ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: farsync: Fix kmemleak when rmmods farsync
	net/tunnel: wait until all sk_user_data reader finish before releasing the sock
	net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: emaclite: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave()
	hamradio: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()
	net: setsockopt: fix IPV6_UNICAST_IF option for connected sockets
	af_unix: call proto_unregister() in the error path in af_unix_init()
	net: amd-xgbe: Fix logic around active and passive cables
	net: amd-xgbe: Check only the minimum speed for active/passive cables
	can: tcan4x5x: Remove invalid write in clear_interrupts
	can: m_can: Call the RAM init directly from m_can_chip_config
	can: tcan4x5x: Fix use of register error status mask
	net: ethernet: ti: am65-cpsw: Fix PM runtime leakage in am65_cpsw_nuss_ndo_slave_open()
	net: lan9303: Fix read error execution path
	ntb_netdev: Use dev_kfree_skb_any() in interrupt context
	sctp: sysctl: make extra pointers netns aware
	Bluetooth: hci_core: fix error handling in hci_register_dev()
	Bluetooth: MGMT: Fix error report for ADD_EXT_ADV_PARAMS
	Bluetooth: Fix EALREADY and ELOOP cases in bt_status()
	Bluetooth: hci_conn: Fix crash on hci_create_cis_sync
	Bluetooth: btintel: Fix missing free skb in btintel_setup_combined()
	Bluetooth: btusb: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: hci_ll: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: hci_h5: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: hci_core: don't call kfree_skb() under spin_lock_irqsave()
	Bluetooth: RFCOMM: don't call kfree_skb() under spin_lock_irqsave()
	octeontx2-af: cn10k: mcs: Fix a resource leak in the probe and remove functions
	stmmac: fix potential division by 0
	i40e: Fix the inability to attach XDP program on downed interface
	net: dsa: tag_8021q: avoid leaking ctx on dsa_tag_8021q_register() error path
	apparmor: fix a memleak in multi_transaction_new()
	apparmor: fix lockdep warning when removing a namespace
	apparmor: Fix abi check to include v8 abi
	apparmor: Fix regression in stacking due to label flags
	crypto: hisilicon/qm - fix incorrect parameters usage
	crypto: hisilicon/qm - re-enable communicate interrupt before notifying PF
	crypto: sun8i-ss - use dma_addr instead u32
	crypto: nitrox - avoid double free on error path in nitrox_sriov_init()
	crypto: tcrypt - fix return value for multiple subtests
	scsi: core: Fix a race between scsi_done() and scsi_timeout()
	apparmor: Use pointer to struct aa_label for lbs_cred
	PCI: dwc: Fix n_fts[] array overrun
	RDMA/core: Fix order of nldev_exit call
	PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
	f2fs: Fix the race condition of resize flag between resizefs
	crypto: rockchip - do not do custom power management
	crypto: rockchip - do not store mode globally
	crypto: rockchip - add fallback for cipher
	crypto: rockchip - add fallback for ahash
	crypto: rockchip - better handle cipher key
	crypto: rockchip - remove non-aligned handling
	crypto: rockchip - rework by using crypto_engine
	apparmor: Fix memleak in alloc_ns()
	fortify: Do not cast to "unsigned char"
	f2fs: fix to invalidate dcc->f2fs_issue_discard in error path
	f2fs: fix gc mode when gc_urgent_high_remaining is 1
	f2fs: fix normal discard process
	f2fs: allow to set compression for inlined file
	f2fs: fix the assign logic of iocb
	f2fs: fix to destroy sbi->post_read_wq in error path of f2fs_fill_super()
	RDMA/irdma: Report the correct link speed
	scsi: qla2xxx: Fix set-but-not-used variable warnings
	RDMA/siw: Fix immediate work request flush to completion queue
	IB/mad: Don't call to function that might sleep while in atomic context
	PCI: vmd: Disable MSI remapping after suspend
	PCI: imx6: Initialize PHY before deasserting core reset
	f2fs: fix to avoid accessing uninitialized spinlock
	RDMA/restrack: Release MR restrack when delete
	RDMA/core: Make sure "ib_port" is valid when access sysfs node
	RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port
	RDMA/siw: Set defined status for work completion with undefined status
	RDMA/irdma: Fix inline for multiple SGE's
	RDMA/irdma: Fix RQ completion opcode
	RDMA/irdma: Do not request 2-level PBLEs for CQ alloc
	scsi: scsi_debug: Fix a warning in resp_write_scat()
	crypto: ccree - Remove debugfs when platform_driver_register failed
	crypto: cryptd - Use request context instead of stack for sub-request
	crypto: hisilicon/qm - add missing pci_dev_put() in q_num_set()
	RDMA/rxe: Fix mr->map double free
	RDMA/hns: Fix ext_sge num error when post send
	RDMA/hns: Fix incorrect sge nums calculation
	PCI: Check for alloc failure in pci_request_irq()
	RDMA/hfi: Decrease PCI device reference count in error path
	crypto: ccree - Make cc_debugfs_global_fini() available for module init function
	RDMA/irdma: Initialize net_type before checking it
	RDMA/hns: fix memory leak in hns_roce_alloc_mr()
	RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed
	dt-bindings: imx6q-pcie: Fix clock names for imx6sx and imx8mq
	dt-bindings: visconti-pcie: Fix interrupts array max constraints
	PCI: endpoint: pci-epf-vntb: Fix call pci_epc_mem_free_addr() in error path
	scsi: hpsa: Fix possible memory leak in hpsa_init_one()
	crypto: tcrypt - Fix multibuffer skcipher speed test mem leak
	padata: Always leave BHs disabled when running ->parallel()
	padata: Fix list iterator in padata_do_serial()
	crypto: x86/aegis128 - fix possible crash with CFI enabled
	crypto: x86/aria - fix crash with CFI enabled
	crypto: x86/sha1 - fix possible crash with CFI enabled
	crypto: x86/sha256 - fix possible crash with CFI enabled
	crypto: x86/sha512 - fix possible crash with CFI enabled
	crypto: x86/sm3 - fix possible crash with CFI enabled
	crypto: x86/sm4 - fix crash with CFI enabled
	crypto: arm64/sm3 - add NEON assembly implementation
	crypto: arm64/sm3 - fix possible crash with CFI enabled
	crypto: hisilicon/qm - fix 'QM_XEQ_DEPTH_CAP' mask value
	scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()
	scsi: hpsa: Fix error handling in hpsa_add_sas_host()
	scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
	scsi: efct: Fix possible memleak in efct_device_init()
	scsi: scsi_debug: Fix a warning in resp_verify()
	scsi: scsi_debug: Fix a warning in resp_report_zones()
	scsi: fcoe: Fix possible name leak when device_register() fails
	scsi: scsi_debug: Fix possible name leak in sdebug_add_host_helper()
	scsi: ipr: Fix WARNING in ipr_init()
	scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
	scsi: snic: Fix possible UAF in snic_tgt_create()
	scsi: ufs: core: Fix the polling implementation
	RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
	f2fs: set zstd compress level correctly
	f2fs: fix to enable compress for newly created file if extension matches
	f2fs: avoid victim selection from previous victim section
	RDMA/nldev: Fix failure to send large messages
	crypto: qat - fix error return code in adf_probe
	crypto: amlogic - Remove kcalloc without check
	crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe()
	riscv/mm: add arch hook arch_clear_hugepage_flags
	RDMA: Disable IB HW for UML
	RDMA/hfi1: Fix error return code in parse_platform_config()
	RDMA/srp: Fix error return code in srp_parse_options()
	PCI: vmd: Fix secondary bus reset for Intel bridges
	orangefs: Fix sysfs not cleanup when dev init failed
	RDMA/hns: Fix the gid problem caused by free mr
	RDMA/hns: Fix AH attr queried by query_qp
	RDMA/hns: Fix PBL page MTR find
	RDMA/hns: Fix page size cap from firmware
	RDMA/hns: Fix error code of CMD
	RDMA/hns: Fix XRC caps on HIP08
	RISC-V: Fix unannoted hardirqs-on in return to userspace slow-path
	RISC-V: Fix MEMREMAP_WB for systems with Svpbmt
	riscv: Fix crash during early errata patching
	crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
	hwrng: amd - Fix PCI device refcount leak
	hwrng: geode - Fix PCI device refcount leak
	IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
	RISC-V: Align the shadow stack
	f2fs: fix iostat parameter for discard
	riscv: Fix P4D_SHIFT definition for 3-level page table mode
	drivers: dio: fix possible memory leak in dio_init()
	serial: tegra: Read DMA status before terminating
	serial: 8250_bcm7271: Fix error handling in brcmuart_init()
	drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler
	class: fix possible memory leak in __class_register()
	vfio: platform: Do not pass return buffer to ACPI _RST method
	vfio/iova_bitmap: Fix PAGE_SIZE unaligned bitmaps
	uio: uio_dmem_genirq: Fix missing unlock in irq configuration
	uio: uio_dmem_genirq: Fix deadlock between irq config and handling
	usb: fotg210-udc: Fix ages old endianness issues
	interconnect: qcom: sc7180: fix dropped const of qcom_icc_bcm
	staging: vme_user: Fix possible UAF in tsi148_dma_list_add
	usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
	usb: typec: tcpci: fix of node refcount leak in tcpci_register_port()
	usb: typec: tipd: Cleanup resources if devm_tps6598_psy_register fails
	usb: typec: tipd: Fix spurious fwnode_handle_put in error path
	usb: typec: tipd: Fix typec_unregister_port error paths
	usb: musb: omap2430: Fix probe regression for missing resources
	extcon: usbc-tusb320: Update state on probe even if no IRQ pending
	USB: gadget: Fix use-after-free during usb config switch
	serial: amba-pl011: avoid SBSA UART accessing DMACR register
	serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle.
	serial: stm32: move dma_request_chan() before clk_prepare_enable()
	serial: pch: Fix PCI device refcount leak in pch_request_dma()
	serial: altera_uart: fix locking in polling mode
	serial: sunsab: Fix error handling in sunsab_init()
	habanalabs: fix return value check in hl_fw_get_sec_attest_data()
	test_firmware: fix memory leak in test_firmware_init()
	misc: ocxl: fix possible name leak in ocxl_file_register_afu()
	ocxl: fix pci device refcount leak when calling get_function_0()
	misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
	misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
	firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()
	cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
	cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()
	iio: temperature: ltc2983: make bulk write buffer DMA-safe
	iio: adis: add '__adis_enable_irq()' implementation
	counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update
	coresight: trbe: remove cpuhp instance node before remove cpuhp state
	coresight: cti: Fix null pointer error on CTI init before ETM
	tracing/user_events: Fix call print_fmt leak
	usb: roles: fix of node refcount leak in usb_role_switch_is_parent()
	usb: core: hcd: Fix return value check in usb_hcd_setup_local_mem()
	usb: gadget: f_hid: fix f_hidg lifetime vs cdev
	usb: gadget: f_hid: fix refcount leak on error path
	drivers: mcb: fix resource leak in mcb_probe()
	mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
	chardev: fix error handling in cdev_device_add()
	vfio/iova_bitmap: refactor iova_bitmap_set() to better handle page boundaries
	i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
	staging: rtl8192u: Fix use after free in ieee80211_rx()
	staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
	vme: Fix error not catched in fake_init()
	gpiolib: cdev: fix NULL-pointer dereferences
	gpiolib: protect the GPIO device against being dropped while in use by user-space
	i2c: mux: reg: check return value after calling platform_get_resource()
	i2c: ismt: Fix an out-of-bounds bug in ismt_access()
	usb: storage: Add check for kcalloc
	usb: typec: wusb3801: fix fwnode refcount leak in wusb3801_probe()
	tracing/hist: Fix issue of losting command info in error_log
	ksmbd: Fix resource leak in ksmbd_session_rpc_open()
	samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
	thermal/drivers/imx8mm_thermal: Validate temperature range
	thermal/drivers/k3_j72xx_bandgap: Fix the debug print message
	thermal/of: Fix memory leak on thermal_of_zone_register() failure
	thermal/drivers/qcom/temp-alarm: Fix inaccurate warning for gen2
	thermal/drivers/qcom/lmh: Fix irq handler return value
	fbdev: ssd1307fb: Drop optional dependency
	fbdev: pm2fb: fix missing pci_disable_device()
	fbdev: via: Fix error in via_core_init()
	fbdev: vermilion: decrease reference count in error path
	fbdev: ep93xx-fb: Add missing clk_disable_unprepare in ep93xxfb_probe()
	fbdev: geode: don't build on UML
	fbdev: uvesafb: don't build on UML
	fbdev: uvesafb: Fixes an error handling path in uvesafb_probe()
	led: qcom-lpg: Fix sleeping in atomic
	perf tools: Fix "kernel lock contention analysis" test by not printing warnings in quiet mode
	perf stat: Use evsel__is_hybrid() more
	perf stat: Move common code in print_metric_headers()
	HSI: omap_ssi_core: fix unbalanced pm_runtime_disable()
	HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
	power: supply: fix residue sysfs file in error handle route of __power_supply_register()
	watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running
	perf trace: Return error if a system call doesn't exist
	perf trace: Use macro RAW_SYSCALL_ARGS_NUM to replace number
	perf trace: Handle failure when trace point folder is missed
	perf symbol: correction while adjusting symbol
	power: supply: z2_battery: Fix possible memleak in z2_batt_probe()
	power: supply: cw2015: Fix potential null-ptr-deref in cw_bat_probe()
	HSI: omap_ssi_core: Fix error handling in ssi_init()
	power: supply: ab8500: Fix error handling in ab8500_charger_init()
	power: supply: Fix refcount leak in rk817_charger_probe
	power: supply: bq25890: Factor out regulator registration code
	power: supply: bq25890: Convert to i2c's .probe_new()
	power: supply: bq25890: Ensure pump_express_work is cancelled on remove
	perf branch: Fix interpretation of branch records
	power: supply: fix null pointer dereferencing in power_supply_get_battery_info
	gfs2: Partially revert gfs2_inode_lookup change
	leds: is31fl319x: Fix setting current limit for is31fl319{0,1,3}
	perf off_cpu: Fix a typo in BTF tracepoint name, it should be 'btf_trace_sched_switch'
	ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack
	perf stat: Do not delay the workload with --delay
	RDMA/siw: Fix pointer cast warning
	fs/ntfs3: Avoid UBSAN error on true_sectors_per_clst()
	fs/ntfs3: Harden against integer overflows
	phy: marvell: phy-mvebu-a3700-comphy: Reset COMPHY registers before USB 3.0 power on
	phy: qcom-qmp-pcie: drop bogus register update
	dmaengine: idxd: Make max batch size attributes in sysfs invisible for Intel IAA
	dmaengine: apple-admac: Allocate cache SRAM to channels
	remoteproc: core: Auto select rproc-virtio device id
	phy: qcom-qmp-pcie: drop power-down delay config
	phy: qcom-qmp-pcie: replace power-down delay
	phy: qcom-qmp-pcie: fix sc8180x initialisation
	phy: qcom-qmp-pcie: fix ipq8074-gen3 initialisation
	phy: qcom-qmp-pcie: fix ipq6018 initialisation
	phy: qcom-qmp-usb: clean up power-down handling
	phy: qcom-qmp-usb: drop sc8280xp power-down delay
	phy: qcom-qmp-usb: drop power-down delay config
	phy: qcom-qmp-usb: clean up status polling
	phy: qcom-qmp-usb: drop start and pwrdn-ctrl abstraction
	phy: qcom-qmp-usb: correct registers layout for IPQ8074 USB3 PHY
	iommu/s390: Fix duplicate domain attachments
	iommu/sun50i: Fix reset release
	iommu/sun50i: Consider all fault sources for reset
	iommu/sun50i: Fix R/W permission check
	iommu/sun50i: Fix flush size
	iommu/sun50i: Implement .iotlb_sync_map
	iommu/rockchip: fix permission bits in page table entries v2
	dmaengine: idxd: Make read buffer sysfs attributes invisible for Intel IAA
	phy: qcom-qmp-usb: fix sc8280xp PCS_USB offset
	phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices
	phy: usb: Use slow clock for wake enabled suspend
	phy: usb: Fix clock imbalance for suspend/resume
	include/uapi/linux/swab: Fix potentially missing __always_inline
	pwm: tegra: Improve required rate calculation
	pwm: tegra: Ensure the clock rate is not less than needed
	phy: qcom-qmp-pcie: split register tables into common and extra parts
	phy: qcom-qmp-pcie: split pcs_misc init cfg for ipq8074 pcs table
	phy: qcom-qmp-pcie: support separate tables for EP mode
	phy: qcom-qmp-pcie: Support SM8450 PCIe1 PHY in EP mode
	phy: qcom-qmp-pcie: Fix high latency with 4x2 PHY when ASPM is enabled
	phy: qcom-qmp-pcie: Fix sm8450_qmp_gen4x2_pcie_pcs_tbl[] register names
	fs/ntfs3: Fix slab-out-of-bounds read in ntfs_trim_fs
	dmaengine: idxd: Fix crc_val field for completion record
	rtc: rzn1: Check return value in rzn1_rtc_probe
	rtc: class: Fix potential memleak in devm_rtc_allocate_device()
	rtc: pcf2127: Convert to .probe_new()
	rtc: cmos: Call cmos_wake_setup() from cmos_do_probe()
	rtc: cmos: Call rtc_wake_setup() from cmos_do_probe()
	rtc: cmos: Eliminate forward declarations of some functions
	rtc: cmos: Rename ACPI-related functions
	rtc: cmos: Disable ACPI RTC event on removal
	rtc: snvs: Allow a time difference on clock register read
	rtc: pcf85063: Fix reading alarm
	iommu/mediatek: Check return value after calling platform_get_resource()
	iommu: Avoid races around device probe
	iommu/amd: Fix pci device refcount leak in ppr_notifier()
	iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
	macintosh: fix possible memory leak in macio_add_one_device()
	macintosh/macio-adb: check the return value of ioremap()
	powerpc/52xx: Fix a resource leak in an error handling path
	cxl: Fix refcount leak in cxl_calc_capp_routing
	powerpc/xmon: Fix -Wswitch-unreachable warning in bpt_cmds
	powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data()
	powerpc/pseries: fix the object owners enum value in plpks driver
	powerpc/pseries: Fix the H_CALL error code in PLPKS driver
	powerpc/pseries: Return -EIO instead of -EINTR for H_ABORTED error
	powerpc/pseries: fix plpks_read_var() code for different consumers
	kprobes: Fix check for probe enabled in kill_kprobe()
	powerpc: dts: turris1x.dts: Add channel labels for temperature sensor
	powerpc/perf: callchain validate kernel stack pointer bounds
	powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()
	powerpc/hv-gpci: Fix hv_gpci event list
	selftests/powerpc: Fix resource leaks
	iommu/mediatek: Add platform_device_put for recovering the device refcnt
	iommu/mediatek: Use component_match_add
	iommu/mediatek: Add error path for loop of mm_dts_parse
	iommu/mediatek: Validate number of phandles associated with "mediatek,larbs"
	iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY
	pwm: sifive: Call pwm_sifive_update_clock() while mutex is held
	pwm: mtk-disp: Fix the parameters calculated by the enabled flag of disp_pwm
	pwm: mediatek: always use bus clock for PWM on MT7622
	RISC-V: KVM: Fix reg_val check in kvm_riscv_vcpu_set_reg_config()
	remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()
	remoteproc: qcom: q6v5: Fix potential null-ptr-deref in q6v5_wcss_init_mmio()
	remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove
	remoteproc: qcom_q6v5_pas: detach power domains on remove
	remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region()
	remoteproc: qcom: q6v5: Fix missing clk_disable_unprepare() in q6v5_wcss_qcs404_power_on()
	powerpc/pseries/eeh: use correct API for error log size
	dt-bindings: mfd: qcom,spmi-pmic: Drop PWM reg dependency
	mfd: axp20x: Do not sleep in the power off handler
	mfd: bd957x: Fix Kconfig dependency on REGMAP_IRQ
	mfd: qcom_rpm: Fix an error handling path in qcom_rpm_probe()
	mfd: pm8008: Fix return value check in pm8008_probe()
	netfilter: flowtable: really fix NAT IPv6 offload
	rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
	rtc: pic32: Move devm_rtc_allocate_device earlier in pic32_rtc_probe()
	rtc: pcf85063: fix pcf85063_clkout_control
	iommu/mediatek: Fix forever loop in error handling
	nfsd: under NFSv4.1, fix double svc_xprt_put on rpc_create failure
	net: macsec: fix net device access prior to holding a lock
	bonding: add missed __rcu annotation for curr_active_slave
	bonding: do failover when high prio link up
	mISDN: hfcsusb: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
	mISDN: hfcpci: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
	mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
	block, bfq: fix possible uaf for 'bfqq->bic'
	selftests/bpf: Select CONFIG_FUNCTION_ERROR_INJECTION
	bpf: prevent leak of lsm program after failed attach
	media: v4l2-ctrls-api.c: add back dropped ctrl->is_new = 1
	net: enetc: avoid buffer leaks on xdp_do_redirect() failure
	nfc: pn533: Clear nfc_target before being used
	unix: Fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()
	r6040: Fix kmemleak in probe and remove
	net: dsa: mv88e6xxx: avoid reg_lock deadlock in mv88e6xxx_setup_port()
	igc: Enhance Qbv scheduling by using first flag bit
	igc: Use strict cycles for Qbv scheduling
	igc: Add checking for basetime less than zero
	igc: allow BaseTime 0 enrollment for Qbv
	igc: recalculate Qbv end_time by considering cycle time
	igc: Set Qbv start_time and end_time to end_time if not being configured in GCL
	rtc: mxc_v2: Add missing clk_disable_unprepare()
	devlink: hold region lock when flushing snapshots
	selftests: devlink: fix the fd redirect in dummy_reporter_test
	openvswitch: Fix flow lookup to use unmasked key
	soc: mediatek: pm-domains: Fix the power glitch issue
	arm64: dts: mt8183: Fix Mali GPU clock
	devlink: protect devlink dump by the instance lock
	skbuff: Account for tail adjustment during pull operations
	mailbox: mpfs: read the system controller's status
	mailbox: arm_mhuv2: Fix return value check in mhuv2_probe()
	mailbox: zynq-ipi: fix error handling while device_register() fails
	net_sched: reject TCF_EM_SIMPLE case for complex ematch module
	rxrpc: Fix missing unlock in rxrpc_do_sendmsg()
	myri10ge: Fix an error handling path in myri10ge_probe()
	net: stream: purge sk_error_queue in sk_stream_kill_queues()
	mctp: serial: Fix starting value for frame check sequence
	cifs: don't leak -ENOMEM in smb2_open_file()
	net: dsa: microchip: remove IRQF_TRIGGER_FALLING in request_threaded_irq
	mctp: Remove device type check at unregister
	HID: amd_sfh: Add missing check for dma_alloc_coherent
	net: fec: check the return value of build_skb()
	rcu: Fix __this_cpu_read() lockdep warning in rcu_force_quiescent_state()
	arm64: make is_ttbrX_addr() noinstr-safe
	ARM: dts: aspeed: rainier,everest: Move reserved memory regions
	video: hyperv_fb: Avoid taking busy spinlock on panic path
	x86/hyperv: Remove unregister syscore call from Hyper-V cleanup
	binfmt_misc: fix shift-out-of-bounds in check_special_flags
	arm64: dts: qcom: sm8450: disable SDHCI SDR104/SDR50 on all boards
	arm64: dts: qcom: sm6350: Add apps_smmu with streamID to SDHCI 1/2 nodes
	fs: jfs: fix shift-out-of-bounds in dbAllocAG
	udf: Avoid double brelse() in udf_rename()
	jfs: Fix fortify moan in symlink
	fs: jfs: fix shift-out-of-bounds in dbDiscardAG
	ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value
	ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur
	ACPICA: Fix error code path in acpi_ds_call_control_method()
	thermal/core: Ensure that thermal device is registered in thermal_zone_get_temp
	ACPI: video: Change GIGABYTE GB-BXBT-2807 quirk to force_none
	ACPI: video: Change Sony Vaio VPCEH3U1E quirk to force_native
	ACPI: video: Add force_vendor quirk for Sony Vaio PCG-FRV35
	ACPI: video: Add force_native quirk for Sony Vaio VPCY11S1E
	nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
	nilfs2: fix shift-out-of-bounds due to too large exponent of block size
	acct: fix potential integer overflow in encode_comp_t()
	x86/apic: Handle no CONFIG_X86_X2APIC on systems with x2APIC enabled by BIOS
	ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Tab 3 Pro (YT3-X90F)
	btrfs: do not panic if we can't allocate a prealloc extent state
	ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
	hfs: fix OOB Read in __hfs_brec_find
	drm/etnaviv: add missing quirks for GC300
	media: imx-jpeg: Disable useless interrupt to avoid kernel panic
	brcmfmac: return error when getting invalid max_flowrings from dongle
	wifi: ath9k: verify the expected usb_endpoints are present
	wifi: ar5523: Fix use-after-free on ar5523_cmd() timed out
	ASoC: codecs: rt298: Add quirk for KBL-R RVP platform
	ASoC: Intel: avs: Add quirk for KBL-R RVP platform
	ipmi: fix memleak when unload ipmi driver
	wifi: ath10k: Delay the unmapping of the buffer
	openvswitch: Use kmalloc_size_roundup() to match ksize() usage
	bnx2: Use kmalloc_size_roundup() to match ksize() usage
	drm/amd/display: skip commit minimal transition state
	drm/amd/display: prevent memory leak
	drm/edid: add a quirk for two LG monitors to get them to work on 10bpc
	Revert "drm/amd/display: Limit max DSC target bpp for specific monitors"
	drm/rockchip: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
	blk-mq: avoid double ->queue_rq() because of early timeout
	HID: apple: fix key translations where multiple quirks attempt to translate the same key
	HID: apple: enable APPLE_ISO_TILDE_QUIRK for the keyboards of Macs with the T2 chip
	wifi: ath11k: Fix qmi_msg_handler data structure initialization
	qed (gcc13): use u16 for fid to be big enough
	drm/meson: Fix return type of meson_encoder_cvbs_mode_valid()
	bpf: make sure skb->len != 0 when redirecting to a tunneling device
	net: ethernet: ti: Fix return type of netcp_ndo_start_xmit()
	hamradio: baycom_epp: Fix return type of baycom_send_packet()
	wifi: brcmfmac: Fix potential shift-out-of-bounds in brcmf_fw_alloc_request()
	wifi: brcmfmac: Fix potential NULL pointer dereference in 'brcmf_c_preinit_dcmds()'
	HID: input: do not query XP-PEN Deco LW battery
	HID: uclogic: Add support for XP-PEN Deco LW
	igb: Do not free q_vector unless new one was allocated
	drm/amdgpu: Fix type of second parameter in trans_msg() callback
	drm/amdgpu: Fix type of second parameter in odn_edit_dpm_table() callback
	s390/ctcm: Fix return type of ctc{mp,}m_tx()
	s390/netiucv: Fix return type of netiucv_tx()
	s390/lcs: Fix return type of lcs_start_xmit()
	drm/amd/display: Use min transition for SubVP into MPO
	drm/amd/display: Disable DRR actions during state commit
	drm/msm: Use drm_mode_copy()
	drm/rockchip: Use drm_mode_copy()
	drm/sti: Use drm_mode_copy()
	drm/mediatek: Fix return type of mtk_hdmi_bridge_mode_valid()
	drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()
	md/raid0, raid10: Don't set discard sectors for request queue
	md/raid1: stop mdx_raid1 thread when raid1 array run failed
	drm/amd/display: Workaround to increase phantom pipe vactive in pipesplit
	drm/amd/display: fix array index out of bound error in bios parser
	nvme-auth: don't override ctrl keys before validation
	net: add atomic_long_t to net_device_stats fields
	ipv6/sit: use DEV_STATS_INC() to avoid data-races
	mrp: introduce active flags to prevent UAF when applicant uninit
	net: ethernet: mtk_eth_soc: drop packets to WDMA if the ring is full
	bpf/verifier: Use kmalloc_size_roundup() to match ksize() usage
	ppp: associate skb with a device at tx
	drm/amd/display: Fix display corruption w/ VSR enable
	bpf: Fix a BTF_ID_LIST bug with CONFIG_DEBUG_INFO_BTF not set
	bpf: Prevent decl_tag from being referenced in func_proto arg
	ethtool: avoiding integer overflow in ethtool_phys_id()
	media: dvb-frontends: fix leak of memory fw
	media: dvbdev: adopts refcnt to avoid UAF
	media: dvb-usb: fix memory leak in dvb_usb_adapter_init()
	media: mediatek: vcodec: Can't set dst buffer to done when lat decode error
	blk-mq: fix possible memleak when register 'hctx' failed
	ALSA: usb-audio: Add quirk for Tascam Model 12
	drm/amdgpu: Fix potential double free and null pointer dereference
	drm/amd/display: Use the largest vready_offset in pipe group
	drm/amd/display: Fix DTBCLK disable requests and SRC_SEL programming
	ASoC: amd: yc: Add Xiaomi Redmi Book Pro 14 2022 into DMI table
	libbpf: Avoid enum forward-declarations in public API in C++ mode
	regulator: core: fix use_count leakage when handling boot-on
	wifi: mt76: do not run mt76u_status_worker if the device is not running
	hwmon: (nct6775) add ASUS CROSSHAIR VIII/TUF/ProArt B550M
	selftests/bpf: Fix conflicts with built-in functions in bpf_iter_ksym
	nfs: fix possible null-ptr-deref when parsing param
	mmc: f-sdh30: Add quirks for broken timeout clock capability
	mmc: renesas_sdhi: add quirk for broken register layout
	mmc: renesas_sdhi: better reset from HS400 mode
	mmc: sdhci-tegra: Issue CMD and DAT resets together
	media: si470x: Fix use-after-free in si470x_int_in_callback()
	clk: st: Fix memory leak in st_of_quadfs_setup()
	regulator: core: Use different devices for resource allocation and DT lookup
	ice: synchronize the misc IRQ when tearing down Tx tracker
	Bluetooth: hci_bcm: Add CYW4373A0 support
	Bluetooth: Add quirk to disable extended scanning
	Bluetooth: Add quirk to disable MWS Transport Configuration
	regulator: core: Fix resolve supply lookup issue
	crypto: hisilicon/hpre - fix resource leak in remove process
	scsi: lpfc: Fix hard lockup when reading the rx_monitor from debugfs
	scsi: ufs: Reduce the START STOP UNIT timeout
	crypto: hisilicon/qm - increase the memory of local variables
	Revert "PCI: Clear PCI_STATUS when setting up device"
	scsi: elx: libefc: Fix second parameter type in state callbacks
	hugetlbfs: fix null-ptr-deref in hugetlbfs_parse_param()
	scsi: smartpqi: Add new controller PCI IDs
	scsi: smartpqi: Correct device removal for multi-actuator devices
	drm/fsl-dcu: Fix return type of fsl_dcu_drm_connector_mode_valid()
	drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
	scsi: target: iscsi: Fix a race condition between login_work and the login thread
	orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string()
	orangefs: Fix kmemleak in orangefs_sysfs_init()
	orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()
	hwmon: (jc42) Fix missing unlock on error in jc42_write()
	ASoC: sof_es8336: fix possible use-after-free in sof_es8336_remove()
	ASoC: Intel: Skylake: Fix driver hang during shutdown
	ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe()
	ASoC: audio-graph-card: fix refcount leak of cpu_ep in __graph_for_each_link()
	ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in rockchip_pdm_runtime_resume()
	ASoC: mediatek: mt8183: fix refcount leak in mt8183_mt6358_ts3a227_max98357_dev_probe()
	ALSA: hda/hdmi: fix i915 silent stream programming flow
	ALSA: hda/hdmi: set default audio parameters for KAE silent-stream
	ALSA: hda/hdmi: fix stream-id config keep-alive for rt suspend
	ASoC: wm8994: Fix potential deadlock
	ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
	ASoC: rt5670: Remove unbalanced pm_runtime_put()
	drm/i915/display: Don't disable DDI/Transcoder when setting phy test pattern
	LoadPin: Ignore the "contents" argument of the LSM hooks
	lkdtm: cfi: Make PAC test work with GCC 7 and 8
	pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
	drm/amd/pm: avoid large variable on kernel stack
	perf debug: Set debug_peo_args and redirect_to_stderr variable to correct values in perf_quiet_option()
	perf tools: Make quiet mode consistent between tools
	perf probe: Check -v and -q options in the right place
	MIPS: ralink: mt7621: avoid to init common ralink reset controller
	perf test: Fix "all PMU test" to skip parametrized events
	afs: Fix lost servers_outstanding count
	cfi: Fix CFI failure with KASAN
	pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
	ima: Simplify ima_lsm_copy_rule
	Input: iqs7222 - drop unused device node references
	Input: iqs7222 - report malformed properties
	Input: iqs7222 - add support for IQS7222A v1.13+
	dt-bindings: input: iqs7222: Reduce 'linux,code' to optional
	dt-bindings: input: iqs7222: Correct minimum slider size
	dt-bindings: input: iqs7222: Add support for IQS7222A v1.13+
	ALSA: usb-audio: Workaround for XRUN at prepare
	ALSA: usb-audio: add the quirk for KT0206 device
	ALSA: hda/realtek: Add quirk for Lenovo TianYi510Pro-14IOB
	ALSA: hda/hdmi: Add HP Device 0x8711 to force connect list
	HID: logitech-hidpp: Guard FF init code against non-USB devices
	usb: cdnsp: fix lack of ZLP for ep0
	usb: xhci-mtk: fix leakage of shared hcd when fail to set wakeup irq
	arm64: dts: qcom: sm6350: fix USB-DP PHY registers
	arm64: dts: qcom: sm8250: fix USB-DP PHY registers
	dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
	clk: imx: imx8mp: add shared clk gate for usb suspend clk
	usb: dwc3: Fix race between dwc3_set_mode and __dwc3_set_mode
	usb: dwc3: core: defer probe on ulpi_read_id timeout
	usb: dwc3: qcom: Fix memory leak in dwc3_qcom_interconnect_init
	xhci: Prevent infinite loop in transaction errors recovery for streams
	HID: wacom: Ensure bootloader PID is usable in hidraw mode
	HID: mcp2221: don't connect hidraw
	loop: Fix the max_loop commandline argument treatment when it is set to 0
	9p: set req refcount to zero to avoid uninitialized usage
	security: Restrict CONFIG_ZERO_CALL_USED_REGS to gcc or clang > 15.0.6
	reiserfs: Add missing calls to reiserfs_security_free()
	iio: fix memory leak in iio_device_register_eventset()
	iio: adc: ad_sigma_delta: do not use internal iio_dev lock
	iio: adc128s052: add proper .data members in adc128_of_match table
	iio: addac: ad74413r: fix integer promotion bug in ad74413_get_input_current_offset()
	regulator: core: fix deadlock on regulator enable
	spi: fsl_spi: Don't change speed while chipselect is active
	floppy: Fix memory leak in do_floppy_init()
	gcov: add support for checksum field
	test_maple_tree: add test for mas_spanning_rebalance() on insufficient data
	maple_tree: fix mas_spanning_rebalance() on insufficient data
	fbdev: fbcon: release buffer when fbcon_do_set_font() failed
	ovl: fix use inode directly in rcu-walk mode
	btrfs: do not BUG_ON() on ENOMEM when dropping extent items for a range
	mm/gup: disallow FOLL_FORCE|FOLL_WRITE on hugetlb mappings
	scsi: qla2xxx: Fix crash when I/O abort times out
	blk-iolatency: Fix memory leak on add_disk() failures
	io_uring/net: introduce IORING_SEND_ZC_REPORT_USAGE flag
	io_uring: add completion locking for iopoll
	io_uring: dont remove file from msg_ring reqs
	io_uring: improve io_double_lock_ctx fail handling
	io_uring/net: ensure compat import handlers clear free_iov
	io_uring/net: fix cleanup after recycle
	io_uring: protect cq_timeouts with timeout_lock
	io_uring: remove iopoll spinlock
	net: stmmac: fix errno when create_singlethread_workqueue() fails
	media: dvbdev: fix build warning due to comments
	media: dvbdev: fix refcnt bug
	drm/amd/display: revert Disable DRR actions during state commit
	mfd: qcom_rpm: Use devm_of_platform_populate() to simplify code
	pwm: tegra: Fix 32 bit build
	Linux 6.1.2

Change-Id: I8f7c080f3b8288ed319fc0e25aaefb7ad5cd6b84
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-01-18 18:44:34 +00:00
Kuniyuki Iwashima
5b81f0c6c6 seccomp: Move copy_seccomp() to no failure path.
[ Upstream commit a1140cb215fa13dcec06d12ba0c3ee105633b7c4 ]

Our syzbot instance reported memory leaks in do_seccomp() [0], similar
to the report [1].  It shows that we miss freeing struct seccomp_filter
and some objects included in it.

We can reproduce the issue with the program below [2] which calls one
seccomp() and two clone() syscalls.

The first clone()d child exits earlier than its parent and sends a
signal to kill it during the second clone(), more precisely before the
fatal_signal_pending() test in copy_process().  When the parent receives
the signal, it has to destroy the embryonic process and return -EINTR to
user space.  In the failure path, we have to call seccomp_filter_release()
to decrement the filter's refcount.

Initially, we called it in free_task() called from the failure path, but
the commit 3a15fb6ed9 ("seccomp: release filter after task is fully
dead") moved it to release_task() to notify user space as early as possible
that the filter is no longer used.

To keep the change and current seccomp refcount semantics, let's move
copy_seccomp() just after the signal check and add a WARN_ON_ONCE() in
free_task() for future debugging.

[0]:
unreferenced object 0xffff8880063add00 (size 256):
  comm "repro_seccomp", pid 230, jiffies 4294687090 (age 9.914s)
  hex dump (first 32 bytes):
    01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00  ................
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  ................
  backtrace:
    do_seccomp (./include/linux/slab.h:600 ./include/linux/slab.h:733 kernel/seccomp.c:666 kernel/seccomp.c:708 kernel/seccomp.c:1871 kernel/seccomp.c:1991)
    do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
unreferenced object 0xffffc90000035000 (size 4096):
  comm "repro_seccomp", pid 230, jiffies 4294687090 (age 9.915s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    __vmalloc_node_range (mm/vmalloc.c:3226)
    __vmalloc_node (mm/vmalloc.c:3261 (discriminator 4))
    bpf_prog_alloc_no_stats (kernel/bpf/core.c:91)
    bpf_prog_alloc (kernel/bpf/core.c:129)
    bpf_prog_create_from_user (net/core/filter.c:1414)
    do_seccomp (kernel/seccomp.c:671 kernel/seccomp.c:708 kernel/seccomp.c:1871 kernel/seccomp.c:1991)
    do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
unreferenced object 0xffff888003fa1000 (size 1024):
  comm "repro_seccomp", pid 230, jiffies 4294687090 (age 9.915s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    bpf_prog_alloc_no_stats (./include/linux/slab.h:600 ./include/linux/slab.h:733 kernel/bpf/core.c:95)
    bpf_prog_alloc (kernel/bpf/core.c:129)
    bpf_prog_create_from_user (net/core/filter.c:1414)
    do_seccomp (kernel/seccomp.c:671 kernel/seccomp.c:708 kernel/seccomp.c:1871 kernel/seccomp.c:1991)
    do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
unreferenced object 0xffff888006360240 (size 16):
  comm "repro_seccomp", pid 230, jiffies 4294687090 (age 9.915s)
  hex dump (first 16 bytes):
    01 00 37 00 76 65 72 6c e0 83 01 06 80 88 ff ff  ..7.verl........
  backtrace:
    bpf_prog_store_orig_filter (net/core/filter.c:1137)
    bpf_prog_create_from_user (net/core/filter.c:1428)
    do_seccomp (kernel/seccomp.c:671 kernel/seccomp.c:708 kernel/seccomp.c:1871 kernel/seccomp.c:1991)
    do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
unreferenced object 0xffff8880060183e0 (size 8):
  comm "repro_seccomp", pid 230, jiffies 4294687090 (age 9.915s)
  hex dump (first 8 bytes):
    06 00 00 00 00 00 ff 7f                          ........
  backtrace:
    kmemdup (mm/util.c:129)
    bpf_prog_store_orig_filter (net/core/filter.c:1144)
    bpf_prog_create_from_user (net/core/filter.c:1428)
    do_seccomp (kernel/seccomp.c:671 kernel/seccomp.c:708 kernel/seccomp.c:1871 kernel/seccomp.c:1991)
    do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
    entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)

[1]: https://syzkaller.appspot.com/bug?id=2809bb0ac77ad9aa3f4afe42d6a610aba594a987

[2]:
#define _GNU_SOURCE
#include <sched.h>
#include <signal.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <linux/filter.h>
#include <linux/seccomp.h>

void main(void)
{
	struct sock_filter filter[] = {
		BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_ALLOW),
	};
	struct sock_fprog fprog = {
		.len = sizeof(filter) / sizeof(filter[0]),
		.filter = filter,
	};
	long i, pid;

	syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, &fprog);

	for (i = 0; i < 2; i++) {
		pid = syscall(__NR_clone, CLONE_NEWNET | SIGKILL, NULL, NULL, 0);
		if (pid == 0)
			return;
	}
}

Fixes: 3a15fb6ed9 ("seccomp: release filter after task is fully dead")
Reported-by: syzbot+ab17848fe269b573eb71@syzkaller.appspotmail.com
Reported-by: Ayushman Dutta <ayudutta@amazon.com>
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220823154532.82913-1-kuniyu@amazon.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:31:53 +01:00
Greg Kroah-Hartman
3f014522eb Merge 676cb49573 ("Merge tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 6.1-rc1

Resolves merge conflicts in:
	kernel/fork.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I187afe0c9a9604d3e5acb5134f0ee65de850e9f1
2022-10-25 15:13:11 +02:00
Greg Kroah-Hartman
de07798cf0 Merge 27bc50fc90 ("Merge tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3a6855cb0e3a54f605ccb92af058088f280e0349
2022-10-25 14:49:20 +02:00
Greg Kroah-Hartman
d7b5f1b219 Merge 0c563f1480 ("proc: remove VMA rbtree use from nommu") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5edff6b45f59f4eed3422bb2e2079c54af885e3f
2022-10-20 14:21:03 +02:00
Greg Kroah-Hartman
15f46fd6cb Merge 8be976a093 ("mm: multi-gen LRU: design doc") into android-mainline
Steps on the way to 6.1-rc1

Resolves conflicts in:
	fs/exec.c

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia649390f891780ed03530adcf0fac9560635e58f
2022-10-20 14:15:01 +02:00
Linus Torvalds
676cb49573 - hfs and hfsplus kmap API modernization from Fabio Francesco
- Valentin Schneider makes crash-kexec work properly when invoked from
   an NMI-time panic.
 
 - ntfs bugfixes from Hawkins Jiawei
 
 - Jiebin Sun improves IPC msg scalability by replacing atomic_t's with
   percpu counters.
 
 - nilfs2 cleanups from Minghao Chi
 
 - lots of other single patches all over the tree!
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCY0Yf0gAKCRDdBJ7gKXxA
 joapAQDT1d1zu7T8yf9cQXkYnZVuBKCjxKE/IsYvqaq1a42MjQD/SeWZg0wV05B8
 DhJPj9nkEp6R3Rj3Mssip+3vNuceAQM=
 =lUQY
 -----END PGP SIGNATURE-----

Merge tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull non-MM updates from Andrew Morton:

 - hfs and hfsplus kmap API modernization (Fabio Francesco)

 - make crash-kexec work properly when invoked from an NMI-time panic
   (Valentin Schneider)

 - ntfs bugfixes (Hawkins Jiawei)

 - improve IPC msg scalability by replacing atomic_t's with percpu
   counters (Jiebin Sun)

 - nilfs2 cleanups (Minghao Chi)

 - lots of other single patches all over the tree!

* tag 'mm-nonmm-stable-2022-10-11' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (71 commits)
  include/linux/entry-common.h: remove has_signal comment of arch_do_signal_or_restart() prototype
  proc: test how it holds up with mapping'less process
  mailmap: update Frank Rowand email address
  ia64: mca: use strscpy() is more robust and safer
  init/Kconfig: fix unmet direct dependencies
  ia64: update config files
  nilfs2: replace WARN_ONs by nilfs_error for checkpoint acquisition failure
  fork: remove duplicate included header files
  init/main.c: remove unnecessary (void*) conversions
  proc: mark more files as permanent
  nilfs2: remove the unneeded result variable
  nilfs2: delete unnecessary checks before brelse()
  checkpatch: warn for non-standard fixes tag style
  usr/gen_init_cpio.c: remove unnecessary -1 values from int file
  ipc/msg: mitigate the lock contention with percpu counter
  percpu: add percpu_counter_add_local and percpu_counter_sub_local
  fs/ocfs2: fix repeated words in comments
  relay: use kvcalloc to alloc page array in relay_alloc_page_array
  proc: make config PROC_CHILDREN depend on PROC_FS
  fs: uninline inode_maybe_inc_iversion()
  ...
2022-10-12 11:00:22 -07:00
Greg Kroah-Hartman
c0ccaa13ae Merge 30c999937f ("Merge tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5f605248ed730aa694b0ad06b440ffd5e2848837
2022-10-12 10:13:13 +02:00
Greg Kroah-Hartman
ed27852308 Merge 493ffd6605 ("Merge tag 'ucount-rlimits-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace") into android-mainline
Steps on the way to 6.1-rc1

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I71ed5f00bef9c7afd7260c80a067ca82a9f202d0
2022-10-12 09:37:52 +02:00
Xu Panda
ef79361b26 fork: remove duplicate included header files
linux/sched/mm.h is included more than once.

Link: https://lkml.kernel.org/r/20220912071556.16811-1-xu.panda@zte.com.cn
Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Reported-by: Zeal Robot <zealci@zte.com.cn>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Christian Brauner (Microsoft) <brauner@kernel.org>
Cc: "Eric W . Biederman" <ebiederm@xmission.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-11 18:51:10 -07:00
Linus Torvalds
27bc50fc90 - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in
linux-next for a couple of months without, to my knowledge, any negative
   reports (or any positive ones, come to that).
 
 - Also the Maple Tree from Liam R.  Howlett.  An overlapping range-based
   tree for vmas.  It it apparently slight more efficient in its own right,
   but is mainly targeted at enabling work to reduce mmap_lock contention.
 
   Liam has identified a number of other tree users in the kernel which
   could be beneficially onverted to mapletrees.
 
   Yu Zhao has identified a hard-to-hit but "easy to fix" lockdep splat
   (https://lkml.kernel.org/r/CAOUHufZabH85CeUN-MEMgL8gJGzJEWUrkiM58JkTbBhh-jew0Q@mail.gmail.com).
   This has yet to be addressed due to Liam's unfortunately timed
   vacation.  He is now back and we'll get this fixed up.
 
 - Dmitry Vyukov introduces KMSAN: the Kernel Memory Sanitizer.  It uses
   clang-generated instrumentation to detect used-unintialized bugs down to
   the single bit level.
 
   KMSAN keeps finding bugs.  New ones, as well as the legacy ones.
 
 - Yang Shi adds a userspace mechanism (madvise) to induce a collapse of
   memory into THPs.
 
 - Zach O'Keefe has expanded Yang Shi's madvise(MADV_COLLAPSE) to support
   file/shmem-backed pages.
 
 - userfaultfd updates from Axel Rasmussen
 
 - zsmalloc cleanups from Alexey Romanov
 
 - cleanups from Miaohe Lin: vmscan, hugetlb_cgroup, hugetlb and memory-failure
 
 - Huang Ying adds enhancements to NUMA balancing memory tiering mode's
   page promotion, with a new way of detecting hot pages.
 
 - memcg updates from Shakeel Butt: charging optimizations and reduced
   memory consumption.
 
 - memcg cleanups from Kairui Song.
 
 - memcg fixes and cleanups from Johannes Weiner.
 
 - Vishal Moola provides more folio conversions
 
 - Zhang Yi removed ll_rw_block() :(
 
 - migration enhancements from Peter Xu
 
 - migration error-path bugfixes from Huang Ying
 
 - Aneesh Kumar added ability for a device driver to alter the memory
   tiering promotion paths.  For optimizations by PMEM drivers, DRM
   drivers, etc.
 
 - vma merging improvements from Jakub Matěn.
 
 - NUMA hinting cleanups from David Hildenbrand.
 
 - xu xin added aditional userspace visibility into KSM merging activity.
 
 - THP & KSM code consolidation from Qi Zheng.
 
 - more folio work from Matthew Wilcox.
 
 - KASAN updates from Andrey Konovalov.
 
 - DAMON cleanups from Kaixu Xia.
 
 - DAMON work from SeongJae Park: fixes, cleanups.
 
 - hugetlb sysfs cleanups from Muchun Song.
 
 - Mike Kravetz fixes locking issues in hugetlbfs and in hugetlb core.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQTTMBEPP41GrTpTJgfdBJ7gKXxAjgUCY0HaPgAKCRDdBJ7gKXxA
 joPjAQDZ5LlRCMWZ1oxLP2NOTp6nm63q9PWcGnmY50FjD/dNlwEAnx7OejCLWGWf
 bbTuk6U2+TKgJa4X7+pbbejeoqnt5QU=
 =xfWx
 -----END PGP SIGNATURE-----

Merge tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull MM updates from Andrew Morton:

 - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in
   linux-next for a couple of months without, to my knowledge, any
   negative reports (or any positive ones, come to that).

 - Also the Maple Tree from Liam Howlett. An overlapping range-based
   tree for vmas. It it apparently slightly more efficient in its own
   right, but is mainly targeted at enabling work to reduce mmap_lock
   contention.

   Liam has identified a number of other tree users in the kernel which
   could be beneficially onverted to mapletrees.

   Yu Zhao has identified a hard-to-hit but "easy to fix" lockdep splat
   at [1]. This has yet to be addressed due to Liam's unfortunately
   timed vacation. He is now back and we'll get this fixed up.

 - Dmitry Vyukov introduces KMSAN: the Kernel Memory Sanitizer. It uses
   clang-generated instrumentation to detect used-unintialized bugs down
   to the single bit level.

   KMSAN keeps finding bugs. New ones, as well as the legacy ones.

 - Yang Shi adds a userspace mechanism (madvise) to induce a collapse of
   memory into THPs.

 - Zach O'Keefe has expanded Yang Shi's madvise(MADV_COLLAPSE) to
   support file/shmem-backed pages.

 - userfaultfd updates from Axel Rasmussen

 - zsmalloc cleanups from Alexey Romanov

 - cleanups from Miaohe Lin: vmscan, hugetlb_cgroup, hugetlb and
   memory-failure

 - Huang Ying adds enhancements to NUMA balancing memory tiering mode's
   page promotion, with a new way of detecting hot pages.

 - memcg updates from Shakeel Butt: charging optimizations and reduced
   memory consumption.

 - memcg cleanups from Kairui Song.

 - memcg fixes and cleanups from Johannes Weiner.

 - Vishal Moola provides more folio conversions

 - Zhang Yi removed ll_rw_block() :(

 - migration enhancements from Peter Xu

 - migration error-path bugfixes from Huang Ying

 - Aneesh Kumar added ability for a device driver to alter the memory
   tiering promotion paths. For optimizations by PMEM drivers, DRM
   drivers, etc.

 - vma merging improvements from Jakub Matěn.

 - NUMA hinting cleanups from David Hildenbrand.

 - xu xin added aditional userspace visibility into KSM merging
   activity.

 - THP & KSM code consolidation from Qi Zheng.

 - more folio work from Matthew Wilcox.

 - KASAN updates from Andrey Konovalov.

 - DAMON cleanups from Kaixu Xia.

 - DAMON work from SeongJae Park: fixes, cleanups.

 - hugetlb sysfs cleanups from Muchun Song.

 - Mike Kravetz fixes locking issues in hugetlbfs and in hugetlb core.

Link: https://lkml.kernel.org/r/CAOUHufZabH85CeUN-MEMgL8gJGzJEWUrkiM58JkTbBhh-jew0Q@mail.gmail.com [1]

* tag 'mm-stable-2022-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (555 commits)
  hugetlb: allocate vma lock for all sharable vmas
  hugetlb: take hugetlb vma_lock when clearing vma_lock->vma pointer
  hugetlb: fix vma lock handling during split vma and range unmapping
  mglru: mm/vmscan.c: fix imprecise comments
  mm/mglru: don't sync disk for each aging cycle
  mm: memcontrol: drop dead CONFIG_MEMCG_SWAP config symbol
  mm: memcontrol: use do_memsw_account() in a few more places
  mm: memcontrol: deprecate swapaccounting=0 mode
  mm: memcontrol: don't allocate cgroup swap arrays when memcg is disabled
  mm/secretmem: remove reduntant return value
  mm/hugetlb: add available_huge_pages() func
  mm: remove unused inline functions from include/linux/mm_inline.h
  selftests/vm: add selftest for MADV_COLLAPSE of uffd-minor memory
  selftests/vm: add file/shmem MADV_COLLAPSE selftest for cleared pmd
  selftests/vm: add thp collapse shmem testing
  selftests/vm: add thp collapse file and tmpfs testing
  selftests/vm: modularize thp collapse memory operations
  selftests/vm: dedup THP helpers
  mm/khugepaged: add tracepoint to hpage_collapse_scan_file()
  mm/madvise: add file and shmem support to MADV_COLLAPSE
  ...
2022-10-10 17:53:04 -07:00
Linus Torvalds
30c999937f Scheduler changes for v6.1:
- Debuggability:
 
      - Change most occurances of BUG_ON() to WARN_ON_ONCE()
 
      - Reorganize & fix TASK_ state comparisons, turn it into a bitmap
 
      - Update/fix misc scheduler debugging facilities
 
  - Load-balancing & regular scheduling:
 
      - Improve the behavior of the scheduler in presence of lot of
        SCHED_IDLE tasks - in particular they should not impact other
        scheduling classes.
 
      - Optimize task load tracking, cleanups & fixes
 
      - Clean up & simplify misc load-balancing code
 
  - Freezer:
 
      - Rewrite the core freezer to behave better wrt thawing and be simpler
        in general, by replacing PF_FROZEN with TASK_FROZEN & fixing/adjusting
        all the fallout.
 
  - Deadline scheduler:
 
      - Fix the DL capacity-aware code
 
      - Factor out dl_task_is_earliest_deadline() & replenish_dl_new_period()
 
      - Relax/optimize locking in task_non_contending()
 
  - Cleanups:
 
      - Factor out the update_current_exec_runtime() helper
 
      - Various cleanups, simplifications
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmM/01cRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1geZA/+PB4KC1T9aVxzaTHI36R03YgJYZmIdtxw
 wTf02MixePmz+gQCbepJbempGOh5ST28aOcI0xhdYOql5B63MaUBBMlB0HvGUyDG
 IU3zETqLMRtAbnSTdQFv8m++ECUtZYp8/x1FCel4WO7ya4ETkRu1NRfCoUepEhpZ
 aVAlae9LH3NBaF9t7s0PT2lTjf3pIzMFRkddJ0ywJhbFR3VnWat05fAK+J6fGY8+
 LS54coefNlJD4oDh5TY8uniL1j5SmWmmwbk9Cdj7bLU5P3dFSS0/+5FJNHJPVGDE
 srGT7wstRUcDrN0CnZo48VIUBiApJCCDqTfJYi9wNYd0NAHvwY6MIJJgEIY8mKsI
 L/qH26H81Wt+ezSZ/5JIlGlZ/LIeNaa6OO/fbWEYABBQogvvx3nxsRNUYKSQzumH
 CnSBasBjLnjWyLlK4qARM9cI7NFSEK6NUigrEx/7h8JFu/8T4DlSy6LsF1HUyKgq
 4+FJLAqG6cL0tcwB/fHYd0oRESN8dStnQhGxSojgufwLc7dlFULvCYF5JM/dX+/V
 IKwbOfIOeOn6ViMtSOXAEGdII+IQ2/ZFPwr+8Z5JC7NzvTVL6xlu/3JXkLZR3L7o
 yaXTSaz06h1vil7Z+GRf7RHc+wUeGkEpXh5vnarGZKXivhFdWsBdROIJANK+xR0i
 TeSLCxQxXlU=
 =KjMD
 -----END PGP SIGNATURE-----

Merge tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:
 "Debuggability:

   - Change most occurances of BUG_ON() to WARN_ON_ONCE()

   - Reorganize & fix TASK_ state comparisons, turn it into a bitmap

   - Update/fix misc scheduler debugging facilities

  Load-balancing & regular scheduling:

   - Improve the behavior of the scheduler in presence of lot of
     SCHED_IDLE tasks - in particular they should not impact other
     scheduling classes.

   - Optimize task load tracking, cleanups & fixes

   - Clean up & simplify misc load-balancing code

  Freezer:

   - Rewrite the core freezer to behave better wrt thawing and be
     simpler in general, by replacing PF_FROZEN with TASK_FROZEN &
     fixing/adjusting all the fallout.

  Deadline scheduler:

   - Fix the DL capacity-aware code

   - Factor out dl_task_is_earliest_deadline() &
     replenish_dl_new_period()

   - Relax/optimize locking in task_non_contending()

  Cleanups:

   - Factor out the update_current_exec_runtime() helper

   - Various cleanups, simplifications"

* tag 'sched-core-2022-10-07' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (41 commits)
  sched: Fix more TASK_state comparisons
  sched: Fix TASK_state comparisons
  sched/fair: Move call to list_last_entry() in detach_tasks
  sched/fair: Cleanup loop_max and loop_break
  sched/fair: Make sure to try to detach at least one movable task
  sched: Show PF_flag holes
  freezer,sched: Rewrite core freezer logic
  sched: Widen TAKS_state literals
  sched/wait: Add wait_event_state()
  sched/completion: Add wait_for_completion_state()
  sched: Add TASK_ANY for wait_task_inactive()
  sched: Change wait_task_inactive()s match_state
  freezer,umh: Clean up freezer/initrd interaction
  freezer: Have {,un}lock_system_sleep() save/restore flags
  sched: Rename task_running() to task_on_cpu()
  sched/fair: Cleanup for SIS_PROP
  sched/fair: Default to false in test_idle_cores()
  sched/fair: Remove useless check in select_idle_core()
  sched/fair: Avoid double search on same cpu
  sched/fair: Remove redundant check in select_idle_smt()
  ...
2022-10-10 09:10:28 -07:00
Qingqing Zhou
3e9d5f02f0 ANDROID: Configure out the macros in android_kabi and android_vendor
Add one CONFIG to control removing the macros or not. On some platform,
configureing out the macros removes the associated members from the
structs, this reduces the object size of the slabs related with the
structs, therefore reduces the total slab memory consumption of system.

Besides, this also reduces vmlinux size a bit, therefore the total
kernel memory size increses a bit.

The macros are ANDROID_KABI_RESERVE, ANDROID_VENDOR_DATA,
ANDROID_VENDOR_DATA_ARRAY, ANDROID_OEM_DATA, ANDROID_OEM_DATA_ARRAY.

Bug: 206561931
Signed-off-by: Qingqing Zhou <quic_qqzhou@quicinc.com>
Change-Id: Iea4b962dff386a17c9bef20ae048be4e17bf43ab
(cherry picked from commit b7a6c15a6f06cc7e324c8d63b87cdd06b5597851)
Signed-off-by: Jaskaran Singh <quic_jasksing@quicinc.com>
(cherry picked from commit 3c06a5ce5e5857a1dff88a784e58e32bbddaf759)
2022-10-10 16:46:40 +05:30
Linus Torvalds
493ffd6605 ucounts: Split rlimit and ucount values and max values
After the ucount rlimit code was merged a bunch of small but
 siginificant bugs were found and fixed.  At the time it was realized
 that part of the problem was that while the ucount rlimits were very
 similar to the oridinary ucounts (in being nested counts with limits)
 the semantics were slightly different and the code would be less error
 prone if there was less sharing.  This is the long awaited cleanup
 that should hopefully keep things more comprehensible and less error
 prone for whoever needs to touch that code next.
 
 Alexey Gladkov (1):
       ucounts: Split rlimit and ucount values and max values
 
  fs/exec.c                      |  2 +-
  fs/proc/array.c                |  2 +-
  include/linux/user_namespace.h | 35 ++++++++++++++++++++++-------------
  kernel/fork.c                  | 12 ++++++------
  kernel/sys.c                   |  2 +-
  kernel/ucount.c                | 34 +++++++++++++++-------------------
  kernel/user_namespace.c        | 10 +++++-----
  7 files changed, 51 insertions(+), 46 deletions(-)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgjlraLDcwBA2B+6cC/v6Eiajj0AFAmM7U4cACgkQC/v6Eiaj
 j0AbRA//RVrGJ9n5iYyHM7WgeoTlFbaupEyLTq5dEpkOMD9CEB4OpMymGA/VXbeX
 cjgF5dqykfrdpYBwJdosl1fgq15ZFe9ChKhPGQkI5CGlwyRYTl2kq+FrZLC790s8
 c4TN3fKO1DyQPn5+UNzlBgLP8ofiUqeScZJDGa+LeMlUIv1OFS3m05jHuG/uzl6b
 bbbdcn61tFKOFCapbE72hWusEQssPOAN+dSY1/lwKO05WOKR0N2CR0EHyZhW2Owd
 GIQ27Zh5ed/9xRNlxa8VIa+JDfuATbPeoWcvRmiWSEoAxKtPBUf8lwcltlHBUcKK
 72MH+KU9AaIZ1prq9ng4xEaM+vXiSSNspYB8siwph7au1gWx1Yu2yYVavEPeFB9o
 C0JaD7kTh6Mhk6xdPhnmFUHFOLLGC5LdnBcIwwoMb1jlwP4QJRVucbjpqaOptoiE
 SeWhRRKUBwpcQdztQZCR+X0h1paHRJJXplHFmeEGcMviGWntgKUaxXJQ4BJrnRTO
 pagn7h181KVF7u9Toh0IWzrd322mXNqmcgwhzE/S9pa5EJMQHt7qYkDzQCgEwoap
 JmIld9tKkv/0fYMOHordjMb1OY37feI7FyDAuZuLP1ZWYgKhOq0LrD5x8PzKmoyM
 6oKAOfXZUVT/Pnw21nEzAtHsazV3mLRpW+gLLiLSiWoSaYT4x14=
 =kjVh
 -----END PGP SIGNATURE-----

Merge tag 'ucount-rlimits-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull ucounts update from Eric Biederman:
 "Split rlimit and ucount values and max values

  After the ucount rlimit code was merged a bunch of small but
  siginificant bugs were found and fixed. At the time it was realized
  that part of the problem was that while the ucount rlimits were very
  similar to the oridinary ucounts (in being nested counts with limits)
  the semantics were slightly different and the code would be less error
  prone if there was less sharing.

  This is the long awaited cleanup that should hopefully keep things
  more comprehensible and less error prone for whoever needs to touch
  that code next"

* tag 'ucount-rlimits-cleanups-for-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  ucounts: Split rlimit and ucount values and max values
2022-10-09 16:24:05 -07:00
Linus Torvalds
e572410e47 ptrace: Stop supporting SIGKILL for PTRACE_EVENT_EXIT
Recently I had a conversation where it was pointed out to me that
 SIGKILL sent to a tracee stropped in PTRACE_EVENT_EXIT is quite
 difficult for a tracer to handle.
 
 Keeping SIGKILL working after the process has been killed is pain
 from an implementation point of view.
 
 So since the debuggers don't want this behavior let's see if we can
 remove this wart for the userspace API
 
 If a regression is detected it should only need to be the last change
 that is the reverted.  The other two are just general cleanups that
 make the last patch simpler.
 
 Eric W. Biederman (3):
       signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit
       signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit
       signal: Drop signals received after a fatal signal has been processed
 
  fs/coredump.c                |  2 +-
  include/linux/sched/signal.h |  1 +
  kernel/exit.c                | 20 +++++++++++++++++++-
  kernel/fork.c                |  2 ++
  kernel/signal.c              |  3 ++-
  5 files changed, 25 insertions(+), 3 deletions(-)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgjlraLDcwBA2B+6cC/v6Eiajj0AFAmM7U40ACgkQC/v6Eiaj
 j0B7eRAAst6EW4nkxiDBN/PRo43Kz7tkYCZGLAq73vZAaKkyTFSwghT85cZwTsuc
 px/iDPWZpSGdIeHhdt1giJeuFG0FuoMR9prQVx3z/fM6KLXEJb86OtW1c1uW00Bh
 TkhVPQiF/9bc+Eb/nRKF61NA4sP0OXwO1+t/zBL4clekO9vFLP1DpRBE9OrNlHq2
 NlDqoPqq6SsKYG8f+J2LJKKzRWLICvHCtz4uUt6O11Wt/PH2TZYdYnXf/2vvZyzS
 SOs8kQjw4QPSptcNH/LIZz0WNHagn1uU/2/T106LOgPgcr515T4MhqOK+Wp95BjA
 0RrhsfdMD+7HArqLmt9VKgKO9Gs+T/M6jQZgpUyzlw3qPorKUGu4s9UnUgS7l4uz
 oNV9no1Ei2fQ+YR6RBR74579a45FWkqRBsaia59KFCzZxRsQz8VB1cqcIgl9dFUA
 f81qt9FiX8duVYZIcoT79BvV1bQ3LGwyygrH+X3sDTQSdN/aeZ24JdGP2MNtYO/c
 jWN/mMVHc1xOsYmACVGETWhZf0Y7lGGBYSIJ92jT2HxIuEiqmFE4kngRjKcYgL/G
 1/o9z8VntMq5t+ZcQY5WfK/WpSeSPXa6TsP80PEm/hvdMwZLEO4IzCR+gPJB6oJS
 KPQ3EZfRCB2Jb1qBmcpbleA/RBA0iJUZtBvtIPI7QmMTR+VRdhc=
 =gX4y
 -----END PGP SIGNATURE-----

Merge tag 'signal-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace

Pull ptrace update from Eric Biederman:
 "ptrace: Stop supporting SIGKILL for PTRACE_EVENT_EXIT

  Recently I had a conversation where it was pointed out to me that
  SIGKILL sent to a tracee stropped in PTRACE_EVENT_EXIT is quite
  difficult for a tracer to handle.

  Keeping SIGKILL working after the process has been killed is pain from
  an implementation point of view.

  So since the debuggers don't want this behavior let's see if we can
  remove this wart for the userspace API

  If a regression is detected it should only need to be the last change
  that is the reverted. The other two are just general cleanups that
  make the last patch simpler"

* tag 'signal-for-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  signal: Drop signals received after a fatal signal has been processed
  signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit
  signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit
2022-10-09 16:14:15 -07:00
Alexander Potapenko
50b5e49ca6 kmsan: handle task creation and exiting
Tell KMSAN that a new task is created, so the tool creates a backing
metadata structure for that task.

Link: https://lkml.kernel.org/r/20220915150417.722975-17-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Marco Elver <elver@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-03 14:03:20 -07:00
Mike Kravetz
8d9bfb2608 hugetlb: add vma based lock for pmd sharing
Allocate a new hugetlb_vma_lock structure and hang off vm_private_data for
synchronization use by vmas that could be involved in pmd sharing.  This
data structure contains a rw semaphore that is the primary tool used for
synchronization.

This new structure is ref counted, so that it can exist when NOT attached
to a vma.  This is only helpful in resolving lock ordering issues where
code may need to obtain the vma_lock while there are no guarantees the vma
may go away.  By obtaining a ref on the structure, it can be guaranteed
that at least the rw semaphore will not go away.

Only add infrastructure for the new lock here.  Actual use will be added
in subsequent patches.

[mike.kravetz@oracle.com: fix build issue for missing hugetlb_vma_lock_release]
  Link: https://lkml.kernel.org/r/YyNUtA1vRASOE4+M@monkey
Link: https://lkml.kernel.org/r/20220914221810.95771-7-mike.kravetz@oracle.com
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: James Houghton <jthoughton@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Prakash Sangappa <prakash.sangappa@oracle.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-10-03 14:03:17 -07:00
Liam R. Howlett
763ecb0350 mm: remove the vma linked list
Replace any vm_next use with vma_find().

Update free_pgtables(), unmap_vmas(), and zap_page_range() to use the
maple tree.

Use the new free_pgtables() and unmap_vmas() in do_mas_align_munmap().  At
the same time, alter the loop to be more compact.

Now that free_pgtables() and unmap_vmas() take a maple tree as an
argument, rearrange do_mas_align_munmap() to use the new tree to hold the
vmas to remove.

Remove __vma_link_list() and __vma_unlink_list() as they are exclusively
used to update the linked list.

Drop linked list update from __insert_vm_struct().

Rework validation of tree as it was depending on the linked list.

[yang.lee@linux.alibaba.com: fix one kernel-doc comment]
  Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=1949
  Link: https://lkml.kernel.org/r/20220824021918.94116-1-yang.lee@linux.alibaba.comLink: https://lkml.kernel.org/r/20220906194824.2110408-69-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:26 -07:00
Matthew Wilcox (Oracle)
fa5e587679 fork: use VMA iterator
The VMA iterator is faster than the linked list and removing the linked
list will shrink the vm_area_struct.

Link: https://lkml.kernel.org/r/20220906194824.2110408-50-Liam.Howlett@oracle.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:22 -07:00
Liam R. Howlett
7964cf8caa mm: remove vmacache
By using the maple tree and the maple tree state, the vmacache is no
longer beneficial and is complicating the VMA code.  Remove the vmacache
to reduce the work in keeping it up to date and code complexity.

Link: https://lkml.kernel.org/r/20220906194824.2110408-26-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:18 -07:00
Liam R. Howlett
c9dbe82cb9 kernel/fork: use maple tree for dup_mmap() during forking
The maple tree was already tracking VMAs in this function by an earlier
commit, but the rbtree iterator was being used to iterate the list.
Change the iterator to use a maple tree native iterator and switch to the
maple tree advanced API to avoid multiple walks of the tree during insert
operations.  Unexport the now-unused vma_store() function.

For performance reasons we bulk allocate the maple tree nodes.  The node
calculations are done internally to the tree and use the VMA count and
assume the worst-case node requirements.  The VM_DONT_COPY flag does not
allow for the most efficient copy method of the tree and so a bulk loading
algorithm is used.

Link: https://lkml.kernel.org/r/20220906194824.2110408-15-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:16 -07:00
Liam R. Howlett
524e00b36e mm: remove rb tree.
Remove the RB tree and start using the maple tree for vm_area_struct
tracking.

Drop validate_mm() calls in expand_upwards() and expand_downwards() as the
lock is not held.

Link: https://lkml.kernel.org/r/20220906194824.2110408-18-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:16 -07:00
Liam R. Howlett
d4af56c5c7 mm: start tracking VMAs with maple tree
Start tracking the VMAs with the new maple tree structure in parallel with
the rb_tree.  Add debug and trace events for maple tree operations and
duplicate the rb_tree that is created on forks into the maple tree.

The maple tree is added to the mm_struct including the mm_init struct,
added support in required mm/mmap functions, added tracking in kernel/fork
for process forking, and used to find the unmapped_area and checked
against what the rbtree finds.

This also moves the mmap_lock() in exit_mmap() since the oom reaper call
does walk the VMAs.  Otherwise lockdep will be unhappy if oom happens.

When splitting a vma fails due to allocations of the maple tree nodes,
the error path in __split_vma() calls new->vm_ops->close(new).  The page
accounting for hugetlb is actually in the close() operation,  so it
accounts for the removal of 1/2 of the VMA which was not adjusted.  This
results in a negative exit value.  To avoid the negative charge, set
vm_start = vm_end and vm_pgoff = 0.

There is also a potential accounting issue in special mappings from
insert_vm_struct() failing to allocate, so reverse the charge there in
the failure scenario.

Link: https://lkml.kernel.org/r/20220906194824.2110408-9-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: Yu Zhao <yuzhao@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: SeongJae Park <sj@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:14 -07:00
Yu Zhao
bd74fdaea1 mm: multi-gen LRU: support page table walks
To further exploit spatial locality, the aging prefers to walk page tables
to search for young PTEs and promote hot pages.  A kill switch will be
added in the next patch to disable this behavior.  When disabled, the
aging relies on the rmap only.

NB: this behavior has nothing similar with the page table scanning in the
2.4 kernel [1], which searches page tables for old PTEs, adds cold pages
to swapcache and unmaps them.

To avoid confusion, the term "iteration" specifically means the traversal
of an entire mm_struct list; the term "walk" will be applied to page
tables and the rmap, as usual.

An mm_struct list is maintained for each memcg, and an mm_struct follows
its owner task to the new memcg when this task is migrated.  Given an
lruvec, the aging iterates lruvec_memcg()->mm_list and calls
walk_page_range() with each mm_struct on this list to promote hot pages
before it increments max_seq.

When multiple page table walkers iterate the same list, each of them gets
a unique mm_struct; therefore they can run concurrently.  Page table
walkers ignore any misplaced pages, e.g., if an mm_struct was migrated,
pages it left in the previous memcg will not be promoted when its current
memcg is under reclaim.  Similarly, page table walkers will not promote
pages from nodes other than the one under reclaim.

This patch uses the following optimizations when walking page tables:
1. It tracks the usage of mm_struct's between context switches so that
   page table walkers can skip processes that have been sleeping since
   the last iteration.
2. It uses generational Bloom filters to record populated branches so
   that page table walkers can reduce their search space based on the
   query results, e.g., to skip page tables containing mostly holes or
   misplaced pages.
3. It takes advantage of the accessed bit in non-leaf PMD entries when
   CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG=y.
4. It does not zigzag between a PGD table and the same PMD table
   spanning multiple VMAs. IOW, it finishes all the VMAs within the
   range of the same PMD table before it returns to a PGD table. This
   improves the cache performance for workloads that have large
   numbers of tiny VMAs [2], especially when CONFIG_PGTABLE_LEVELS=5.

Server benchmark results:
  Single workload:
    fio (buffered I/O): no change

  Single workload:
    memcached (anon): +[8, 10]%
                Ops/sec      KB/sec
      patch1-7: 1147696.57   44640.29
      patch1-8: 1245274.91   48435.66

  Configurations:
    no change

Client benchmark results:
  kswapd profiles:
    patch1-7
      48.16%  lzo1x_1_do_compress (real work)
       8.20%  page_vma_mapped_walk (overhead)
       7.06%  _raw_spin_unlock_irq
       2.92%  ptep_clear_flush
       2.53%  __zram_bvec_write
       2.11%  do_raw_spin_lock
       2.02%  memmove
       1.93%  lru_gen_look_around
       1.56%  free_unref_page_list
       1.40%  memset

    patch1-8
      49.44%  lzo1x_1_do_compress (real work)
       6.19%  page_vma_mapped_walk (overhead)
       5.97%  _raw_spin_unlock_irq
       3.13%  get_pfn_folio
       2.85%  ptep_clear_flush
       2.42%  __zram_bvec_write
       2.08%  do_raw_spin_lock
       1.92%  memmove
       1.44%  alloc_zspage
       1.36%  memset

  Configurations:
    no change

Thanks to the following developers for their efforts [3].
  kernel test robot <lkp@intel.com>

[1] https://lwn.net/Articles/23732/
[2] https://llvm.org/docs/ScudoHardenedAllocator.html
[3] https://lore.kernel.org/r/202204160827.ekEARWQo-lkp@intel.com/

Link: https://lkml.kernel.org/r/20220918080010.2920238-9-yuzhao@google.com
Signed-off-by: Yu Zhao <yuzhao@google.com>
Acked-by: Brian Geffon <bgeffon@google.com>
Acked-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Acked-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Acked-by: Steven Barrett <steven@liquorix.net>
Acked-by: Suleiman Souhlal <suleiman@google.com>
Tested-by: Daniel Byrne <djbyrne@mtu.edu>
Tested-by: Donald Carr <d@chaos-reins.com>
Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
Tested-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Tested-by: Shuang Zhai <szhai2@cs.rochester.edu>
Tested-by: Sofia Trinh <sofia.trinh@edi.works>
Tested-by: Vaibhav Jain <vaibhav@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michael Larabel <Michael@MichaelLarabel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-09-26 19:46:09 -07:00
Greg Kroah-Hartman
39d2e77918 Merge dc164f4fb0 ("Merge tag 'for-linus-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/uml/linux") into android-mainline
Steps on the way to 6.0-rc7

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3b3bab694ec08989894b82b9f0dfdbdf5c299755
2022-09-22 15:56:57 +02:00
Greg Kroah-Hartman
498b9a4519 Merge 087aa69a9f ("Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux") into android-mainline
Steps on the way to 6.0-rc5

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id10d98a4f06618350adb4a594838c45519264c9e
2022-09-20 17:59:24 +02:00
Linus Torvalds
f489921dba execve reverts for v6.0-rc7
- Remove the recent "unshare time namespace on vfork+exec" feature (Andrei Vagin)
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmMoxpIWHGtlZXNjb29r
 QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJpd/D/9V7iLUZoquMvXFonv//sRH21P+
 u7vH03q0X4lSov73jdjizq8znZl9RVO14IYi+6lQE8VHyOjzjBoTALRPnirNCyGa
 Ia8P+LPaOHDTDQmGqt+9xmPKp3z0qwrpWWyTrFHLo7GRzWtI0QjQsSlgUTIz7jCw
 dSwLRWN6n7d3hzNzFWt9VUOOlzpip8NTcnAbC9YA5dPFLO85+wZ4ZpMYYfFJMcQj
 N/Zm63lrqAU0wy7EhonkKJQDjgRP/zYUs6VJMejHqYl951SrZJ+DgXEGaAwR14Sz
 IZAUhSM5Fl8alhkrcmlkiy9A5P014iVRR6AaSyeT2616fac97wY1EWHxvBMqzNsB
 AJJqjPHoN+mc8cqt9lMyIhbmS8WkTuyTHziEcFyyTVsNYGYN6x9hVVZalqPrl8o3
 Y3zC6MfRK33JNVB2GZVUzsf5EZC3mjz9VJKKmLwYmG4X7/JOvIVCiW123b060T7z
 b49PzI+0rTG8SHTk1I/T8NpWuvLRTCglzZK06q971uyT80xPoGD/HmSpmm+86dHs
 k3WV2qBoz31Eaoewa3NJqn6pBxQLy9WAZP6rJb3aQSFwDRCuvKO4CUpHAXILt5U+
 SoarR5445zVzY3NYHaf/3BRsEnCQS06U67ma0lAmMWk4J3ehFOY0DrRqtLJ02iwd
 sKJD/KnKC+IEcLjrAA==
 =yFGx
 -----END PGP SIGNATURE-----

Merge tag 'execve-v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull execve reverts from Kees Cook:
 "The recent work to support time namespace unsharing turns out to have
  some undesirable corner cases, so rather than allowing the API to stay
  exposed for another release, it'd be best to remove it ASAP, with the
  replacement getting another cycle of testing. Nothing is known to use
  this yet, so no userspace breakage is expected.

  For more details, see:

    https://lore.kernel.org/lkml/ed418e43ad28b8688cfea2b7c90fce1c@ispras.ru

  Summary:

   - Remove the recent 'unshare time namespace on vfork+exec' feature
     (Andrei Vagin)"

* tag 'execve-v6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  Revert "fs/exec: allow to unshare a time namespace on vfork+exec"
  Revert "selftests/timens: add a test for vfork+exit"
2022-09-20 08:38:55 -07:00