Commit Graph

36576 Commits

Author SHA1 Message Date
Greg Kroah-Hartman
49c25af89c Revert "bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE"
This reverts commit 08f61a3491 which is
commit 9cacf81f8161111db25f98e78a7a0e32ae142b3f upstream.

It breaks the Android abi.  If it is required in the future, it can come
back in an abi-safe way.

Bug: 161946584
Change-Id: I83c4a094c650eee44a2f7160aab6ccc6e442e726
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-08-04 11:36:48 +00:00
Greg Kroah-Hartman
938b8658b9 Revert "posix-timers: Ensure timer ID search-loop limit is valid"
This reverts commit 322377cc90 which is
commit 8ce8849dd1e78dadcee0ec9acbd259d239b7069f upstream.

It breaks the Android abi.  If it is required in the future, it can come
back in an abi-safe way.

Bug: 161946584
Change-Id: I44be0f7b4df730e599bf80939b6d40d4f8d04a57
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-08-04 07:19:15 +00:00
Greg Kroah-Hartman
477f5e6b9e This is the 5.10.188 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmTCEmYACgkQONu9yGCS
 aT5ETA/+MGhe+GasO74Gvx1MaSVJrPZgPzInUg5UoYIkf+N3BfNqH9KVrY/zFKfU
 mKNQSQDsli+WG8agHVzoa4lh3ZFHbiUrNx14n+3A8lZ0X5s31fqTLXRvKy9BCu4t
 8OQW6nuMv22SVDd40F5ciroNmAbDquDfUQK4KbETNRPU2Yzvd5VEZiCY9aQAGFbc
 YnqBbx1Qc5EQKmzoBmEiup2j04SWXwMPQERKdFVZ1jrjC3hC8MFmL62YwfbCH4gY
 faDSZPj++/V5c++bP6oG8QhfrQS+WYGwFmEJpf4GUJ8dxxJC9Ao9CwcXbd2jOjfz
 Tk0gNQ9YPs+a2gexAnaHsJqKXn+dcRvkIMzmArApZv73PET0LgMv8N7s3OB5E9ei
 K2ft+nfXs5NCLRjPFCqL9nAeclj8ZX92B4d4mrpbqHZ+fFBiHMb0H/aGxfCAR0MJ
 BuW1dWQJykR2crhzQ1PJr3OthnL9O4Nl+bBAAuOu6NwqiALFW57uKXQ/2xfhPPbI
 qi0cTyXNYYY28kRdprERyV1w4K8W8V6L2YUt3N8LWuPNsI9pHSSQQDKru2JIR1T5
 rHeC41JSR6iw8rBXtkCj1YhGbH5P8CP3fxlikuKo3Q4PHCjVJo8ZpzYU/Ci8FFCL
 g/g6DLb9/AHtIhJ8WgcRcxbRNkdyGUc2w9uh6c3rBVS4gwFm/44=
 =2pvu
 -----END PGP SIGNATURE-----

Merge 5.10.188 into android12-5.10-lts

Changes in 5.10.188
	media: atomisp: fix "variable dereferenced before check 'asd'"
	x86/smp: Use dedicated cache-line for mwait_play_dead()
	can: isotp: isotp_sendmsg(): fix return error fix on TX path
	video: imsttfb: check for ioremap() failures
	fbdev: imsttfb: Fix use after free bug in imsttfb_probe
	HID: wacom: Use ktime_t rather than int when dealing with timestamps
	HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
	Revert "thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe"
	scripts/tags.sh: Resolve gtags empty index generation
	drm/amdgpu: Validate VM ioctl flags.
	nubus: Partially revert proc_create_single_data() conversion
	fs: pipe: reveal missing function protoypes
	x86/resctrl: Only show tasks' pid in current pid namespace
	blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost
	md/raid10: check slab-out-of-bounds in md_bitmap_get_counter
	md/raid10: fix overflow of md/safe_mode_delay
	md/raid10: fix wrong setting of max_corr_read_errors
	md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
	md/raid10: fix io loss while replacement replace rdev
	irqchip/jcore-aic: Kill use of irq_create_strict_mappings()
	irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
	posix-timers: Prevent RT livelock in itimer_delete()
	tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode().
	clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe
	PM: domains: fix integer overflow issues in genpd_parse_state()
	perf/arm-cmn: Fix DTC reset
	powercap: RAPL: Fix CONFIG_IOSF_MBI dependency
	ARM: 9303/1: kprobes: avoid missing-declaration warnings
	cpufreq: intel_pstate: Fix energy_performance_preference for passive
	thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe()
	rcuscale: Console output claims too few grace periods
	rcuscale: Always log error message
	rcuscale: Move shutdown from wait_event() to wait_event_idle()
	rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()
	rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale
	perf/ibs: Fix interface via core pmu events
	x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
	evm: Complete description of evm_inode_setattr()
	ima: Fix build warnings
	pstore/ram: Add check for kstrdup
	igc: Enable and fix RX hash usage by netstack
	wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation
	wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx
	samples/bpf: Fix buffer overflow in tcp_basertt
	spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG
	wifi: wilc1000: fix for absent RSN capabilities WFA testcase
	wifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan()
	bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE
	sctp: add bpf_bypass_getsockopt proto callback
	libbpf: fix offsetof() and container_of() to work with CO-RE
	nfc: constify several pointers to u8, char and sk_buff
	nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
	bpftool: JIT limited misreported as negative value on aarch64
	regulator: core: Fix more error checking for debugfs_create_dir()
	regulator: core: Streamline debugfs operations
	wifi: orinoco: Fix an error handling path in spectrum_cs_probe()
	wifi: orinoco: Fix an error handling path in orinoco_cs_probe()
	wifi: atmel: Fix an error handling path in atmel_probe()
	wl3501_cs: Fix misspelling and provide missing documentation
	net: create netdev->dev_addr assignment helpers
	wl3501_cs: use eth_hw_addr_set()
	wifi: wl3501_cs: Fix an error handling path in wl3501_probe()
	wifi: ray_cs: Utilize strnlen() in parse_addr()
	wifi: ray_cs: Drop useless status variable in parse_addr()
	wifi: ray_cs: Fix an error handling path in ray_probe()
	wifi: ath9k: don't allow to overwrite ENDPOINT0 attributes
	wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled
	wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown
	watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config
	watchdog/perf: more properly prevent false positives with turbo modes
	kexec: fix a memory leak in crash_shrink_memory()
	memstick r592: make memstick_debug_get_tpc_name() static
	wifi: ath9k: Fix possible stall on ath9k_txq_list_has_key()
	rtnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO
	wifi: iwlwifi: pull from TXQs with softirqs disabled
	wifi: cfg80211: rewrite merging of inherited elements
	wifi: ath9k: convert msecs to jiffies where needed
	igc: Fix race condition in PTP tx code
	net: stmmac: fix double serdes powerdown
	netlink: fix potential deadlock in netlink_set_err()
	netlink: do not hard code device address lenth in fdb dumps
	selftests: rtnetlink: remove netdevsim device after ipsec offload test
	gtp: Fix use-after-free in __gtp_encap_destroy().
	net: axienet: Move reset before 64-bit DMA detection
	sfc: fix crash when reading stats while NIC is resetting
	nfc: llcp: simplify llcp_sock_connect() error paths
	net: nfc: Fix use-after-free caused by nfc_llcp_find_local
	lib/ts_bm: reset initial match offset for every block of text
	netfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one
	netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value.
	ipvlan: Fix return value of ipvlan_queue_xmit()
	netlink: Add __sock_i_ino() for __netlink_diag_dump().
	radeon: avoid double free in ci_dpm_init()
	drm/amd/display: Explicitly specify update type per plane info change
	Input: drv260x - sleep between polling GO bit
	drm/bridge: tc358768: always enable HS video mode
	drm/bridge: tc358768: fix PLL parameters computation
	drm/bridge: tc358768: fix PLL target frequency
	drm/bridge: tc358768: fix TCLK_ZEROCNT computation
	drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation
	drm/bridge: tc358768: fix TCLK_TRAILCNT computation
	drm/bridge: tc358768: fix THS_ZEROCNT computation
	drm/bridge: tc358768: fix TXTAGOCNT computation
	drm/bridge: tc358768: fix THS_TRAILCNT computation
	drm/vram-helper: fix function names in vram helper doc
	ARM: dts: BCM5301X: Drop "clock-names" from the SPI node
	ARM: dts: meson8b: correct uart_B and uart_C clock references
	Input: adxl34x - do not hardcode interrupt trigger type
	drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks`
	drm/panel: sharp-ls043t1le01: adjust mode settings
	ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards
	bus: ti-sysc: Fix dispc quirk masking bool variables
	arm64: dts: microchip: sparx5: do not use PSCI on reference boards
	RDMA/bnxt_re: Disable/kill tasklet only if it is enabled
	RDMA/bnxt_re: Fix to remove unnecessary return labels
	RDMA/bnxt_re: Use unique names while registering interrupts
	RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid
	RDMA/bnxt_re: Fix to remove an unnecessary log
	ARM: dts: gta04: Move model property out of pinctrl node
	arm64: dts: qcom: msm8916: correct camss unit address
	arm64: dts: qcom: msm8994: correct SPMI unit address
	arm64: dts: qcom: msm8996: correct camss unit address
	drm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H
	ARM: ep93xx: fix missing-prototype warnings
	ARM: omap2: fix missing tick_broadcast() prototype
	arm64: dts: qcom: apq8096: fix fixed regulator name property
	ARM: dts: stm32: Shorten the AV96 HDMI sound card name
	memory: brcmstb_dpfe: fix testing array offset after use
	ASoC: es8316: Increment max value for ALC Capture Target Volume control
	ASoC: es8316: Do not set rate constraints for unsupported MCLKs
	ARM: dts: meson8: correct uart_B and uart_C clock references
	soc/fsl/qe: fix usb.c build errors
	IB/hfi1: Use bitmap_zalloc() when applicable
	IB/hfi1: Fix sdma.h tx->num_descs off-by-one errors
	IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate
	RDMA: Remove uverbs_ex_cmd_mask values that are linked to functions
	RDMA/hns: Fix coding style issues
	RDMA/hns: Use refcount_t APIs for HEM
	RDMA/hns: Clean the hardware related code for HEM
	RDMA/hns: Fix hns_roce_table_get return value
	ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier
	arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1
	fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
	arm64: dts: ti: k3-j7200: Fix physical address of pin
	ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2
	ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx
	hwmon: (gsc-hwmon) fix fan pwm temperature scaling
	hwmon: (adm1275) enable adm1272 temperature reporting
	hwmon: (adm1275) Allow setting sample averaging
	hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272
	ARM: dts: BCM5301X: fix duplex-full => full-duplex
	drm/amdkfd: Fix potential deallocation of previously deallocated memory.
	drm/radeon: fix possible division-by-zero errors
	amdgpu: validate offset_in_bo of drm_amdgpu_gem_va
	RDMA/bnxt_re: wraparound mbox producer index
	RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context
	clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe
	clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
	clk: tegra: tegra124-emc: Fix potential memory leak
	ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
	drm/msm/dpu: do not enable color-management if DSPPs are not available
	drm/msm/dp: Free resources after unregistering them
	clk: vc5: check memory returned by kasprintf()
	clk: cdce925: check return value of kasprintf()
	clk: si5341: Allow different output VDD_SEL values
	clk: si5341: Add sysfs properties to allow checking/resetting device faults
	clk: si5341: return error if one synth clock registration fails
	clk: si5341: check return value of {devm_}kasprintf()
	clk: si5341: free unused memory on probe failure
	clk: keystone: sci-clk: check return value of kasprintf()
	clk: ti: clkctrl: check return value of kasprintf()
	drivers: meson: secure-pwrc: always enable DMA domain
	ovl: update of dentry revalidate flags after copy up
	ASoC: imx-audmix: check return value of devm_kasprintf()
	PCI: cadence: Fix Gen2 Link Retraining process
	scsi: qedf: Fix NULL dereference in error handling
	pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors
	PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free
	scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()
	PCI: pciehp: Cancel bringup sequence if card is not present
	PCI: ftpci100: Release the clock resources
	PCI: Add pci_clear_master() stub for non-CONFIG_PCI
	perf bench: Use unbuffered output when pipe/tee'ing to a file
	perf bench: Add missing setlocale() call to allow usage of %'d style formatting
	pinctrl: cherryview: Return correct value if pin in push-pull mode
	kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
	perf script: Fixup 'struct evsel_script' method prefix
	perf script: Fix allocation of evsel->priv related to per-event dump files
	perf dwarf-aux: Fix off-by-one in die_get_varname()
	pinctrl: at91-pio4: check return value of devm_kasprintf()
	powerpc/powernv/sriov: perform null check on iov before dereferencing iov
	mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *
	mm: rename p4d_page_vaddr to p4d_pgtable and make it return pud_t *
	powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo
	powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary
	hwrng: virtio - add an internal buffer
	hwrng: virtio - don't wait on cleanup
	hwrng: virtio - don't waste entropy
	hwrng: virtio - always add a pending request
	hwrng: virtio - Fix race on data_avail and actual data
	crypto: nx - fix build warnings when DEBUG_FS is not enabled
	modpost: fix section mismatch message for R_ARM_ABS32
	modpost: fix section mismatch message for R_ARM_{PC24,CALL,JUMP24}
	crypto: marvell/cesa - Fix type mismatch warning
	modpost: fix off by one in is_executable_section()
	ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard
	NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION
	dax: Fix dax_mapping_release() use after free
	dax: Introduce alloc_dev_dax_id()
	hwrng: st - keep clock enabled while hwrng is registered
	io_uring: ensure IOPOLL locks around deferred work
	USB: serial: option: add LARA-R6 01B PIDs
	usb: dwc3: gadget: Propagate core init errors to UDC during pullup
	phy: tegra: xusb: Clear the driver reference in usb-phy dev
	block: fix signed int overflow in Amiga partition support
	block: change all __u32 annotations to __be32 in affs_hardblocks.h
	SUNRPC: Fix UAF in svc_tcp_listen_data_ready()
	w1: w1_therm: fix locking behavior in convert_t
	w1: fix loop in w1_fini()
	sh: j2: Use ioremap() to translate device tree address into kernel memory
	serial: 8250: omap: Fix freeing of resources on failed register
	clk: qcom: gcc-ipq6018: Use floor ops for sdcc clocks
	media: usb: Check az6007_read() return value
	media: videodev2.h: Fix struct v4l2_input tuner index comment
	media: usb: siano: Fix warning due to null work_func_t function pointer
	clk: qcom: reset: Allow specifying custom reset delay
	clk: qcom: reset: support resetting multiple bits
	clk: qcom: ipq6018: fix networking resets
	usb: dwc3: qcom: Fix potential memory leak
	usb: gadget: u_serial: Add null pointer check in gserial_suspend
	extcon: Fix kernel doc of property fields to avoid warnings
	extcon: Fix kernel doc of property capability fields to avoid warnings
	usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe()
	usb: hide unused usbfs_notify_suspend/resume functions
	serial: 8250: lock port for stop_rx() in omap8250_irq()
	serial: 8250: lock port for UART_IER access in omap8250_irq()
	kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR
	coresight: Fix loss of connection info when a module is unloaded
	mfd: rt5033: Drop rt5033-battery sub-device
	media: venus: helpers: Fix ALIGN() of non power of two
	media: atomisp: gmin_platform: fix out_len in gmin_get_config_dsm_var()
	KVM: s390: fix KVM_S390_GET_CMMA_BITS for GFNs in memslot holes
	usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()
	usb: dwc3: qcom: Fix an error handling path in dwc3_qcom_probe()
	usb: common: usb-conn-gpio: Set last role to unknown before initial detection
	usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe()
	mfd: intel-lpss: Add missing check for platform_get_resource
	Revert "usb: common: usb-conn-gpio: Set last role to unknown before initial detection"
	serial: 8250_omap: Use force_suspend and resume for system suspend
	test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation
	mfd: stmfx: Fix error path in stmfx_chip_init
	mfd: stmfx: Nullify stmfx->vdd in case of error
	KVM: s390: vsie: fix the length of APCB bitmap
	mfd: stmpe: Only disable the regulators if they are enabled
	phy: tegra: xusb: check return value of devm_kzalloc()
	pwm: imx-tpm: force 'real_period' to be zero in suspend
	pwm: sysfs: Do not apply state to already disabled PWMs
	rtc: st-lpc: Release some resources in st_rtc_probe() in case of error
	media: cec: i2c: ch7322: also select REGMAP
	sctp: fix potential deadlock on &net->sctp.addr_wq_lock
	Add MODULE_FIRMWARE() for FIRMWARE_TG357766.
	net: dsa: vsc73xx: fix MTU configuration
	spi: bcm-qspi: return error if neither hif_mspi nor mspi is available
	mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0
	f2fs: fix error path handling in truncate_dnode()
	octeontx2-af: Fix mapping for NIX block from CGX connection
	powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y
	net: bridge: keep ports without IFF_UNICAST_FLT in BR_PROMISC mode
	tcp: annotate data races in __tcp_oow_rate_limited()
	xsk: Honor SO_BINDTODEVICE on bind
	net/sched: act_pedit: Add size check for TCA_PEDIT_PARMS_EX
	pptp: Fix fib lookup calls.
	net: dsa: tag_sja1105: fix MAC DA patching from meta frames
	s390/qeth: Fix vipa deletion
	sh: dma: Fix DMA channel offset calculation
	apparmor: fix missing error check for rhashtable_insert_fast
	i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process()
	i2c: xiic: Don't try to handle more interrupt events after error
	ALSA: jack: Fix mutex call in snd_jack_report()
	i2c: qup: Add missing unwind goto in qup_i2c_probe()
	NFSD: add encoding of op_recall flag for write delegation
	io_uring: wait interruptibly for request completions on exit
	mmc: core: disable TRIM on Kingston EMMC04G-M627
	mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M
	mmc: mmci: Set PROBE_PREFER_ASYNCHRONOUS
	mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used.
	bcache: fixup btree_cache_wait list damage
	bcache: Remove unnecessary NULL point check in node allocations
	bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent
	um: Use HOST_DIR for mrproper
	integrity: Fix possible multiple allocation in integrity_inode_get()
	autofs: use flexible array in ioctl structure
	shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs
	jffs2: reduce stack usage in jffs2_build_xattr_subsystem()
	fs: avoid empty option when generating legacy mount string
	ext4: Remove ext4 locking of moved directory
	Revert "f2fs: fix potential corruption when moving a directory"
	fs: Establish locking order for unrelated directories
	fs: Lock moved directories
	btrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile
	btrfs: fix race when deleting quota root from the dirty cow roots list
	ASoC: mediatek: mt8173: Fix irq error path
	ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path
	ARM: orion5x: fix d2net gpio initialization
	leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename
	fs: no need to check source
	fanotify: disallow mount/sb marks on kernel internal pseudo fs
	tpm, tpm_tis: Claim locality in interrupt handler
	selftests/bpf: Add verifier test for PTR_TO_MEM spill
	block: add overflow checks for Amiga partition support
	sh: pgtable-3level: Fix cast to pointer from integer of different size
	netfilter: nf_tables: use net_generic infra for transaction data
	netfilter: nf_tables: add rescheduling points during loop detection walks
	netfilter: nf_tables: incorrect error path handling with NFT_MSG_NEWRULE
	netfilter: nf_tables: fix chain binding transaction logic
	netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain
	netfilter: nf_tables: reject unbound anonymous set before commit phase
	netfilter: nf_tables: reject unbound chain set before commit phase
	netfilter: nftables: rename set element data activation/deactivation functions
	netfilter: nf_tables: drop map element references from preparation phase
	netfilter: nf_tables: unbind non-anonymous set if rule construction fails
	netfilter: nf_tables: fix scheduling-while-atomic splat
	netfilter: conntrack: Avoid nf_ct_helper_hash uses after free
	netfilter: nf_tables: do not ignore genmask when looking up chain by id
	netfilter: nf_tables: prevent OOB access in nft_byteorder_eval
	wireguard: queueing: use saner cpu selection wrapping
	wireguard: netlink: send staged packets when setting initial private key
	tty: serial: fsl_lpuart: add earlycon for imx8ulp platform
	rcu-tasks: Mark ->trc_reader_nesting data races
	rcu-tasks: Mark ->trc_reader_special.b.need_qs data races
	rcu-tasks: Simplify trc_read_check_handler() atomic operations
	block/partition: fix signedness issue for Amiga partitions
	io_uring: Use io_schedule* in cqring wait
	io_uring: add reschedule point to handle_tw_list()
	net: lan743x: Don't sleep in atomic context
	workqueue: clean up WORK_* constant types, clarify masking
	drm/panel: simple: Add connector_type for innolux_at043tn24
	drm/panel: simple: Add Powertip PH800480T013 drm_display_mode flags
	igc: Remove delay during TX ring configuration
	net/mlx5e: fix double free in mlx5e_destroy_flow_table
	net/mlx5e: Check for NOT_READY flag state after locking
	igc: set TP bit in 'supported' and 'advertising' fields of ethtool_link_ksettings
	scsi: qla2xxx: Fix error code in qla2x00_start_sp()
	net: mvneta: fix txq_map in case of txq_number==1
	net/sched: cls_fw: Fix improper refcount update leads to use-after-free
	gve: Set default duplex configuration to full
	ionic: remove WARN_ON to prevent panic_on_warn
	net: bgmac: postpone turning IRQs off to avoid SoC hangs
	net: prevent skb corruption on frag list segmentation
	icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev().
	udp6: fix udp6_ehashfn() typo
	ntb: idt: Fix error handling in idt_pci_driver_init()
	NTB: amd: Fix error handling in amd_ntb_pci_driver_init()
	ntb: intel: Fix error handling in intel_ntb_pci_driver_init()
	NTB: ntb_transport: fix possible memory leak while device_register() fails
	NTB: ntb_tool: Add check for devm_kcalloc
	ipv6/addrconf: fix a potential refcount underflow for idev
	platform/x86: wmi: remove unnecessary argument
	platform/x86: wmi: use guid_t and guid_equal()
	platform/x86: wmi: move variables
	platform/x86: wmi: Break possible infinite loop when parsing GUID
	igc: Fix launchtime before start of cycle
	igc: Fix inserting of empty frame for launchtime
	riscv: bpf: Move bpf_jit_alloc_exec() and bpf_jit_free_exec() to core
	riscv: bpf: Avoid breaking W^X
	bpf, riscv: Support riscv jit to provide bpf_line_info
	riscv, bpf: Fix inconsistent JIT image generation
	erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF
	wifi: airo: avoid uninitialized warning in airo_get_rate()
	net/sched: flower: Ensure both minimum and maximum ports are specified
	netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write()
	net/sched: make psched_mtu() RTNL-less safe
	net/sched: sch_qfq: refactor parsing of netlink parameters
	net/sched: sch_qfq: account for stab overhead in qfq_enqueue
	nvme-pci: fix DMA direction of unmapping integrity data
	f2fs: fix to avoid NULL pointer dereference f2fs_write_end_io()
	pinctrl: amd: Fix mistake in handling clearing pins at startup
	pinctrl: amd: Detect internal GPIO0 debounce handling
	pinctrl: amd: Only use special debounce behavior for GPIO 0
	tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation
	mtd: rawnand: meson: fix unaligned DMA buffers handling
	net: bcmgenet: Ensure MDIO unregistration has clocks enabled
	powerpc: Fail build if using recordmcount with binutils v2.37
	misc: fastrpc: Create fastrpc scalar with correct buffer count
	erofs: fix compact 4B support for 16k block size
	MIPS: Loongson: Fix cpu_probe_loongson() again
	ext4: Fix reusing stale buffer heads from last failed mounting
	ext4: fix wrong unit use in ext4_mb_clear_bb
	ext4: get block from bh in ext4_free_blocks for fast commit replay
	ext4: fix wrong unit use in ext4_mb_new_blocks
	ext4: only update i_reserved_data_blocks on successful block allocation
	jfs: jfs_dmap: Validate db_l2nbperpage while mounting
	hwrng: imx-rngc - fix the timeout for init and self check
	PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold
	PCI: Add function 1 DMA alias quirk for Marvell 88SE9235
	PCI: qcom: Disable write access to read only registers for IP v2.3.3
	PCI: rockchip: Assert PCI Configuration Enable bit after probe
	PCI: rockchip: Write PCI Device ID to correct register
	PCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked
	PCI: rockchip: Fix legacy IRQ generation for RK3399 PCIe endpoint core
	PCI: rockchip: Use u32 variable to access 32-bit registers
	PCI: rockchip: Set address alignment for endpoint mode
	misc: pci_endpoint_test: Free IRQs before removing the device
	misc: pci_endpoint_test: Re-init completion for every test
	md/raid0: add discard support for the 'original' layout
	fs: dlm: return positive pid value for F_GETLK
	drm/atomic: Allow vblank-enabled + self-refresh "disable"
	drm/rockchip: vop: Leave vblank enabled in self-refresh
	drm/amd/display: Correct `DMUB_FW_VERSION` macro
	serial: atmel: don't enable IRQs prematurely
	tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error
	tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk
	firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()
	ceph: don't let check_caps skip sending responses for revoke msgs
	xhci: Fix resume issue of some ZHAOXIN hosts
	xhci: Fix TRB prefetch issue of ZHAOXIN hosts
	xhci: Show ZHAOXIN xHCI root hub speed correctly
	meson saradc: fix clock divider mask length
	Revert "8250: add support for ASIX devices with a FIFO bug"
	s390/decompressor: fix misaligned symbol build error
	tracing/histograms: Add histograms to hist_vars if they have referenced variables
	samples: ftrace: Save required argument registers in sample trampolines
	net: ena: fix shift-out-of-bounds in exponential backoff
	ring-buffer: Fix deadloop issue on reading trace_pipe
	xtensa: ISS: fix call to split_if_spec
	tracing: Fix null pointer dereference in tracing_err_log_open()
	tracing/probes: Fix not to count error code to total length
	scsi: qla2xxx: Wait for io return on terminate rport
	scsi: qla2xxx: Array index may go out of bound
	scsi: qla2xxx: Fix buffer overrun
	scsi: qla2xxx: Fix potential NULL pointer dereference
	scsi: qla2xxx: Check valid rport returned by fc_bsg_to_rport()
	scsi: qla2xxx: Correct the index of array
	scsi: qla2xxx: Pointer may be dereferenced
	scsi: qla2xxx: Remove unused nvme_ls_waitq wait queue
	net/sched: sch_qfq: reintroduce lmax bound check for MTU
	RDMA/cma: Ensure rdma_addr_cancel() happens before issuing more requests
	drm/atomic: Fix potential use-after-free in nonblocking commits
	ALSA: hda/realtek - remove 3k pull low procedure
	ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx
	keys: Fix linking a duplicate key to a keyring's assoc_array
	perf probe: Add test for regression introduced by switch to die_get_decl_file()
	btrfs: fix warning when putting transaction with qgroups enabled after abort
	fuse: revalidate: don't invalidate if interrupted
	selftests: tc: set timeout to 15 minutes
	selftests: tc: add 'ct' action kconfig dep
	regmap: Drop initial version of maximum transfer length fixes
	regmap: Account for register length in SMBus I/O limits
	can: bcm: Fix UAF in bcm_proc_show()
	drm/client: Fix memory leak in drm_client_target_cloned
	drm/client: Fix memory leak in drm_client_modeset_probe
	ASoC: fsl_sai: Disable bit clock with transmitter
	ext4: correct inline offset when handling xattrs in inode body
	debugobjects: Recheck debug_objects_enabled before reporting
	nbd: Add the maximum limit of allocated index in nbd_dev_add
	md: fix data corruption for raid456 when reshape restart while grow up
	md/raid10: prevent soft lockup while flush writes
	posix-timers: Ensure timer ID search-loop limit is valid
	btrfs: add xxhash to fast checksum implementations
	ACPI: button: Add lid disable DMI quirk for Nextbook Ares 8A
	ACPI: video: Add backlight=native DMI quirk for Apple iMac11,3
	ACPI: video: Add backlight=native DMI quirk for Lenovo ThinkPad X131e (3371 AMD version)
	arm64: set __exception_irq_entry with __irq_entry as a default
	arm64: mm: fix VA-range sanity check
	sched/fair: Don't balance task to its current running CPU
	wifi: ath11k: fix registration of 6Ghz-only phy without the full channel range
	bpf: Address KCSAN report on bpf_lru_list
	devlink: report devlink_port_type_warn source device
	wifi: wext-core: Fix -Wstringop-overflow warning in ioctl_standard_iw_point()
	wifi: iwlwifi: mvm: avoid baid size integer overflow
	igb: Fix igb_down hung on surprise removal
	spi: bcm63xx: fix max prepend length
	fbdev: imxfb: warn about invalid left/right margin
	pinctrl: amd: Use amd_pinconf_set() for all config options
	net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field()
	bridge: Add extack warning when enabling STP in netns.
	iavf: Fix use-after-free in free_netdev
	iavf: Fix out-of-bounds when setting channels on remove
	security: keys: Modify mismatched function name
	octeontx2-pf: Dont allocate BPIDs for LBK interfaces
	tcp: annotate data-races around tcp_rsk(req)->ts_recent
	net: ipv4: Use kfree_sensitive instead of kfree
	net:ipv6: check return value of pskb_trim()
	Revert "tcp: avoid the lookup process failing to get sk in ehash table"
	fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe
	llc: Don't drop packet from non-root netns.
	netfilter: nf_tables: fix spurious set element insertion failure
	netfilter: nf_tables: can't schedule in nft_chain_validate
	netfilter: nft_set_pipapo: fix improper element removal
	netfilter: nf_tables: skip bound chain in netns release path
	netfilter: nf_tables: skip bound chain on rule flush
	tcp: annotate data-races around tp->tcp_tx_delay
	tcp: annotate data-races around tp->keepalive_time
	tcp: annotate data-races around tp->keepalive_intvl
	tcp: annotate data-races around tp->keepalive_probes
	net: Introduce net.ipv4.tcp_migrate_req.
	tcp: Fix data-races around sysctl_tcp_syn(ack)?_retries.
	tcp: annotate data-races around icsk->icsk_syn_retries
	tcp: annotate data-races around tp->linger2
	tcp: annotate data-races around rskq_defer_accept
	tcp: annotate data-races around tp->notsent_lowat
	tcp: annotate data-races around icsk->icsk_user_timeout
	tcp: annotate data-races around fastopenq.max_qlen
	net: phy: prevent stale pointer dereference in phy_init()
	tracing/histograms: Return an error if we fail to add histogram to hist_vars list
	tracing: Fix memory leak of iter->temp when reading trace_pipe
	ftrace: Store the order of pages allocated in ftrace_page
	ftrace: Fix possible warning on checking all pages used in ftrace_process_locs()
	Linux 5.10.188

Change-Id: Ibcc1adc43df5b8f649b12078eedd5d4f57de4578
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-08-03 11:23:27 +00:00
Zheng Yejian
edce5fba78 ftrace: Fix possible warning on checking all pages used in ftrace_process_locs()
commit 26efd79c4624294e553aeaa3439c646729bad084 upstream.

As comments in ftrace_process_locs(), there may be NULL pointers in
mcount_loc section:
 > Some architecture linkers will pad between
 > the different mcount_loc sections of different
 > object files to satisfy alignments.
 > Skip any NULL pointers.

After commit 20e5227e9f ("ftrace: allow NULL pointers in mcount_loc"),
NULL pointers will be accounted when allocating ftrace pages but skipped
before adding into ftrace pages, this may result in some pages not being
used. Then after commit 706c81f87f ("ftrace: Remove extra helper
functions"), warning may occur at:
  WARN_ON(pg->next);

To fix it, only warn for case that no pointers skipped but pages not used
up, then free those unused pages after releasing ftrace_lock.

Link: https://lore.kernel.org/linux-trace-kernel/20230712060452.3175675-1-zhengyejian1@huawei.com

Cc: stable@vger.kernel.org
Fixes: 706c81f87f ("ftrace: Remove extra helper functions")
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:44 +02:00
Linus Torvalds
115b19f893 ftrace: Store the order of pages allocated in ftrace_page
commit db42523b4f3e83ff86b53cdda219a9767c8b047f upstream.

Instead of saving the size of the records field of the ftrace_page, store
the order it uses to allocate the pages, as that is what is needed to know
in order to free the pages. This simplifies the code.

Link: https://lore.kernel.org/lkml/CAHk-=whyMxheOqXAORt9a7JK9gc9eHTgCJ55Pgs4p=X3RrQubQ@mail.gmail.com/

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[ change log written by Steven Rostedt ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:43 +02:00
Zheng Yejian
1a1e793e02 tracing: Fix memory leak of iter->temp when reading trace_pipe
commit d5a821896360cc8b93a15bd888fabc858c038dc0 upstream.

kmemleak reports:
  unreferenced object 0xffff88814d14e200 (size 256):
    comm "cat", pid 336, jiffies 4294871818 (age 779.490s)
    hex dump (first 32 bytes):
      04 00 01 03 00 00 00 00 08 00 00 00 00 00 00 00  ................
      0c d8 c8 9b ff ff ff ff 04 5a ca 9b ff ff ff ff  .........Z......
    backtrace:
      [<ffffffff9bdff18f>] __kmalloc+0x4f/0x140
      [<ffffffff9bc9238b>] trace_find_next_entry+0xbb/0x1d0
      [<ffffffff9bc9caef>] trace_print_lat_context+0xaf/0x4e0
      [<ffffffff9bc94490>] print_trace_line+0x3e0/0x950
      [<ffffffff9bc95499>] tracing_read_pipe+0x2d9/0x5a0
      [<ffffffff9bf03a43>] vfs_read+0x143/0x520
      [<ffffffff9bf04c2d>] ksys_read+0xbd/0x160
      [<ffffffff9d0f0edf>] do_syscall_64+0x3f/0x90
      [<ffffffff9d2000aa>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8

when reading file 'trace_pipe', 'iter->temp' is allocated or relocated
in trace_find_next_entry() but not freed before 'trace_pipe' is closed.

To fix it, free 'iter->temp' in tracing_release_pipe().

Link: https://lore.kernel.org/linux-trace-kernel/20230713141435.1133021-1-zhengyejian1@huawei.com

Cc: stable@vger.kernel.org
Fixes: ff895103a8 ("tracing: Save off entry when peeking at next entry")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
[Fix conflict due to lack of 649e72070cbbb8600eb823833e4748f5a0815116]
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:43 +02:00
Mohamed Khalfella
43e786aa51 tracing/histograms: Return an error if we fail to add histogram to hist_vars list
commit 4b8b3905165ef98386a3c06f196c85d21292d029 upstream.

Commit 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if
they have referenced variables") added a check to fail histogram creation
if save_hist_vars() failed to add histogram to hist_vars list. But the
commit failed to set ret to failed return code before jumping to
unregister histogram, fix it.

Link: https://lore.kernel.org/linux-trace-kernel/20230714203341.51396-1-mkhalfella@purestorage.com

Cc: stable@vger.kernel.org
Fixes: 6018b585e8c6 ("tracing/histograms: Add histograms to hist_vars if they have referenced variables")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:43 +02:00
Martin KaFai Lau
b6d9a4062c bpf: Address KCSAN report on bpf_lru_list
[ Upstream commit ee9fd0ac3017c4313be91a220a9ac4c99dde7ad4 ]

KCSAN reported a data-race when accessing node->ref.
Although node->ref does not have to be accurate,
take this chance to use a more common READ_ONCE() and WRITE_ONCE()
pattern instead of data_race().

There is an existing bpf_lru_node_is_ref() and bpf_lru_node_set_ref().
This patch also adds bpf_lru_node_clear_ref() to do the
WRITE_ONCE(node->ref, 0) also.

==================================================================
BUG: KCSAN: data-race in __bpf_lru_list_rotate / __htab_lru_percpu_map_update_elem

write to 0xffff888137038deb of 1 bytes by task 11240 on cpu 1:
__bpf_lru_node_move kernel/bpf/bpf_lru_list.c:113 [inline]
__bpf_lru_list_rotate_active kernel/bpf/bpf_lru_list.c:149 [inline]
__bpf_lru_list_rotate+0x1bf/0x750 kernel/bpf/bpf_lru_list.c:240
bpf_lru_list_pop_free_to_local kernel/bpf/bpf_lru_list.c:329 [inline]
bpf_common_lru_pop_free kernel/bpf/bpf_lru_list.c:447 [inline]
bpf_lru_pop_free+0x638/0xe20 kernel/bpf/bpf_lru_list.c:499
prealloc_lru_pop kernel/bpf/hashtab.c:290 [inline]
__htab_lru_percpu_map_update_elem+0xe7/0x820 kernel/bpf/hashtab.c:1316
bpf_percpu_hash_update+0x5e/0x90 kernel/bpf/hashtab.c:2313
bpf_map_update_value+0x2a9/0x370 kernel/bpf/syscall.c:200
generic_map_update_batch+0x3ae/0x4f0 kernel/bpf/syscall.c:1687
bpf_map_do_batch+0x2d9/0x3d0 kernel/bpf/syscall.c:4534
__sys_bpf+0x338/0x810
__do_sys_bpf kernel/bpf/syscall.c:5096 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5094 [inline]
__x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5094
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888137038deb of 1 bytes by task 11241 on cpu 0:
bpf_lru_node_set_ref kernel/bpf/bpf_lru_list.h:70 [inline]
__htab_lru_percpu_map_update_elem+0x2f1/0x820 kernel/bpf/hashtab.c:1332
bpf_percpu_hash_update+0x5e/0x90 kernel/bpf/hashtab.c:2313
bpf_map_update_value+0x2a9/0x370 kernel/bpf/syscall.c:200
generic_map_update_batch+0x3ae/0x4f0 kernel/bpf/syscall.c:1687
bpf_map_do_batch+0x2d9/0x3d0 kernel/bpf/syscall.c:4534
__sys_bpf+0x338/0x810
__do_sys_bpf kernel/bpf/syscall.c:5096 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5094 [inline]
__x64_sys_bpf+0x43/0x50 kernel/bpf/syscall.c:5094
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x01 -> 0x00

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 11241 Comm: syz-executor.3 Not tainted 6.3.0-rc7-syzkaller-00136-g6a66fdd29ea1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
==================================================================

Reported-by: syzbot+ebe648a84e8784763f82@syzkaller.appspotmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/r/20230511043748.1384166-1-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:44:38 +02:00
Yicong Yang
6b0c79aa33 sched/fair: Don't balance task to its current running CPU
[ Upstream commit 0dd37d6dd33a9c23351e6115ae8cdac7863bc7de ]

We've run into the case that the balancer tries to balance a migration
disabled task and trigger the warning in set_task_cpu() like below:

 ------------[ cut here ]------------
 WARNING: CPU: 7 PID: 0 at kernel/sched/core.c:3115 set_task_cpu+0x188/0x240
 Modules linked in: hclgevf xt_CHECKSUM ipt_REJECT nf_reject_ipv4 <...snip>
 CPU: 7 PID: 0 Comm: swapper/7 Kdump: loaded Tainted: G           O       6.1.0-rc4+ #1
 Hardware name: Huawei TaiShan 2280 V2/BC82AMDC, BIOS 2280-V2 CS V5.B221.01 12/09/2021
 pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : set_task_cpu+0x188/0x240
 lr : load_balance+0x5d0/0xc60
 sp : ffff80000803bc70
 x29: ffff80000803bc70 x28: ffff004089e190e8 x27: ffff004089e19040
 x26: ffff007effcabc38 x25: 0000000000000000 x24: 0000000000000001
 x23: ffff80000803be84 x22: 000000000000000c x21: ffffb093e79e2a78
 x20: 000000000000000c x19: ffff004089e19040 x18: 0000000000000000
 x17: 0000000000001fad x16: 0000000000000030 x15: 0000000000000000
 x14: 0000000000000003 x13: 0000000000000000 x12: 0000000000000000
 x11: 0000000000000001 x10: 0000000000000400 x9 : ffffb093e4cee530
 x8 : 00000000fffffffe x7 : 0000000000ce168a x6 : 000000000000013e
 x5 : 00000000ffffffe1 x4 : 0000000000000001 x3 : 0000000000000b2a
 x2 : 0000000000000b2a x1 : ffffb093e6d6c510 x0 : 0000000000000001
 Call trace:
  set_task_cpu+0x188/0x240
  load_balance+0x5d0/0xc60
  rebalance_domains+0x26c/0x380
  _nohz_idle_balance.isra.0+0x1e0/0x370
  run_rebalance_domains+0x6c/0x80
  __do_softirq+0x128/0x3d8
  ____do_softirq+0x18/0x24
  call_on_irq_stack+0x2c/0x38
  do_softirq_own_stack+0x24/0x3c
  __irq_exit_rcu+0xcc/0xf4
  irq_exit_rcu+0x18/0x24
  el1_interrupt+0x4c/0xe4
  el1h_64_irq_handler+0x18/0x2c
  el1h_64_irq+0x74/0x78
  arch_cpu_idle+0x18/0x4c
  default_idle_call+0x58/0x194
  do_idle+0x244/0x2b0
  cpu_startup_entry+0x30/0x3c
  secondary_start_kernel+0x14c/0x190
  __secondary_switched+0xb0/0xb4
 ---[ end trace 0000000000000000 ]---

Further investigation shows that the warning is superfluous, the migration
disabled task is just going to be migrated to its current running CPU.
This is because that on load balance if the dst_cpu is not allowed by the
task, we'll re-select a new_dst_cpu as a candidate. If no task can be
balanced to dst_cpu we'll try to balance the task to the new_dst_cpu
instead. In this case when the migration disabled task is not on CPU it
only allows to run on its current CPU, load balance will select its
current CPU as new_dst_cpu and later triggers the warning above.

The new_dst_cpu is chosen from the env->dst_grpmask. Currently it
contains CPUs in sched_group_span() and if we have overlapped groups it's
possible to run into this case. This patch makes env->dst_grpmask of
group_balance_mask() which exclude any CPUs from the busiest group and
solve the issue. For balancing in a domain with no overlapped groups
the behaviour keeps same as before.

Suggested-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230530082507.10444-1-yangyicong@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:44:37 +02:00
Thomas Gleixner
322377cc90 posix-timers: Ensure timer ID search-loop limit is valid
[ Upstream commit 8ce8849dd1e78dadcee0ec9acbd259d239b7069f ]

posix_timer_add() tries to allocate a posix timer ID by starting from the
cached ID which was stored by the last successful allocation.

This is done in a loop searching the ID space for a free slot one by
one. The loop has to terminate when the search wrapped around to the
starting point.

But that's racy vs. establishing the starting point. That is read out
lockless, which leads to the following problem:

CPU0	  	      	     	   CPU1
posix_timer_add()
  start = sig->posix_timer_id;
  lock(hash_lock);
  ...				   posix_timer_add()
  if (++sig->posix_timer_id < 0)
      			             start = sig->posix_timer_id;
     sig->posix_timer_id = 0;

So CPU1 can observe a negative start value, i.e. -1, and the loop break
never happens because the condition can never be true:

  if (sig->posix_timer_id == start)
     break;

While this is unlikely to ever turn into an endless loop as the ID space is
huge (INT_MAX), the racy read of the start value caught the attention of
KCSAN and Dmitry unearthed that incorrectness.

Rewrite it so that all id operations are under the hash lock.

Reported-by: syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/87bkhzdn6g.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:44:36 +02:00
Masami Hiramatsu (Google)
6ea2a408d3 tracing/probes: Fix not to count error code to total length
commit b41326b5e0f82e93592c4366359917b5d67b529f upstream.

Fix not to count the error code (which is minus value) to the total
used length of array, because it can mess up the return code of
process_fetch_insn_bottom(). Also clear the 'ret' value because it
will be used for calculating next data_loc entry.

Link: https://lore.kernel.org/all/168908493827.123124.2175257289106364229.stgit@devnote2/

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/8819b154-2ba1-43c3-98a2-cbde20892023@moroto.mountain/
Fixes: 9b960a3883 ("tracing: probeevent: Unify fetch_insn processing common part")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:32 +02:00
Mateusz Stachyra
7060e5aac6 tracing: Fix null pointer dereference in tracing_err_log_open()
commit 02b0095e2fbbc060560c1065f86a211d91e27b26 upstream.

Fix an issue in function 'tracing_err_log_open'.
The function doesn't call 'seq_open' if the file is opened only with
write permissions, which results in 'file->private_data' being left as null.
If we then use 'lseek' on that opened file, 'seq_lseek' dereferences
'file->private_data' in 'mutex_lock(&m->lock)', resulting in a kernel panic.
Writing to this node requires root privileges, therefore this bug
has very little security impact.

Tracefs node: /sys/kernel/tracing/error_log

Example Kernel panic:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000038
Call trace:
 mutex_lock+0x30/0x110
 seq_lseek+0x34/0xb8
 __arm64_sys_lseek+0x6c/0xb8
 invoke_syscall+0x58/0x13c
 el0_svc_common+0xc4/0x10c
 do_el0_svc+0x24/0x98
 el0_svc+0x24/0x88
 el0t_64_sync_handler+0x84/0xe4
 el0t_64_sync+0x1b4/0x1b8
Code: d503201f aa0803e0 aa1f03e1 aa0103e9 (c8e97d02)
---[ end trace 561d1b49c12cf8a5 ]---
Kernel panic - not syncing: Oops: Fatal exception

Link: https://lore.kernel.org/linux-trace-kernel/20230703155237eucms1p4dfb6a19caa14c79eb6c823d127b39024@eucms1p4
Link: https://lore.kernel.org/linux-trace-kernel/20230704102706eucms1p30d7ecdcc287f46ad67679fc8491b2e0f@eucms1p3

Cc: stable@vger.kernel.org
Fixes: 8a062902be ("tracing: Add tracing error log")
Signed-off-by: Mateusz Stachyra <m.stachyra@samsung.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:32 +02:00
Zheng Yejian
5e68f1f3a2 ring-buffer: Fix deadloop issue on reading trace_pipe
commit 7e42907f3a7b4ce3a2d1757f6d78336984daf8f5 upstream.

Soft lockup occurs when reading file 'trace_pipe':

  watchdog: BUG: soft lockup - CPU#6 stuck for 22s! [cat:4488]
  [...]
  RIP: 0010:ring_buffer_empty_cpu+0xed/0x170
  RSP: 0018:ffff88810dd6fc48 EFLAGS: 00000246
  RAX: 0000000000000000 RBX: 0000000000000246 RCX: ffffffff93d1aaeb
  RDX: ffff88810a280040 RSI: 0000000000000008 RDI: ffff88811164b218
  RBP: ffff88811164b218 R08: 0000000000000000 R09: ffff88815156600f
  R10: ffffed102a2acc01 R11: 0000000000000001 R12: 0000000051651901
  R13: 0000000000000000 R14: ffff888115e49500 R15: 0000000000000000
  [...]
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007f8d853c2000 CR3: 000000010dcd8000 CR4: 00000000000006e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
  Call Trace:
   __find_next_entry+0x1a8/0x4b0
   ? peek_next_entry+0x250/0x250
   ? down_write+0xa5/0x120
   ? down_write_killable+0x130/0x130
   trace_find_next_entry_inc+0x3b/0x1d0
   tracing_read_pipe+0x423/0xae0
   ? tracing_splice_read_pipe+0xcb0/0xcb0
   vfs_read+0x16b/0x490
   ksys_read+0x105/0x210
   ? __ia32_sys_pwrite64+0x200/0x200
   ? switch_fpu_return+0x108/0x220
   do_syscall_64+0x33/0x40
   entry_SYSCALL_64_after_hwframe+0x61/0xc6

Through the vmcore, I found it's because in tracing_read_pipe(),
ring_buffer_empty_cpu() found some buffer is not empty but then it
cannot read anything due to "rb_num_of_entries() == 0" always true,
Then it infinitely loop the procedure due to user buffer not been
filled, see following code path:

  tracing_read_pipe() {
    ... ...
    waitagain:
      tracing_wait_pipe() // 1. find non-empty buffer here
      trace_find_next_entry_inc()  // 2. loop here try to find an entry
        __find_next_entry()
          ring_buffer_empty_cpu();  // 3. find non-empty buffer
          peek_next_entry()  // 4. but peek always return NULL
            ring_buffer_peek()
              rb_buffer_peek()
                rb_get_reader_page()
                  // 5. because rb_num_of_entries() == 0 always true here
                  //    then return NULL
      // 6. user buffer not been filled so goto 'waitgain'
      //    and eventually leads to an deadloop in kernel!!!
  }

By some analyzing, I found that when resetting ringbuffer, the 'entries'
of its pages are not all cleared (see rb_reset_cpu()). Then when reducing
the ringbuffer, and if some reduced pages exist dirty 'entries' data, they
will be added into 'cpu_buffer->overrun' (see rb_remove_pages()), which
cause wrong 'overrun' count and eventually cause the deadloop issue.

To fix it, we need to clear every pages in rb_reset_cpu().

Link: https://lore.kernel.org/linux-trace-kernel/20230708225144.3785600-1-zhengyejian1@huawei.com

Cc: stable@vger.kernel.org
Fixes: a5fb833172 ("ring-buffer: Fix uninitialized read_stamp")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:31 +02:00
Mohamed Khalfella
1576f0df7b tracing/histograms: Add histograms to hist_vars if they have referenced variables
commit 6018b585e8c6fa7d85d4b38d9ce49a5b67be7078 upstream.

Hist triggers can have referenced variables without having direct
variables fields. This can be the case if referenced variables are added
for trigger actions. In this case the newly added references will not
have field variables. Not taking such referenced variables into
consideration can result in a bug where it would be possible to remove
hist trigger with variables being refenced. This will result in a bug
that is easily reproducable like so

$ cd /sys/kernel/tracing
$ echo 'synthetic_sys_enter char[] comm; long id' >> synthetic_events
$ echo 'hist:keys=common_pid.execname,id.syscall:vals=hitcount:comm=common_pid.execname' >> events/raw_syscalls/sys_enter/trigger
$ echo 'hist:keys=common_pid.execname,id.syscall:onmatch(raw_syscalls.sys_enter).synthetic_sys_enter($comm, id)' >> events/raw_syscalls/sys_enter/trigger
$ echo '!hist:keys=common_pid.execname,id.syscall:vals=hitcount:comm=common_pid.execname' >> events/raw_syscalls/sys_enter/trigger

[  100.263533] ==================================================================
[  100.264634] BUG: KASAN: slab-use-after-free in resolve_var_refs+0xc7/0x180
[  100.265520] Read of size 8 at addr ffff88810375d0f0 by task bash/439
[  100.266320]
[  100.266533] CPU: 2 PID: 439 Comm: bash Not tainted 6.5.0-rc1 #4
[  100.267277] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-20220807_005459-localhost 04/01/2014
[  100.268561] Call Trace:
[  100.268902]  <TASK>
[  100.269189]  dump_stack_lvl+0x4c/0x70
[  100.269680]  print_report+0xc5/0x600
[  100.270165]  ? resolve_var_refs+0xc7/0x180
[  100.270697]  ? kasan_complete_mode_report_info+0x80/0x1f0
[  100.271389]  ? resolve_var_refs+0xc7/0x180
[  100.271913]  kasan_report+0xbd/0x100
[  100.272380]  ? resolve_var_refs+0xc7/0x180
[  100.272920]  __asan_load8+0x71/0xa0
[  100.273377]  resolve_var_refs+0xc7/0x180
[  100.273888]  event_hist_trigger+0x749/0x860
[  100.274505]  ? kasan_save_stack+0x2a/0x50
[  100.275024]  ? kasan_set_track+0x29/0x40
[  100.275536]  ? __pfx_event_hist_trigger+0x10/0x10
[  100.276138]  ? ksys_write+0xd1/0x170
[  100.276607]  ? do_syscall_64+0x3c/0x90
[  100.277099]  ? entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[  100.277771]  ? destroy_hist_data+0x446/0x470
[  100.278324]  ? event_hist_trigger_parse+0xa6c/0x3860
[  100.278962]  ? __pfx_event_hist_trigger_parse+0x10/0x10
[  100.279627]  ? __kasan_check_write+0x18/0x20
[  100.280177]  ? mutex_unlock+0x85/0xd0
[  100.280660]  ? __pfx_mutex_unlock+0x10/0x10
[  100.281200]  ? kfree+0x7b/0x120
[  100.281619]  ? ____kasan_slab_free+0x15d/0x1d0
[  100.282197]  ? event_trigger_write+0xac/0x100
[  100.282764]  ? __kasan_slab_free+0x16/0x20
[  100.283293]  ? __kmem_cache_free+0x153/0x2f0
[  100.283844]  ? sched_mm_cid_remote_clear+0xb1/0x250
[  100.284550]  ? __pfx_sched_mm_cid_remote_clear+0x10/0x10
[  100.285221]  ? event_trigger_write+0xbc/0x100
[  100.285781]  ? __kasan_check_read+0x15/0x20
[  100.286321]  ? __bitmap_weight+0x66/0xa0
[  100.286833]  ? _find_next_bit+0x46/0xe0
[  100.287334]  ? task_mm_cid_work+0x37f/0x450
[  100.287872]  event_triggers_call+0x84/0x150
[  100.288408]  trace_event_buffer_commit+0x339/0x430
[  100.289073]  ? ring_buffer_event_data+0x3f/0x60
[  100.292189]  trace_event_raw_event_sys_enter+0x8b/0xe0
[  100.295434]  syscall_trace_enter.constprop.0+0x18f/0x1b0
[  100.298653]  syscall_enter_from_user_mode+0x32/0x40
[  100.301808]  do_syscall_64+0x1a/0x90
[  100.304748]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[  100.307775] RIP: 0033:0x7f686c75c1cb
[  100.310617] Code: 73 01 c3 48 8b 0d 65 3c 10 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 21 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 35 3c 10 00 f7 d8 64 89 01 48
[  100.317847] RSP: 002b:00007ffc60137a38 EFLAGS: 00000246 ORIG_RAX: 0000000000000021
[  100.321200] RAX: ffffffffffffffda RBX: 000055f566469ea0 RCX: 00007f686c75c1cb
[  100.324631] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 000000000000000a
[  100.328104] RBP: 00007ffc60137ac0 R08: 00007f686c818460 R09: 000000000000000a
[  100.331509] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009
[  100.334992] R13: 0000000000000007 R14: 000000000000000a R15: 0000000000000007
[  100.338381]  </TASK>

We hit the bug because when second hist trigger has was created
has_hist_vars() returned false because hist trigger did not have
variables. As a result of that save_hist_vars() was not called to add
the trigger to trace_array->hist_vars. Later on when we attempted to
remove the first histogram find_any_var_ref() failed to detect it is
being used because it did not find the second trigger in hist_vars list.

With this change we wait until trigger actions are created so we can take
into consideration if hist trigger has variable references. Also, now we
check the return value of save_hist_vars() and fail trigger creation if
save_hist_vars() fails.

Link: https://lore.kernel.org/linux-trace-kernel/20230712223021.636335-1-mkhalfella@purestorage.com

Cc: stable@vger.kernel.org
Fixes: 067fe038e7 ("tracing: Add variable reference handling to hist triggers")
Signed-off-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:31 +02:00
Linus Torvalds
13c353dc5c workqueue: clean up WORK_* constant types, clarify masking
commit afa4bb778e48d79e4a642ed41e3b4e0de7489a6c upstream.

Dave Airlie reports that gcc-13.1.1 has started complaining about some
of the workqueue code in 32-bit arm builds:

  kernel/workqueue.c: In function ‘get_work_pwq’:
  kernel/workqueue.c:713:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
    713 |                 return (void *)(data & WORK_STRUCT_WQ_DATA_MASK);
        |                        ^
  [ ... a couple of other cases ... ]

and while it's not immediately clear exactly why gcc started complaining
about it now, I suspect it's some C23-induced enum type handlign fixup in
gcc-13 is the cause.

Whatever the reason for starting to complain, the code and data types
are indeed disgusting enough that the complaint is warranted.

The wq code ends up creating various "helper constants" (like that
WORK_STRUCT_WQ_DATA_MASK) using an enum type, which is all kinds of
confused.  The mask needs to be 'unsigned long', not some unspecified
enum type.

To make matters worse, the actual "mask and cast to a pointer" is
repeated a couple of times, and the cast isn't even always done to the
right pointer, but - as the error case above - to a 'void *' with then
the compiler finishing the job.

That's now how we roll in the kernel.

So create the masks using the proper types rather than some ambiguous
enumeration, and use a nice helper that actually does the type
conversion in one well-defined place.

Incidentally, this magically makes clang generate better code.  That,
admittedly, is really just a sign of clang having been seriously
confused before, and cleaning up the typing unconfuses the compiler too.

Reported-by: Dave Airlie <airlied@gmail.com>
Link: https://lore.kernel.org/lkml/CAPM=9twNnV4zMCvrPkw3H-ajZOH-01JVh_kDrxdPYQErz8ZTdA@mail.gmail.com/
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Tejun Heo <tj@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:19 +02:00
Paul E. McKenney
4f91de9a81 rcu-tasks: Simplify trc_read_check_handler() atomic operations
[ Upstream commit 96017bf9039763a2e02dcc6adaa18592cd73a39d ]

Currently, trc_wait_for_one_reader() atomically increments
the trc_n_readers_need_end counter before sending the IPI
invoking trc_read_check_handler().  All failure paths out of
trc_read_check_handler() and also from the smp_call_function_single()
within trc_wait_for_one_reader() must carefully atomically decrement
this counter.  This is more complex than it needs to be.

This commit therefore simplifies things and saves a few lines of
code by dispensing with the atomic decrements in favor of having
trc_read_check_handler() do the atomic increment only in the success case.
In theory, this represents no change in functionality.

Cc: <stable@vger.kernel.org> # 5.10.x
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:18 +02:00
Paul E. McKenney
3a64cd01cd rcu-tasks: Mark ->trc_reader_special.b.need_qs data races
[ Upstream commit f8ab3fad80dddf3f2cecb53983063c4431058ca1 ]

There are several ->trc_reader_special.b.need_qs data races that are
too low-probability for KCSAN to notice, but which will happen sooner
or later.  This commit therefore marks these accesses.

Cc: <stable@vger.kernel.org> # 5.10.x
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:18 +02:00
Paul E. McKenney
058f077d09 rcu-tasks: Mark ->trc_reader_nesting data races
[ Upstream commit bdb0cca0d11060fce8a8a44588ac1470c25d62bc ]

There are several ->trc_reader_nesting data races that are too
low-probability for KCSAN to notice, but which will happen sooner or
later.  This commit therefore marks these accesses, and comments one
that cannot race.

Cc: <stable@vger.kernel.org> # 5.10.x
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-27 08:44:18 +02:00
Christophe Leroy
958acb479e kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
[ Upstream commit 353e7300a1db928e427462f2745f9a2cd1625b3d ]

Activating KCSAN on a 32 bits architecture leads to the following
link-time failure:

    LD      .tmp_vmlinux.kallsyms1
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'

32 bits architectures don't have 64 bits atomic builtins. Only
include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.

Fixes: 0f8ad5f2e9 ("kcsan: Add support for atomic builtins")
Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Marco Elver <elver@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/d9c6afc28d0855240171a4e0ad9ffcdb9d07fceb.1683892665.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:57 +02:00
Zhen Lei
6cb477e722 kexec: fix a memory leak in crash_shrink_memory()
[ Upstream commit 1cba6c4309f03de570202c46f03df3f73a0d4c82 ]

Patch series "kexec: enable kexec_crash_size to support two crash kernel
regions".

When crashkernel=X fails to reserve region under 4G, it will fall back to
reserve region above 4G and a region of the default size will also be
reserved under 4G.  Unfortunately, /sys/kernel/kexec_crash_size only
supports one crash kernel region now, the user cannot sense the low memory
reserved by reading /sys/kernel/kexec_crash_size.  Also, low memory cannot
be freed by writing this file.

For example:
resource_size(crashk_res) = 512M
resource_size(crashk_low_res) = 256M

The result of 'cat /sys/kernel/kexec_crash_size' is 512M, but it should be
768M.  When we execute 'echo 0 > /sys/kernel/kexec_crash_size', the size
of crashk_res becomes 0 and resource_size(crashk_low_res) is still 256 MB,
which is incorrect.

Since crashk_res manages the memory with high address and crashk_low_res
manages the memory with low address, crashk_low_res is shrunken only when
all crashk_res is shrunken.  And because when there is only one crash
kernel region, crashk_res is always used.  Therefore, if all crashk_res is
shrunken and crashk_low_res still exists, swap them.

This patch (of 6):

If the value of parameter 'new_size' is in the semi-open and semi-closed
interval (crashk_res.end - KEXEC_CRASH_MEM_ALIGN + 1, crashk_res.end], the
calculation result of ram_res is:

	ram_res->start = crashk_res.end + 1
	ram_res->end   = crashk_res.end

The operation of insert_resource() fails, and ram_res is not added to
iomem_resource.  As a result, the memory of the control block ram_res is
leaked.

In fact, on all architectures, the start address and size of crashk_res
are already aligned by KEXEC_CRASH_MEM_ALIGN.  Therefore, we do not need
to round up crashk_res.start again.  Instead, we should round up
'new_size' in advance.

Link: https://lkml.kernel.org/r/20230527123439.772-1-thunder.leizhen@huawei.com
Link: https://lkml.kernel.org/r/20230527123439.772-2-thunder.leizhen@huawei.com
Fixes: 6480e5a092 ("kdump: add missing RAM resource in crash_shrink_memory()")
Fixes: 06a7f71124 ("kexec: premit reduction of the reserved memory size")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Cong Wang <amwang@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:40 +02:00
Douglas Anderson
fdb07728d8 watchdog/perf: more properly prevent false positives with turbo modes
[ Upstream commit 4379e59fe5665cfda737e45b8bf2f05321ef049c ]

Currently, in the watchdog_overflow_callback() we first check to see if
the watchdog had been touched and _then_ we handle the workaround for
turbo mode.  This order should be reversed.

Specifically, "touching" the hardlockup detector's watchdog should avoid
lockups being detected for one period that should be roughly the same
regardless of whether we're running turbo or not.  That means that we
should do the extra accounting for turbo _before_ we look at (and clear)
the global indicating that we've been touched.

NOTE: this fix is made based on code inspection.  I am not aware of any
reports where the old code would have generated false positives.  That
being said, this order seems more correct and also makes it easier down
the line to share code with the "buddy" hardlockup detector.

Link: https://lkml.kernel.org/r/20230519101840.v5.2.I843b0d1de3e096ba111a179f3adb16d576bef5c7@changeid
Fixes: 7edaeb6841 ("kernel/watchdog: Prevent false positives with turbo modes")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Colin Cross <ccross@android.com>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Masayoshi Mizuma <msys.mizuma@gmail.com>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Pingfan Liu <kernelfans@gmail.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: "Ravi V. Shankar" <ravi.v.shankar@intel.com>
Cc: Ricardo Neri <ricardo.neri@intel.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Stephen Boyd <swboyd@chromium.org>
Cc: Sumit Garg <sumit.garg@linaro.org>
Cc: Tzung-Bi Shih <tzungbi@chromium.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:40 +02:00
Stanislav Fomichev
08f61a3491 bpf: Remove extra lock_sock for TCP_ZEROCOPY_RECEIVE
[ Upstream commit 9cacf81f8161111db25f98e78a7a0e32ae142b3f ]

Add custom implementation of getsockopt hook for TCP_ZEROCOPY_RECEIVE.
We skip generic hooks for TCP_ZEROCOPY_RECEIVE and have a custom
call in do_tcp_getsockopt using the on-stack data. This removes
3% overhead for locking/unlocking the socket.

Without this patch:
     3.38%     0.07%  tcp_mmap  [kernel.kallsyms]  [k] __cgroup_bpf_run_filter_getsockopt
            |
             --3.30%--__cgroup_bpf_run_filter_getsockopt
                       |
                        --0.81%--__kmalloc

With the patch applied:
     0.52%     0.12%  tcp_mmap  [kernel.kallsyms]  [k] __cgroup_bpf_run_filter_getsockopt_kern

Note, exporting uapi/tcp.h requires removing netinet/tcp.h
from test_progs.h because those headers have confliciting
definitions.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20210115163501.805133-2-sdf@google.com
Stable-dep-of: 2598619e012c ("sctp: add bpf_bypass_getsockopt proto callback")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:37 +02:00
Qiuxu Zhuo
604d6a5ff7 rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale
[ Upstream commit 23fc8df26dead16687ae6eb47b0561a4a832e2f6 ]

Running the 'kfree_rcu_test' test case [1] results in a splat [2].
The root cause is the kfree_scale_thread thread(s) continue running
after unloading the rcuscale module.  This commit fixes that isue by
invoking kfree_scale_cleanup() from rcu_scale_cleanup() when removing
the rcuscale module.

[1] modprobe rcuscale kfree_rcu_test=1
    // After some time
    rmmod rcuscale
    rmmod torture

[2] BUG: unable to handle page fault for address: ffffffffc0601a87
    #PF: supervisor instruction fetch in kernel mode
    #PF: error_code(0x0010) - not-present page
    PGD 11de4f067 P4D 11de4f067 PUD 11de51067 PMD 112f4d067 PTE 0
    Oops: 0010 [#1] PREEMPT SMP NOPTI
    CPU: 1 PID: 1798 Comm: kfree_scale_thr Not tainted 6.3.0-rc1-rcu+ #1
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015
    RIP: 0010:0xffffffffc0601a87
    Code: Unable to access opcode bytes at 0xffffffffc0601a5d.
    RSP: 0018:ffffb25bc2e57e18 EFLAGS: 00010297
    RAX: 0000000000000000 RBX: ffffffffc061f0b6 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: ffffffff962fd0de RDI: ffffffff962fd0de
    RBP: ffffb25bc2e57ea8 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000
    R13: 0000000000000000 R14: 000000000000000a R15: 00000000001c1dbe
    FS:  0000000000000000(0000) GS:ffff921fa2200000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: ffffffffc0601a5d CR3: 000000011de4c006 CR4: 0000000000370ee0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     ? kvfree_call_rcu+0xf0/0x3a0
     ? kthread+0xf3/0x120
     ? kthread_complete_and_exit+0x20/0x20
     ? ret_from_fork+0x1f/0x30
     </TASK>
    Modules linked in: rfkill sunrpc ... [last unloaded: torture]
    CR2: ffffffffc0601a87
    ---[ end trace 0000000000000000 ]---

Fixes: e6e78b004f ("rcuperf: Add kfree_rcu() performance Tests")
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:35 +02:00
Qiuxu Zhuo
d414e24d15 rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()
[ Upstream commit bf5ddd736509a7d9077c0b6793e6f0852214dbea ]

This code-movement-only commit moves the rcu_scale_cleanup() and
rcu_scale_shutdown() functions to follow kfree_scale_cleanup().
This is code movement is in preparation for a bug-fix patch that invokes
kfree_scale_cleanup() from rcu_scale_cleanup().

Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:35 +02:00
Paul E. McKenney
ecc5e6dbc2 rcuscale: Move shutdown from wait_event() to wait_event_idle()
[ Upstream commit ef1ef3d47677dc191b88650a9f7f91413452cc1b ]

The rcu_scale_shutdown() and kfree_scale_shutdown() kthreads/functions
use wait_event() to wait for the rcuscale test to complete.  However,
each updater thread in such a test waits for at least 100 grace periods.
If each grace period takes more than 1.2 seconds, which is long, but
not insanely so, this can trigger the hung-task timeout.

This commit therefore replaces those wait_event() calls with calls to
wait_event_idle(), which do not trigger the hung-task timeout.

Reported-by: kernel test robot <yujie.liu@intel.com>
Reported-by: Liam Howlett <liam.howlett@oracle.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Yujie Liu <yujie.liu@intel.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:34 +02:00
Li Zhijian
b62c816bdb rcuscale: Always log error message
[ Upstream commit 86e7ed1bd57d020e35d430542bf5d689c3200568 ]

Unconditionally log messages corresponding to errors.

Acked-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:34 +02:00
Jiangong.Han
8cd9917c13 rcuscale: Console output claims too few grace periods
[ Upstream commit 811192c5f24bfd7246ce9ce06f668d8c408bf39b ]

The rcuscale console output claims N grace periods, numbered from zero
to N, which means that there were really N+1 grace periods.  The root
cause of this bug is that rcu_scale_writer() stores the number of the
last grace period (numbered from zero) into writer_n_durations[me]
instead of the number of grace periods.  This commit therefore assigns
the actual number of grace periods to writer_n_durations[me], and also
makes the corresponding adjustment to the loop outputting per-grace-period
measurements.

Sample of old console output:
    rcu-scale: writer 0 gps: 133
    ......
    rcu-scale:    0 writer-duration:     0 44003961
    rcu-scale:    0 writer-duration:     1 32003582
    ......
    rcu-scale:    0 writer-duration:   132 28004391
    rcu-scale:    0 writer-duration:   133 27996410

Sample of new console output:
    rcu-scale: writer 0 gps: 134
    ......
    rcu-scale:    0 writer-duration:     0 44003961
    rcu-scale:    0 writer-duration:     1 32003582
    ......
    rcu-scale:    0 writer-duration:   132 28004391
    rcu-scale:    0 writer-duration:   133 27996410

Signed-off-by: Jiangong.Han <jiangong.han@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Stable-dep-of: 23fc8df26dea ("rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:34 +02:00
Thomas Gleixner
f1be1ed32d posix-timers: Prevent RT livelock in itimer_delete()
[ Upstream commit 9d9e522010eb5685d8b53e8a24320653d9d4cbbf ]

itimer_delete() has a retry loop when the timer is concurrently expired. On
non-RT kernels this just spin-waits until the timer callback has completed,
except for posix CPU timers which have HAVE_POSIX_CPU_TIMERS_TASK_WORK
enabled.

In that case and on RT kernels the existing task could live lock when
preempting the task which does the timer delivery.

Replace spin_unlock() with an invocation of timer_wait_running() to handle
it the same way as the other retry loops in the posix timer code.

Fixes: ec8f954a40 ("posix-timers: Use a callback for cancel synchronization on PREEMPT_RT")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/87v8g7c50d.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:43:33 +02:00
Greg Kroah-Hartman
9710ae86ef Merge branch 'android12-5.10' into branch 'android12-5.10-lts'
Catch up with some commits applied to the android12-5.10 branch that adds
new symbols to ensure that the ABI remains stable with LTS merges.

This merge contains the following commits:

*   383607d234 Merge "Merge tag 'android12-5.10.185_r00' into android12-5.10" into android12-5.10
|\
| * e424229872 Merge tag 'android12-5.10.185_r00' into android12-5.10
* | b4b7d22830 ANDROID: wakeupbypass: Add vendor hook for batteryswap
* | 1dc5772322 ANDROID: GKI: Update symbols to symbol list
* | 28f1c8e015 ANDROID: vendor_hook: Add hook to abort reclaim and compaction
* | adad2dab31 UPSTREAM: Revert "Fix XFRM-I support for nested ESP tunnels"
* | f48a4c3b29 ANDROID: Incremental fs: Allocate data buffer based on input request size
* | 4def2dd180 ANDROID: ABI: update symbol list for Xclipse GPU
* | bff06d6020 ANDROID: vendor_hooks: Supplement the missing hook call point.
* | de4dc1c15c ANDROID: GKI: Add symbol list for Nothing
|/
* b52f2d4395 UPSTREAM: usb: dwc3: gadget: Propagate core init errors to UDC during pullup
* 505b4a1929 UPSTREAM: usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
* 158d8bfffc UPSTREAM: media: rkvdec: fix use after free bug in rkvdec_remove
* 739f5722f4 UPSTREAM: x86/mm: Avoid using set_pgd() outside of real PGD pages
* 5db82d830f UPSTREAM: relayfs: fix out-of-bounds access in relay_file_read
* be9bc79296 UPSTREAM: io_uring: hold uring mutex around poll removal
* 6a975c2771 UPSTREAM: net/sched: flower: fix possible OOB write in fl_set_geneve_opt()
* c811ac11f7 UPSTREAM: ipvlan:Fix out-of-bounds caused by unclear skb->cb
* 540586cf5b ANDROID: GKI: Update symbols to symbol list
* 4782c8cb16 ANDROID: vendor_hook: Add hook to tune readaround size
* 69a794a283 ANDROID: vendor_hooks: Add hooks to avoid key threads stalled in memory allocations
* 69dc2c1a79 UPSTREAM: f2fs: fix to avoid use-after-free for cached IPU bio
* 39c3d16903 UPSTREAM: net/sched: cls_u32: Fix reference counter leak leading to overflow
* 4991def0fa UPSTREAM: xfs: verify buffer contents when we skip log replay
* 1c98645c8e UPSTREAM: memstick: r592: Fix UAF bug in r592_remove due to race condition
* e6d71f847b BACKPORT: btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
* b3af11bf90 ANDROID: ABI: Update oplus symbol list
* 5f17bf82b4 ANDROID: Export memcg functions to allow module to add new files
* 40aea038ea ANDROID: HID: Only utilise UHID provided exports if UHID is enabled
* 5bffeca4fb UPSTREAM: bluetooth: Perform careful capability checks in hci_sock_ioctl()
* c93516a2d0 ANDROID: HID; Over-ride default maximum buffer size when using UHID
* ab25d94e88 UPSTREAM: usb: gadget: f_fs: Add unbind event before functionfs_unbind
* 552009b284 UPSTREAM: net: cdc_ncm: Deal with too low values of dwNtbOutMaxSize
* c6ae8be4e6 ANDROID: GKI: update symbol list for exynos
* 0a52039fcb UPSTREAM: mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
* 17bbc533f8 UPSTREAM: mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
* 708d51e22a UPSTREAM: 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
* b82903573e FROMGIT: pstore: Revert pmsg_lock back to a normal mutex
* 403d5d1318 ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters
* 2246168a72 ANDROID: fix a race between speculative page walk and unmap operations
* 7cc458acf4 BACKPORT: usb: gadget: udc: Handle gadget_connect failure during bind operation
* fffb0ae9aa BACKPORT: usb: dwc3: gadget: Bail out in pullup if soft reset timeout happens
* a4420dc21f BACKPORT: f2fs: skip GC if possible when checkpoint disabling

Change-Id: I74d4bd3e7f094e845598f8c29348bea10738d57a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-07-25 09:23:28 +00:00
Treehugger Robot
383607d234 Merge "Merge tag 'android12-5.10.185_r00' into android12-5.10" into android12-5.10 2023-07-24 17:05:05 +00:00
Vatsal Parasrampuria
b4b7d22830 ANDROID: wakeupbypass: Add vendor hook for batteryswap
Implemented a hook to check if battery swap is enabled in
alarm timer suspend routine. During a battery swap, it is
crucial to ensure that the device remains in a suspended
state, relying on a limited backup power source. It is
essential to prevent any unintended awakenings in this
state, as they could potentially lead to sudden surges
in the power consumption, ultimately resulting in a
device shutdown. Hence, we disable alarmtimer IRQs when
in batteryswap mode.

Bug: 290881352
Change-Id: I31dc30d9a3168bb1356cccba49f0a70fd6b73782
Signed-off-by: Vatsal Parasrampuria <vp9924@zebra.com>
2023-07-20 00:34:49 +00:00
Liujie Xie
bff06d6020 ANDROID: vendor_hooks: Supplement the missing hook call point.
As a supplement to commit eed2741ae6
("ANDROID: vendor_hook: add hooks to protect locking-tsk in cpu scheduler").
In rwsem read, we missed a lock-holding scenario, add it now.

Bug: 290868674

Change-Id: I718dd942b24b330a79283fc241dcbf47cc34c0c5
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2023-07-12 17:50:14 +08:00
Greg Kroah-Hartman
e424229872 Merge tag 'android12-5.10.185_r00' into android12-5.10
This is the merge of the upstream LTS release of 5.10.185 into the
android12-5.10 branch.

It contains the following commits:

* c4f52f22c7 Revert "net: Remove DECnet leftovers from flow.h."
*   c6ac900e26 Merge 5.10.185 into android12-5.10-lts
|\
| * ef0d5feb32 Linux 5.10.185
| * ed2bf5cee6 um: Fix build w/o CONFIG_PM_SLEEP
| * f73ec12dc7 drm/i915/gen11+: Only load DRAM information from pcode
| * 27458487c8 drm/i915/dg1: Wait for pcode/uncore handshake at startup
| * 2d1c19597d media: dvb-core: Fix use-after-free due to race at dvb_register_device()
| * 5c61c3945a media: dvbdev: fix error logic at dvb_register_device()
| * a1b26dac8b media: dvbdev: Fix memleak in dvb_register_device
| * a13dee47fa nilfs2: reject devices with insufficient block count
| * c374552b54 mm/memory_hotplug: extend offline_and_remove_memory() to handle more than one memory block
| * e6dc6a9d0a mmc: block: ensure error propagation for non-blk
| * 7ce0e8b287 batman-adv: Switch to kstrtox.h for kstrtou64
| * e6104284c4 neighbour: delete neigh_lookup_nodev as not used
| * bf82668eb9 net: Remove DECnet leftovers from flow.h.
| * 7d07fd03f5 net: Remove unused inline function dst_hold_and_use()
| * 53076071fb neighbour: Remove unused inline function neigh_key_eq16()
| * 7230a9e599 rcu/kvfree: Avoid freeing new kfree_rcu() memory after old grace period
| * a261589621 cgroup: always put cset in cgroup_css_set_put_fork
| * 4c10843863 afs: Fix vlserver probe RTT handling
| * 49b6607ded selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET
| * 08899e8d5a net: tipc: resize nlattr array to correct size
| * 5fd696b404 net: lapbether: only support ethernet devices
| * 6ee3728ae8 net/sched: cls_api: Fix lockup on flushing explicitly created chain
| * efed5b50f3 ext4: drop the call to ext4_error() from ext4_get_group_info()
| * 6ab91d1adb drm/nouveau: add nv_encoder pointer check for NULL
| * 5d43bb9b3e drm/nouveau/dp: check for NULL nv_connector->native_mode
| * edb970e03d drm/nouveau: don't detect DSM for non-NVIDIA device
| * 8c3446ab59 igb: fix nvm.ops.read() error handling
| * 221281d60c sctp: fix an error code in sctp_sf_eat_auth()
| * 5c47ed7f25 ipvlan: fix bound dev checking for IPv6 l3s mode
| * 3c97f2c9ec IB/isert: Fix incorrect release of isert connection
| * da6ae4aab5 IB/isert: Fix possible list corruption in CMA handler
| * 2b6f8817ca IB/isert: Fix dead lock in ib_isert
| * 2f9d26345c IB/uverbs: Fix to consider event queue closing also upon non-blocking mode
| * 6cccdbc9f0 RDMA/cma: Always set static rate to 0 for RoCE
| * f49abbb274 RDMA/mlx5: Initiate dropless RQ for RAW Ethernet functions
| * aa277d5cd4 octeontx2-af: fixed resource availability check
| * 0fb48a2a6a iavf: remove mask from iavf_irq_enable_queues()
| * 079a9591ee RDMA/rxe: Fix the use-before-initialization error of resp_pkts
| * 089a0e831f RDMA/rxe: Removed unused name from rxe_task struct
| * 6205c0d9ff RDMA/rxe: Remove the unused variable obj
| * af6eaa5798 net/sched: cls_u32: Fix reference counter leak leading to overflow
| * 5852d17aaa ping6: Fix send to link-local addresses with VRF.
| * 9e666a77f0 net: enetc: correct the indexes of highest and 2nd highest TCs
| * 1200af82cf netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
| * af42c4fd82 spi: fsl-dspi: avoid SCK glitches with continuous transfers
| * cb6ec51ddd RDMA/rtrs: Fix the last iu->buf leak in err path
| * 26293251ab usb: dwc3: gadget: Reset num TRBs before giving back the request
| * f4bc416942 serial: lantiq: add missing interrupt ack
| * 0b6e65016c USB: serial: option: add Quectel EM061KGL series
| * 1c004b379b Remove DECnet support from kernel
| * e9d384983f ALSA: hda/realtek: Add a quirk for Compaq N14JP6
| * 1148d4ca30 net: usb: qmi_wwan: add support for Compal RXM-G1
| * d7acfd5225 RDMA/uverbs: Restrict usage of privileged QKEYs
| * 96e14c91c5 nouveau: fix client work fence deletion race
| * f1f7117b22 powerpc/purgatory: remove PGO flags
| * 26c80741ce x86/purgatory: remove PGO flags
| * f368aed482 kexec: support purgatories with .text.hot sections
| * 7e78b9142f nilfs2: fix possible out-of-bounds segment allocation in resize ioctl
| * 902fcec052 nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key()
| * d59293f082 nios2: dts: Fix tse_mac "max-frame-size" property
| * 2847d9eed4 ocfs2: check new file size on fallocate call
| * e73b135f54 ocfs2: fix use-after-free when unmounting read-only filesystem
| * 370f5d98ff epoll: ep_autoremove_wake_function should use list_del_init_careful
| * 4716c73b18 io_uring: hold uring mutex around poll removal
| * 93a68acc49 irqchip/gic: Correctly validate OF quirk descriptors
| * 2a2641a842 drm:amd:amdgpu: Fix missing buffer object unlock in failure path
| * 7c0b17679b xen/blkfront: Only check REQ_FUA for writes
| * 8e45fb70f4 ASoC: dwc: move DMA init to snd_soc_dai_driver probe()
| * d47b5a6d23 mips: Move initrd_start check after initrd address sanitisation.
| * 619672bf2d MIPS: Alchemy: fix dbdma2
| * 0ca73b45b7 parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory()
| * 3f7625e086 parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu()
| * 73102fdb5b ASoC: soc-pcm: test if a BE can be prepared
| * 3bc883132d btrfs: handle memory allocation failure in btrfs_csum_one_bio
| * 142fbad314 btrfs: scrub: try harder to mark RAID56 block groups read-only
| * 35d32d8415 power: supply: Fix logic checking if system is running from battery
| * 8b7a2207ee irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues
| * dbf6109972 regulator: Fix error checking for debugfs_create_dir
| * 37bcc48e7d platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
| * 88d1c1365f power: supply: Ratelimit no data debug output
| * 6be7a4bef9 tools: gpio: fix debounce_period_us output of lsgpio
| * 39eb9eb9ea ARM: dts: vexpress: add missing cache properties
| * b2856c3cd3 power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule()
| * ce2b5f24ca power: supply: sc27xx: Fix external_power_changed race
| * 9e9e150fa8 power: supply: ab8500: Fix external_power_changed race
| * 539c387f0b test_firmware: fix a memory leak with reqs buffer
| * af36f35074 test_firmware: prevent race conditions by a correct implementation of locking
| * 682ca60251 test_firmware: Use kstrtobool() instead of strtobool()
| * 6e2e551e39 kernel.h: split out kstrtox() and simple_strtox() to a separate header
| * c2def5578b lib: cleanup kstrto*() usage
* | 2f2122a869 Revert "neighbour: fix unaligned access to pneigh_entry"
* | b7321283a9 Merge 5.10.184 into android12-5.10-lts
|\|
| * a1f0beb13d Linux 5.10.184
| * 7f896130ef Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE"
| * b60e862e13 btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
| * 6f371623f3 btrfs: check return value of btrfs_commit_transaction in relocation
| * ea0d413094 drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
| * 1659268d1a MIPS: locking/atomic: Fix atomic{_64,}_sub_if_positive
| * 0e98a97f77 xfs: verify buffer contents when we skip log replay
| * 58e8cf94de tcp: fix tcp_min_tso_segs sysctl
| * 1b4b335096 ext4: only check dquot_initialize_needed() when debugging
| * fd6cb51719 Revert "ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled"
| * cfa91c0573 vhost: support PACKED when setting-getting vring_base
| * 461c88caa8 riscv: fix kprobe __user string arg print fault issue
| * c6b9050874 eeprom: at24: also select REGMAP
| * 10e376a7c3 i2c: sprd: Delete i2c adapter in .remove's error path
| * c4aeef5602 ASoC: codecs: wsa881x: do not set can_multi_write flag
| * b6f309e9d2 staging: vc04_services: fix gcc-13 build warning
| * 0d3c75a693 usb: usbfs: Use consistent mmap functions
| * 143f405721 usb: usbfs: Enforce page requirements for mmap
| * bcd474d183 pinctrl: meson-axg: add missing GPIOA_18 gpio group
| * 1981d37b1d rbd: get snapshot context after exclusive lock is ensured to be held
| * 76ae4a7bc9 rbd: move RBD_OBJ_FLAG_COPYUP_ENABLED flag setting
| * 841d3b5a84 tee: amdtee: Add return_origin to 'struct tee_cmd_load_ta'
| * a94024991d Bluetooth: hci_qca: fix debugfs registration
| * 2270e32bd1 Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
| * 76b40319a1 s390/dasd: Use correct lock while counting channel queue length
| * e715c86e92 ceph: fix use-after-free bug for inodes when flushing capsnaps
| * 6714873158 can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
| * cc834f4d97 can: j1939: change j1939_netdev_lock type to mutex
| * 0268005076 can: j1939: j1939_sk_send_loop_abort(): improved error queue handling in J1939 Socket
| * 0038055135 drm/amdgpu: fix xclk freq on CHIP_STONEY
| * ef95f987be ALSA: hda/realtek: Add Lenovo P3 Tower platform
| * 95520b3fba ALSA: hda/realtek: Add a quirk for HP Slim Desktop S01
| * ca26d00828 Input: psmouse - fix OOB access in Elantech protocol
| * 86efc409f2 Input: xpad - delete a Razer DeathAdder mouse VID/PID entry
| * 9ece26ff08 batman-adv: Broken sync while rescheduling delayed work
| * 3f6dfff5fe bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
| * deead0d872 bnxt_en: Query default VLAN before VNIC setup on a VF
| * 84dbd27ad5 bnxt_en: Don't issue AP reset during ethtool's reset operation
| * dedd47977a lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
| * 27b8d6931f bpf: Add extra path pointer check to d_path helper
| * 36d07046c2 net: sched: fix possible refcount leak in tc_chain_tmplt_add()
| * 54acac57fe net: sched: move rtm_tca_policy declaration to include file
| * dad7417db7 rfs: annotate lockless accesses to RFS sock flow table
| * c62ca9d037 rfs: annotate lockless accesses to sk->sk_rxhash
| * 86e3981ff1 ipv6: rpl: Fix Route of Death.
| * b4be099c5f netfilter: ipset: Add schedule point in call_ad().
| * 35c89cfcac netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper
| * c4ba90ae35 qed/qede: Fix scheduling while atomic
| * 0fee54fa33 Bluetooth: L2CAP: Add missing checks for invalid DCID
| * 0066598012 Bluetooth: Fix l2cap_disconnect_req deadlock
| * 83cfac5851 net/sched: fq_pie: ensure reasonable TCA_FQ_PIE_QUANTUM values
| * 8ab2bec9e1 net/smc: Avoid to access invalid RMBs' MRs in SMCRv1 ADD LINK CONT
| * 47ef881f1c net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods
| * 9fcc3c3d26 neighbour: fix unaligned access to pneigh_entry
| * 99883d4a0b wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
| * 2d3e4c5b3e afs: Fix setting of mtime when creating a file/dir/symlink
| * 1ed651e234 spi: qup: Request DMA before enabling clocks
| * e7c61c39d6 staging: vchiq_core: drop vchiq_status from vchiq_initialise
| * fa30327060 i40e: fix build warning in ice_fltr_add_mac_to_list()
| * 15ca8d584c i40e: fix build warnings in i40e_alloc.h
| * f7e208d1c5 i40iw: fix build warning in i40iw_manage_apbvt()
| * 318e2c18da block/blk-iocost (gcc13): keep large values in a new enum
| * b6d652f7fb blk-iocost: avoid 64-bit division in ioc_timer_fn
| * 9214a5484e f2fs: fix iostat lock protection
| * d3b74c288d bonding (gcc13): synchronize bond_{a,t}lb_xmit() types
| * f122e55174 remove the sx8 block driver
| * 9236470a1d sfc (gcc13): synchronize ef100_enqueue_skb()'s return type
| * 02ce3cf222 gcc-plugins: Reorganize gimple includes for GCC 13
| * 4c3ddc06ce ata: ahci: fix enum constants for gcc-13
* | 0c0856714e Revert "tcp: deny tcp_disconnect() when threads are waiting"
* | 848ca335c1 Merge 5.10.183 into android12-5.10-lts
|\|
| * 7356714b95 Linux 5.10.183
| * 842156dc0a ARM: defconfig: drop CONFIG_DRM_RCAR_LVDS
| * 2c0ea7a06d ext4: enable the lazy init thread when remounting read/write
| * 92450a1eaa selftests: mptcp: join: skip if MPTCP is not supported
| * 1a6db1f927 selftests: mptcp: simult flows: skip if MPTCP is not supported
| * 4f8356ab74 selftests: mptcp: diag: skip if MPTCP is not supported
| * 81df7153f0 crypto: ccp: Play nice with vmalloc'd memory for SEV command structs
| * 1f988ce6e4 crypto: ccp: Reject SEV commands with mismatching command buffer
| * d21a20f442 scsi: dpt_i2o: Do not process completions with invalid addresses
| * a2cd7599b5 scsi: dpt_i2o: Remove broken pass-through ioctl (I2OUSERCMD)
| * 6d6612f7f9 drm/rcar: stop using 'imply' for dependencies
| * c759c9e4bf media: ti-vpe: cal: avoid FIELD_GET assertion
| * d21e955de9 tpm, tpm_tis: Request threaded interrupt handler
| * 608c1f2083 regmap: Account for register length when chunking
| * cb1cbe430e KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
| * 3295dc04af KVM: x86: Account fastpath-only VM-Exits in vCPU stats
| * 21bb3cd2e1 test_firmware: fix the memory leak of the allocated firmware buffer
| * 510e015b90 serial: 8250_tegra: Fix an error handling path in tegra_uart_probe()
| * b02ae50c7f fbcon: Fix null-ptr-deref in soft_cursor
| * c94228a5ae ext4: add lockdep annotations for i_data_sem for ea_inode's
| * ef70012ab5 ext4: disallow ea_inodes with extended attributes
| * 6f4fa43757 ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
| * 6d67d4966c ext4: add EA_INODE checking to ext4_iget()
| * 6d0adaa90d selftests: mptcp: pm nl: skip if MPTCP is not supported
| * 54dea0aa6b selftests: mptcp: connect: skip if MPTCP is not supported
| * 57eb824b8c tracing/probe: trace_probe_primary_from_call(): checked list_first_entry
| * 122ba1d40b selinux: don't use make's grouped targets feature yet
| * e0b8664c2f btrfs: fix csum_tree_block page iteration to avoid tripping on -Werror=array-bounds
| * 6c859764f4 tty: serial: fsl_lpuart: use UARTCTRL_TXINV to send break instead of UARTCTRL_SBK
| * 6127e956c3 mmc: vub300: fix invalid response handling
| * 99cb5ed15d eth: sun: cassini: remove dead code
| * 1d8693376a gcc-12: disable '-Wdangling-pointer' warning for now
| * 7c602f540b ath6kl: Use struct_group() to avoid size-mismatched casting
| * c92ea38a77 ACPI: thermal: drop an always true check
| * 93e28b66c1 x86/boot: Wrap literal addresses in absolute_pointer()
| * 3442be8f30 ata: libata-scsi: Use correct device no in ata_find_dev()
| * ae0d7613e0 scsi: stex: Fix gcc 13 warnings
| * 86b2d292c2 misc: fastrpc: reject new invocations during device removal
| * dacb7c103c misc: fastrpc: return -EPIPE to invocations on device removal
| * a4f88cb043 usb: gadget: f_fs: Add unbind event before functionfs_unbind
| * 90f581eb74 net: usb: qmi_wwan: Set DTR quirk for BroadMobi BM818
| * e18b0009dd iio: dac: build ad5758 driver when AD5758 is selected
| * a869ab6987 iio: adc: ad7192: Change "shorted" channels to differential
| * 143dbb313a iio: dac: mcp4725: Fix i2c_master_send() return value handling
| * 81c70f4bea iio: light: vcnl4035: fixed chip ID check
| * ff864a92d9 iio: imu: inv_icm42600: fix timestamp reset
| * 954bd5a44b HID: wacom: avoid integer overflow in wacom_intuos_inout()
| * adac1c22f5 HID: google: add jewel USB id
| * 55c507a34e iio: adc: mxs-lradc: fix the order of two cleanup operations
| * 5a445c2bf6 mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
| * c05ac53bb0 atm: hide unused procfs functions
| * ab33230458 drm/msm: Be more shouty if per-process pgtables aren't working
| * 93a61212db ALSA: oss: avoid missing-prototype warnings
| * 4987bf0446 netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT
| * 1c2537291e wifi: b43: fix incorrect __packed annotation
| * ea478186ea scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed
| * 05226a8f22 arm64/mm: mark private VM_FAULT_X defines as vm_fault_t
| * 32f86763c2 ARM: dts: stm32: add pin map for CAN controller on stm32f7
| * 01c76cb5e5 wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value
| * 0467212806 s390/pkey: zeroize key blobs
| * 76169f7490 media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221
| * ca2d171fd1 media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*()
| * 2ea7d26ed8 media: dvb-core: Fix use-after-free due on race condition at dvb_net
| * 415651c8f4 media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table
| * eb37fef417 media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
| * 1995e71472 media: dvb_ca_en50221: fix a size write bug
| * b85233ab53 media: netup_unidvb: fix irq init by register it at the end of probe
| * 74c80d2024 media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address
| * fcbb72b041 media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer()
| * 7945c13c9b media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer
| * 2d47867a6b media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer()
| * 647da51e4d media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer()
| * 084e43d9a4 media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()
| * a81280cf33 media: dvb_demux: fix a bug for the continuity counter
| * 204e9082f6 ASoC: ssm2602: Add workaround for playback distortions
| * beee708ccc ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs
| * bd99da6472 xfrm: Check if_id in inbound policy/secpath match
| * 5ee83fef0c ASoC: dwc: limit the number of overrun messages
| * 32f6f1bf1b block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE
| * 01c3d30649 nbd: Fix debugfs_create_dir error checking
| * 29f6b42a73 fbdev: stifb: Fix info entry in sti_struct on error path
| * 742dab42d7 fbdev: modedb: Add 1920x1080 at 60 Hz video mode
| * d03d31d3a2 gfs2: Don't deref jdesc in evict
| * fe4f6e159b media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE
| * 16ee4562c7 ARM: 9295/1: unwind:fix unwind abort for uleb128 case
| * a3393eb6fb btrfs: abort transaction when sibling keys check fails for leaves
| * c12c288f1e mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
| * 0dcf021af4 ALSA: hda: Glenfly: add HD Audio PCI IDs and HDMI Codec Vendor IDs.
| * d5fcccfc50 watchdog: menz069_wdt: fix watchdog initialisation
| * 9823ac6e7a mtd: rawnand: marvell: don't set the NAND frequency select
| * e4666d793a mtd: rawnand: marvell: ensure timing values are written
| * a437d3d25a net: dsa: mv88e6xxx: Increase wait after reset deactivation
| * 7c5c67aa29 net/sched: flower: fix possible OOB write in fl_set_geneve_opt()
| * f5c29a9e91 net/mlx5: Read embedded cpu after init bit cleared
| * f03bc01360 udp6: Fix race condition in udp6_sendmsg & connect
| * 57e6c54034 net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report
| * ae7e941f4d net: sched: fix NULL pointer dereference in mq_attach
| * a8ad1303b9 net/sched: Prohibit regrafting ingress or clsact Qdiscs
| * 676f203803 net/sched: Reserve TC_H_INGRESS (TC_H_CLSACT) for ingress (clsact) Qdiscs
| * 18c76349af net/sched: sch_clsact: Only create under TC_H_CLSACT
| * 1b0163b2dc net/sched: sch_ingress: Only create under TC_H_INGRESS
| * dfb80ebc3b tcp: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set
| * cccc620970 tcp: deny tcp_disconnect() when threads are waiting
| * 8f0365a3e2 af_packet: do not use READ_ONCE() in packet_bind()
| * 4de3c2c43c mtd: rawnand: ingenic: fix empty stub helper definitions
| * 11a1f2561b amd-xgbe: fix the false linkup in xgbe_phy_status
| * fa909b1384 af_packet: Fix data-races of pkt_sk(sk)->num.
| * 616da05ff8 netrom: fix info-leak in nr_write_internal()
| * d1b224cb78 net/mlx5: fw_tracer, Fix event handling
| * a864a8543c dmaengine: pl330: rename _start to prevent build error
| * 33d7035dc2 iommu/amd: Don't block updates to GATag if guest mode is on
| * bd9e61ee3e iommu/rockchip: Fix unwind goto issue
| * 75c60dacf0 RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx
| * 861868b063 RDMA/bnxt_re: Fix a possible memory leak
| * ff296fcceb dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved()
| * 6b32ed353f dmaengine: at_xdmac: Move the free desc to the tail of the desc list
| * 3041b768cc dmaengine: at_xdmac: Fix race for the tx desc callback
| * 127afc87bb dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie
| * 958226b3a6 RDMA/efa: Fix unsupported page sizes in device
| * 7d6662e4a4 RDMA/bnxt_re: Fix the page_size used during the MR creation
| * b51c896285 RDMA/bnxt_re: Code refactor while populating user MRs
* | 04a55bbb7f Revert "regulator: Add regmap helper for ramp-delay setting"
* | 5e8d66e06a Revert "regulator: pca9450: Convert to use regulator_set_ramp_delay_regmap"
* | 4d5a15daae Revert "regulator: pca9450: Fix BUCK2 enable_mask"
* | 06f0c366cb Merge 5.10.182 into android12-5.10-lts
|\|
| * c7992b6c7f Linux 5.10.182
| * 468bebc426 netfilter: ctnetlink: Support offloaded conntrack entry deletion
| * 18c14d3028 ipv{4,6}/raw: fix output xfrm lookup wrt protocol
| * 2218752325 binder: fix UAF caused by faulty buffer cleanup
| * e4d2e6c305 bluetooth: Add cmd validity checks at the start of hci_sock_ioctl()
| * 6a0712d9fe net: phy: mscc: enable VSC8501/2 RGMII RX clock
| * b556990235 net/mlx5: Devcom, serialize devcom registration
| * 57dc3c124e net/mlx5: devcom only supports 2 ports
| * 860ad704e4 regulator: pca9450: Fix BUCK2 enable_mask
| * b3a9c4081d regulator: pca9450: Convert to use regulator_set_ramp_delay_regmap
| * 12cb97ed85 regulator: Add regmap helper for ramp-delay setting
| * b557220d31 power: supply: bq24190: Call power_supply_changed() after updating input current
| * 224f7bbf57 power: supply: core: Refactor power_supply_set_input_current_limit_from_supplier()
| * 277b489ad0 power: supply: bq27xxx: After charger plug in/out wait 0.5s for things to stabilize
| * 0949c572d4 power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes
| * 6ed541254f power: supply: bq27xxx: Move bq27xxx_battery_update() down
| * ed78797a26 power: supply: bq27xxx: expose battery data when CI=1
| * 7ff807d68b power: supply: bq27xxx: Add cache parameter to bq27xxx_battery_current_and_status()
| * 432f98c559 power: supply: bq27xxx: make status more robust
| * 659094e405 power: supply: bq27xxx: fix sign of current_now for newer ICs
| * 14e1a958d9 power: supply: bq27xxx: fix polarity of current_now
| * 18c9cf4633 x86/cpu: Drop spurious underscore from RAPTOR_LAKE #define
| * 4a8980cb2a x86/cpu: Add Raptor Lake to Intel family
* | f8e9848656 Revert "tipc: add tipc_bearer_min_mtu to calculate min mtu"
* | 7ae5626406 Revert "tipc: do not update mtu if msg_max is too small in mtu negotiation"
* | 4a7c41b710 Revert "tipc: check the bearer min mtu properly when setting it by netlink"
* | f015c92c49 Revert "ipv4/tcp: do not use per netns ctl sockets"
* | 8231b54cd2 ANDROID: GKI: preserve CRC generation for some bluetooth symbols
* | a4be51e26a Revert "net: Find dst with sk's xfrm policy not ctl_sk"
* | c86beaeed1 Revert "tcp: fix possible sk_priority leak in tcp_v4_send_reset()"
* | 7c491aaf07 Revert "firmware: arm_sdei: Fix sleep from invalid context BUG"
* | 6d62ca19a7 Merge 5.10.181 into android12-5.10-lts
|\|
| * 272d4b8a5b Linux 5.10.181
| * cf7ee4b158 net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE
| * 98cedb9910 3c589_cs: Fix an error handling path in tc589_probe()
| * 6f449e409b arm64: dts: imx8mn-var-som: fix PHY detection bug by adding deassert delay
| * d4d10a6df1 net/mlx5: Devcom, fix error flow in mlx5_devcom_register_device
| * 8b9c561b9f net/mlx5: Fix error message when failing to allocate device memory
| * c21862232f net/mlx5: DR, Fix crc32 calculation to work on big-endian (BE) CPUs
| * 058fd18e74 net/mlx5e: do as little as possible in napi poll when budget is 0
| * 5afd5fb8a9 forcedeth: Fix an error handling path in nv_probe()
| * 80a4b9ad42 ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
| * c966b58c85 x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
| * 0de80163de xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
| * b663696c06 coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
| * a52d2019ec fs: fix undefined behavior in bit shift for SB_NOUSER
| * 52967bbb93 power: supply: sbs-charger: Fix INHIBITED bit for Status reg
| * e85757da90 power: supply: bq27xxx: Fix poll_interval handling and races on remove
| * 1da9a4b55a power: supply: bq27xxx: Fix I2C IRQ race on remove
| * ac1ab21394 power: supply: bq27xxx: Fix bq27xxx_battery_update() race condition
| * 2de6eb7c40 power: supply: leds: Fix blink to LED on transition
| * e5f82688ae ipv6: Fix out-of-bounds access in ipv6_find_tlv()
| * a61d5c13c7 bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
| * 72971f4071 octeontx2-pf: Fix TSOv6 offload
| * 1c8a016822 selftests: fib_tests: mute cleanup error message
| * a594382ec6 net: fix skb leak in __skb_tstamp_tx()
| * 8a30dce9d7 media: radio-shark: Add endpoint checks
| * ccef03c511 USB: sisusbvga: Add endpoint checks
| * 4c260bbf35 USB: core: Add routines for endpoint checks in old drivers
| * 5014b64e36 udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().
| * 4bb955c4d2 net: fix stack overflow when LRO is disabled for virtual interfaces
| * 58ecc165ab fbdev: udlfb: Fix endpoint check
| * fd67307974 debugobjects: Don't wake up kswapd from fill_pool()
| * a12ce786be x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms
| * 518c39fc1e parisc: Fix flush_dcache_page() for usage from irq context
| * 2d78438c31 selftests/memfd: Fix unknown type name build failure
| * d4a5e6ae99 x86/mm: Avoid incomplete Global INVLPG flushes
| * 628d7e4941 dt-binding: cdns,usb3: Fix cdns,on-chip-buff-size type
| * 139f84c80d btrfs: use nofs when cleaning up aborted transactions
| * ea50ee0ef9 gpio: mockup: Fix mode of debugfs files
| * c570dbf279 parisc: Allow to reboot machine after system halt
| * de0d7dd5ef parisc: Handle kgdb breakpoints only in kernel context
| * 89eba5586a m68k: Move signal frame following exception on 68020/030
| * 42b78c8cc7 net: cdc_ncm: Deal with too low values of dwNtbOutMaxSize
| * 798c1c62cf ALSA: hda/realtek: Enable headset onLenovo M70/M90
| * 1f57a1b979 ALSA: hda: Fix unhandled register update during auto-suspend period
| * b0d7e62fd1 ALSA: hda/ca0132: add quirk for EVGA X299 DARK
| * c41324385a ocfs2: Switch to security_inode_init_security()
| * 60afe299bb spi: fsl-cpm: Use 16 bit mode for large transfers with even size
| * e3674788a8 spi: fsl-spi: Re-organise transfer bits_per_word adaptation
| * 5324510378 act_mirred: use the backlog for nested calls to mirred ingress
| * f5bf8e3ca1 net/sched: act_mirred: better wording on protection against excessive stack growth
| * bba7ebe10b net/sched: act_mirred: refactor the handle of xmit
| * 047f618d19 writeback, cgroup: remove extra percpu_ref_exit()
| * 84fbe6ad0f ARM: dts: stm32: fix AV96 board SAI2 pin muxing on stm32mp15
| * dbcc95bb51 watchdog: sp5100_tco: Immediately trigger upon starting.
| * 75258f0838 s390/qdio: fix do_sqbs() inline assembly constraint
| * 3681a0287a s390/qdio: get rid of register asm
| * 9c9f253fc6 serial: 8250_exar: Add support for USR298x PCI Modems
| * 1ffa0b8ba9 serial: exar: Add support for Sealevel 7xxxC serial cards
| * fb3c5714f5 serial: 8250_exar: derive nr_ports from PCI ID for Acces I/O cards
| * 18fbf8cfbb KVM: arm64: Link position-independent string routines into .hyp.text
| * e266da1656 HID: wacom: add three styli to wacom_intuos_get_tool_type
| * dfd419db03 HID: wacom: Add new Intuos Pro Small (PTH-460) device IDs
| * 05b1703797 HID: wacom: Force pen out of prox if no events have been received in a while
| * 6b4205ea97 nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()
| * 710dee5701 powerpc/64s/radix: Fix soft dirty tracking
| * ae149cdaef tpm/tpm_tis: Disable interrupts for more Lenovo devices
| * 8c0109d762 ceph: force updating the msg pointer in non-split case
| * 11dddfbb7a vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF
| * ea3d5de90b serial: Add support for Advantech PCI-1611U card
| * ba061afa06 statfs: enforce statfs[64] structure initialization
| * 845f98af6a can: kvaser_pciefd: Disable interrupts in probe error path
| * 7a7ec807fe can: kvaser_pciefd: Do not send EFLUSH command on TFD interrupt
| * 65e85232ff can: kvaser_pciefd: Clear listen-only bit if not explicitly requested
| * 0babb3fabf can: kvaser_pciefd: Empty SRB buffer in probe
| * 03714e9c04 can: kvaser_pciefd: Call request_irq() before enabling interrupts
| * 3bbeba3ce1 can: kvaser_pciefd: Set CAN_STATE_STOPPED in kvaser_pciefd_stop()
| * 073a4d750c can: isotp: recvmsg(): allow MSG_CMSG_COMPAT flag
| * b4b8294a41 can: j1939: recvmsg(): allow MSG_CMSG_COMPAT flag
| * f7f799a6fe ALSA: hda/realtek: Add quirk for 2nd ASUS GU603
| * b4f770e612 ALSA: hda/realtek: Add a quirk for HP EliteDesk 805
| * 6cebdffba6 ALSA: hda/realtek: Add quirk for Clevo L140AU
| * 3add6b2a4a ALSA: hda: Add NVIDIA codec IDs a3 through a7 to patch table
| * 546b1f5f45 ALSA: hda: Fix Oops by 9.1 surround channel names
| * ff466f77d0 usb: typec: altmodes/displayport: fix pin_assignment_show
| * 35e31e1e92 usb: gadget: u_ether: Fix host MAC address case
| * e35adb75fd usb: dwc3: debugfs: Resume dwc3 before accessing registers
| * 66070f5b99 USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value
| * 0caed1faf5 usb-storage: fix deadlock when a scsi command timeouts more than once
| * 6340e432cf USB: usbtmc: Fix direction for 0-length ioctl control messages
| * 3b3c6f2d2f ALSA: usb-audio: Add a sample rate workaround for Line6 Pod Go
| * 3bd6d11e7e bridge: always declare tunnel functions
| * 3fa13203b6 netfilter: nft_set_rbtree: fix null deref on element insertion
| * 6cfe6f5185 vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
| * 562ec162b0 igb: fix bit_shift to be in [1..8] range
| * dc61f7582c cassini: Fix a memory leak in the error handling path of cas_init_one()
| * 81139679f4 scsi: storvsc: Don't pass unused PFNs to Hyper-V host
| * d0d39bed9e wifi: iwlwifi: mvm: don't trust firmware n_channels
| * f9337a4177 wifi: mac80211: fix min center freq offset tracing
| * 43f6575004 net: bcmgenet: Restore phy_stop() depending upon suspend/close
| * e92727ed9e net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()
| * 2937127d24 tipc: check the bearer min mtu properly when setting it by netlink
| * 2bd4ff4ffb tipc: do not update mtu if msg_max is too small in mtu negotiation
| * 097ea78d8c tipc: add tipc_bearer_min_mtu to calculate min mtu
| * 76ea144a35 net/tipc: fix tipc header files for kernel-doc
| * 02b20e0bc0 net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
| * 01cdda0d27 drm/exynos: fix g2d_open/close helper function definitions
| * ce97bb60a6 SUNRPC: Fix trace_svc_register() call site
| * f9982db735 media: netup_unidvb: fix use-after-free at del_timer()
| * 0cefa42152 net: hns3: fix reset delay time to avoid configuration timeout
| * aba74ad998 net: hns3: fix sending pfc frames after reset issue
| * e1f800be74 erspan: get the proto with the md version for collect_md
| * 153017561d serial: arc_uart: fix of_iomap leak in `arc_serial_probe`
| * e7fd68abbb tcp: fix possible sk_priority leak in tcp_v4_send_reset()
| * 788791990d net: Find dst with sk's xfrm policy not ctl_sk
| * a9ef8b2589 ipv4/tcp: do not use per netns ctl sockets
| * 1716699177 vsock: avoid to close connected socket after the timeout
| * b1cf6bd883 ALSA: hda/realtek: Apply HP B&O top speaker profile to Pavilion 15
| * 13c5fa1248 ALSA: firewire-digi00x: prevent potential use after free
| * 6fb537895d net: phy: dp83867: add w/a for packet errors seen with short cables
| * 83996d317b net: fec: Better handle pm_runtime_get() failing in .remove()
| * 8f57715f8e af_key: Reject optional tunnel/BEET mode templates in outbound policies
| * f5cb28a90c cpupower: Make TSC read per CPU for Mperf monitor
| * dc30fed07d drm/msm/dpu: Remove duplicate register defines from INTF
| * eaf9394ed7 drm/msm/dp: unregister audio driver during unbind
| * c5449195f8 Revert "Fix XFRM-I support for nested ESP tunnels"
| * 295e07a76b xfrm: don't check the default policy if the policy allows the packet
| * 84fdaaf0d7 btrfs: fix space cache inconsistency after error loading it from disk
| * a842fb6038 btrfs: replace calls to btrfs_find_free_ino with btrfs_find_free_objectid
| * 9c69a9d058 btrfs: move btrfs_find_highest_objectid/btrfs_find_free_objectid to disk-io.c
| * 6a1a72a8cf mfd: dln2: Fix memory leak in dln2_probe()
| * 7d939e367b phy: st: miphy28lp: use _poll_timeout functions for waits
| * 3b37bb0d92 Input: xpad - add constants for GIP interface numbers
| * 94ec1a44e8 iommu/arm-smmu-v3: Acknowledge pri/event queue overflow if any
| * cae5f8f4f7 clk: tegra20: fix gcc-7 constant overflow warning
| * 8c472e68be iommu/arm-smmu-qcom: Limit the SMR groups to 128
| * 214ae2c1a9 RDMA/core: Fix multiple -Warray-bounds warnings
| * 2d9ca5f62f recordmcount: Fix memory leaks in the uwrite function
| * cf3e291601 sched: Fix KCSAN noinstr violation
| * 158502f790 mcb-pci: Reallocate memory region to avoid memory overlapping
| * 2c86a1305c serial: 8250: Reinit port->pm on port specific driver unbind
| * 7ed30db879 usb: typec: tcpm: fix multiple times discover svids error
| * 60fabcba75 HID: wacom: generic: Set battery quirk only when we see battery data
| * d234de1a92 spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3
| * 0898a1df72 HID: logitech-hidpp: Reconcile USB and Unifying serials
| * 958534d436 HID: logitech-hidpp: Don't use the USB serial for USB devices
| * bb1313f37e staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
| * 55410a9144 Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
| * a2d816f55d Bluetooth: hci_bcm: Fall back to getting bdaddr from EFI if not set
| * ba66851aba ipvs: Update width of source for ip_vs_sync_conn_options
| * 866921dc06 wifi: ath11k: Fix SKB corruption in REO destination ring
| * 91ad1ab3cc wifi: iwlwifi: dvm: Fix memcpy: detected field-spanning write backtrace
| * e732a266b9 null_blk: Always check queue mode setting from configfs
| * 059e426d66 wifi: iwlwifi: pcie: Fix integer overflow in iwl_write_to_user_buf
| * 0fc0d287c1 wifi: iwlwifi: pcie: fix possible NULL pointer dereference
| * 7560ed6592 samples/bpf: Fix fout leak in hbm's run_bpf_prog
| * ad87bd313f f2fs: fix to drop all dirty pages during umount() if cp_error is set
| * fc7237e191 ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()
| * 3ca3005b50 ext4: set goal start correctly in ext4_mb_normalize_request
| * 4c2c8f9599 gfs2: Fix inode height consistency check
| * 697f92f831 scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition
| * f748e15253 lib: cpu_rmap: Avoid use after free on rmap->obj array entries
| * 4621e24c92 scsi: target: iscsit: Free cmds before session free
| * 2ea171230a net: Catch invalid index in XPS mapping
| * 8b61e7ad13 net: pasemi: Fix return type of pasemi_mac_start_tx()
| * e0e7faee3a scsi: lpfc: Prevent lpfc_debugfs_lockstat_write() buffer overflow
| * 22ab5fed07 ext2: Check block size validity during mount
| * 4e8dc0e5c7 wifi: brcmfmac: cfg80211: Pass the PMK in binary instead of hex
| * e8d49d1c59 bpf: Annotate data races in bpf_local_storage
| * 30d041c18d wifi: ath: Silence memcpy run-time false positive warning
| * b8e7589f50 drm/amd: Fix an out of bounds error in BIOS parser
| * 978e0d0554 ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
| * 16359bc02c ACPICA: Avoid undefined behavior: applying zero offset to null pointer
| * 3f64a0e664 drm/tegra: Avoid potential 32-bit integer overflow
| * f718f1fd3e remoteproc: stm32_rproc: Add mutex protection for workqueue
| * 066b90bca7 ACPI: EC: Fix oops when removing custom query handlers
| * 7d8f5ccc82 firmware: arm_sdei: Fix sleep from invalid context BUG
| * 5c23f6da62 memstick: r592: Fix UAF bug in r592_remove due to race condition
| * ae6769fb93 arm64: dts: qcom: msm8996: Add missing DWC3 quirks
| * bb1616e105 regmap: cache: Return error in cache sync operations for REGCACHE_NONE
| * d5138ad7ca drm/amd/display: Use DC_LOG_DC in the trasform pixel function
| * c8daee6658 fs: hfsplus: remove WARN_ON() from hfsplus_cat_{read,write}_inode()
| * a7d21b8585 rcu: Protect rcu_print_task_exp_stall() ->exp_tasks access
| * e4842de4ec refscale: Move shutdown from wait_event() to wait_event_idle()
| * 100c0ad6c0 ext4: allow ext4_get_group_info() to fail
| * 371d8b8ea0 ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set
| * 8669fff0d0 ext4: add mballoc stats proc file
| * 9b6a0c140e ext4: drop s_mb_bal_lock and convert protected fields to atomic
| * 0983142c5f ext4: remove redundant mb_regenerate_buddy()
| * d48b7eea94 ext4: fix lockdep warning when enabling MMP
| * 5c87115520 ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled
| * 8284c7592d ext4: reflect error codes from ext4_multi_mount_protect() to its callers
| * efd18a91c9 ext4: remove an unused variable warning with CONFIG_QUOTA=n
| * df1be652a4 fbdev: arcfb: Fix error handling in arcfb_probe()
| * bd6b353671 drm/i915/dp: prevent potential div-by-zero
| * 8307e372e7 af_unix: Fix data races around sk->sk_shutdown.
| * 9b977b0cbb af_unix: Fix a data race of sk->sk_receive_queue->qlen.
| * fb6ac4b5bd net: datagram: fix data-races in datagram_poll()
| * f4a371d3f5 ipvlan:Fix out-of-bounds caused by unclear skb->cb
| * 963fe9ed86 tcp: add annotations around sk->sk_shutdown accesses
| * f86568eca4 tcp: factor out __tcp_close() helper
| * 34a5ee69ec net: add vlan_get_protocol_and_depth() helper
| * 9ccf3edbaf net: tap: check vlan with eth_type_vlan() method
| * 4493914009 net: deal with most data-races in sk_wait_event()
| * 1b33bdd766 net: annotate sk->sk_err write from do_recvmmsg()
| * f92557f79a netlink: annotate accesses to nlk->cb_running
| * 26001e75dc netfilter: conntrack: fix possible bug_on with enable_hooks=1
| * d06f67b2b8 net: Fix load-tearing on sk->sk_stamp in sock_recv_cmsgs().
| * 8eb35b1aca linux/dim: Do nothing if no time delta between samples
| * 4d3ae448e8 net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe()
| * b882224d73 ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings
| * 139c27648f drm/mipi-dsi: Set the fwnode for mipi_dsi_device
| * 423908e89d driver core: add a helper to setup both the of_node and fwnode of a device
* | 6229d57677 Revert "arm64: Stash shadow stack pointer in the task struct on interrupt"
* | d70c95bd81 Merge 5.10.180 into android12-5.10-lts
|\|
| * 4c893ff559 Linux 5.10.180
| * 3ebe5d6d69 drm/amd/display: Fix hang when skipping modeset
| * a992c387b4 mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock
| * f2656f437f drm/exynos: move to use request_irq by IRQF_NO_AUTOEN flag
| * 32232bcd4e printk: declare printk_deferred_{enter,safe}() in include/linux/printk.h
| * fcfe05990a KVM: x86: move guest_pv_has out of user_access section
| * 85cfbaa575 KVM: x86: do not report preemption if the steal time cache is stale
| * 4bffae22be KVM: x86: revalidate steal time cache if MSR value changes
| * e10a73f538 KVM: x86: do not set st->preempted when going back to user space
| * 0296620043 KVM: x86: Remove obsolete disabling of page faults in kvm_arch_vcpu_put()
| * 8e39c2f407 KVM: Fix steal time asm constraints
| * ebd3010d42 KVM: x86: Fix recording of guest steal time / preempted status
| * 4b19cbdb1d KVM: x86: Ensure PV TLB flush tracepoint reflects KVM behavior
| * 01c0002ec7 drbd: correctly submit flush bio on barrier
| * ef77d602e3 serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
| * 1a8822343e ext4: fix invalid free tracking in ext4_xattr_move_to_block()
| * b0fc279de4 ext4: remove a BUG_ON in ext4_mb_release_group_pa()
| * d88fe8e611 ext4: bail out of ext4_xattr_ibody_get() fails for any reason
| * 4597554b4f ext4: add bounds checking in get_max_inline_xattr_value_size()
| * 5f8b55136a ext4: fix deadlock when converting an inline directory in nojournal mode
| * 37c69da3ad ext4: improve error recovery code paths in __ext4_remount()
| * 08838aeefa ext4: check iomap type only if ext4_iomap_begin() does not fail
| * 4aa7f744fa ext4: fix data races when using cached status extents
| * 0dde3141c5 ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum
| * 5d356d902e ext4: fix WARNING in mb_find_extent
| * 529f41f0eb KVM: x86: do not report a vCPU as preempted outside instruction boundaries
| * 0cb6e9e7d3 KVM: x86: hyper-v: Avoid calling kvm_make_vcpus_request_mask() with vcpu_mask==NULL
| * 4502ebbdc0 HID: wacom: insert timestamp to packed Bluetooth (BT) events
| * 77fd800d3f HID: wacom: Set a default resolution for older tablets
| * c1420276be drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend
| * 20ca90ceda drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras
| * eed63477ae drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini()
| * c85327c1e9 drm/panel: otm8009a: Set backlight parent to panel device
| * 957904f531 f2fs: fix potential corruption when moving a directory
| * 4a638a9582 ARM: dts: s5pv210: correct MIPI CSIS clock name
| * fed6318e47 ARM: dts: exynos: fix WM8960 clock name in Itop Elite
| * 777952ce11 remoteproc: st: Call of_node_put() on iteration error
| * 30e0834bec remoteproc: stm32: Call of_node_put() on iteration error
| * 62fe5d74ef sh: nmi_debug: fix return value of __setup handler
| * 9245f34029 sh: init: use OF_EARLY_FLATTREE for early init
| * f19bc0d2a6 sh: mcount.S: fix build error when PRINTK is not enabled
| * bbad64abd6 sh: math-emu: fix macro redefined warning
| * 2d65c97777 inotify: Avoid reporting event with invalid wd
| * 73aef14407 platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i
| * 4b87eec73e platform/x86: touchscreen_dmi: Add upside-down quirk for GDIX1002 ts on the Juno Tablet
| * 8c2cdb7326 cifs: fix pcchunk length type in smb2_copychunk_range
| * 829c20fd7a btrfs: print-tree: parent bytenr must be aligned to sector size
| * 148b16cd30 btrfs: don't free qgroup space unless specified
| * 08fa23adbd btrfs: fix btrfs_prev_leaf() to not return the same key twice
| * 7a4db11f00 perf symbols: Fix return incorrect build_id size in elf_read_build_id()
| * 87a1fa0ad7 crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
| * be3517ae6b perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp()
| * 604b650fb5 perf pmu: zfree() expects a pointer to a pointer to zero it after freeing its contents
| * 1ebd0dfb27 perf vendor events power9: Remove UTF-8 characters from JSON files
| * 796616f216 net: enetc: check the index of the SFI rather than the handle
| * b6b15de512 virtio_net: suppress cpu stall when free_unused_bufs
| * c043714ef2 virtio_net: split free_unused_bufs()
| * 0773270b13 net: dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621
| * 0f1ad0ef60 ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init`
| * 7f497a9451 drm/amdgpu: add a missing lock for AMDGPU_SCHED
| * f00ef2618f af_packet: Don't send zero-byte data in packet_sendmsg_spkt().
| * 02359ba526 ionic: remove noise from ethtool rxnfc error msg
| * 3605b33184 octeontx2-vf: Detach LF resources on probe cleanup
| * ea7453f5e5 octeontx2-pf: Disable packet I/O for graceful exit
| * 15152b8a4b rxrpc: Fix hard call timeout units
| * 9291aba0ff sfc: Fix module EEPROM reporting for QSFP modules
| * 774da70521 net/sched: act_mirred: Add carrier check
| * f3fae1b1c7 watchdog: dw_wdt: Fix the error handling path of dw_wdt_drv_probe()
| * 3b7798b42e writeback: fix call of incorrect macro
| * f47f0fb5b5 net: dsa: mv88e6xxx: add mv88e6321 rsvd2cpu
| * d6f0687d50 sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()
| * 7311c8be37 net/sched: cls_api: remove block_cb from driver_list before freeing
| * cc8efc78c3 net/ncsi: clear Tx enable mode when handling a Config required AEN
| * fa19c533ab scsi: qedi: Fix use after free bug in qedi_remove()
| * 4285cc0a22 dm verity: fix error handling for check_at_most_once on FEC
| * fc097cfca0 dm verity: skip redundant verity_handle_err() on I/O errors
| * 26b1b0d0be mailbox: zynqmp: Fix counts of child nodes
| * 67fb57f247 mailbox: zynq: Switch to flexible array to simplify code
| * c4e636f025 crypto: ccp - Clear PSP interrupt status register before calling handler
| * 6f60aae72c ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus
| * 2fcb12b3f4 tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH
| * 6c2ee50c90 tty: clean include/linux/tty.h up
| * 57b510c7d3 tty: move some tty-only functions to drivers/tty/tty.h
| * 1924d47a28 tty: move some internal tty lock enums and functions out of tty.h
| * f665d81ffa tty: audit: move some local functions out of tty.h
| * 6a392b806f tty: create internal tty.h file
| * e044a24447 netfilter: nf_tables: deactivate anonymous set from preparation phase
| * a222d2794c scsi: target: core: Avoid smp_processor_id() in preemptible code
| * 14fc6af67b arm64: dts: qcom: sdm845: correct dynamic power coefficients
| * c820c05c5f sound/oss/dmasound: fix 'dmasound_setup' defined but not used
| * 9079ff34a1 debugobject: Ensure pool refill (again)
| * 3f225f29c6 arm64: Stash shadow stack pointer in the task struct on interrupt
* | d9baf420d0 Merge 9134b5a464 ("arm64: Always load shadow stack pointer directly from the task struct") into android12-5.10-lts
|\|
| * 9134b5a464 arm64: Always load shadow stack pointer directly from the task struct
* | 4a2ed7d4bc Merge a25a403e4b ("perf intel-pt: Fix CYC timestamps after standalone CBR") into android12-5.10-lts
|\|
| * a25a403e4b perf intel-pt: Fix CYC timestamps after standalone CBR
| * 905f847675 perf auxtrace: Fix address filter entire kernel size
* | 5cb8a3c82c Merge ea827627a9 ("dm ioctl: fix nested locking in table_clear() to remove deadlock concern") into android12-5.10-lts
|\|
| * ea827627a9 dm ioctl: fix nested locking in table_clear() to remove deadlock concern
* | e3f8cee7f9 Merge a1e3fffe02 ("dm flakey: fix a crash with invalid table line") into android12-5.10-lts
|\|
| * a1e3fffe02 dm flakey: fix a crash with invalid table line
* | eee3af95eb Merge 44f29e93a5 ("dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path") into android12-5.10-lts
|\|
| * 44f29e93a5 dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path
* | 7a6cb8c4fa Merge 717ceb487b ("dm clone: call kmem_cache_destroy() in dm_clone_init() error path") into android12-5.10-lts
|\|
| * 717ceb487b dm clone: call kmem_cache_destroy() in dm_clone_init() error path
* | c7f1b9f365 Merge eded3ad80a ("ia64: fix an addr to taddr in huge_pte_offset()") into android12-5.10-lts
|\|
| * eded3ad80a ia64: fix an addr to taddr in huge_pte_offset()
| * abb427cb77 s390/dasd: fix hanging blockdevice after request requeue
| * c96807a4ad btrfs: scrub: reject unsupported scrub flags
| * f7fd1eed31 scripts/gdb: fix lx-timerlist for Python3
| * 9aabb5f9ef afs: Fix updating of i_size with dv jump from server
| * 3530a795bb mfd: tqmx86: Correct board names for TQMxE39x
| * cbe060011b mfd: tqmx86: Specify IO port register range more precisely
| * 640a1f7e36 mfd: tqmx86: Add support for TQMx110EB and TQMxE40x
| * 4be49b7c24 mfd: tqmx86: Remove incorrect TQMx90UC board ID
| * 6697a3b0ed mfd: tqmx86: Do not access I2C_DETECT register through io_base
| * 15da2acad5 thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe
| * 08012d9edc dmaengine: at_xdmac: do not enable all cyclic channels
| * 4f6303fd8f dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing
| * b295431945 dmaengine: dw-edma: Fix to change for continuous transfer
| * da67d60467 phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
| * 45e4c00940 pwm: mtk-disp: Disable shadow registers before setting backlight values
| * 6d13804388 pwm: mtk-disp: Adjust the clocks to avoid them mismatch
| * 060bd30bf7 pwm: mtk-disp: Don't check the return code of pwmchip_remove()
| * 795cec288e leds: tca6507: Fix error handling of using fwnode_property_read_string
| * 033f00eb89 dmaengine: mv_xor_v2: Fix an error code.
| * 198fbdd106 leds: TI_LMU_COMMON: select REGMAP instead of depending on it
| * 770b061363 ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
| * 8f009ae90b openrisc: Properly store r31 to pt_regs on unhandled exceptions
| * 1fe1580521 clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
| * 3bc78eddf0 RDMA/mlx5: Use correct device num_ports when modify DC
| * 95468f165d SUNRPC: remove the maximum number of retries in call_bind_status
| * 50440cdb0b RDMA/mlx5: Fix flow counter query via DEVX
| * 0d6a5c9489 Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
| * 09bfd90d04 input: raspberrypi-ts: Release firmware handle when not needed
| * 3aa2503717 firmware: raspberrypi: Introduce devm_rpi_firmware_get()
| * 73a65744c7 NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease
| * 9c4c6512d7 IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests
| * f84c025978 IB/hfi1: Add additional usdma traces
| * 1af73620a1 IB/hfi1: Add AIP tx traces
| * 823b59fc56 IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order
| * 8ec6acdb9b RDMA/srpt: Add a check for valid 'mad_agent' pointer
| * 16f596cfe9 RDMA/cm: Trace icm_send_rej event before the cm state is reset
| * 3ef7a4c0d5 RDMA/siw: Remove namespace check from siw_netdev_event()
| * ac7f79ee11 clk: add missing of_node_put() in "assigned-clocks" property parsing
| * 391fbf0d08 power: supply: generic-adc-battery: fix unit scaling
| * 9e5a7c1106 rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
| * 9ad3221c86 RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
| * 889a2070dc rtc: omap: include header for omap_rtc_power_off_program prototype
* | b38d756cea Revert "workqueue: Rename "delayed" (delayed by active management) to "inactive""
* | 24c41942a4 Revert "workqueue: Fix hung time report of worker pools"
* | 24c3784e97 Merge 647781347a ("workqueue: Fix hung time report of worker pools") into android12-5.10-lts
|\|
| * 647781347a workqueue: Fix hung time report of worker pools
| * 77d9a64cfb workqueue: Rename "delayed" (delayed by active management) to "inactive"
* | de3c7c404a Merge 960167e0e0 ("RDMA/rdmavt: Delete unnecessary NULL check") into android12-5.10-lts
|\|
| * 960167e0e0 RDMA/rdmavt: Delete unnecessary NULL check
| * f7790aecb3 RDMA/siw: Fix potential page_array out of range access
| * ab8646c9a0 clk: at91: clk-sam9x60-pll: fix return value check
| * 8f381b2494 perf/core: Fix hardlockup failure caused by perf throttle
| * 3ea9186a3e powerpc/rtas: use memmove for potentially overlapping buffer copy
| * 6339b9dcdb macintosh: via-pmu-led: requires ATA to be set
| * 15f3a811bf powerpc/sysdev/tsi108: fix resource printk format warnings
| * 4f41f55d82 powerpc/wii: fix resource printk format warnings
| * 701e3e5999 powerpc/mpc512x: fix resource printk format warning
| * d68265ec0b macintosh/windfarm_smu_sat: Add missing of_node_put()
| * c45ab3ab9c spmi: Add a check for remove callback when removing a SPMI driver
| * 4ca4a3e454 staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
| * d5d628fea5 serial: 8250: Add missing wakeup event reporting
| * fde8ffaaac tty: serial: fsl_lpuart: adjust buffer length to the intended size
| * 5a76bc35cc firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
| * 012936502a usb: mtu3: fix kernel panic at qmu transfer done irq handler
| * e8f64f3200 usb: chipidea: fix missing goto in `ci_hdrc_probe`
| * 7d667749b3 usb: gadget: tegra-xudc: Fix crash in vbus_draw
| * 95d97e182d sh: sq: Fix incorrect element size for allocating bitmap buffer
* | 01e0792f60 Revert "uapi/linux/const.h: prefer ISO-friendly __typeof__"
* | 2343b43cca Merge a69eb1200e ("uapi/linux/const.h: prefer ISO-friendly __typeof__") into android12-5.10-lts
|\|
| * a69eb1200e uapi/linux/const.h: prefer ISO-friendly __typeof__
* | 2dcf843019 Merge fd7bf900c3 ("i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path") into android12-5.10-lts
|\|
| * fd7bf900c3 i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path
| * b24f1ecc8f spi: cadence-quadspi: fix suspend-resume implementations
| * b5a6930fc6 ASoC: fsl_mqs: move of_node_put() to the correct location
| * 5bf2d84074 coresight: etm_pmu: Set the module field
| * 174d7483f1 scripts/gdb: bail early if there are no generic PD
| * 01710564a9 scripts/gdb: bail early if there are no clocks
| * b4b4409510 ia64: salinfo: placate defined-but-not-used warning
| * 65b5b2c5fd ia64: mm/contig: fix section mismatch warning/error
| * fd4e45d8d7 PCI/EDR: Clear Device Status after EDR error recovery
| * 9e5ee4fa0d of: Fix modalias string generation
| * 85b4aa4eb2 vmci_host: fix a race condition in vmci_host_poll() causing GPF
| * 4bdae667f9 spi: fsl-spi: Fix CPM/QE mode Litte Endian
| * bc88243bbe spi: qup: Don't skip cleanup in remove's error path
| * 00c5b5498b linux/vt_buffer.h: allow either builtin or modular for macros
| * d4a3c912c8 ASoC: es8316: Handle optional IRQ assignment
| * 67b6e077fb ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ
| * eb971efca7 PCI: imx6: Install the fault handler only on compatible match
| * 36c237b202 usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
| * aa93a46f99 spi: imx: Don't skip cleanup in remove's error path
| * c3aba912f4 spi: spi-imx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
| * f1f3bc9915 iio: light: max44009: add missing OF device matching
| * ed1f459af6 fpga: bridge: fix kernel-doc parameter description
| * 98bf98e749 usb: dwc3: gadget: Change condition for processing suspend event
| * 8a859ac86d usb: host: xhci-rcar: remove leftover quirk handling
| * c76ba91791 pstore: Revert pmsg_lock back to a normal mutex
| * 7d285c6cfe ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it
| * 230a5ed7d8 tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp.
| * 0abcb0b0d6 net: amd: Fix link leak when verifying config failed
| * b978d22fa1 netlink: Use copy_to_user() for optval in netlink_getsockopt().
| * 0837d10f6c Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work"
| * 566785731c ipv4: Fix potential uninit variable access bug in __ip_make_skb()
| * 4b8a05e380 net/sched: sch_fq: fix integer overflow of "credit"
| * cb71b24a89 netfilter: nf_tables: don't write table validation state without mutex
| * f4fc43fde1 bpf: Don't EFAULT for getsockopt with optval=NULL
| * 80090acb58 ixgbe: Enable setting RSS table to default values
| * 7a150a5b54 ixgbe: Allow flow hash to be set via ethtool
| * 89496d6cff wifi: iwlwifi: fw: fix memory leak in debugfs
| * f4eb14d261 wifi: iwlwifi: mvm: check firmware response size
| * 4ff7c0fbb3 wifi: iwlwifi: make the loop for card preparation effective
| * 62fde46517 jdb2: Don't refuse invalidation of already invalidated buffers
| * 038cbab550 wifi: iwlwifi: fw: move memset before early return
| * c0ca382419 wifi: iwlwifi: yoyo: Fix possible division by zero
| * 2a65555f7e md/raid10: fix memleak of md thread
| * 6361b0592b md/raid10: fix memleak for 'conf->bio_split'
| * 1697fb124c md/raid10: fix leak of 'r10bio->remaining' for recovery
| * fcacaa9d04 bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap
| * 21f2503d37 nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage"
| * e119d19183 nvme: fix async event trace event
| * a9e3d9bac9 nvme: handle the persistent internal error AER
| * 2f93072222 bpf, sockmap: fix deadlocks in the sockhash and sockmap
| * 2be04fa7ee net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling
| * bab8dc38b1 scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
| * b2f423fda6 f2fs: fix to avoid use-after-free for cached IPU bio
| * 5877980dc2 xsk: Fix unaligned descriptor validation
| * 2a67bc52cd crypto: drbg - Only fail when jent is unavailable in FIPS mode
| * 9dbdedd44f crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors
| * 27942f477d bpftool: Fix bug for long instructions in program CFG dumps
| * 072d16abf5 selftests/bpf: Wait for receive in cg_storage_multi test
| * d64a12eeb4 net: qrtr: correct types of trace event parameters
| * dc55805db2 wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_reg()
| * c621697505 wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_rfreg()
* | be7602cdd6 Merge adc2d82eee ("crypto: sa2ul - Select CRYPTO_DES") into android12-5.10-lts
|\|
| * adc2d82eee crypto: sa2ul - Select CRYPTO_DES
| * de3908e151 crypto: caam - Clear some memory in instantiate_rng
| * a8226a45b2 f2fs: compress: fix to call f2fs_wait_on_page_writeback() in f2fs_write_raw_pages()
| * d11a74577c f2fs: apply zone capacity to all zone type
| * d420c4a06d f2fs: enforce single zone capacity
| * c3a1914b96 f2fs: handle dqget error in f2fs_transfer_project_quota()
| * 202048ec1e scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS
| * bfe67e0563 scsi: target: iscsit: Fix TAS handling during conn cleanup
| * e1f59cd18a scsi: target: Fix multiple LUN_RESET handling
| * 008b936bbd scsi: target: Make state_list per CPU
| * 7c8a29f1b2 scsi: target: Rename cmd.bad_sector to cmd.sense_info
| * 621c89a021 scsi: target: Rename struct sense_info to sense_detail
| * 05c6db12ae net/packet: convert po->auxdata to an atomic flag
| * 5ca1be3658 net/packet: convert po->origdev to an atomic flag
| * 8bb81a925a net/packet: annotate accesses to po->xmit
| * ba6d56b20e vlan: partially enable SIOCSHWTSTAMP in container
| * 118df5df1b bpf: Remove misleading spec_v1 check on var-offset stack read
| * 10c1051267 scm: fix MSG_CTRUNC setting condition for SO_PASSSEC
| * 10702be8b3 bpf: fix precision propagation verbose logging
| * 6be8ad4cdc bpf: take into account liveness when propagating precision
| * 243fab8e37 wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()
| * 1980dd8c53 wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
| * 3ab6ec6c48 tools: bpftool: Remove invalid \' json escape
| * 1300517e37 wifi: ath6kl: reduce WARN to dev_dbg() in callback
| * 6c91b3b57b wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()
| * 320d760a35 wifi: ath9k: hif_usb: fix memory leak of remain_skbs
| * 129c3fb579 wifi: ath6kl: minor fix for allocation size
| * c401368926 tick/common: Align tick period with the HZ tick.
| * 107ea1f63b tick: Get rid of tick_period
| * fdc4876746 tick/sched: Optimize tick_do_update_jiffies64() further
| * 93c4300836 tick/sched: Reduce seqcount held scope in tick_do_update_jiffies64()
| * ca721584e9 tick/sched: Use tick_next_period for lockless quick check
| * 780f303233 drm/i915: Make intel_get_crtc_new_encoder() less oopsy
| * 9edf5518db debugobject: Prevent init race with static objects
| * f16f065f8c arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step
| * 55fc2246c4 x86/ioapic: Don't return 0 from arch_dynirq_lower_bound()
| * dfce9bb351 regulator: stm32-pwr: fix of_iomap leak
| * a6aeba550c media: venus: dec: Fix handling of the start cmd
| * 3a227dc12b media: venus: vdec: Handle DRC after drain
| * 5bac3de7f4 media: venus: preserve DRC state across seeks
| * 4c1239274f media: venus: vdec: Make decoder return LAST flag for sufficient event
| * a30297bff8 media: venus: vdec: Fix non reliable setting of LAST flag
| * 025a34716c media: rc: gpio-ir-recv: Fix support for wake-up
| * 1acb982e36 media: rcar_fdp1: Fix refcount leak in probe and remove function
| * ccc454881f media: rcar_fdp1: Fix the correct variable assignments
| * ee24c9e232 media: rcar_fdp1: Make use of the helper function devm_platform_ioremap_resource()
| * bf91fb6c1e media: rcar_fdp1: fix pm_runtime_get_sync() usage count
| * 21de9d0daa media: rcar_fdp1: simplify error check logic at fdp_open()
| * 7dac96e9cc media: saa7134: fix use after free bug in saa7134_finidev due to race condition
| * e9d64e90a0 media: dm1105: Fix use after free bug in dm1105_remove due to race condition
| * de19d02d73 media: rkvdec: fix use after free bug in rkvdec_remove
| * 4883f0f7ee x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
| * 06140d6dfe regulator: core: Avoid lockdep reports when resolving supplies
| * 4c0b98d87c regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
| * e21c93b20a drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
| * 0fc1a90bce ARM: dts: gta04: fix excess dma channel usage
| * f59421334e mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
* | c83bfc082b Merge 1487b29030 ("ACPI: processor: Fix evaluating _PDC method when running as Xen dom0") into android12-5.10-lts
|\|
| * 1487b29030 ACPI: processor: Fix evaluating _PDC method when running as Xen dom0
| * ee22417f82 drm: msm: adreno: Disable preemption on Adreno 510
| * 00f02bb8cb drm/msm/adreno: drop bogus pm_runtime_set_active()
| * f9ba5962cc drm/msm/adreno: Defer enabling runpm until hw_init()
| * 9a3a907cf6 media: max9286: Free control handler
| * f8d28cecf2 drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
| * 076cdba34d firmware: qcom_scm: Clear download bit during reboot
| * 4362444dca media: bdisp: Add missing check for create_workqueue
| * a9b9ea0e63 x86/MCE/AMD: Use an u64 for bank_map
| * a8504f9a13 ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
| * 7d731faebc ARM: dts: qcom: ipq8064: reduce pci IO size to 64K
| * 870644bf1b ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
| * 4585591295 arm64: dts: qcom: msm8996: Fix the PCI I/O port range
| * b6082e8caa arm64: dts: qcom: ipq8074: Fix the PCI I/O port range
| * 5f6302ab78 arm64: dts: qcom: msm8998: Fix the PCI I/O port range
| * 212352542d arm64: dts: qcom: sdm845: Fix the PCI I/O port range
| * eb9c5b383e arm64: dts: qcom: sdm845: correct dynamic power coefficients
| * 94e6f7e757 arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name
| * e951bdaa65 EDAC/skx: Fix overflows on the DRAM row address mapping arrays
| * 6e6c27b2fb drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
| * 9c4c9010ae arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
| * fbfca9b839 arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
| * 08310f8109 soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
| * a1e6a4161a soc: ti: pm33xx: Enable basic PM runtime support for genpd
| * e33f374d65 drm/probe-helper: Cancel previous job before starting new one
| * 67f07215eb drm/vgem: add missing mutex_destroy
| * ae784c3ed3 drm/rockchip: Drop unbalanced obj unref
| * 056a1217cf erofs: fix potential overflow calculating xattr_isize
| * 7a4579cd6e erofs: stop parsing non-compact HEAD index if clusterofs is invalid
| * e5ec129158 tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
| * 933bfc5ad2 tpm, tpm: Implement usage counter for locality
| * 140735c46d tpm, tpm_tis: Claim locality before writing interrupt registers
| * 35ca7f6252 tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
| * cbb1dd2705 tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register
| * c62a2331ab tpm, tpm_tis: Do not skip reset of original interrupt vector
| * 3ec77043a2 selinux: ensure av_permissions.h is built when needed
| * fea3144639 selinux: fix Makefile dependencies of flask.h
| * 0c29f14cf4 selftests/resctrl: Check for return value after write_schemata()
| * 4075fbcde4 selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
| * d0653cc6e0 rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
| * d1ab8b54b2 clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
* | 6f849f24da Merge e0dd13b49d ("wifi: rtl8xxxu: RTL8192EU always needs full init") into android12-5.10-lts
|\|
| * e0dd13b49d wifi: rtl8xxxu: RTL8192EU always needs full init
| * 0fd9b0f611 mailbox: zynqmp: Fix typo in IPI documentation
| * 63314371eb mailbox: zynqmp: Fix IPI isr handling
| * bdbf104b1c md/raid10: fix null-ptr-deref in raid10_sync_request
| * 8a89d36a07 nilfs2: fix infinite loop in nilfs_mdt_get_block()
| * 7c3e662048 nilfs2: do not write dirty data after degenerating to read-only
| * e4b5264422 parisc: Fix argument pointer in real64_call_asm()
| * be649ea153 sound/oss/dmasound: fix build when drivers are mixed =y/=m
| * b8f444a4fa ubifs: Free memory for tmpfile name
| * 5b4b6cb724 ubi: Fix return value overwrite issue in try_write_vid_and_data()
| * 66e9f2fb3e ubifs: Fix memleak when insert_old_idx() failed
| * a4904c56fc Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path"
| * 87d98984b0 iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
| * db8b34ffb2 i2c: omap: Fix standard mode false ACK readings
| * 2b00b2a0e6 writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs
| * 1b0df44753 relayfs: fix out-of-bounds access in relay_file_read
| * e28df70df0 KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted
| * 680c419d0d reiserfs: Add security prefix to xattr name in reiserfs_security_write()
| * eb18bc5a86 rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed
| * 0a89d4a075 crypto: safexcel - Cleanup ring IRQ workqueues on load failure
| * ff86deaba1 crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
| * 1c99f65d6a ring-buffer: Sync IRQ works before buffer destruction
| * dda1372c8d pwm: meson: Fix g12a ao clk81 name
| * c1cabb10e0 pwm: meson: Fix axg ao mux parents
| * fcd2da2e6b kheaders: Use array declaration instead of char
| * 1b633da2fe ipmi: fix SSIF not responding under certain cond.
| * 6d5993d569 ipmi:ssif: Add send_retries increment
* | d7203e0307 Merge 47e61cadc7 ("MIPS: fw: Allow firmware to pass a empty env") into android12-5.10-lts
|\|
| * 47e61cadc7 MIPS: fw: Allow firmware to pass a empty env
| * 2884595932 tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
| * 29b89908fd xhci: fix debugfs register accesses while suspended
| * a863ac03fa staging: iio: resolver: ads1210: fix config mode
| * c8714ddf3c ext4: use ext4_journal_start/stop for fast commit transactions
| * 701a822076 blk-crypto: make blk_crypto_evict_key() more robust
| * 5072008bef blk-crypto: make blk_crypto_evict_key() return void
| * 874bdf43b4 blk-mq: release crypto keyslot before reporting I/O complete
| * 68494eb75f perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE)
| * 7c5811b95c posix-cpu-timers: Implement the missing timer_wait_running callback
| * aed39acf7e hwmon: (adt7475) Use device_property APIs when configuring polarity
| * b009006887 hwmon: (k10temp) Check range scale when CUR_TEMP register is read-write
| * a71cb92ec4 USB: dwc3: fix runtime pm imbalance on unbind
| * 27dc207c38 USB: dwc3: fix runtime pm imbalance on probe errors
| * b978269dda PCI: qcom: Fix the incorrect register usage in v2.7.0 config
| * 2f31633da8 PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
| * 5434c7019d wireguard: timers: cast enum limits members to int in prints
| * 69fdbb334d asm-generic/io.h: suppress endianness warnings for readq() and writeq()
| * 925cbb7253 ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750
| * f5e96af71e iio: adc: palmas_gpadc: fix NULL dereference on rmmod
| * 8aa079c2fd driver core: Don't require dynamic_debug for initcall_debug probe timing
| * f964a00386 USB: serial: option: add UNISOC vendor and TOZED LT70C product
| * c0e9214223 x86/fpu: Prevent FPU state corruption
| * 98cfbad52f bluetooth: Perform careful capability checks in hci_sock_ioctl()
| * dc110b20f4 drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var
| * 549825602e wifi: brcmfmac: slab-out-of-bounds read in brcmf_get_assoc_ies()
| * 1dd95b2109 KVM: arm64: Fix buffer overflow in kvm_arm_set_fw_reg()
| * 0f29d0e8fc counter: 104-quad-8: Fix race condition between FLAG and CNTR reads
| * d4a895e924 seccomp: Move copy_seccomp() to no failure path.
* | 571879dd5f Revert "sched/fair: Detect capacity inversion"
* | ce3ecd63bf Revert "sched/fair: Consider capacity inversion in util_fits_cpu()"
* | 652a7f2c7e Revert "sched/uclamp: Fix a uninitialized variable warnings"
* | e1be343429 Revert "sched/fair: Fixes for capacity inversion detection"
* | 4c20c2c837 Merge 5.10.179 into android12-5.10-lts
|\|
| * f1b32fda06 Linux 5.10.179
| * 0367bf3f4a ASN.1: Fix check for strdup() success
| * 4ab5f8f9d0 ASoC: fsl_asrc_dma: fix potential null-ptr-deref
| * 42604b4ad5 iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()
| * 155b2586de pwm: hibvt: Explicitly set .polarity in .get_state()
| * 1c3a121137 pwm: iqs620a: Explicitly set .polarity in .get_state()
| * b28079807d pwm: meson: Explicitly set .polarity in .get_state()
| * f69112de70 sctp: Call inet6_destroy_sock() via sk->sk_destruct().
| * 7da54ddc04 dccp: Call inet6_destroy_sock() via sk->sk_destruct().
| * 04d393c4bb inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().
| * b1f06ab985 tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct().
| * 0e7b5e1020 udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM).
| * 05cf34a2b6 ext4: fix use-after-free in ext4_xattr_set_entry
| * c75711396c ext4: remove duplicate definition of ext4_xattr_ibody_inline_set()
| * 9400206d9d Revert "ext4: fix use-after-free in ext4_xattr_set_entry"
| * 81775ab858 fuse: fix deadlock between atomic O_TRUNC and page invalidation
| * 03cefde986 fuse: always revalidate rename target dentry
| * 42dfdbd4dc fuse: fix attr version comparison in fuse_read_update_size()
| * 0078a1667c fuse: check s_root when destroying sb
| * 6d0d67b05f virtiofs: split requests that exceed virtqueue size
| * cf08dc7916 virtiofs: clean up error handling in virtio_fs_get_tree()
| * e220438d1e purgatory: fix disabling debug info
| * 37df709706 docs: futex: Fix kernel-doc references after code split-up preparation
| * 77748b0a04 MIPS: Define RUNTIME_DISCARD_EXIT in LD script
| * 4735b6f74f sched/fair: Fixes for capacity inversion detection
| * 89ad8a672f sched/uclamp: Fix a uninitialized variable warnings
| * 09129798a6 sched/fair: Consider capacity inversion in util_fits_cpu()
| * 30f04dd56d sched/fair: Detect capacity inversion
| * b18cbd359d sched/uclamp: Cater for uclamp in find_energy_efficient_cpu()'s early exit condition
| * 41a880740c sched/uclamp: Make cpu_overutilized() use util_fits_cpu()
| * 07750955e9 sched/uclamp: Make asym_fits_capacity() use util_fits_cpu()
| * 2fd1c194e6 sched/uclamp: Make select_idle_capacity() use util_fits_cpu()
| * 8ca2bf63d9 sched/uclamp: Fix fits_capacity() check in feec()
| * 5cb1a56ced sched/uclamp: Make task_fits_capacity() use util_fits_cpu()
| * 2523d9d7bb mm/khugepaged: check again on anon uffd-wp during isolation
| * 651b0bf43d mmc: sdhci_am654: Set HIGH_SPEED_ENA for SDR12 and SDR25
| * c61928fcca kernel/sys.c: fix and improve control flow in __sys_setres[ug]id()
| * e10a6d88ae memstick: fix memory leak if card device is never registered
| * 2c90ef3715 nilfs2: initialize unused bytes in segment summary blocks
| * 09daff9c3c iio: light: tsl2772: fix reading proximity-diodes from device tree
| * 77ac8f2ad4 xfs: drop submit side trans alloc for append ioends
| * a4e800a7bd powerpc/doc: Fix htmldocs errors
| * c215c63681 xen/netback: use same error messages for same errors
| * 0c9cbfc951 nvme-tcp: fix a possible UAF when failing to allocate an io queue
| * 8c746b6650 s390/ptrace: fix PTRACE_GET_LAST_BREAK error handling
| * a36246a748 net: dsa: b53: mmap: add phy ops
| * b33f28ea45 scsi: core: Improve scsi_vpd_inquiry() checks
| * 24ddcc6a63 scsi: megaraid_sas: Fix fw_crash_buffer_show()
| * 01bd481b1b selftests: sigaltstack: fix -Wuninitialized
| * 8b44a83a16 Input: i8042 - add quirk for Fujitsu Lifebook A574/H
| * 37882b203a f2fs: Fix f2fs_truncate_partial_nodes ftrace event
| * 9a8dbfd7f3 e1000e: Disable TSO on i219-LM card to increase speed
| * b1281d0088 bpf: Fix incorrect verifier pruning due to missing register precision taints
| * b085b5787b mlxsw: pci: Fix possible crash during initialization
| * c972851d38 net: rpl: fix rpl header size calculation
| * b6b06c5ee3 mlxfw: fix null-ptr-deref in mlxfw_mfa2_tlv_next()
| * 880c09bc2f i40e: fix i40e_setup_misc_vector() error handling
| * 72df55d3dc i40e: fix accessing vsi->active_filters without holding lock
| * 381110d061 netfilter: nf_tables: fix ifdef to also consider nf_tables=m
| * 6758a51ef3 sfc: Fix use-after-free due to selftest_work
| * 06a72bbf0d sfc: Split STATE_READY in to STATE_NET_DOWN and STATE_NET_UP.
| * b6dd232f63 virtio_net: bugfix overflow inside xdp_linearize_page()
| * ddcf35deb8 net: sched: sch_qfq: prevent slab-out-of-bounds in qfq_activate_agg
| * 8e73952957 regulator: fan53555: Explicitly include bits header
| * 3224458030 netfilter: br_netfilter: fix recent physdev match breakage
| * 08b78037c4 arm64: dts: imx8mm-evk: correct pmic clock source
| * 2c06e904c2 arm64: dts: meson-g12-common: specify full DMC range
| * b33dbd06ac arm64: dts: qcom: ipq8074-hk01: enable QMP device, not the PHY node
| * e662521ec7 ARM: dts: rockchip: fix a typo error for rk3288 spdif node
* | b6b9dff07b Merge branch android12-5.10 into android12-5.10-lts
* | 49df5be923 Revert "ASoC: hdac_hdmi: use set_stream() instead of set_tdm_slots()"
* | a406acdee0 ANDROID: preserve CRC for xhci symbols
* | a4023d8fc3 Revert "ipv4: shrink netns_ipv4 with sysctl conversions"
* | e2f3aab65b Revert "tcp: convert elligible sysctls to u8"
* | 036fa20734 Revert "tcp: restrict net.ipv4.tcp_app_win"
* | 2d6a4ad08c Merge 5.10.178 into android12-5.10-lts
|/
* 791a854ae5 Linux 5.10.178
* f177b382c3 sysctl: Fix data-races in proc_dou8vec_minmax().
* 56314b90fd panic, kexec: make __crash_kexec() NMI safe
* d425f34821 kexec: turn all kexec_mutex acquisitions into trylocks
* 784b6ba15e kexec: move locking into do_kexec_load
* 0b077b22ea riscv: Handle zicsr/zifencei issues between clang and binutils
* c36a251011 kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS
* d5f67f6d4e kbuild: Switch to 'f' variants of integrated assembler flag
* 83f55e6f29 kbuild: check the minimum assembler version in Kconfig
* 6facabb4d0 coresight-etm4: Fix for() loop drvdata->nr_addr_cmp range bug
* 7b78445bce watchdog: sbsa_wdog: Make sure the timeout programming is within the limits
* 10b7a33c5d i2c: ocores: generate stop condition after timeout in polling mode
* b4210b10dc x86/rtc: Remove __init for runtime functions
* ba4a2f6d99 sched/fair: Fix imbalance overflow
* 68387ae3b6 sched/fair: Move calculate of avg_load to a better location
* ccbec01cc9 powerpc/papr_scm: Update the NUMA distance table for the target node
* 453b3188be powerpc/pseries: Add support for FORM2 associativity
* 498618e0a1 powerpc/pseries: Add a helper for form1 cpu distance
* 18ce785eff powerpc/pseries: Consolidate different NUMA distance update code paths
* f2ae0eb96b powerpc/pseries: Rename TYPE1_AFFINITY to FORM1_AFFINITY
* f6d8a3a2ea powerpc/pseries: rename min_common_depth to primary_domain_index
* 5abf8af8df ubi: Fix deadlock caused by recursively holding work_sem
* 33611d4a81 mtd: ubi: wl: Fix a couple of kernel-doc issues
* 0279e82e14 ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
* 37a3cf4abc cgroup/cpuset: Wake up cpuset_attach_wq tasks in cpuset_cancel_attach()
* 10bda0ec31 x86/PCI: Add quirk for AMD XHCI controller that loses MSI-X state in D3hot
* 176d7345b8 scsi: ses: Handle enclosure with just a primary component gracefully
* cf22c98bcb net: sfp: initialize sfp->i2c_block_size at sfp allocation
* 2a4835b8ed riscv: add icache flush for nommu sigreturn trampoline
* c76e79e526 asymmetric_keys: log on fatal failures in PE/pkcs7
* 5de2e1f5e2 verify_pefile: relax wrapper length check
* e4b9f0bf91 drm: panel-orientation-quirks: Add quirk for Lenovo Yoga Book X90F
* 9f0ee9ed54 efi: sysfb_efi: Add quirk for Lenovo Yoga Book X91F/L
* e1f80b4dfa i2c: imx-lpi2c: clean rx/tx buffers upon new message
* 81c30f89b9 wifi: mwifiex: mark OF related data as maybe unused
* ab39582f30 power: supply: cros_usbpd: reclassify "default case!" as debug
* 6de0d0699f libbpf: Fix single-line struct definition output in btf_dump
* 1bec9da233 net: macb: fix a memory corruption in extended buffer descriptor mode
* 7d8c844b33 udp6: fix potential access to stale information
* d1b9b31916 RDMA/core: Fix GID entry ref leak when create_ah fails
* 79b28f4221 sctp: fix a potential overflow in sctp_ifwdtsn_skip
* 3814d211ff net: qrtr: Fix an uninit variable access bug in qrtr_tx_resume()
* dad92d8ada qlcnic: check pci_reset_function result
* 4a519731ec drm/armada: Fix a potential double free in an error handling path
* a069d4d98c tcp: restrict net.ipv4.tcp_app_win
* cc9f9a49f5 tcp: convert elligible sysctls to u8
* f662a0786d ipv4: shrink netns_ipv4 with sysctl conversions
* 389dab6142 sysctl: add proc_dou8vec_minmax()
* 8a1fdb3545 niu: Fix missing unwind goto in niu_alloc_channels()
* 9266e939d7 9p/xen : Fix use after free bug in xen_9pfs_front_remove due to race condition
* ae11498851 RDMA/cma: Allow UD qp_type to join multicast only
* 5e567fd296 IB/mlx5: Add support for 400G_8X lane speed
* a1d2fb5d13 IB/mlx5: Add support for NDR link speed
* 8a886f01b8 clk: sprd: set max_register according to mapping range
* 6e2845284b mtd: rawnand: stm32_fmc2: use timings.mode instead of checking tRC_min
* 9e946e4e8c mtd: rawnand: stm32_fmc2: remove unsupported EDO mode
* 6b0e719192 mtd: rawnand: meson: fix bitmask for length in command word
* 441e57ff87 mtdblock: tolerate corrected bit-flips
* 0d07ea8d38 fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace
* 5635e69406 btrfs: fix fast csum implementation detection
* 3576e08f19 btrfs: print checksum type and implementation at mount time
* f7ec5ca433 Bluetooth: Fix race condition in hidp_session_thread
* d9ba36c22a Bluetooth: L2CAP: Fix use-after-free in l2cap_disconnect_{req,rsp}
* 8533fe8645 ALSA: hda/sigmatel: fix S/PDIF out on Intel D*45* motherboards
* 8f6a20a4f4 ALSA: firewire-tascam: add missing unwind goto in snd_tscm_stream_start_duplex()
* 69108a8a45 ALSA: i2c/cs8427: fix iec958 mixer control deactivation
* e63a515d11 ALSA: hda/sigmatel: add pin overrides for Intel DP45SG motherboard
* df4af0ddf7 ALSA: emu10k1: fix capture interrupt handler unlinking
* 14e90335bc Revert "pinctrl: amd: Disable and mask interrupts on resume"
* 59dc9767ce bpftool: Print newline before '}' for struct with padding only fields
* 2765aca637 ocfs2: fix freeing uninitialized resource on ocfs2_dlm_shutdown
* a412ba6b6c Revert "media: ti: cal: fix possible memory leak in cal_ctx_create()"
* 2d96c8dca9 drm/bridge: lt9611: Fix PLL being unable to lock
* a2773afc81 selftests: intel_pstate: ftime() is deprecated
* ea8c42b3b6 mm/swap: fix swap_info_struct race between swapoff and get_swap_pages()
* 5a74837809 ring-buffer: Fix race while reader and writer are on the same page
* c1bbe926a1 drm/nouveau/disp: Support more modes by checking with lower bpc
* 8250f7f7ae drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path
* acbbfdba9c ASoC: hdac_hdmi: use set_stream() instead of set_tdm_slots()
* 6e36373aa5 tracing: Free error logs of tracing instances
* 9c5df2f14e can: isotp: isotp_ops: fix poll() to not report false EPOLLOUT events
* 70caa596d1 can: j1939: j1939_tp_tx_dat_new(): fix out-of-bounds memory access
* f018ef34c4 ftrace: Fix issue that 'direct->addr' not restored in modify_ftrace_direct()
* eadcad0a47 ftrace: Mark get_lock_parent_ip() __always_inline
* 9470fc63ab perf/core: Fix the same task check in perf_event_set_output
* 499757ad33 scsi: iscsi_tcp: Check that sock is valid before iscsi_set_param()
* 4bfdead174 iio: adc: ad7791: fix IRQ flags
* 14f9ff7857 ALSA: hda/realtek: Add quirk for Clevo X370SNW
* 1f3b8c3b04 dt-bindings: serial: renesas,scif: Fix 4th IRQ for 4-IRQ SCIFs
* 3dbee84bf9 nilfs2: fix sysfs interface lifetime
* f32297dba3 nilfs2: fix potential UAF of struct nilfs_sc_info in nilfs_segctor_thread()
* a17bed82c0 tty: serial: fsl_lpuart: avoid checking for transfer complete when UARTCTRL_SBK is asserted in lpuart32_tx_empty
* 25eff5e7f7 tty: serial: sh-sci: Fix Rx on RZ/G2L SCI
* 72a3e4fa88 tty: serial: sh-sci: Fix transmit end interrupt handler
* 741d73fc57 iio: light: cm32181: Unregister second I2C client if present
* 58bf30479a iio: dac: cio-dac: Fix max DAC write value check for 12-bit
* f47659f1e9 iio: adc: ti-ads7950: Set `can_sleep` flag for GPIO chip
* 52a003870e USB: serial: option: add Quectel RM500U-CN modem
* e6655d4837 USB: serial: option: add Telit FE990 compositions
* 9d1f2a6b8d usb: typec: altmodes/displayport: Fix configure initial pin assignment
* 4be2b71e9d USB: serial: cp210x: add Silicon Labs IFS-USB-DATACABLE IDs
* ec20260950 xhci: also avoid the XHCI_ZERO_64B_REGS quirk with a passthrough iommu
* b4b4f17aa4 usb: xhci: tegra: fix sleep in atomic call
* 07216da8fb NFSD: callback request does not use correct credential for AUTH_SYS
* a3c4aa48e5 sunrpc: only free unix grouplist after RCU settles
* 890517a4a2 net: stmmac: fix up RX flow hash indirection table when setting channels
* bdbbd3fa58 net: ethernet: ti: am65-cpsw: Fix mdio cleanup in probe
* d8c8476c14 gpio: davinci: Add irq chip flag to skip set wake
* 605b056d63 ipv6: Fix an uninit variable access bug in __ip6_make_skb()
* ff2565fb8f net: qrtr: Do not do DEL_SERVER broadcast after DEL_CLIENT
* b4b6dfad41 sctp: check send stream number after wait_for_sndbuf
* efda95cebf net: don't let netpoll invoke NAPI if in xmit context
* ec81049f09 icmp: guard against too small mtu
* 98a9cd82c5 net: qrtr: Fix a refcount bug in qrtr_recvmsg()
* 94c53d2949 net: qrtr: combine nameservice into main module
* 3fe2051544 wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for non-uploaded sta
* 2951229ee7 KVM: s390: pv: fix external interruption loop not always detected
* b43a8939f1 pwm: sprd: Explicitly set .polarity in .get_state()
* d59b83494d pwm: cros-ec: Explicitly set .polarity in .get_state()
* 176c6b4889 Drivers: vmbus: Check for channel allocation before looking up relids
* c51b336bd9 gpio: GPIO_REGMAP: select REGMAP instead of depending on it

Change-Id: I6a8130fdb5232ff7293bdb1bb84c5dc6dd2f4d47
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-07-10 16:27:04 +00:00
Zhang Zhengming
5db82d830f UPSTREAM: relayfs: fix out-of-bounds access in relay_file_read
commit 43ec16f1450f4936025a9bdf1a273affdb9732c1 upstream.

There is a crash in relay_file_read, as the var from
point to the end of last subbuf.

The oops looks something like:
pc : __arch_copy_to_user+0x180/0x310
lr : relay_file_read+0x20c/0x2c8
Call trace:
 __arch_copy_to_user+0x180/0x310
 full_proxy_read+0x68/0x98
 vfs_read+0xb0/0x1d0
 ksys_read+0x6c/0xf0
 __arm64_sys_read+0x20/0x28
 el0_svc_common.constprop.3+0x84/0x108
 do_el0_svc+0x74/0x90
 el0_svc+0x1c/0x28
 el0_sync_handler+0x88/0xb0
 el0_sync+0x148/0x180

We get the condition by analyzing the vmcore:

1). The last produced byte and last consumed byte
    both at the end of the last subbuf

2). A softirq calls function(e.g __blk_add_trace)
    to write relay buffer occurs when an program is calling
    relay_file_read_avail().

        relay_file_read
                relay_file_read_avail
                        relay_file_read_consume(buf, 0, 0);
                        //interrupted by softirq who will write subbuf
                        ....
                        return 1;
                //read_start point to the end of the last subbuf
                read_start = relay_file_read_start_pos
                //avail is equal to subsize
                avail = relay_file_read_subbuf_avail
                //from  points to an invalid memory address
                from = buf->start + read_start
                //system is crashed
                copy_to_user(buffer, from, avail)

Bug: 288957094
Link: https://lkml.kernel.org/r/20230419040203.37676-1-zhang.zhengming@h3c.com
Fixes: 8d62fdebda ("relay file read: start-pos fix")
Signed-off-by: Zhang Zhengming <zhang.zhengming@h3c.com>
Reviewed-by: Zhao Lei <zhao_lei1@hoperun.com>
Reviewed-by: Zhou Kete <zhou.kete@h3c.com>
Reviewed-by: Pengcheng Yang <yangpc@wangsu.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f6ee841ff2169d7a7d045340ee72b2b9de9f06c5)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ibbdf65d8bf2268c3e8c09520f595167a2ed41e8b
2023-07-04 09:12:16 +00:00
Greg Kroah-Hartman
02a1b32243 Merge 5.10.186 into android12-5.10-lts
Changes in 5.10.186
	drm/amd/display: fix the system hang while disable PSR
	net/sched: Refactor qdisc_graft() for ingress and clsact Qdiscs
	tracing: Add tracing_reset_all_online_cpus_unlocked() function
	tick/common: Align tick period during sched_timer setup
	selftests: mptcp: lib: skip if missing symbol
	selftests: mptcp: lib: skip if not below kernel version
	selftests: mptcp: pm nl: remove hardcoded default limits
	selftests: mptcp: join: skip check if MIB counter not supported
	nilfs2: fix buffer corruption due to concurrent device reads
	Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs
	PCI: hv: Fix a race condition bug in hv_pci_query_relations()
	Revert "PCI: hv: Fix a timing issue which causes kdump to fail occasionally"
	PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev
	PCI: hv: Fix a race condition in hv_irq_unmask() that can cause panic
	cgroup: Do not corrupt task iteration when rebinding subsystem
	mmc: sdhci-msm: Disable broken 64-bit DMA on MSM8916
	mmc: meson-gx: remove redundant mmc_request_done() call from irq context
	mmc: mmci: stm32: fix max busy timeout calculation
	ip_tunnels: allow VXLAN/GENEVE to inherit TOS/TTL from VLAN
	regulator: pca9450: Fix LDO3OUT and LDO4OUT MASK
	regmap: spi-avmm: Fix regmap_bus max_raw_write
	writeback: fix dereferencing NULL mapping->host on writeback_page_template
	io_uring/net: save msghdr->msg_control for retries
	io_uring/net: clear msg_controllen on partial sendmsg retry
	io_uring/net: disable partial retries for recvmsg with cmsg
	nilfs2: prevent general protection fault in nilfs_clear_dirty_page()
	x86/mm: Avoid using set_pgd() outside of real PGD pages
	mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%
	sysctl: move some boundary constants from sysctl.c to sysctl_vals
	memfd: check for non-NULL file_seals in memfd_create() syscall
	ieee802154: hwsim: Fix possible memory leaks
	xfrm: Treat already-verified secpath entries as optional
	xfrm: interface: rename xfrm_interface.c to xfrm_interface_core.c
	xfrm: Ensure policies always checked on XFRM-I input path
	bpf: track immediate values written to stack by BPF_ST instruction
	bpf: Fix verifier id tracking of scalars on spill
	xfrm: fix inbound ipv4/udp/esp packets to UDPv6 dualstack sockets
	selftests: net: vrf-xfrm-tests: change authentication and encryption algos
	selftests: net: fcnal-test: check if FIPS mode is enabled
	xfrm: Linearize the skb after offloading if needed.
	net: qca_spi: Avoid high load if QCA7000 is not available
	mmc: mtk-sd: fix deferred probing
	mmc: mvsdio: fix deferred probing
	mmc: omap: fix deferred probing
	mmc: omap_hsmmc: fix deferred probing
	mmc: owl: fix deferred probing
	mmc: sdhci-acpi: fix deferred probing
	mmc: sh_mmcif: fix deferred probing
	mmc: usdhi60rol0: fix deferred probing
	ipvs: align inner_mac_header for encapsulation
	net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
	be2net: Extend xmit workaround to BE3 chip
	netfilter: nft_set_pipapo: .walk does not deal with generations
	netfilter: nf_tables: disallow element updates of bound anonymous sets
	netfilter: nfnetlink_osf: fix module autoload
	Revert "net: phy: dp83867: perform soft reset and retain established link"
	sch_netem: acquire qdisc lock in netem_change()
	gpio: Allow per-parent interrupt data
	gpiolib: Fix GPIO chip IRQ initialization restriction
	scsi: target: iscsi: Prevent login threads from racing between each other
	HID: wacom: Add error check to wacom_parse_and_register()
	arm64: Add missing Set/Way CMO encodings
	media: cec: core: don't set last_initiator if tx in progress
	nfcsim.c: Fix error checking for debugfs_create_dir
	usb: gadget: udc: fix NULL dereference in remove()
	Input: soc_button_array - add invalid acpi_index DMI quirk handling
	s390/cio: unregister device when the only path is gone
	spi: lpspi: disable lpspi module irq in DMA mode
	ASoC: simple-card: Add missing of_node_put() in case of error
	ASoC: nau8824: Add quirk to active-high jack-detect
	s390/purgatory: disable branch profiling
	ARM: dts: Fix erroneous ADS touchscreen polarities
	drm/exynos: vidi: fix a wrong error return
	drm/exynos: fix race condition UAF in exynos_g2d_exec_ioctl
	drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
	x86/apic: Fix kernel panic when booting with intremap=off and x2apic_phys
	i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle
	netfilter: nftables: statify nft_parse_register()
	netfilter: nf_tables: validate registers coming from userspace.
	netfilter: nf_tables: hold mutex on netns pre_exit path
	bpf/btf: Accept function names that contain dots
	Linux 5.10.186

Change-Id: I2c45f6bd0cb20e43ac316ed751d2708315db80f0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-30 12:27:51 +00:00
Greg Kroah-Hartman
c6ac900e26 Merge 5.10.185 into android12-5.10-lts
Changes in 5.10.185
	lib: cleanup kstrto*() usage
	kernel.h: split out kstrtox() and simple_strtox() to a separate header
	test_firmware: Use kstrtobool() instead of strtobool()
	test_firmware: prevent race conditions by a correct implementation of locking
	test_firmware: fix a memory leak with reqs buffer
	power: supply: ab8500: Fix external_power_changed race
	power: supply: sc27xx: Fix external_power_changed race
	power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule()
	ARM: dts: vexpress: add missing cache properties
	tools: gpio: fix debounce_period_us output of lsgpio
	power: supply: Ratelimit no data debug output
	platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
	regulator: Fix error checking for debugfs_create_dir
	irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues
	power: supply: Fix logic checking if system is running from battery
	btrfs: scrub: try harder to mark RAID56 block groups read-only
	btrfs: handle memory allocation failure in btrfs_csum_one_bio
	ASoC: soc-pcm: test if a BE can be prepared
	parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu()
	parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory()
	MIPS: Alchemy: fix dbdma2
	mips: Move initrd_start check after initrd address sanitisation.
	ASoC: dwc: move DMA init to snd_soc_dai_driver probe()
	xen/blkfront: Only check REQ_FUA for writes
	drm:amd:amdgpu: Fix missing buffer object unlock in failure path
	irqchip/gic: Correctly validate OF quirk descriptors
	io_uring: hold uring mutex around poll removal
	epoll: ep_autoremove_wake_function should use list_del_init_careful
	ocfs2: fix use-after-free when unmounting read-only filesystem
	ocfs2: check new file size on fallocate call
	nios2: dts: Fix tse_mac "max-frame-size" property
	nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key()
	nilfs2: fix possible out-of-bounds segment allocation in resize ioctl
	kexec: support purgatories with .text.hot sections
	x86/purgatory: remove PGO flags
	powerpc/purgatory: remove PGO flags
	nouveau: fix client work fence deletion race
	RDMA/uverbs: Restrict usage of privileged QKEYs
	net: usb: qmi_wwan: add support for Compal RXM-G1
	ALSA: hda/realtek: Add a quirk for Compaq N14JP6
	Remove DECnet support from kernel
	USB: serial: option: add Quectel EM061KGL series
	serial: lantiq: add missing interrupt ack
	usb: dwc3: gadget: Reset num TRBs before giving back the request
	RDMA/rtrs: Fix the last iu->buf leak in err path
	spi: fsl-dspi: avoid SCK glitches with continuous transfers
	netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
	net: enetc: correct the indexes of highest and 2nd highest TCs
	ping6: Fix send to link-local addresses with VRF.
	net/sched: cls_u32: Fix reference counter leak leading to overflow
	RDMA/rxe: Remove the unused variable obj
	RDMA/rxe: Removed unused name from rxe_task struct
	RDMA/rxe: Fix the use-before-initialization error of resp_pkts
	iavf: remove mask from iavf_irq_enable_queues()
	octeontx2-af: fixed resource availability check
	RDMA/mlx5: Initiate dropless RQ for RAW Ethernet functions
	RDMA/cma: Always set static rate to 0 for RoCE
	IB/uverbs: Fix to consider event queue closing also upon non-blocking mode
	IB/isert: Fix dead lock in ib_isert
	IB/isert: Fix possible list corruption in CMA handler
	IB/isert: Fix incorrect release of isert connection
	ipvlan: fix bound dev checking for IPv6 l3s mode
	sctp: fix an error code in sctp_sf_eat_auth()
	igb: fix nvm.ops.read() error handling
	drm/nouveau: don't detect DSM for non-NVIDIA device
	drm/nouveau/dp: check for NULL nv_connector->native_mode
	drm/nouveau: add nv_encoder pointer check for NULL
	ext4: drop the call to ext4_error() from ext4_get_group_info()
	net/sched: cls_api: Fix lockup on flushing explicitly created chain
	net: lapbether: only support ethernet devices
	net: tipc: resize nlattr array to correct size
	selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET
	afs: Fix vlserver probe RTT handling
	cgroup: always put cset in cgroup_css_set_put_fork
	rcu/kvfree: Avoid freeing new kfree_rcu() memory after old grace period
	neighbour: Remove unused inline function neigh_key_eq16()
	net: Remove unused inline function dst_hold_and_use()
	net: Remove DECnet leftovers from flow.h.
	neighbour: delete neigh_lookup_nodev as not used
	batman-adv: Switch to kstrtox.h for kstrtou64
	mmc: block: ensure error propagation for non-blk
	mm/memory_hotplug: extend offline_and_remove_memory() to handle more than one memory block
	nilfs2: reject devices with insufficient block count
	media: dvbdev: Fix memleak in dvb_register_device
	media: dvbdev: fix error logic at dvb_register_device()
	media: dvb-core: Fix use-after-free due to race at dvb_register_device()
	drm/i915/dg1: Wait for pcode/uncore handshake at startup
	drm/i915/gen11+: Only load DRAM information from pcode
	um: Fix build w/o CONFIG_PM_SLEEP
	Linux 5.10.185

Change-Id: I05ba9c2e38c013c553c9f89e2a6b71ec9bdb0bd3
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-28 10:31:14 +00:00
Florent Revest
29917a20be bpf/btf: Accept function names that contain dots
[ Upstream commit 9724160b3942b0a967b91a59f81da5593f28b8ba ]

When building a kernel with LLVM=1, LLVM_IAS=0 and CONFIG_KASAN=y, LLVM
leaves DWARF tags for the "asan.module_ctor" & co symbols. In turn,
pahole creates BTF_KIND_FUNC entries for these and this makes the BTF
metadata validation fail because they contain a dot.

In a dramatic turn of event, this BTF verification failure can cause
the netfilter_bpf initialization to fail, causing netfilter_core to
free the netfilter_helper hashmap and netfilter_ftp to trigger a
use-after-free. The risk of u-a-f in netfilter will be addressed
separately but the existence of "asan.module_ctor" debug info under some
build conditions sounds like a good enough reason to accept functions
that contain dots in BTF.

Although using only LLVM=1 is the recommended way to compile clang-based
kernels, users can certainly do LLVM=1, LLVM_IAS=0 as well and we still
try to support that combination according to Nick. To clarify:

  - > v5.10 kernel, LLVM=1 (LLVM_IAS=0 is not the default) is recommended,
    but user can still have LLVM=1, LLVM_IAS=0 to trigger the issue

  - <= 5.10 kernel, LLVM=1 (LLVM_IAS=0 is the default) is recommended in
    which case GNU as will be used

Fixes: 1dc9285184 ("bpf: kernel side support for BTF Var and DataSec")
Signed-off-by: Florent Revest <revest@chromium.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Cc: Yonghong Song <yhs@meta.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/bpf/20230615145607.3469985-1-revest@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:28:16 +02:00
Maxim Mikityanskiy
562800447f bpf: Fix verifier id tracking of scalars on spill
[ Upstream commit 713274f1f2c896d37017efee333fd44149710119 ]

The following scenario describes a bug in the verifier where it
incorrectly concludes about equivalent scalar IDs which could lead to
verifier bypass in privileged mode:

1. Prepare a 32-bit rogue number.
2. Put the rogue number into the upper half of a 64-bit register, and
   roll a random (unknown to the verifier) bit in the lower half. The
   rest of the bits should be zero (although variations are possible).
3. Assign an ID to the register by MOVing it to another arbitrary
   register.
4. Perform a 32-bit spill of the register, then perform a 32-bit fill to
   another register. Due to a bug in the verifier, the ID will be
   preserved, although the new register will contain only the lower 32
   bits, i.e. all zeros except one random bit.

At this point there are two registers with different values but the same
ID, which means the integrity of the verifier state has been corrupted.

5. Compare the new 32-bit register with 0. In the branch where it's
   equal to 0, the verifier will believe that the original 64-bit
   register is also 0, because it has the same ID, but its actual value
   still contains the rogue number in the upper half.
   Some optimizations of the verifier prevent the actual bypass, so
   extra care is needed: the comparison must be between two registers,
   and both branches must be reachable (this is why one random bit is
   needed). Both branches are still suitable for the bypass.
6. Right shift the original register by 32 bits to pop the rogue number.
7. Use the rogue number as an offset with any pointer. The verifier will
   believe that the offset is 0, while in reality it's the given number.

The fix is similar to the 32-bit BPF_MOV handling in check_alu_op for
SCALAR_VALUE. If the spill is narrowing the actual register value, don't
keep the ID, make sure it's reset to 0.

Fixes: 354e8f1970f8 ("bpf: Support <8-byte scalar spill and refill")
Signed-off-by: Maxim Mikityanskiy <maxim@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Andrii Nakryiko <andrii@kernel.org> # Checked veristat delta
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20230607123951.558971-2-maxtram95@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:28:10 +02:00
Eduard Zingerman
3b0a96db67 bpf: track immediate values written to stack by BPF_ST instruction
[ Upstream commit ecdf985d7615356b78241fdb159c091830ed0380 ]

For aligned stack writes using BPF_ST instruction track stored values
in a same way BPF_STX is handled, e.g. make sure that the following
commands produce similar verifier knowledge:

  fp[-8] = 42;             r1 = 42;
                       fp[-8] = r1;

This covers two cases:
 - non-null values written to stack are stored as spill of fake
   registers;
 - null values written to stack are stored as STACK_ZERO marks.

Previously both cases above used STACK_MISC marks instead.

Some verifier test cases relied on the old logic to obtain STACK_MISC
marks for some stack values. These test cases are updated in the same
commit to avoid failures during bisect.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230214232030.1502829-2-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 713274f1f2c8 ("bpf: Fix verifier id tracking of scalars on spill")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:28:10 +02:00
Xiaoming Ni
1ac6e9ee84 sysctl: move some boundary constants from sysctl.c to sysctl_vals
[ Upstream commit 78e36f3b0dae586f623c4a37ec5eb5496f5abbe1 ]

sysctl has helpers which let us specify boundary values for a min or max
int value.  Since these are used for a boundary check only they don't
change, so move these variables to sysctl_vals to avoid adding duplicate
variables.  This will help with our cleanup of kernel/sysctl.c.

[akpm@linux-foundation.org: update it for "mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%"]
[mcgrof@kernel.org: major rebase]

Link: https://lkml.kernel.org/r/20211123202347.818157-3-mcgrof@kernel.org
Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Qing Wang <wangqing@vivo.com>
Cc: Sebastian Reichel <sre@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Stephen Kitt <steve@sk2.org>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Julia Lawall <julia.lawall@inria.fr>
Cc: Lukas Middendorf <kernel@tuxforce.de>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Phillip Potter <phil@philpotter.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: James E.J. Bottomley <jejb@linux.ibm.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 935d44acf621 ("memfd: check for non-NULL file_seals in memfd_create() syscall")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:28:09 +02:00
Suren Baghdasaryan
e1aa3fe3e2 mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%
[ Upstream commit 39c65a94cd9661532be150e88f8b02f4a6844a35 ]

For embedded systems with low total memory, having to run applications
with relatively large memory requirements, 10% max limitation for
watermark_scale_factor poses an issue of triggering direct reclaim every
time such application is started.  This results in slow application
startup times and bad end-user experience.

By increasing watermark_scale_factor max limit we allow vendors more
flexibility to choose the right level of kswapd aggressiveness for their
device and workload requirements.

Link: https://lkml.kernel.org/r/20211124193604.2758863-1-surenb@google.com
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Lukas Middendorf <kernel@tuxforce.de>
Cc: Antti Palosaari <crope@iki.fi>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Zhang Yi <yi.zhang@huawei.com>
Cc: Fengfei Xi <xi.fengfei@h3c.com>
Cc: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: 935d44acf621 ("memfd: check for non-NULL file_seals in memfd_create() syscall")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 10:28:09 +02:00
Xiu Jianfeng
63608437a8 cgroup: Do not corrupt task iteration when rebinding subsystem
commit 6f363f5aa845561f7ea496d8b1175e3204470486 upstream.

We found a refcount UAF bug as follows:

refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 342 at lib/refcount.c:25 refcount_warn_saturate+0xa0/0x148
Workqueue: events cpuset_hotplug_workfn
Call trace:
 refcount_warn_saturate+0xa0/0x148
 __refcount_add.constprop.0+0x5c/0x80
 css_task_iter_advance_css_set+0xd8/0x210
 css_task_iter_advance+0xa8/0x120
 css_task_iter_next+0x94/0x158
 update_tasks_root_domain+0x58/0x98
 rebuild_root_domains+0xa0/0x1b0
 rebuild_sched_domains_locked+0x144/0x188
 cpuset_hotplug_workfn+0x138/0x5a0
 process_one_work+0x1e8/0x448
 worker_thread+0x228/0x3e0
 kthread+0xe0/0xf0
 ret_from_fork+0x10/0x20

then a kernel panic will be triggered as below:

Unable to handle kernel paging request at virtual address 00000000c0000010
Call trace:
 cgroup_apply_control_disable+0xa4/0x16c
 rebind_subsystems+0x224/0x590
 cgroup_destroy_root+0x64/0x2e0
 css_free_rwork_fn+0x198/0x2a0
 process_one_work+0x1d4/0x4bc
 worker_thread+0x158/0x410
 kthread+0x108/0x13c
 ret_from_fork+0x10/0x18

The race that cause this bug can be shown as below:

(hotplug cpu)                | (umount cpuset)
mutex_lock(&cpuset_mutex)    | mutex_lock(&cgroup_mutex)
cpuset_hotplug_workfn        |
 rebuild_root_domains        |  rebind_subsystems
  update_tasks_root_domain   |   spin_lock_irq(&css_set_lock)
   css_task_iter_start       |    list_move_tail(&cset->e_cset_node[ss->id]
   while(css_task_iter_next) |                  &dcgrp->e_csets[ss->id]);
   css_task_iter_end         |   spin_unlock_irq(&css_set_lock)
mutex_unlock(&cpuset_mutex)  | mutex_unlock(&cgroup_mutex)

Inside css_task_iter_start/next/end, css_set_lock is hold and then
released, so when iterating task(left side), the css_set may be moved to
another list(right side), then it->cset_head points to the old list head
and it->cset_pos->next points to the head node of new list, which can't
be used as struct css_set.

To fix this issue, switch from all css_sets to only scgrp's css_sets to
patch in-flight iterators to preserve correct iteration, and then
update it->cset_head as well.

Reported-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://www.spinics.net/lists/cgroups/msg37935.html
Suggested-by: Michal Koutný <mkoutny@suse.com>
Link: https://lore.kernel.org/all/20230526114139.70274-1-xiujianfeng@huaweicloud.com/
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Fixes: 2d8f243a5e ("cgroup: implement cgroup->e_csets[]")
Cc: stable@vger.kernel.org # v3.16+
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 10:28:07 +02:00
Thomas Gleixner
3cc7935d32 tick/common: Align tick period during sched_timer setup
commit 13bb06f8dd42071cb9a49f6e21099eea05d4b856 upstream.

The tick period is aligned very early while the first clock_event_device is
registered. At that point the system runs in periodic mode and switches
later to one-shot mode if possible.

The next wake-up event is programmed based on the aligned value
(tick_next_period) but the delta value, that is used to program the
clock_event_device, is computed based on ktime_get().

With the subtracted offset, the device fires earlier than the exact time
frame. With a large enough offset the system programs the timer for the
next wake-up and the remaining time left is too small to make any boot
progress. The system hangs.

Move the alignment later to the setup of tick_sched timer. At this point
the system switches to oneshot mode and a high resolution clocksource is
available. At this point it is safe to align tick_next_period because
ktime_get() will now return accurate (not jiffies based) time.

[bigeasy: Patch description + testing].

Fixes: e9523a0d81899 ("tick/common: Align tick period with the HZ tick.")
Reported-by: Mathias Krause <minipli@grsecurity.net>
Reported-by: "Bhatnagar, Rishabh" <risbhat@amazon.com>
Suggested-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Tested-by: Mathias Krause <minipli@grsecurity.net>
Acked-by: SeongJae Park <sj@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/5a56290d-806e-b9a5-f37c-f21958b5a8c0@grsecurity.net
Link: https://lore.kernel.org/12c6f9a3-d087-b824-0d05-0d18c9bc1bf3@amazon.com
Link: https://lore.kernel.org/r/20230615091830.RxMV2xf_@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 10:28:06 +02:00
Steven Rostedt (Google)
db4ab0c97a tracing: Add tracing_reset_all_online_cpus_unlocked() function
commit e18eb8783ec4949adebc7d7b0fdb65f65bfeefd9 upstream.

Currently the tracing_reset_all_online_cpus() requires the
trace_types_lock held. But only one caller of this function actually has
that lock held before calling it, and the other just takes the lock so
that it can call it. More users of this function is needed where the lock
is not held.

Add a tracing_reset_all_online_cpus_unlocked() function for the one use
case that calls it without being held, and also add a lockdep_assert to
make sure it is held when called.

Then have tracing_reset_all_online_cpus() take the lock internally, such
that callers do not need to worry about taking it.

Link: https://lkml.kernel.org/r/20221123192741.658273220@goodmis.org

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-28 10:28:06 +02:00
Greg Kroah-Hartman
b7321283a9 Merge 5.10.184 into android12-5.10-lts
Changes in 5.10.184
	ata: ahci: fix enum constants for gcc-13
	gcc-plugins: Reorganize gimple includes for GCC 13
	sfc (gcc13): synchronize ef100_enqueue_skb()'s return type
	remove the sx8 block driver
	bonding (gcc13): synchronize bond_{a,t}lb_xmit() types
	f2fs: fix iostat lock protection
	blk-iocost: avoid 64-bit division in ioc_timer_fn
	block/blk-iocost (gcc13): keep large values in a new enum
	i40iw: fix build warning in i40iw_manage_apbvt()
	i40e: fix build warnings in i40e_alloc.h
	i40e: fix build warning in ice_fltr_add_mac_to_list()
	staging: vchiq_core: drop vchiq_status from vchiq_initialise
	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
	neighbour: fix unaligned access to pneigh_entry
	net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods
	net/smc: Avoid to access invalid RMBs' MRs in SMCRv1 ADD LINK CONT
	net/sched: fq_pie: ensure reasonable TCA_FQ_PIE_QUANTUM values
	Bluetooth: Fix l2cap_disconnect_req deadlock
	Bluetooth: L2CAP: Add missing checks for invalid DCID
	qed/qede: Fix scheduling while atomic
	netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper
	netfilter: ipset: Add schedule point in call_ad().
	ipv6: rpl: Fix Route of Death.
	rfs: annotate lockless accesses to sk->sk_rxhash
	rfs: annotate lockless accesses to RFS sock flow table
	net: sched: move rtm_tca_policy declaration to include file
	net: sched: fix possible refcount leak in tc_chain_tmplt_add()
	bpf: Add extra path pointer check to d_path helper
	lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
	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: 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
	ALSA: hda/realtek: Add a quirk for HP Slim Desktop S01
	ALSA: hda/realtek: Add Lenovo P3 Tower platform
	drm/amdgpu: fix xclk freq on CHIP_STONEY
	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
	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: 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
	pinctrl: meson-axg: add missing GPIOA_18 gpio group
	usb: usbfs: Enforce page requirements for mmap
	usb: usbfs: Use consistent mmap functions
	staging: vc04_services: fix gcc-13 build warning
	ASoC: codecs: wsa881x: do not set can_multi_write flag
	i2c: sprd: Delete i2c adapter in .remove's error path
	eeprom: at24: also select REGMAP
	riscv: fix kprobe __user string arg print fault issue
	vhost: support PACKED when setting-getting vring_base
	Revert "ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled"
	ext4: only check dquot_initialize_needed() when debugging
	tcp: fix tcp_min_tso_segs sysctl
	xfs: verify buffer contents when we skip log replay
	MIPS: locking/atomic: Fix atomic{_64,}_sub_if_positive
	drm/atomic: Don't pollute crtc_state->mode_blob with error pointers
	btrfs: check return value of btrfs_commit_transaction in relocation
	btrfs: unset reloc control if transaction commit fails in prepare_to_relocate()
	Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE"
	Linux 5.10.184

Change-Id: If2d013f1bba8d713f8935810a5887f80eabae81c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-28 07:16:23 +00:00
Greg Kroah-Hartman
848ca335c1 Merge 5.10.183 into android12-5.10-lts
Changes in 5.10.183
	RDMA/bnxt_re: Code refactor while populating user MRs
	RDMA/bnxt_re: Fix the page_size used during the MR creation
	RDMA/efa: Fix unsupported page sizes in device
	dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie
	dmaengine: at_xdmac: Fix race for the tx desc callback
	dmaengine: at_xdmac: Move the free desc to the tail of the desc list
	dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved()
	RDMA/bnxt_re: Fix a possible memory leak
	RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx
	iommu/rockchip: Fix unwind goto issue
	iommu/amd: Don't block updates to GATag if guest mode is on
	dmaengine: pl330: rename _start to prevent build error
	net/mlx5: fw_tracer, Fix event handling
	netrom: fix info-leak in nr_write_internal()
	af_packet: Fix data-races of pkt_sk(sk)->num.
	amd-xgbe: fix the false linkup in xgbe_phy_status
	mtd: rawnand: ingenic: fix empty stub helper definitions
	af_packet: do not use READ_ONCE() in packet_bind()
	tcp: deny tcp_disconnect() when threads are waiting
	tcp: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set
	net/sched: sch_ingress: Only create under TC_H_INGRESS
	net/sched: sch_clsact: Only create under TC_H_CLSACT
	net/sched: Reserve TC_H_INGRESS (TC_H_CLSACT) for ingress (clsact) Qdiscs
	net/sched: Prohibit regrafting ingress or clsact Qdiscs
	net: sched: fix NULL pointer dereference in mq_attach
	net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report
	udp6: Fix race condition in udp6_sendmsg & connect
	net/mlx5: Read embedded cpu after init bit cleared
	net/sched: flower: fix possible OOB write in fl_set_geneve_opt()
	net: dsa: mv88e6xxx: Increase wait after reset deactivation
	mtd: rawnand: marvell: ensure timing values are written
	mtd: rawnand: marvell: don't set the NAND frequency select
	watchdog: menz069_wdt: fix watchdog initialisation
	ALSA: hda: Glenfly: add HD Audio PCI IDs and HDMI Codec Vendor IDs.
	mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
	btrfs: abort transaction when sibling keys check fails for leaves
	ARM: 9295/1: unwind:fix unwind abort for uleb128 case
	media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE
	gfs2: Don't deref jdesc in evict
	fbdev: modedb: Add 1920x1080 at 60 Hz video mode
	fbdev: stifb: Fix info entry in sti_struct on error path
	nbd: Fix debugfs_create_dir error checking
	block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE
	ASoC: dwc: limit the number of overrun messages
	xfrm: Check if_id in inbound policy/secpath match
	ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs
	ASoC: ssm2602: Add workaround for playback distortions
	media: dvb_demux: fix a bug for the continuity counter
	media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()
	media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer()
	media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer()
	media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer
	media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer()
	media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address
	media: netup_unidvb: fix irq init by register it at the end of probe
	media: dvb_ca_en50221: fix a size write bug
	media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
	media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table
	media: dvb-core: Fix use-after-free due on race condition at dvb_net
	media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*()
	media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221
	s390/pkey: zeroize key blobs
	wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value
	ARM: dts: stm32: add pin map for CAN controller on stm32f7
	arm64/mm: mark private VM_FAULT_X defines as vm_fault_t
	scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed
	wifi: b43: fix incorrect __packed annotation
	netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT
	ALSA: oss: avoid missing-prototype warnings
	drm/msm: Be more shouty if per-process pgtables aren't working
	atm: hide unused procfs functions
	mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
	iio: adc: mxs-lradc: fix the order of two cleanup operations
	HID: google: add jewel USB id
	HID: wacom: avoid integer overflow in wacom_intuos_inout()
	iio: imu: inv_icm42600: fix timestamp reset
	iio: light: vcnl4035: fixed chip ID check
	iio: dac: mcp4725: Fix i2c_master_send() return value handling
	iio: adc: ad7192: Change "shorted" channels to differential
	iio: dac: build ad5758 driver when AD5758 is selected
	net: usb: qmi_wwan: Set DTR quirk for BroadMobi BM818
	usb: gadget: f_fs: Add unbind event before functionfs_unbind
	misc: fastrpc: return -EPIPE to invocations on device removal
	misc: fastrpc: reject new invocations during device removal
	scsi: stex: Fix gcc 13 warnings
	ata: libata-scsi: Use correct device no in ata_find_dev()
	x86/boot: Wrap literal addresses in absolute_pointer()
	ACPI: thermal: drop an always true check
	ath6kl: Use struct_group() to avoid size-mismatched casting
	gcc-12: disable '-Wdangling-pointer' warning for now
	eth: sun: cassini: remove dead code
	mmc: vub300: fix invalid response handling
	tty: serial: fsl_lpuart: use UARTCTRL_TXINV to send break instead of UARTCTRL_SBK
	btrfs: fix csum_tree_block page iteration to avoid tripping on -Werror=array-bounds
	selinux: don't use make's grouped targets feature yet
	tracing/probe: trace_probe_primary_from_call(): checked list_first_entry
	selftests: mptcp: connect: skip if MPTCP is not supported
	selftests: mptcp: pm nl: skip if MPTCP is not supported
	ext4: add EA_INODE checking to ext4_iget()
	ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
	ext4: disallow ea_inodes with extended attributes
	ext4: add lockdep annotations for i_data_sem for ea_inode's
	fbcon: Fix null-ptr-deref in soft_cursor
	serial: 8250_tegra: Fix an error handling path in tegra_uart_probe()
	test_firmware: fix the memory leak of the allocated firmware buffer
	KVM: x86: Account fastpath-only VM-Exits in vCPU stats
	KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
	regmap: Account for register length when chunking
	tpm, tpm_tis: Request threaded interrupt handler
	media: ti-vpe: cal: avoid FIELD_GET assertion
	drm/rcar: stop using 'imply' for dependencies
	scsi: dpt_i2o: Remove broken pass-through ioctl (I2OUSERCMD)
	scsi: dpt_i2o: Do not process completions with invalid addresses
	crypto: ccp: Reject SEV commands with mismatching command buffer
	crypto: ccp: Play nice with vmalloc'd memory for SEV command structs
	selftests: mptcp: diag: skip if MPTCP is not supported
	selftests: mptcp: simult flows: skip if MPTCP is not supported
	selftests: mptcp: join: skip if MPTCP is not supported
	ext4: enable the lazy init thread when remounting read/write
	ARM: defconfig: drop CONFIG_DRM_RCAR_LVDS
	Linux 5.10.183

Change-Id: Iaaaaa9d53fea0e6f58a5ba1ad86f9150c2cdf8af
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-27 16:18:22 +00:00
Greg Kroah-Hartman
6d62ca19a7 Merge 5.10.181 into android12-5.10-lts
Changes in 5.10.181
	driver core: add a helper to setup both the of_node and fwnode of a device
	drm/mipi-dsi: Set the fwnode for mipi_dsi_device
	ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings
	net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe()
	linux/dim: Do nothing if no time delta between samples
	net: Fix load-tearing on sk->sk_stamp in sock_recv_cmsgs().
	netfilter: conntrack: fix possible bug_on with enable_hooks=1
	netlink: annotate accesses to nlk->cb_running
	net: annotate sk->sk_err write from do_recvmmsg()
	net: deal with most data-races in sk_wait_event()
	net: tap: check vlan with eth_type_vlan() method
	net: add vlan_get_protocol_and_depth() helper
	tcp: factor out __tcp_close() helper
	tcp: add annotations around sk->sk_shutdown accesses
	ipvlan:Fix out-of-bounds caused by unclear skb->cb
	net: datagram: fix data-races in datagram_poll()
	af_unix: Fix a data race of sk->sk_receive_queue->qlen.
	af_unix: Fix data races around sk->sk_shutdown.
	drm/i915/dp: prevent potential div-by-zero
	fbdev: arcfb: Fix error handling in arcfb_probe()
	ext4: remove an unused variable warning with CONFIG_QUOTA=n
	ext4: reflect error codes from ext4_multi_mount_protect() to its callers
	ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled
	ext4: fix lockdep warning when enabling MMP
	ext4: remove redundant mb_regenerate_buddy()
	ext4: drop s_mb_bal_lock and convert protected fields to atomic
	ext4: add mballoc stats proc file
	ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set
	ext4: allow ext4_get_group_info() to fail
	refscale: Move shutdown from wait_event() to wait_event_idle()
	rcu: Protect rcu_print_task_exp_stall() ->exp_tasks access
	fs: hfsplus: remove WARN_ON() from hfsplus_cat_{read,write}_inode()
	drm/amd/display: Use DC_LOG_DC in the trasform pixel function
	regmap: cache: Return error in cache sync operations for REGCACHE_NONE
	arm64: dts: qcom: msm8996: Add missing DWC3 quirks
	memstick: r592: Fix UAF bug in r592_remove due to race condition
	firmware: arm_sdei: Fix sleep from invalid context BUG
	ACPI: EC: Fix oops when removing custom query handlers
	remoteproc: stm32_rproc: Add mutex protection for workqueue
	drm/tegra: Avoid potential 32-bit integer overflow
	ACPICA: Avoid undefined behavior: applying zero offset to null pointer
	ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
	drm/amd: Fix an out of bounds error in BIOS parser
	wifi: ath: Silence memcpy run-time false positive warning
	bpf: Annotate data races in bpf_local_storage
	wifi: brcmfmac: cfg80211: Pass the PMK in binary instead of hex
	ext2: Check block size validity during mount
	scsi: lpfc: Prevent lpfc_debugfs_lockstat_write() buffer overflow
	net: pasemi: Fix return type of pasemi_mac_start_tx()
	net: Catch invalid index in XPS mapping
	scsi: target: iscsit: Free cmds before session free
	lib: cpu_rmap: Avoid use after free on rmap->obj array entries
	scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition
	gfs2: Fix inode height consistency check
	ext4: set goal start correctly in ext4_mb_normalize_request
	ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()
	f2fs: fix to drop all dirty pages during umount() if cp_error is set
	samples/bpf: Fix fout leak in hbm's run_bpf_prog
	wifi: iwlwifi: pcie: fix possible NULL pointer dereference
	wifi: iwlwifi: pcie: Fix integer overflow in iwl_write_to_user_buf
	null_blk: Always check queue mode setting from configfs
	wifi: iwlwifi: dvm: Fix memcpy: detected field-spanning write backtrace
	wifi: ath11k: Fix SKB corruption in REO destination ring
	ipvs: Update width of source for ip_vs_sync_conn_options
	Bluetooth: hci_bcm: Fall back to getting bdaddr from EFI if not set
	Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
	staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
	HID: logitech-hidpp: Don't use the USB serial for USB devices
	HID: logitech-hidpp: Reconcile USB and Unifying serials
	spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3
	HID: wacom: generic: Set battery quirk only when we see battery data
	usb: typec: tcpm: fix multiple times discover svids error
	serial: 8250: Reinit port->pm on port specific driver unbind
	mcb-pci: Reallocate memory region to avoid memory overlapping
	sched: Fix KCSAN noinstr violation
	recordmcount: Fix memory leaks in the uwrite function
	RDMA/core: Fix multiple -Warray-bounds warnings
	iommu/arm-smmu-qcom: Limit the SMR groups to 128
	clk: tegra20: fix gcc-7 constant overflow warning
	iommu/arm-smmu-v3: Acknowledge pri/event queue overflow if any
	Input: xpad - add constants for GIP interface numbers
	phy: st: miphy28lp: use _poll_timeout functions for waits
	mfd: dln2: Fix memory leak in dln2_probe()
	btrfs: move btrfs_find_highest_objectid/btrfs_find_free_objectid to disk-io.c
	btrfs: replace calls to btrfs_find_free_ino with btrfs_find_free_objectid
	btrfs: fix space cache inconsistency after error loading it from disk
	xfrm: don't check the default policy if the policy allows the packet
	Revert "Fix XFRM-I support for nested ESP tunnels"
	drm/msm/dp: unregister audio driver during unbind
	drm/msm/dpu: Remove duplicate register defines from INTF
	cpupower: Make TSC read per CPU for Mperf monitor
	af_key: Reject optional tunnel/BEET mode templates in outbound policies
	net: fec: Better handle pm_runtime_get() failing in .remove()
	net: phy: dp83867: add w/a for packet errors seen with short cables
	ALSA: firewire-digi00x: prevent potential use after free
	ALSA: hda/realtek: Apply HP B&O top speaker profile to Pavilion 15
	vsock: avoid to close connected socket after the timeout
	ipv4/tcp: do not use per netns ctl sockets
	net: Find dst with sk's xfrm policy not ctl_sk
	tcp: fix possible sk_priority leak in tcp_v4_send_reset()
	serial: arc_uart: fix of_iomap leak in `arc_serial_probe`
	erspan: get the proto with the md version for collect_md
	net: hns3: fix sending pfc frames after reset issue
	net: hns3: fix reset delay time to avoid configuration timeout
	media: netup_unidvb: fix use-after-free at del_timer()
	SUNRPC: Fix trace_svc_register() call site
	drm/exynos: fix g2d_open/close helper function definitions
	net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
	net/tipc: fix tipc header files for kernel-doc
	tipc: add tipc_bearer_min_mtu to calculate min mtu
	tipc: do not update mtu if msg_max is too small in mtu negotiation
	tipc: check the bearer min mtu properly when setting it by netlink
	net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()
	net: bcmgenet: Restore phy_stop() depending upon suspend/close
	wifi: mac80211: fix min center freq offset tracing
	wifi: iwlwifi: mvm: don't trust firmware n_channels
	scsi: storvsc: Don't pass unused PFNs to Hyper-V host
	cassini: Fix a memory leak in the error handling path of cas_init_one()
	igb: fix bit_shift to be in [1..8] range
	vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
	netfilter: nft_set_rbtree: fix null deref on element insertion
	bridge: always declare tunnel functions
	ALSA: usb-audio: Add a sample rate workaround for Line6 Pod Go
	USB: usbtmc: Fix direction for 0-length ioctl control messages
	usb-storage: fix deadlock when a scsi command timeouts more than once
	USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value
	usb: dwc3: debugfs: Resume dwc3 before accessing registers
	usb: gadget: u_ether: Fix host MAC address case
	usb: typec: altmodes/displayport: fix pin_assignment_show
	ALSA: hda: Fix Oops by 9.1 surround channel names
	ALSA: hda: Add NVIDIA codec IDs a3 through a7 to patch table
	ALSA: hda/realtek: Add quirk for Clevo L140AU
	ALSA: hda/realtek: Add a quirk for HP EliteDesk 805
	ALSA: hda/realtek: Add quirk for 2nd ASUS GU603
	can: j1939: recvmsg(): allow MSG_CMSG_COMPAT flag
	can: isotp: recvmsg(): allow MSG_CMSG_COMPAT flag
	can: kvaser_pciefd: Set CAN_STATE_STOPPED in kvaser_pciefd_stop()
	can: kvaser_pciefd: Call request_irq() before enabling interrupts
	can: kvaser_pciefd: Empty SRB buffer in probe
	can: kvaser_pciefd: Clear listen-only bit if not explicitly requested
	can: kvaser_pciefd: Do not send EFLUSH command on TFD interrupt
	can: kvaser_pciefd: Disable interrupts in probe error path
	statfs: enforce statfs[64] structure initialization
	serial: Add support for Advantech PCI-1611U card
	vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF
	ceph: force updating the msg pointer in non-split case
	tpm/tpm_tis: Disable interrupts for more Lenovo devices
	powerpc/64s/radix: Fix soft dirty tracking
	nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()
	HID: wacom: Force pen out of prox if no events have been received in a while
	HID: wacom: Add new Intuos Pro Small (PTH-460) device IDs
	HID: wacom: add three styli to wacom_intuos_get_tool_type
	KVM: arm64: Link position-independent string routines into .hyp.text
	serial: 8250_exar: derive nr_ports from PCI ID for Acces I/O cards
	serial: exar: Add support for Sealevel 7xxxC serial cards
	serial: 8250_exar: Add support for USR298x PCI Modems
	s390/qdio: get rid of register asm
	s390/qdio: fix do_sqbs() inline assembly constraint
	watchdog: sp5100_tco: Immediately trigger upon starting.
	ARM: dts: stm32: fix AV96 board SAI2 pin muxing on stm32mp15
	writeback, cgroup: remove extra percpu_ref_exit()
	net/sched: act_mirred: refactor the handle of xmit
	net/sched: act_mirred: better wording on protection against excessive stack growth
	act_mirred: use the backlog for nested calls to mirred ingress
	spi: fsl-spi: Re-organise transfer bits_per_word adaptation
	spi: fsl-cpm: Use 16 bit mode for large transfers with even size
	ocfs2: Switch to security_inode_init_security()
	ALSA: hda/ca0132: add quirk for EVGA X299 DARK
	ALSA: hda: Fix unhandled register update during auto-suspend period
	ALSA: hda/realtek: Enable headset onLenovo M70/M90
	net: cdc_ncm: Deal with too low values of dwNtbOutMaxSize
	m68k: Move signal frame following exception on 68020/030
	parisc: Handle kgdb breakpoints only in kernel context
	parisc: Allow to reboot machine after system halt
	gpio: mockup: Fix mode of debugfs files
	btrfs: use nofs when cleaning up aborted transactions
	dt-binding: cdns,usb3: Fix cdns,on-chip-buff-size type
	x86/mm: Avoid incomplete Global INVLPG flushes
	selftests/memfd: Fix unknown type name build failure
	parisc: Fix flush_dcache_page() for usage from irq context
	x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms
	debugobjects: Don't wake up kswapd from fill_pool()
	fbdev: udlfb: Fix endpoint check
	net: fix stack overflow when LRO is disabled for virtual interfaces
	udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().
	USB: core: Add routines for endpoint checks in old drivers
	USB: sisusbvga: Add endpoint checks
	media: radio-shark: Add endpoint checks
	net: fix skb leak in __skb_tstamp_tx()
	selftests: fib_tests: mute cleanup error message
	octeontx2-pf: Fix TSOv6 offload
	bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
	ipv6: Fix out-of-bounds access in ipv6_find_tlv()
	power: supply: leds: Fix blink to LED on transition
	power: supply: bq27xxx: Fix bq27xxx_battery_update() race condition
	power: supply: bq27xxx: Fix I2C IRQ race on remove
	power: supply: bq27xxx: Fix poll_interval handling and races on remove
	power: supply: sbs-charger: Fix INHIBITED bit for Status reg
	fs: fix undefined behavior in bit shift for SB_NOUSER
	coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
	xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
	x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
	ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
	forcedeth: Fix an error handling path in nv_probe()
	net/mlx5e: do as little as possible in napi poll when budget is 0
	net/mlx5: DR, Fix crc32 calculation to work on big-endian (BE) CPUs
	net/mlx5: Fix error message when failing to allocate device memory
	net/mlx5: Devcom, fix error flow in mlx5_devcom_register_device
	arm64: dts: imx8mn-var-som: fix PHY detection bug by adding deassert delay
	3c589_cs: Fix an error handling path in tc589_probe()
	net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE
	Linux 5.10.181

Change-Id: Iaad0b0bb7c1ad061b28ad4ee16e03db935241177
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-27 08:23:11 +00:00
Greg Kroah-Hartman
d70c95bd81 Merge 5.10.180 into android12-5.10-lts
Changes in 5.10.180
	seccomp: Move copy_seccomp() to no failure path.
	counter: 104-quad-8: Fix race condition between FLAG and CNTR reads
	KVM: arm64: Fix buffer overflow in kvm_arm_set_fw_reg()
	wifi: brcmfmac: slab-out-of-bounds read in brcmf_get_assoc_ies()
	drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var
	bluetooth: Perform careful capability checks in hci_sock_ioctl()
	x86/fpu: Prevent FPU state corruption
	USB: serial: option: add UNISOC vendor and TOZED LT70C product
	driver core: Don't require dynamic_debug for initcall_debug probe timing
	iio: adc: palmas_gpadc: fix NULL dereference on rmmod
	ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750
	asm-generic/io.h: suppress endianness warnings for readq() and writeq()
	wireguard: timers: cast enum limits members to int in prints
	PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
	PCI: qcom: Fix the incorrect register usage in v2.7.0 config
	USB: dwc3: fix runtime pm imbalance on probe errors
	USB: dwc3: fix runtime pm imbalance on unbind
	hwmon: (k10temp) Check range scale when CUR_TEMP register is read-write
	hwmon: (adt7475) Use device_property APIs when configuring polarity
	posix-cpu-timers: Implement the missing timer_wait_running callback
	perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE)
	blk-mq: release crypto keyslot before reporting I/O complete
	blk-crypto: make blk_crypto_evict_key() return void
	blk-crypto: make blk_crypto_evict_key() more robust
	ext4: use ext4_journal_start/stop for fast commit transactions
	staging: iio: resolver: ads1210: fix config mode
	xhci: fix debugfs register accesses while suspended
	tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
	MIPS: fw: Allow firmware to pass a empty env
	ipmi:ssif: Add send_retries increment
	ipmi: fix SSIF not responding under certain cond.
	kheaders: Use array declaration instead of char
	pwm: meson: Fix axg ao mux parents
	pwm: meson: Fix g12a ao clk81 name
	ring-buffer: Sync IRQ works before buffer destruction
	crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON()
	crypto: safexcel - Cleanup ring IRQ workqueues on load failure
	rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed
	reiserfs: Add security prefix to xattr name in reiserfs_security_write()
	KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted
	relayfs: fix out-of-bounds access in relay_file_read
	writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs
	i2c: omap: Fix standard mode false ACK readings
	iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE
	Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path"
	ubifs: Fix memleak when insert_old_idx() failed
	ubi: Fix return value overwrite issue in try_write_vid_and_data()
	ubifs: Free memory for tmpfile name
	sound/oss/dmasound: fix build when drivers are mixed =y/=m
	parisc: Fix argument pointer in real64_call_asm()
	nilfs2: do not write dirty data after degenerating to read-only
	nilfs2: fix infinite loop in nilfs_mdt_get_block()
	md/raid10: fix null-ptr-deref in raid10_sync_request
	mailbox: zynqmp: Fix IPI isr handling
	mailbox: zynqmp: Fix typo in IPI documentation
	wifi: rtl8xxxu: RTL8192EU always needs full init
	clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent
	rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
	selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
	selftests/resctrl: Check for return value after write_schemata()
	selinux: fix Makefile dependencies of flask.h
	selinux: ensure av_permissions.h is built when needed
	tpm, tpm_tis: Do not skip reset of original interrupt vector
	tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register
	tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
	tpm, tpm_tis: Claim locality before writing interrupt registers
	tpm, tpm: Implement usage counter for locality
	tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
	erofs: stop parsing non-compact HEAD index if clusterofs is invalid
	erofs: fix potential overflow calculating xattr_isize
	drm/rockchip: Drop unbalanced obj unref
	drm/vgem: add missing mutex_destroy
	drm/probe-helper: Cancel previous job before starting new one
	soc: ti: pm33xx: Enable basic PM runtime support for genpd
	soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
	arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
	arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
	drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
	EDAC/skx: Fix overflows on the DRAM row address mapping arrays
	arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name
	arm64: dts: qcom: sdm845: correct dynamic power coefficients
	arm64: dts: qcom: sdm845: Fix the PCI I/O port range
	arm64: dts: qcom: msm8998: Fix the PCI I/O port range
	arm64: dts: qcom: ipq8074: Fix the PCI I/O port range
	arm64: dts: qcom: msm8996: Fix the PCI I/O port range
	ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
	ARM: dts: qcom: ipq8064: reduce pci IO size to 64K
	ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
	x86/MCE/AMD: Use an u64 for bank_map
	media: bdisp: Add missing check for create_workqueue
	firmware: qcom_scm: Clear download bit during reboot
	drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
	media: max9286: Free control handler
	drm/msm/adreno: Defer enabling runpm until hw_init()
	drm/msm/adreno: drop bogus pm_runtime_set_active()
	drm: msm: adreno: Disable preemption on Adreno 510
	ACPI: processor: Fix evaluating _PDC method when running as Xen dom0
	mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
	ARM: dts: gta04: fix excess dma channel usage
	drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
	regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
	regulator: core: Avoid lockdep reports when resolving supplies
	x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
	media: rkvdec: fix use after free bug in rkvdec_remove
	media: dm1105: Fix use after free bug in dm1105_remove due to race condition
	media: saa7134: fix use after free bug in saa7134_finidev due to race condition
	media: rcar_fdp1: simplify error check logic at fdp_open()
	media: rcar_fdp1: fix pm_runtime_get_sync() usage count
	media: rcar_fdp1: Make use of the helper function devm_platform_ioremap_resource()
	media: rcar_fdp1: Fix the correct variable assignments
	media: rcar_fdp1: Fix refcount leak in probe and remove function
	media: rc: gpio-ir-recv: Fix support for wake-up
	media: venus: vdec: Fix non reliable setting of LAST flag
	media: venus: vdec: Make decoder return LAST flag for sufficient event
	media: venus: preserve DRC state across seeks
	media: venus: vdec: Handle DRC after drain
	media: venus: dec: Fix handling of the start cmd
	regulator: stm32-pwr: fix of_iomap leak
	x86/ioapic: Don't return 0 from arch_dynirq_lower_bound()
	arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step
	debugobject: Prevent init race with static objects
	drm/i915: Make intel_get_crtc_new_encoder() less oopsy
	tick/sched: Use tick_next_period for lockless quick check
	tick/sched: Reduce seqcount held scope in tick_do_update_jiffies64()
	tick/sched: Optimize tick_do_update_jiffies64() further
	tick: Get rid of tick_period
	tick/common: Align tick period with the HZ tick.
	wifi: ath6kl: minor fix for allocation size
	wifi: ath9k: hif_usb: fix memory leak of remain_skbs
	wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list()
	wifi: ath6kl: reduce WARN to dev_dbg() in callback
	tools: bpftool: Remove invalid \' json escape
	wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser()
	wifi: rtw88: mac: Return the original error from rtw_mac_power_switch()
	bpf: take into account liveness when propagating precision
	bpf: fix precision propagation verbose logging
	scm: fix MSG_CTRUNC setting condition for SO_PASSSEC
	bpf: Remove misleading spec_v1 check on var-offset stack read
	vlan: partially enable SIOCSHWTSTAMP in container
	net/packet: annotate accesses to po->xmit
	net/packet: convert po->origdev to an atomic flag
	net/packet: convert po->auxdata to an atomic flag
	scsi: target: Rename struct sense_info to sense_detail
	scsi: target: Rename cmd.bad_sector to cmd.sense_info
	scsi: target: Make state_list per CPU
	scsi: target: Fix multiple LUN_RESET handling
	scsi: target: iscsit: Fix TAS handling during conn cleanup
	scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS
	f2fs: handle dqget error in f2fs_transfer_project_quota()
	f2fs: enforce single zone capacity
	f2fs: apply zone capacity to all zone type
	f2fs: compress: fix to call f2fs_wait_on_page_writeback() in f2fs_write_raw_pages()
	crypto: caam - Clear some memory in instantiate_rng
	crypto: sa2ul - Select CRYPTO_DES
	wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_rfreg()
	wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_reg()
	net: qrtr: correct types of trace event parameters
	selftests/bpf: Wait for receive in cg_storage_multi test
	bpftool: Fix bug for long instructions in program CFG dumps
	crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors
	crypto: drbg - Only fail when jent is unavailable in FIPS mode
	xsk: Fix unaligned descriptor validation
	f2fs: fix to avoid use-after-free for cached IPU bio
	scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
	net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling
	bpf, sockmap: fix deadlocks in the sockhash and sockmap
	nvme: handle the persistent internal error AER
	nvme: fix async event trace event
	nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage"
	bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap
	md/raid10: fix leak of 'r10bio->remaining' for recovery
	md/raid10: fix memleak for 'conf->bio_split'
	md/raid10: fix memleak of md thread
	wifi: iwlwifi: yoyo: Fix possible division by zero
	wifi: iwlwifi: fw: move memset before early return
	jdb2: Don't refuse invalidation of already invalidated buffers
	wifi: iwlwifi: make the loop for card preparation effective
	wifi: iwlwifi: mvm: check firmware response size
	wifi: iwlwifi: fw: fix memory leak in debugfs
	ixgbe: Allow flow hash to be set via ethtool
	ixgbe: Enable setting RSS table to default values
	bpf: Don't EFAULT for getsockopt with optval=NULL
	netfilter: nf_tables: don't write table validation state without mutex
	net/sched: sch_fq: fix integer overflow of "credit"
	ipv4: Fix potential uninit variable access bug in __ip_make_skb()
	Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work"
	netlink: Use copy_to_user() for optval in netlink_getsockopt().
	net: amd: Fix link leak when verifying config failed
	tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp.
	ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it
	pstore: Revert pmsg_lock back to a normal mutex
	usb: host: xhci-rcar: remove leftover quirk handling
	usb: dwc3: gadget: Change condition for processing suspend event
	fpga: bridge: fix kernel-doc parameter description
	iio: light: max44009: add missing OF device matching
	spi: spi-imx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
	spi: imx: Don't skip cleanup in remove's error path
	usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition
	PCI: imx6: Install the fault handler only on compatible match
	ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ
	ASoC: es8316: Handle optional IRQ assignment
	linux/vt_buffer.h: allow either builtin or modular for macros
	spi: qup: Don't skip cleanup in remove's error path
	spi: fsl-spi: Fix CPM/QE mode Litte Endian
	vmci_host: fix a race condition in vmci_host_poll() causing GPF
	of: Fix modalias string generation
	PCI/EDR: Clear Device Status after EDR error recovery
	ia64: mm/contig: fix section mismatch warning/error
	ia64: salinfo: placate defined-but-not-used warning
	scripts/gdb: bail early if there are no clocks
	scripts/gdb: bail early if there are no generic PD
	coresight: etm_pmu: Set the module field
	ASoC: fsl_mqs: move of_node_put() to the correct location
	spi: cadence-quadspi: fix suspend-resume implementations
	i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path
	uapi/linux/const.h: prefer ISO-friendly __typeof__
	sh: sq: Fix incorrect element size for allocating bitmap buffer
	usb: gadget: tegra-xudc: Fix crash in vbus_draw
	usb: chipidea: fix missing goto in `ci_hdrc_probe`
	usb: mtu3: fix kernel panic at qmu transfer done irq handler
	firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
	tty: serial: fsl_lpuart: adjust buffer length to the intended size
	serial: 8250: Add missing wakeup event reporting
	staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
	spmi: Add a check for remove callback when removing a SPMI driver
	macintosh/windfarm_smu_sat: Add missing of_node_put()
	powerpc/mpc512x: fix resource printk format warning
	powerpc/wii: fix resource printk format warnings
	powerpc/sysdev/tsi108: fix resource printk format warnings
	macintosh: via-pmu-led: requires ATA to be set
	powerpc/rtas: use memmove for potentially overlapping buffer copy
	perf/core: Fix hardlockup failure caused by perf throttle
	clk: at91: clk-sam9x60-pll: fix return value check
	RDMA/siw: Fix potential page_array out of range access
	RDMA/rdmavt: Delete unnecessary NULL check
	workqueue: Rename "delayed" (delayed by active management) to "inactive"
	workqueue: Fix hung time report of worker pools
	rtc: omap: include header for omap_rtc_power_off_program prototype
	RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
	rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
	power: supply: generic-adc-battery: fix unit scaling
	clk: add missing of_node_put() in "assigned-clocks" property parsing
	RDMA/siw: Remove namespace check from siw_netdev_event()
	RDMA/cm: Trace icm_send_rej event before the cm state is reset
	RDMA/srpt: Add a check for valid 'mad_agent' pointer
	IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order
	IB/hfi1: Add AIP tx traces
	IB/hfi1: Add additional usdma traces
	IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests
	NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease
	firmware: raspberrypi: Introduce devm_rpi_firmware_get()
	input: raspberrypi-ts: Release firmware handle when not needed
	Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
	RDMA/mlx5: Fix flow counter query via DEVX
	SUNRPC: remove the maximum number of retries in call_bind_status
	RDMA/mlx5: Use correct device num_ports when modify DC
	clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
	openrisc: Properly store r31 to pt_regs on unhandled exceptions
	ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
	leds: TI_LMU_COMMON: select REGMAP instead of depending on it
	dmaengine: mv_xor_v2: Fix an error code.
	leds: tca6507: Fix error handling of using fwnode_property_read_string
	pwm: mtk-disp: Don't check the return code of pwmchip_remove()
	pwm: mtk-disp: Adjust the clocks to avoid them mismatch
	pwm: mtk-disp: Disable shadow registers before setting backlight values
	phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
	dmaengine: dw-edma: Fix to change for continuous transfer
	dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing
	dmaengine: at_xdmac: do not enable all cyclic channels
	thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe
	mfd: tqmx86: Do not access I2C_DETECT register through io_base
	mfd: tqmx86: Remove incorrect TQMx90UC board ID
	mfd: tqmx86: Add support for TQMx110EB and TQMxE40x
	mfd: tqmx86: Specify IO port register range more precisely
	mfd: tqmx86: Correct board names for TQMxE39x
	afs: Fix updating of i_size with dv jump from server
	scripts/gdb: fix lx-timerlist for Python3
	btrfs: scrub: reject unsupported scrub flags
	s390/dasd: fix hanging blockdevice after request requeue
	ia64: fix an addr to taddr in huge_pte_offset()
	dm clone: call kmem_cache_destroy() in dm_clone_init() error path
	dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path
	dm flakey: fix a crash with invalid table line
	dm ioctl: fix nested locking in table_clear() to remove deadlock concern
	perf auxtrace: Fix address filter entire kernel size
	perf intel-pt: Fix CYC timestamps after standalone CBR
	arm64: Always load shadow stack pointer directly from the task struct
	arm64: Stash shadow stack pointer in the task struct on interrupt
	debugobject: Ensure pool refill (again)
	sound/oss/dmasound: fix 'dmasound_setup' defined but not used
	arm64: dts: qcom: sdm845: correct dynamic power coefficients
	scsi: target: core: Avoid smp_processor_id() in preemptible code
	netfilter: nf_tables: deactivate anonymous set from preparation phase
	tty: create internal tty.h file
	tty: audit: move some local functions out of tty.h
	tty: move some internal tty lock enums and functions out of tty.h
	tty: move some tty-only functions to drivers/tty/tty.h
	tty: clean include/linux/tty.h up
	tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH
	ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus
	crypto: ccp - Clear PSP interrupt status register before calling handler
	mailbox: zynq: Switch to flexible array to simplify code
	mailbox: zynqmp: Fix counts of child nodes
	dm verity: skip redundant verity_handle_err() on I/O errors
	dm verity: fix error handling for check_at_most_once on FEC
	scsi: qedi: Fix use after free bug in qedi_remove()
	net/ncsi: clear Tx enable mode when handling a Config required AEN
	net/sched: cls_api: remove block_cb from driver_list before freeing
	sit: update dev->needed_headroom in ipip6_tunnel_bind_dev()
	net: dsa: mv88e6xxx: add mv88e6321 rsvd2cpu
	writeback: fix call of incorrect macro
	watchdog: dw_wdt: Fix the error handling path of dw_wdt_drv_probe()
	net/sched: act_mirred: Add carrier check
	sfc: Fix module EEPROM reporting for QSFP modules
	rxrpc: Fix hard call timeout units
	octeontx2-pf: Disable packet I/O for graceful exit
	octeontx2-vf: Detach LF resources on probe cleanup
	ionic: remove noise from ethtool rxnfc error msg
	af_packet: Don't send zero-byte data in packet_sendmsg_spkt().
	drm/amdgpu: add a missing lock for AMDGPU_SCHED
	ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init`
	net: dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621
	virtio_net: split free_unused_bufs()
	virtio_net: suppress cpu stall when free_unused_bufs
	net: enetc: check the index of the SFI rather than the handle
	perf vendor events power9: Remove UTF-8 characters from JSON files
	perf pmu: zfree() expects a pointer to a pointer to zero it after freeing its contents
	perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp()
	crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
	perf symbols: Fix return incorrect build_id size in elf_read_build_id()
	btrfs: fix btrfs_prev_leaf() to not return the same key twice
	btrfs: don't free qgroup space unless specified
	btrfs: print-tree: parent bytenr must be aligned to sector size
	cifs: fix pcchunk length type in smb2_copychunk_range
	platform/x86: touchscreen_dmi: Add upside-down quirk for GDIX1002 ts on the Juno Tablet
	platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i
	inotify: Avoid reporting event with invalid wd
	sh: math-emu: fix macro redefined warning
	sh: mcount.S: fix build error when PRINTK is not enabled
	sh: init: use OF_EARLY_FLATTREE for early init
	sh: nmi_debug: fix return value of __setup handler
	remoteproc: stm32: Call of_node_put() on iteration error
	remoteproc: st: Call of_node_put() on iteration error
	ARM: dts: exynos: fix WM8960 clock name in Itop Elite
	ARM: dts: s5pv210: correct MIPI CSIS clock name
	f2fs: fix potential corruption when moving a directory
	drm/panel: otm8009a: Set backlight parent to panel device
	drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini()
	drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras
	drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend
	HID: wacom: Set a default resolution for older tablets
	HID: wacom: insert timestamp to packed Bluetooth (BT) events
	KVM: x86: hyper-v: Avoid calling kvm_make_vcpus_request_mask() with vcpu_mask==NULL
	KVM: x86: do not report a vCPU as preempted outside instruction boundaries
	ext4: fix WARNING in mb_find_extent
	ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum
	ext4: fix data races when using cached status extents
	ext4: check iomap type only if ext4_iomap_begin() does not fail
	ext4: improve error recovery code paths in __ext4_remount()
	ext4: fix deadlock when converting an inline directory in nojournal mode
	ext4: add bounds checking in get_max_inline_xattr_value_size()
	ext4: bail out of ext4_xattr_ibody_get() fails for any reason
	ext4: remove a BUG_ON in ext4_mb_release_group_pa()
	ext4: fix invalid free tracking in ext4_xattr_move_to_block()
	serial: 8250: Fix serial8250_tx_empty() race with DMA Tx
	drbd: correctly submit flush bio on barrier
	KVM: x86: Ensure PV TLB flush tracepoint reflects KVM behavior
	KVM: x86: Fix recording of guest steal time / preempted status
	KVM: Fix steal time asm constraints
	KVM: x86: Remove obsolete disabling of page faults in kvm_arch_vcpu_put()
	KVM: x86: do not set st->preempted when going back to user space
	KVM: x86: revalidate steal time cache if MSR value changes
	KVM: x86: do not report preemption if the steal time cache is stale
	KVM: x86: move guest_pv_has out of user_access section
	printk: declare printk_deferred_{enter,safe}() in include/linux/printk.h
	drm/exynos: move to use request_irq by IRQF_NO_AUTOEN flag
	mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock
	drm/amd/display: Fix hang when skipping modeset
	Linux 5.10.180

Change-Id: Ie0c8ae79d56d844ec23ec277d91d4c70c3e1e9a8
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-26 17:31:57 +00:00
Greg Kroah-Hartman
b38d756cea Revert "workqueue: Rename "delayed" (delayed by active management) to "inactive""
This reverts commit 77d9a64cfb which is
commit f97a4a1a3f8769e3452885967955e21c88f3f263 upstream.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Change-Id: Ia1a60890202c1cddb635ecbd392e1a0726463a3c
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 17:07:37 +00:00
Greg Kroah-Hartman
24c41942a4 Revert "workqueue: Fix hung time report of worker pools"
This reverts commit 647781347a which is
commit 335a42ebb0ca8ee9997a1731aaaae6dcd704c113 upstream.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Change-Id: I702fcb45a1147789f1ff78ed07500162e8632d5f
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 17:07:37 +00:00
Greg Kroah-Hartman
24c3784e97 Merge 647781347a ("workqueue: Fix hung time report of worker pools") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: I559e6bbf071d1d28e4a296c6229e32d4d938764b
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 17:07:14 +00:00
Greg Kroah-Hartman
de3c7c404a Merge 960167e0e0 ("RDMA/rdmavt: Delete unnecessary NULL check") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: Iac1fc6d3dd80baecfbd51eba70a3e2b2da135e97
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 14:00:28 +00:00
Greg Kroah-Hartman
2dcf843019 Merge fd7bf900c3 ("i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: I3438288cccc8a544306afc5aa178fde55e7e34fb
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 11:42:29 +00:00
Greg Kroah-Hartman
be7602cdd6 Merge adc2d82eee ("crypto: sa2ul - Select CRYPTO_DES") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: I2356127ad84f0179909589c63453c3367e99f4ee
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 11:41:48 +00:00
Greg Kroah-Hartman
c83bfc082b Merge 1487b29030 ("ACPI: processor: Fix evaluating _PDC method when running as Xen dom0") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: I7ff36de2cd04657e3f9e7c688fe1555823564e10
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 11:40:52 +00:00
Greg Kroah-Hartman
6f849f24da Merge e0dd13b49d ("wifi: rtl8xxxu: RTL8192EU always needs full init") into android12-5.10-lts
Steps on the way to 5.10.180

Change-Id: Id1ae1d6b019603d17be21ebc68f399eb60bde38a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-25 08:10:12 +00:00
Greg Kroah-Hartman
d7203e0307 Merge 47e61cadc7 ("MIPS: fw: Allow firmware to pass a empty env") into android12-5.10-lts
Steps on the way to 5.10.180 to help resolve some testing errors.

Change-Id: I291b51c58e5eeff603ad8bfa999b88c628b0fe8a
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-23 14:15:14 +00:00
Ziwei Dai
7230a9e599 rcu/kvfree: Avoid freeing new kfree_rcu() memory after old grace period
commit 5da7cb193db32da783a3f3e77d8b639989321d48 upstream.

Memory passed to kvfree_rcu() that is to be freed is tracked by a
per-CPU kfree_rcu_cpu structure, which in turn contains pointers
to kvfree_rcu_bulk_data structures that contain pointers to memory
that has not yet been handed to RCU, along with an kfree_rcu_cpu_work
structure that tracks the memory that has already been handed to RCU.
These structures track three categories of memory: (1) Memory for
kfree(), (2) Memory for kvfree(), and (3) Memory for both that arrived
during an OOM episode.  The first two categories are tracked in a
cache-friendly manner involving a dynamically allocated page of pointers
(the aforementioned kvfree_rcu_bulk_data structures), while the third
uses a simple (but decidedly cache-unfriendly) linked list through the
rcu_head structures in each block of memory.

On a given CPU, these three categories are handled as a unit, with that
CPU's kfree_rcu_cpu_work structure having one pointer for each of the
three categories.  Clearly, new memory for a given category cannot be
placed in the corresponding kfree_rcu_cpu_work structure until any old
memory has had its grace period elapse and thus has been removed.  And
the kfree_rcu_monitor() function does in fact check for this.

Except that the kfree_rcu_monitor() function checks these pointers one
at a time.  This means that if the previous kfree_rcu() memory passed
to RCU had only category 1 and the current one has only category 2, the
kfree_rcu_monitor() function will send that current category-2 memory
along immediately.  This can result in memory being freed too soon,
that is, out from under unsuspecting RCU readers.

To see this, consider the following sequence of events, in which:

o	Task A on CPU 0 calls rcu_read_lock(), then uses "from_cset",
	then is preempted.

o	CPU 1 calls kfree_rcu(cset, rcu_head) in order to free "from_cset"
	after a later grace period.  Except that "from_cset" is freed
	right after the previous grace period ended, so that "from_cset"
	is immediately freed.  Task A resumes and references "from_cset"'s
	member, after which nothing good happens.

In full detail:

CPU 0					CPU 1
----------------------			----------------------
count_memcg_event_mm()
|rcu_read_lock()  <---
|mem_cgroup_from_task()
 |// css_set_ptr is the "from_cset" mentioned on CPU 1
 |css_set_ptr = rcu_dereference((task)->cgroups)
 |// Hard irq comes, current task is scheduled out.

					cgroup_attach_task()
					|cgroup_migrate()
					|cgroup_migrate_execute()
					|css_set_move_task(task, from_cset, to_cset, true)
					|cgroup_move_task(task, to_cset)
					|rcu_assign_pointer(.., to_cset)
					|...
					|cgroup_migrate_finish()
					|put_css_set_locked(from_cset)
					|from_cset->refcount return 0
					|kfree_rcu(cset, rcu_head) // free from_cset after new gp
					|add_ptr_to_bulk_krc_lock()
					|schedule_delayed_work(&krcp->monitor_work, ..)

					kfree_rcu_monitor()
					|krcp->bulk_head[0]'s work attached to krwp->bulk_head_free[]
					|queue_rcu_work(system_wq, &krwp->rcu_work)
					|if rwork->rcu.work is not in WORK_STRUCT_PENDING_BIT state,
					|call_rcu(&rwork->rcu, rcu_work_rcufn) <--- request new gp

					// There is a perious call_rcu(.., rcu_work_rcufn)
					// gp end, rcu_work_rcufn() is called.
					rcu_work_rcufn()
					|__queue_work(.., rwork->wq, &rwork->work);

					|kfree_rcu_work()
					|krwp->bulk_head_free[0] bulk is freed before new gp end!!!
					|The "from_cset" is freed before new gp end.

// the task resumes some time later.
 |css_set_ptr->subsys[(subsys_id) <--- Caused kernel crash, because css_set_ptr is freed.

This commit therefore causes kfree_rcu_monitor() to refrain from moving
kfree_rcu() memory to the kfree_rcu_cpu_work structure until the RCU
grace period has completed for all three categories.

v2: Use helper function instead of inserted code block at kfree_rcu_monitor().

Fixes: 34c8817455 ("rcu: Support kfree_bulk() interface in kfree_rcu()")
Fixes: 5f3c8d6204 ("rcu/tree: Maintain separate array for vmalloc ptrs")
Reported-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Ziwei Dai <ziwei.dai@unisoc.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Tested-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-21 15:45:40 +02:00
John Sperbeck
a261589621 cgroup: always put cset in cgroup_css_set_put_fork
commit 2bd110339288c18823dcace602b63b0d8627e520 upstream.

A successful call to cgroup_css_set_fork() will always have taken
a ref on kargs->cset (regardless of CLONE_INTO_CGROUP), so always
do a corresponding put in cgroup_css_set_put_fork().

Without this, a cset and its contained css structures will be
leaked for some fork failures.  The following script reproduces
the leak for a fork failure due to exceeding pids.max in the
pids controller.  A similar thing can happen if we jump to the
bad_fork_cancel_cgroup label in copy_process().

[ -z "$1" ] && echo "Usage $0 pids-root" && exit 1
PID_ROOT=$1
CGROUP=$PID_ROOT/foo

[ -e $CGROUP ] && rmdir -f $CGROUP
mkdir $CGROUP
echo 5 > $CGROUP/pids.max
echo $$ > $CGROUP/cgroup.procs

fork_bomb()
{
	set -e
	for i in $(seq 10); do
		/bin/sleep 3600 &
	done
}

(fork_bomb) &
wait
echo $$ > $PID_ROOT/cgroup.procs
kill $(cat $CGROUP/cgroup.procs)
rmdir $CGROUP

Fixes: ef2c41cf38 ("clone3: allow spawning processes into cgroups")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: John Sperbeck <jsperbeck@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
[TJM: This backport accommodates the lack of cgroup_unlock]
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-21 15:45:40 +02:00
Ricardo Ribalda
f368aed482 kexec: support purgatories with .text.hot sections
commit 8652d44f466ad5772e7d1756e9457046189b0dfc upstream.

Patch series "kexec: Fix kexec_file_load for llvm16 with PGO", v7.

When upreving llvm I realised that kexec stopped working on my test
platform.

The reason seems to be that due to PGO there are multiple .text sections
on the purgatory, and kexec does not supports that.


This patch (of 4):

Clang16 links the purgatory text in two sections when PGO is in use:

  [ 1] .text             PROGBITS         0000000000000000  00000040
       00000000000011a1  0000000000000000  AX       0     0     16
  [ 2] .rela.text        RELA             0000000000000000  00003498
       0000000000000648  0000000000000018   I      24     1     8
  ...
  [17] .text.hot.        PROGBITS         0000000000000000  00003220
       000000000000020b  0000000000000000  AX       0     0     1
  [18] .rela.text.hot.   RELA             0000000000000000  00004428
       0000000000000078  0000000000000018   I      24    17     8

And both of them have their range [sh_addr ... sh_addr+sh_size] on the
area pointed by `e_entry`.

This causes that image->start is calculated twice, once for .text and
another time for .text.hot. The second calculation leaves image->start
in a random location.

Because of this, the system crashes immediately after:

kexec_core: Starting new kernel

Link: https://lkml.kernel.org/r/20230321-kexec_clang16-v7-0-b05c520b7296@chromium.org
Link: https://lkml.kernel.org/r/20230321-kexec_clang16-v7-1-b05c520b7296@chromium.org
Fixes: 930457057a ("kernel/kexec_file.c: split up __kexec_load_puragory")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Simon Horman <horms@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Rix <trix@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-21 15:45:37 +02:00
LongPing Wei
5f17bf82b4 ANDROID: Export memcg functions to allow module to add new files
Export cgroup_add_dfl_cftypes to allow vendor module to expose additional files in the memory cgroup-v2 hierarchy.

Bug: 287922632

Change-Id: I103b983fbb46ff7a45cfc57f5657142a1bbd3d68
Signed-off-by: LongPing Wei <weilongping@oppo.com>
2023-06-21 13:23:40 +00:00
Greg Kroah-Hartman
571879dd5f Revert "sched/fair: Detect capacity inversion"
This reverts commit 30f04dd56d.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Cc: Qais Yousef <qyousef@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I576fa3894406ad6db3d4eafe5c08572d20c71902
2023-06-20 11:21:24 +00:00
Greg Kroah-Hartman
ce3ecd63bf Revert "sched/fair: Consider capacity inversion in util_fits_cpu()"
This reverts commit 09129798a6.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Cc: Qais Yousef <qyousef@google.com>
Change-Id: Ied83e33a14ff0e09f5f9f288d4e779d8175a8f0f
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-20 11:21:23 +00:00
Greg Kroah-Hartman
652a7f2c7e Revert "sched/uclamp: Fix a uninitialized variable warnings"
This reverts commit 89ad8a672f.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Cc: Qais Yousef <qyousef@google.com>
Change-Id: I5e23eb845f1e2558992cdfe828e9ebcf32055a52
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-20 11:21:20 +00:00
Greg Kroah-Hartman
e1be343429 Revert "sched/fair: Fixes for capacity inversion detection"
This reverts commit 4735b6f74f.

It breaks the Android kernel abi, so revert it.  If it needs to come
back later, it can do so in an abi-safe way.

Bug: 161946584
Cc: Qais Yousef <qyousef@google.com>
Change-Id: I91e7a2222c06516f4df460603cc27cf7c1106823
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-20 11:21:13 +00:00
Greg Kroah-Hartman
4c20c2c837 This is the 5.10.179 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmRI7pUACgkQONu9yGCS
 aT4cCRAA0YwtiFA5PDxWdBVW2f/6ad7NL4cCUATt7yd68j22SKifIxmsI4J3WnmT
 K8p7yvc7WstuvCyoRT+9LpR969jDa/ao5jQQDky+9nFn39RK2pUQ1S4tQhRr0QWP
 /QrVbecT4X3rn126JhEMauR97Ma5yp0XMj9lOVIac40irf0UyRrvNHciGLfL37Zy
 2Q7AOOJGrA9IREpj+uaG4r8QWZtvVYMCZkIgqZDdnEgfjZew+2w8j+4boL6anxpM
 0f+6ZFT5OHUabwuBsw+4ee6eRE0K3iaAzde8pIZ2y1/ihYgQ+VlMwcLRncuE/34X
 dUG1aQyfbcMdukzWO2fay0on/7NF/U2ljS8WTFjWeCGWXzKRxxbmgXD/WRpBba6V
 NZQB/LroXv+8HVAzlfnZoHD9ojRg8b3exxjy70hUvgAING2CXMqX7KILalFKQvBz
 Ish5e5cxUBP2khMo1caPCU04dy3t/CF68UBrx4s8+RJFvGBmTykhfUx+DhS8usmu
 y0GrvyBfCXb1CW56ZZaip2jLv5IiOUL9KzKpPli1PV9K+He6aa2mTtvKzVBUalZf
 qVzMTifW6JskpxW58I0xKqiaHY5pZVfv0EX65Gs0gVYskSpSLu5MINMvBl5F1sDf
 DdrJ+ZivMUNU5eGUf99IQgXuYFPWigEzsXQRfwHr78kFP4wIPxg=
 =Ubp5
 -----END PGP SIGNATURE-----

Merge 5.10.179 into android12-5.10-lts

Changes in 5.10.179
	ARM: dts: rockchip: fix a typo error for rk3288 spdif node
	arm64: dts: qcom: ipq8074-hk01: enable QMP device, not the PHY node
	arm64: dts: meson-g12-common: specify full DMC range
	arm64: dts: imx8mm-evk: correct pmic clock source
	netfilter: br_netfilter: fix recent physdev match breakage
	regulator: fan53555: Explicitly include bits header
	net: sched: sch_qfq: prevent slab-out-of-bounds in qfq_activate_agg
	virtio_net: bugfix overflow inside xdp_linearize_page()
	sfc: Split STATE_READY in to STATE_NET_DOWN and STATE_NET_UP.
	sfc: Fix use-after-free due to selftest_work
	netfilter: nf_tables: fix ifdef to also consider nf_tables=m
	i40e: fix accessing vsi->active_filters without holding lock
	i40e: fix i40e_setup_misc_vector() error handling
	mlxfw: fix null-ptr-deref in mlxfw_mfa2_tlv_next()
	net: rpl: fix rpl header size calculation
	mlxsw: pci: Fix possible crash during initialization
	bpf: Fix incorrect verifier pruning due to missing register precision taints
	e1000e: Disable TSO on i219-LM card to increase speed
	f2fs: Fix f2fs_truncate_partial_nodes ftrace event
	Input: i8042 - add quirk for Fujitsu Lifebook A574/H
	selftests: sigaltstack: fix -Wuninitialized
	scsi: megaraid_sas: Fix fw_crash_buffer_show()
	scsi: core: Improve scsi_vpd_inquiry() checks
	net: dsa: b53: mmap: add phy ops
	s390/ptrace: fix PTRACE_GET_LAST_BREAK error handling
	nvme-tcp: fix a possible UAF when failing to allocate an io queue
	xen/netback: use same error messages for same errors
	powerpc/doc: Fix htmldocs errors
	xfs: drop submit side trans alloc for append ioends
	iio: light: tsl2772: fix reading proximity-diodes from device tree
	nilfs2: initialize unused bytes in segment summary blocks
	memstick: fix memory leak if card device is never registered
	kernel/sys.c: fix and improve control flow in __sys_setres[ug]id()
	mmc: sdhci_am654: Set HIGH_SPEED_ENA for SDR12 and SDR25
	mm/khugepaged: check again on anon uffd-wp during isolation
	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
	sched/fair: Detect capacity inversion
	sched/fair: Consider capacity inversion in util_fits_cpu()
	sched/uclamp: Fix a uninitialized variable warnings
	sched/fair: Fixes for capacity inversion detection
	MIPS: Define RUNTIME_DISCARD_EXIT in LD script
	docs: futex: Fix kernel-doc references after code split-up preparation
	purgatory: fix disabling debug info
	virtiofs: clean up error handling in virtio_fs_get_tree()
	virtiofs: split requests that exceed virtqueue size
	fuse: check s_root when destroying sb
	fuse: fix attr version comparison in fuse_read_update_size()
	fuse: always revalidate rename target dentry
	fuse: fix deadlock between atomic O_TRUNC and page invalidation
	Revert "ext4: fix use-after-free in ext4_xattr_set_entry"
	ext4: remove duplicate definition of ext4_xattr_ibody_inline_set()
	ext4: fix use-after-free in ext4_xattr_set_entry
	udp: Call inet6_destroy_sock() in setsockopt(IPV6_ADDRFORM).
	tcp/udp: Call inet6_destroy_sock() in IPv6 sk->sk_destruct().
	inet6: Remove inet6_destroy_sock() in sk->sk_prot->destroy().
	dccp: Call inet6_destroy_sock() via sk->sk_destruct().
	sctp: Call inet6_destroy_sock() via sk->sk_destruct().
	pwm: meson: Explicitly set .polarity in .get_state()
	pwm: iqs620a: Explicitly set .polarity in .get_state()
	pwm: hibvt: Explicitly set .polarity in .get_state()
	iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger()
	ASoC: fsl_asrc_dma: fix potential null-ptr-deref
	ASN.1: Fix check for strdup() success
	Linux 5.10.179

Change-Id: I54e476aa9b199a4711a091c77583739ed82af5ad
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-16 09:49:29 +00:00
Jiri Olsa
27b8d6931f bpf: Add extra path pointer check to d_path helper
[ Upstream commit f46fab0e36e611a2389d3843f34658c849b6bd60 ]

Anastasios reported crash on stable 5.15 kernel with following
BPF attached to lsm hook:

  SEC("lsm.s/bprm_creds_for_exec")
  int BPF_PROG(bprm_creds_for_exec, struct linux_binprm *bprm)
  {
          struct path *path = &bprm->executable->f_path;
          char p[128] = { 0 };

          bpf_d_path(path, p, 128);
          return 0;
  }

But bprm->executable can be NULL, so bpf_d_path call will crash:

  BUG: kernel NULL pointer dereference, address: 0000000000000018
  #PF: supervisor read access in kernel mode
  #PF: error_code(0x0000) - not-present page
  PGD 0 P4D 0
  Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC NOPTI
  ...
  RIP: 0010:d_path+0x22/0x280
  ...
  Call Trace:
   <TASK>
   bpf_d_path+0x21/0x60
   bpf_prog_db9cf176e84498d9_bprm_creds_for_exec+0x94/0x99
   bpf_trampoline_6442506293_0+0x55/0x1000
   bpf_lsm_bprm_creds_for_exec+0x5/0x10
   security_bprm_creds_for_exec+0x29/0x40
   bprm_execve+0x1c1/0x900
   do_execveat_common.isra.0+0x1af/0x260
   __x64_sys_execve+0x32/0x40

It's problem for all stable trees with bpf_d_path helper, which was
added in 5.9.

This issue is fixed in current bpf code, where we identify and mark
trusted pointers, so the above code would fail even to load.

For the sake of the stable trees and to workaround potentially broken
verifier in the future, adding the code that reads the path object from
the passed pointer and verifies it's valid in kernel space.

Fixes: 6e22ab9da7 ("bpf: Add d_path helper")
Reported-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
Suggested-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Stanislav Fomichev <sdf@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20230606181714.532998-1-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-14 11:09:44 +02:00
Pietro Borrello
57eb824b8c tracing/probe: trace_probe_primary_from_call(): checked list_first_entry
commit 81d0fa4cb4fc0e1a49c2b22f92c43d9fe972ebcf upstream.

All callers of trace_probe_primary_from_call() check the return
value to be non NULL. However, the function returns
list_first_entry(&tpe->probes, ...) which can never be NULL.
Additionally, it does not check for the list being possibly empty,
possibly causing a type confusion on empty lists.
Use list_first_entry_or_null() which solves both problems.

Link: https://lore.kernel.org/linux-trace-kernel/20230128-list-entry-null-check-v1-1-8bde6a3da2ef@diag.uniroma1.it/

Fixes: 60d53e2c3b ("tracing/probe: Split trace_event related data from trace_probe")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Mukesh Ojha <quic_mojha@quicinc.com>
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-09 10:30:16 +02:00
xieliujie
403d5d1318 ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters
With hooks below, we can mark a lock-owned thread with an identifiable flag, which can protect it from being preempted by some other unimportant threads, and then waiter will be wakeup more quickly.
https://android-review.googlesource.com/c/kernel/common/+/2183353

but now we find an issue like this one:
static inline void __up_write(struct rw_semaphore *sem)
{
        ...
        // Step 1. we clear flag.
        trace_android_vh_record_rwsem_lock_starttime(current, 0);
        // Step 2. owner may be preempted by unimportant threads.
        rwsem_clear_owner(sem);
        ...
        // Step 3. wake up waiter, but it's too later.
        if (unlikely(tmp & RWSEM_FLAG_WAITERS))
                rwsem_wake(sem);
}

This patch will clear protect-flag after waking up waiters.

Bug: 286024926
Change-Id: I71f8b6a7d8a01336fd36b8267c2cb5edab65bd11
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-06-07 06:36:55 +00:00
Will Deacon
a61d5c13c7 bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
commit 0613d8ca9ab382caabe9ed2dceb429e9781e443f upstream.

A narrow load from a 64-bit context field results in a 64-bit load
followed potentially by a 64-bit right-shift and then a bitwise AND
operation to extract the relevant data.

In the case of a 32-bit access, an immediate mask of 0xffffffff is used
to construct a 64-bit BPP_AND operation which then sign-extends the mask
value and effectively acts as a glorified no-op. For example:

0:	61 10 00 00 00 00 00 00	r0 = *(u32 *)(r1 + 0)

results in the following code generation for a 64-bit field:

	ldr	x7, [x7]	// 64-bit load
	mov	x10, #0xffffffffffffffff
	and	x7, x7, x10

Fix the mask generation so that narrow loads always perform a 32-bit AND
operation:

	ldr	x7, [x7]	// 64-bit load
	mov	w10, #0xffffffff
	and	w7, w7, w10

Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Krzesimir Nowak <krzesimir@kinvolk.io>
Cc: Andrey Ignatov <rdna@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Fixes: 31fd85816d ("bpf: permits narrower load from bpf program context fields")
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230518102528.1341-1-will@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-30 12:57:58 +01:00
Kumar Kartikeya Dwivedi
e8d49d1c59 bpf: Annotate data races in bpf_local_storage
[ Upstream commit 0a09a2f933c73dc76ab0b72da6855f44342a8903 ]

There are a few cases where hlist_node is checked to be unhashed without
holding the lock protecting its modification. In this case, one must use
hlist_unhashed_lockless to avoid load tearing and KCSAN reports. Fix
this by using lockless variant in places not protected by the lock.

Since this is not prompted by any actual KCSAN reports but only from
code review, I have not included a fixes tag.

Cc: Martin KaFai Lau <martin.lau@kernel.org>
Cc: KP Singh <kpsingh@kernel.org>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20230221200646.2500777-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-30 12:57:48 +01:00
Zqiang
a7d21b8585 rcu: Protect rcu_print_task_exp_stall() ->exp_tasks access
[ Upstream commit 3c1566bca3f8349f12b75d0a2d5e4a20ad6262ec ]

For kernels built with CONFIG_PREEMPT_RCU=y, the following scenario can
result in a NULL-pointer dereference:

           CPU1                                           CPU2
rcu_preempt_deferred_qs_irqrestore                rcu_print_task_exp_stall
  if (special.b.blocked)                            READ_ONCE(rnp->exp_tasks) != NULL
    raw_spin_lock_rcu_node
    np = rcu_next_node_entry(t, rnp)
    if (&t->rcu_node_entry == rnp->exp_tasks)
      WRITE_ONCE(rnp->exp_tasks, np)
      ....
      raw_spin_unlock_irqrestore_rcu_node
                                                    raw_spin_lock_irqsave_rcu_node
                                                    t = list_entry(rnp->exp_tasks->prev,
                                                        struct task_struct, rcu_node_entry)
                                                    (if rnp->exp_tasks is NULL, this
                                                       will dereference a NULL pointer)

The problem is that CPU2 accesses the rcu_node structure's->exp_tasks
field without holding the rcu_node structure's ->lock and CPU2 did
not observe CPU1's change to rcu_node structure's ->exp_tasks in time.
Therefore, if CPU1 sets rcu_node structure's->exp_tasks pointer to NULL,
then CPU2 might dereference that NULL pointer.

This commit therefore holds the rcu_node structure's ->lock while
accessing that structure's->exp_tasks field.

[ paulmck: Apply Frederic Weisbecker feedback. ]

Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-30 12:57:47 +01:00
Paul E. McKenney
e4842de4ec refscale: Move shutdown from wait_event() to wait_event_idle()
[ Upstream commit 6bc6e6b27524304aadb9c04611ddb1c84dd7617a ]

The ref_scale_shutdown() kthread/function uses wait_event() to wait for
the refscale test to complete.  However, although the read-side tests
are normally extremely fast, there is no law against specifying a very
large value for the refscale.loops module parameter or against having
a slow read-side primitive.  Either way, this might well trigger the
hung-task timeout.

This commit therefore replaces those wait_event() calls with calls to
wait_event_idle(), which do not trigger the hung-task timeout.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-30 12:57:47 +01:00
Tze-nan Wu
6f60aae72c ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus
[ Upstream commit 7c339fb4d8577792378136c15fde773cfb863cb8 ]

In ring_buffer_reset_online_cpus, the buffer_size_kb write operation
may permanently fail if the cpu_online_mask changes between two
for_each_online_buffer_cpu loops. The number of increases and decreases
on both cpu_buffer->resize_disabled and cpu_buffer->record_disabled may be
inconsistent, causing some CPUs to have non-zero values for these atomic
variables after the function returns.

This issue can be reproduced by "echo 0 > trace" while hotplugging cpu.
After reproducing success, we can find out buffer_size_kb will not be
functional anymore.

To prevent leaving 'resize_disabled' and 'record_disabled' non-zero after
ring_buffer_reset_online_cpus returns, we ensure that each atomic variable
has been set up before atomic_sub() to it.

Link: https://lore.kernel.org/linux-trace-kernel/20230426062027.17451-1-Tze-nan.Wu@mediatek.com

Cc: stable@vger.kernel.org
Cc: <mhiramat@kernel.org>
Cc: npiggin@gmail.com
Fixes: b23d7a5f4a ("ring-buffer: speed up buffer resets by avoiding synchronize_rcu for each CPU")
Reviewed-by: Cheng-Jui Wang <cheng-jui.wang@mediatek.com>
Signed-off-by: Tze-nan Wu <Tze-nan.Wu@mediatek.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:48:09 +02:00
Petr Mladek
647781347a workqueue: Fix hung time report of worker pools
[ Upstream commit 335a42ebb0ca8ee9997a1731aaaae6dcd704c113 ]

The workqueue watchdog prints a warning when there is no progress in
a worker pool. Where the progress means that the pool started processing
a pending work item.

Note that it is perfectly fine to process work items much longer.
The progress should be guaranteed by waking up or creating idle
workers.

show_one_worker_pool() prints state of non-idle worker pool. It shows
a delay since the last pool->watchdog_ts.

The timestamp is updated when a first pending work is queued in
__queue_work(). Also it is updated when a work is dequeued for
processing in worker_thread() and rescuer_thread().

The delay is misleading when there is no pending work item. In this
case it shows how long the last work item is being proceed. Show
zero instead. There is no stall if there is no pending work.

Fixes: 82607adcf9 ("workqueue: implement lockup detector")
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:48:00 +02:00
Lai Jiangshan
77d9a64cfb workqueue: Rename "delayed" (delayed by active management) to "inactive"
[ Upstream commit f97a4a1a3f8769e3452885967955e21c88f3f263 ]

There are two kinds of "delayed" work items in workqueue subsystem.

One is for timer-delayed work items which are visible to workqueue users.
The other kind is for work items delayed by active management which can
not be directly visible to workqueue users.  We mixed the word "delayed"
for both kinds and caused somewhat ambiguity.

This patch renames the later one (delayed by active management) to
"inactive", because it is used for workqueue active management and
most of its related symbols are named with "active" or "activate".

All "delayed" and "DELAYED" are carefully checked and renamed one by
one to avoid accidentally changing the name of the other kind for
timer-delayed.

No functional change intended.

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Stable-dep-of: 335a42ebb0ca ("workqueue: Fix hung time report of worker pools")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:48:00 +02:00
Yang Jihong
8f381b2494 perf/core: Fix hardlockup failure caused by perf throttle
[ Upstream commit 15def34e2635ab7e0e96f1bc32e1b69609f14942 ]

commit e050e3f0a7 ("perf: Fix broken interrupt rate throttling")
introduces a change in throttling threshold judgment. Before this,
compare hwc->interrupts and max_samples_per_tick, then increase
hwc->interrupts by 1, but this commit reverses order of these two
behaviors, causing the semantics of max_samples_per_tick to change.
In literal sense of "max_samples_per_tick", if hwc->interrupts ==
max_samples_per_tick, it should not be throttled, therefore, the judgment
condition should be changed to "hwc->interrupts > max_samples_per_tick".

In fact, this may cause the hardlockup to fail, The minimum value of
max_samples_per_tick may be 1, in this case, the return value of
__perf_event_account_interrupt function is 1.
As a result, nmi_watchdog gets throttled, which would stop PMU (Use x86
architecture as an example, see x86_pmu_handle_irq).

Fixes: e050e3f0a7 ("perf: Fix broken interrupt rate throttling")
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20230227023508.102230-1-yangjihong1@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:48:00 +02:00
Stanislav Fomichev
f4fc43fde1 bpf: Don't EFAULT for getsockopt with optval=NULL
[ Upstream commit 00e74ae0863827d944e36e56a4ce1e77e50edb91 ]

Some socket options do getsockopt with optval=NULL to estimate the size
of the final buffer (which is returned via optlen). This breaks BPF
getsockopt assumptions about permitted optval buffer size. Let's enforce
these assumptions only when non-NULL optval is provided.

Fixes: 0d01da6afc ("bpf: implement getsockopt and setsockopt hooks")
Reported-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/ZD7Js4fj5YyI2oLd@google.com/T/#mb68daf700f87a9244a15d01d00c3f0e5b08f49f7
Link: https://lore.kernel.org/bpf/20230418225343.553806-2-sdf@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:53 +02:00
Luis Gerhorst
118df5df1b bpf: Remove misleading spec_v1 check on var-offset stack read
[ Upstream commit 082cdc69a4651dd2a77539d69416a359ed1214f5 ]

For every BPF_ADD/SUB involving a pointer, adjust_ptr_min_max_vals()
ensures that the resulting pointer has a constant offset if
bypass_spec_v1 is false. This is ensured by calling sanitize_check_bounds()
which in turn calls check_stack_access_for_ptr_arithmetic(). There,
-EACCESS is returned if the register's offset is not constant, thereby
rejecting the program.

In summary, an unprivileged user must never be able to create stack
pointers with a variable offset. That is also the case, because a
respective check in check_stack_write() is missing. If they were able
to create a variable-offset pointer, users could still use it in a
stack-write operation to trigger unsafe speculative behavior [1].

Because unprivileged users must already be prevented from creating
variable-offset stack pointers, viable options are to either remove
this check (replacing it with a clarifying comment), or to turn it
into a "verifier BUG"-message, also adding a similar check in
check_stack_write() (for consistency, as a second-level defense).
This patch implements the first option to reduce verifier bloat.

This check was introduced by commit 01f810ace9ed ("bpf: Allow
variable-offset stack access") which correctly notes that
"variable-offset reads and writes are disallowed (they were already
disallowed for the indirect access case) because the speculative
execution checking code doesn't support them". However, it does not
further discuss why the check in check_stack_read() is necessary.
The code which made this check obsolete was also introduced in this
commit.

I have compiled ~650 programs from the Linux selftests, Linux samples,
Cilium, and libbpf/examples projects and confirmed that none of these
trigger the check in check_stack_read() [2]. Instead, all of these
programs are, as expected, already rejected when constructing the
variable-offset pointers. Note that the check in
check_stack_access_for_ptr_arithmetic() also prints "off=%d" while the
code removed by this patch does not (the error removed does not appear
in the "verification_error" values). For reproducibility, the
repository linked includes the raw data and scripts used to create
the plot.

  [1] https://arxiv.org/pdf/1807.03757.pdf
  [2] 53dc19fcf4/data/plots/23-02-26_23-56_bpftool/bpftool/0004-errors.pdf

Fixes: 01f810ace9ed ("bpf: Allow variable-offset stack access")
Signed-off-by: Luis Gerhorst <gerhorst@cs.fau.de>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20230315165358.23701-1-gerhorst@cs.fau.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:47 +02:00
Andrii Nakryiko
10702be8b3 bpf: fix precision propagation verbose logging
[ Upstream commit 34f0677e7afd3a292bc1aadda7ce8e35faedb204 ]

Fix wrong order of frame index vs register/slot index in precision
propagation verbose (level 2) output. It's wrong and very confusing as is.

Fixes: 529409ea92d5 ("bpf: propagate precision across all frames, not just the last one")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230313184017.4083374-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:47 +02:00
Andrii Nakryiko
6be8ad4cdc bpf: take into account liveness when propagating precision
[ Upstream commit 52c2b005a3c18c565fc70cfd0ca49375f301e952 ]

When doing state comparison, if old state has register that is not
marked as REG_LIVE_READ, then we just skip comparison, regardless what's
the state of corresponing register in current state. This is because not
REG_LIVE_READ register is irrelevant for further program execution and
correctness. All good here.

But when we get to precision propagation, after two states were declared
equivalent, we don't take into account old register's liveness, and thus
attempt to propagate precision for register in current state even if
that register in old state was not REG_LIVE_READ anymore. This is bad,
because register in current state could be anything at all and this
could cause -EFAULT due to internal logic bugs.

Fix by taking into account REG_LIVE_READ liveness mark to keep the logic
in state comparison in sync with precision propagation.

Fixes: a3ce685dd0 ("bpf: fix precision tracking")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230309224131.57449-1-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:47 +02:00
Sebastian Andrzej Siewior
c401368926 tick/common: Align tick period with the HZ tick.
[ Upstream commit e9523a0d81899361214d118ad60ef76f0e92f71d ]

With HIGHRES enabled tick_sched_timer() is programmed every jiffy to
expire the timer_list timers. This timer is programmed accurate in
respect to CLOCK_MONOTONIC so that 0 seconds and nanoseconds is the
first tick and the next one is 1000/CONFIG_HZ ms later. For HZ=250 it is
every 4 ms and so based on the current time the next tick can be
computed.

This accuracy broke since the commit mentioned below because the jiffy
based clocksource is initialized with higher accuracy in
read_persistent_wall_and_boot_offset(). This higher accuracy is
inherited during the setup in tick_setup_device(). The timer still fires
every 4ms with HZ=250 but timer is no longer aligned with
CLOCK_MONOTONIC with 0 as it origin but has an offset in the us/ns part
of the timestamp. The offset differs with every boot and makes it
impossible for user land to align with the tick.

Align the tick period with CLOCK_MONOTONIC ensuring that it is always a
multiple of 1000/CONFIG_HZ ms.

Fixes: 857baa87b6 ("sched/clock: Enable sched clock early")
Reported-by: Gusenleitner Klaus <gus@keba.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/20230406095735.0_14edn3@linutronix.de
Link: https://lore.kernel.org/r/20230418122639.ikgfvu3f@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:46 +02:00
Thomas Gleixner
107ea1f63b tick: Get rid of tick_period
[ Upstream commit b996544916429946bf4934c1c01a306d1690972c ]

The variable tick_period is initialized to NSEC_PER_TICK / HZ during boot
and never updated again.

If NSEC_PER_TICK is not an integer multiple of HZ this computation is less
accurate than TICK_NSEC which has proper rounding in place.

Aside of the inaccuracy there is no reason for having this variable at
all. It's just a pointless indirection and all usage sites can just use the
TICK_NSEC constant.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201117132006.766643526@linutronix.de
Stable-dep-of: e9523a0d8189 ("tick/common: Align tick period with the HZ tick.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:46 +02:00
Thomas Gleixner
fdc4876746 tick/sched: Optimize tick_do_update_jiffies64() further
[ Upstream commit 7a35bf2a6a871cd0252cd371d741e7d070b53af9 ]

Now that it's clear that there is always one tick to account, simplify the
calculations some more.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201117132006.565663056@linutronix.de
Stable-dep-of: e9523a0d8189 ("tick/common: Align tick period with the HZ tick.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:46 +02:00
Yunfeng Ye
93c4300836 tick/sched: Reduce seqcount held scope in tick_do_update_jiffies64()
[ Upstream commit 94ad2e3cedb82af034f6d97c58022f162b669f9b ]

If jiffies are up to date already (caller lost the race against another
CPU) there is no point to change the sequence count. Doing that just forces
other CPUs into the seqcount retry loop in tick_nohz_next_event() for
nothing.

Just bail out early.

[ tglx: Rewrote most of it ]

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201117132006.462195901@linutronix.de
Stable-dep-of: e9523a0d8189 ("tick/common: Align tick period with the HZ tick.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:45 +02:00
Thomas Gleixner
ca721584e9 tick/sched: Use tick_next_period for lockless quick check
[ Upstream commit 372acbbaa80940189593f9d69c7c069955f24f7a ]

No point in doing calculations.

   tick_next_period = last_jiffies_update + tick_period

Just check whether now is before tick_next_period to figure out whether
jiffies need an update.

Add a comment why the intentional data race in the quick check is safe or
not so safe in a 32bit corner case and why we don't worry about it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20201117132006.337366695@linutronix.de
Stable-dep-of: e9523a0d8189 ("tick/common: Align tick period with the HZ tick.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:45 +02:00
Zqiang
d0653cc6e0 rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
[ Upstream commit db7b464df9d820186e98a65aa6a10f0d51fbf8ce ]

This commit adds checks for the TICK_DEP_MASK_RCU_EXP bit, thus enabling
RCU expedited grace periods to actually force-enable scheduling-clock
interrupts on holdout CPUs.

Fixes: df1e849ae4 ("rcu: Enable tick for nohz_full CPUs slow to provide expedited QS")
Signed-off-by: Zqiang <qiang1.zhang@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:47:36 +02:00
Zhang Zhengming
1b0df44753 relayfs: fix out-of-bounds access in relay_file_read
commit 43ec16f1450f4936025a9bdf1a273affdb9732c1 upstream.

There is a crash in relay_file_read, as the var from
point to the end of last subbuf.

The oops looks something like:
pc : __arch_copy_to_user+0x180/0x310
lr : relay_file_read+0x20c/0x2c8
Call trace:
 __arch_copy_to_user+0x180/0x310
 full_proxy_read+0x68/0x98
 vfs_read+0xb0/0x1d0
 ksys_read+0x6c/0xf0
 __arm64_sys_read+0x20/0x28
 el0_svc_common.constprop.3+0x84/0x108
 do_el0_svc+0x74/0x90
 el0_svc+0x1c/0x28
 el0_sync_handler+0x88/0xb0
 el0_sync+0x148/0x180

We get the condition by analyzing the vmcore:

1). The last produced byte and last consumed byte
    both at the end of the last subbuf

2). A softirq calls function(e.g __blk_add_trace)
    to write relay buffer occurs when an program is calling
    relay_file_read_avail().

        relay_file_read
                relay_file_read_avail
                        relay_file_read_consume(buf, 0, 0);
                        //interrupted by softirq who will write subbuf
                        ....
                        return 1;
                //read_start point to the end of the last subbuf
                read_start = relay_file_read_start_pos
                //avail is equal to subsize
                avail = relay_file_read_subbuf_avail
                //from  points to an invalid memory address
                from = buf->start + read_start
                //system is crashed
                copy_to_user(buffer, from, avail)

Link: https://lkml.kernel.org/r/20230419040203.37676-1-zhang.zhengming@h3c.com
Fixes: 8d62fdebda ("relay file read: start-pos fix")
Signed-off-by: Zhang Zhengming <zhang.zhengming@h3c.com>
Reviewed-by: Zhao Lei <zhao_lei1@hoperun.com>
Reviewed-by: Zhou Kete <zhou.kete@h3c.com>
Reviewed-by: Pengcheng Yang <yangpc@wangsu.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:34 +02:00
Zheng Yejian
eb18bc5a86 rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed
commit 7a29fb4a4771124bc61de397dbfc1554dbbcc19c upstream.

Registering a kprobe on __rcu_irq_enter_check_tick() can cause kernel
stack overflow as shown below. This issue can be reproduced by enabling
CONFIG_NO_HZ_FULL and booting the kernel with argument "nohz_full=",
and then giving the following commands at the shell prompt:

  # cd /sys/kernel/tracing/
  # echo 'p:mp1 __rcu_irq_enter_check_tick' >> kprobe_events
  # echo 1 > events/kprobes/enable

This commit therefore adds __rcu_irq_enter_check_tick() to the kprobes
blacklist using NOKPROBE_SYMBOL().

Insufficient stack space to handle exception!
ESR: 0x00000000f2000004 -- BRK (AArch64)
FAR: 0x0000ffffccf3e510
Task stack:     [0xffff80000ad30000..0xffff80000ad38000]
IRQ stack:      [0xffff800008050000..0xffff800008058000]
Overflow stack: [0xffff089c36f9f310..0xffff089c36fa0310]
CPU: 5 PID: 190 Comm: bash Not tainted 6.2.0-rc2-00320-g1f5abbd77e2c #19
Hardware name: linux,dummy-virt (DT)
pstate: 400003c5 (nZcv DAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __rcu_irq_enter_check_tick+0x0/0x1b8
lr : ct_nmi_enter+0x11c/0x138
sp : ffff80000ad30080
x29: ffff80000ad30080 x28: ffff089c82e20000 x27: 0000000000000000
x26: 0000000000000000 x25: ffff089c02a8d100 x24: 0000000000000000
x23: 00000000400003c5 x22: 0000ffffccf3e510 x21: ffff089c36fae148
x20: ffff80000ad30120 x19: ffffa8da8fcce148 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: ffffa8da8e44ea6c
x14: ffffa8da8e44e968 x13: ffffa8da8e03136c x12: 1fffe113804d6809
x11: ffff6113804d6809 x10: 0000000000000a60 x9 : dfff800000000000
x8 : ffff089c026b404f x7 : 00009eec7fb297f7 x6 : 0000000000000001
x5 : ffff80000ad30120 x4 : dfff800000000000 x3 : ffffa8da8e3016f4
x2 : 0000000000000003 x1 : 0000000000000000 x0 : 0000000000000000
Kernel panic - not syncing: kernel stack overflow
CPU: 5 PID: 190 Comm: bash Not tainted 6.2.0-rc2-00320-g1f5abbd77e2c #19
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0xf8/0x108
 show_stack+0x20/0x30
 dump_stack_lvl+0x68/0x84
 dump_stack+0x1c/0x38
 panic+0x214/0x404
 add_taint+0x0/0xf8
 panic_bad_stack+0x144/0x160
 handle_bad_stack+0x38/0x58
 __bad_stack+0x78/0x7c
 __rcu_irq_enter_check_tick+0x0/0x1b8
 arm64_enter_el1_dbg.isra.0+0x14/0x20
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 arm64_enter_el1_dbg.isra.0+0x14/0x20
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 arm64_enter_el1_dbg.isra.0+0x14/0x20
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 [...]
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 arm64_enter_el1_dbg.isra.0+0x14/0x20
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 arm64_enter_el1_dbg.isra.0+0x14/0x20
 el1_dbg+0x2c/0x90
 el1h_64_sync_handler+0xcc/0xe8
 el1h_64_sync+0x64/0x68
 __rcu_irq_enter_check_tick+0x0/0x1b8
 el1_interrupt+0x28/0x60
 el1h_64_irq_handler+0x18/0x28
 el1h_64_irq+0x64/0x68
 __ftrace_set_clr_event_nolock+0x98/0x198
 __ftrace_set_clr_event+0x58/0x80
 system_enable_write+0x144/0x178
 vfs_write+0x174/0x738
 ksys_write+0xd0/0x188
 __arm64_sys_write+0x4c/0x60
 invoke_syscall+0x64/0x180
 el0_svc_common.constprop.0+0x84/0x160
 do_el0_svc+0x48/0xe8
 el0_svc+0x34/0xd0
 el0t_64_sync_handler+0xb8/0xc0
 el0t_64_sync+0x190/0x194
SMP: stopping secondary CPUs
Kernel Offset: 0x28da86000000 from 0xffff800008000000
PHYS_OFFSET: 0xfffff76600000000
CPU features: 0x00000,01a00100,0000421b
Memory Limit: none

Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Link: https://lore.kernel.org/all/20221119040049.795065-1-zhengyejian1@huawei.com/
Fixes: aaf2bc50df ("rcu: Abstract out rcu_irq_enter_check_tick() from rcu_nmi_enter()")
Signed-off-by: Zheng Yejian <zhengyejian1@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:34 +02:00
Johannes Berg
1c99f65d6a ring-buffer: Sync IRQ works before buffer destruction
commit 675751bb20634f981498c7d66161584080cc061e upstream.

If something was written to the buffer just before destruction,
it may be possible (maybe not in a real system, but it did
happen in ARCH=um with time-travel) to destroy the ringbuffer
before the IRQ work ran, leading this KASAN report (or a crash
without KASAN):

    BUG: KASAN: slab-use-after-free in irq_work_run_list+0x11a/0x13a
    Read of size 8 at addr 000000006d640a48 by task swapper/0

    CPU: 0 PID: 0 Comm: swapper Tainted: G        W  O       6.3.0-rc1 #7
    Stack:
     60c4f20f 0c203d48 41b58ab3 60f224fc
     600477fa 60f35687 60c4f20f 601273dd
     00000008 6101eb00 6101eab0 615be548
    Call Trace:
     [<60047a58>] show_stack+0x25e/0x282
     [<60c609e0>] dump_stack_lvl+0x96/0xfd
     [<60c50d4c>] print_report+0x1a7/0x5a8
     [<603078d3>] kasan_report+0xc1/0xe9
     [<60308950>] __asan_report_load8_noabort+0x1b/0x1d
     [<60232844>] irq_work_run_list+0x11a/0x13a
     [<602328b4>] irq_work_tick+0x24/0x34
     [<6017f9dc>] update_process_times+0x162/0x196
     [<6019f335>] tick_sched_handle+0x1a4/0x1c3
     [<6019fd9e>] tick_sched_timer+0x79/0x10c
     [<601812b9>] __hrtimer_run_queues.constprop.0+0x425/0x695
     [<60182913>] hrtimer_interrupt+0x16c/0x2c4
     [<600486a3>] um_timer+0x164/0x183
     [...]

    Allocated by task 411:
     save_stack_trace+0x99/0xb5
     stack_trace_save+0x81/0x9b
     kasan_save_stack+0x2d/0x54
     kasan_set_track+0x34/0x3e
     kasan_save_alloc_info+0x25/0x28
     ____kasan_kmalloc+0x8b/0x97
     __kasan_kmalloc+0x10/0x12
     __kmalloc+0xb2/0xe8
     load_elf_phdrs+0xee/0x182
     [...]

    The buggy address belongs to the object at 000000006d640800
     which belongs to the cache kmalloc-1k of size 1024
    The buggy address is located 584 bytes inside of
     freed 1024-byte region [000000006d640800, 000000006d640c00)

Add the appropriate irq_work_sync() so the work finishes before
the buffers are destroyed.

Prior to the commit in the Fixes tag below, there was only a
single global IRQ work, so this issue didn't exist.

Link: https://lore.kernel.org/linux-trace-kernel/20230427175920.a76159263122.I8295e405c44362a86c995e9c2c37e3e03810aa56@changeid

Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 15693458c4 ("tracing/ring-buffer: Move poll wake ups into ring buffer code")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:33 +02:00
Kees Cook
fcd2da2e6b kheaders: Use array declaration instead of char
commit b69edab47f1da8edd8e7bfdf8c70f51a2a5d89fb upstream.

Under CONFIG_FORTIFY_SOURCE, memcpy() will check the size of destination
and source buffers. Defining kernel_headers_data as "char" would trip
this check. Since these addresses are treated as byte arrays, define
them as arrays (as done everywhere else).

This was seen with:

  $ cat /sys/kernel/kheaders.tar.xz >> /dev/null

  detected buffer overflow in memcpy
  kernel BUG at lib/string_helpers.c:1027!
  ...
  RIP: 0010:fortify_panic+0xf/0x20
  [...]
  Call Trace:
   <TASK>
   ikheaders_read+0x45/0x50 [kheaders]
   kernfs_fop_read_iter+0x1a4/0x2f0
  ...

Reported-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/bpf/20230302112130.6e402a98@kernel.org/
Acked-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Tested-by: Jakub Kicinski <kuba@kernel.org>
Fixes: 43d8ce9d65 ("Provide in-kernel headers to make extending kernel easier")
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230302224946.never.243-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:33 +02:00
Joel Fernandes (Google)
2884595932 tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem
commit 58d7668242647e661a20efe065519abd6454287e upstream.

For CONFIG_NO_HZ_FULL systems, the tick_do_timer_cpu cannot be offlined.
However, cpu_is_hotpluggable() still returns true for those CPUs. This causes
torture tests that do offlining to end up trying to offline this CPU causing
test failures. Such failure happens on all architectures.

Fix the repeated error messages thrown by this (even if the hotplug errors are
harmless) by asking the opinion of the nohz subsystem on whether the CPU can be
hotplugged.

[ Apply Frederic Weisbecker feedback on refactoring tick_nohz_cpu_down(). ]

For drivers/base/ portion:
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Zhouyi Zhou <zhouzhouyi@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: rcu <rcu@vger.kernel.org>
Cc: stable@vger.kernel.org
Fixes: 2987557f52 ("driver-core/cpu: Expose hotpluggability to the rest of the kernel")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:32 +02:00
Thomas Gleixner
7c5811b95c posix-cpu-timers: Implement the missing timer_wait_running callback
commit f7abf14f0001a5a47539d9f60bbdca649e43536b upstream.

For some unknown reason the introduction of the timer_wait_running callback
missed to fixup posix CPU timers, which went unnoticed for almost four years.
Marco reported recently that the WARN_ON() in timer_wait_running()
triggers with a posix CPU timer test case.

Posix CPU timers have two execution models for expiring timers depending on
CONFIG_POSIX_CPU_TIMERS_TASK_WORK:

1) If not enabled, the expiry happens in hard interrupt context so
   spin waiting on the remote CPU is reasonably time bound.

   Implement an empty stub function for that case.

2) If enabled, the expiry happens in task work before returning to user
   space or guest mode. The expired timers are marked as firing and moved
   from the timer queue to a local list head with sighand lock held. Once
   the timers are moved, sighand lock is dropped and the expiry happens in
   fully preemptible context. That means the expiring task can be scheduled
   out, migrated, interrupted etc. So spin waiting on it is more than
   suboptimal.

   The timer wheel has a timer_wait_running() mechanism for RT, which uses
   a per CPU timer-base expiry lock which is held by the expiry code and the
   task waiting for the timer function to complete blocks on that lock.

   This does not work in the same way for posix CPU timers as there is no
   timer base and expiry for process wide timers can run on any task
   belonging to that process, but the concept of waiting on an expiry lock
   can be used too in a slightly different way:

    - Add a mutex to struct posix_cputimers_work. This struct is per task
      and used to schedule the expiry task work from the timer interrupt.

    - Add a task_struct pointer to struct cpu_timer which is used to store
      a the task which runs the expiry. That's filled in when the task
      moves the expired timers to the local expiry list. That's not
      affecting the size of the k_itimer union as there are bigger union
      members already

    - Let the task take the expiry mutex around the expiry function

    - Let the waiter acquire a task reference with rcu_read_lock() held and
      block on the expiry mutex

   This avoids spin-waiting on a task which might not even be on a CPU and
   works nicely for RT too.

Fixes: ec8f954a40 ("posix-timers: Use a callback for cancel synchronization on PREEMPT_RT")
Reported-by: Marco Elver <elver@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marco Elver <elver@google.com>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/87zg764ojw.ffs@tglx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:31 +02:00
Kuniyuki Iwashima
d4a895e924 seccomp: Move copy_seccomp() to no failure path.
commit a1140cb215fa13dcec06d12ba0c3ee105633b7c4 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-17 11:47:27 +02:00
Qais Yousef
4735b6f74f sched/fair: Fixes for capacity inversion detection
commit da07d2f9c153e457e845d4dcfdd13568d71d18a4 upstream.

Traversing the Perf Domains requires rcu_read_lock() to be held and is
conditional on sched_energy_enabled(). Ensure right protections applied.

Also skip capacity inversion detection for our own pd; which was an
error.

Fixes: 44c7b80bffc3 ("sched/fair: Detect capacity inversion")
Reported-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230112122708.330667-3-qyousef@layalina.io
(cherry picked from commit da07d2f9c153e457e845d4dcfdd13568d71d18a4)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00
Qais Yousef
89ad8a672f sched/uclamp: Fix a uninitialized variable warnings
commit e26fd28db82899be71b4b949527373d0a6be1e65 upstream.

Addresses the following warnings:

> config: riscv-randconfig-m031-20221111
> compiler: riscv64-linux-gcc (GCC) 12.1.0
>
> smatch warnings:
> kernel/sched/fair.c:7263 find_energy_efficient_cpu() error: uninitialized symbol 'util_min'.
> kernel/sched/fair.c:7263 find_energy_efficient_cpu() error: uninitialized symbol 'util_max'.

Fixes: 244226035a1f ("sched/uclamp: Fix fits_capacity() check in feec()")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230112122708.330667-2-qyousef@layalina.io
(cherry picked from commit e26fd28db82899be71b4b949527373d0a6be1e65)
[Conflict in kernel/sched/fair.c due to new automatic variable in
master vs 5.10 and new code around for loop]
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00
Qais Yousef
09129798a6 sched/fair: Consider capacity inversion in util_fits_cpu()
commit: aa69c36f31aadc1669bfa8a3de6a47b5e6c98ee8 upstream.

We do consider thermal pressure in util_fits_cpu() for uclamp_min only.
With the exception of the biggest cores which by definition are the max
performance point of the system and all tasks by definition should fit.

Even under thermal pressure, the capacity of the biggest CPU is the
highest in the system and should still fit every task. Except when it
reaches capacity inversion point, then this is no longer true.

We can handle this by using the inverted capacity as capacity_orig in
util_fits_cpu(). Which not only addresses the problem above, but also
ensure uclamp_max now considers the inverted capacity. Force fitting
a task when a CPU is in this adverse state will contribute to making the
thermal throttling last longer.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-10-qais.yousef@arm.com
(cherry picked from commit aa69c36f31aadc1669bfa8a3de6a47b5e6c98ee8)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00
Qais Yousef
30f04dd56d sched/fair: Detect capacity inversion
commit: 44c7b80bffc3a657a36857098d5d9c49d94e652b upstream.

Check each performance domain to see if thermal pressure is causing its
capacity to be lower than another performance domain.

We assume that each performance domain has CPUs with the same
capacities, which is similar to an assumption made in energy_model.c

We also assume that thermal pressure impacts all CPUs in a performance
domain equally.

If there're multiple performance domains with the same capacity_orig, we
will trigger a capacity inversion if the domain is under thermal
pressure.

The new cpu_in_capacity_inversion() should help users to know when
information about capacity_orig are not reliable and can opt in to use
the inverted capacity as the 'actual' capacity_orig.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-9-qais.yousef@arm.com
(cherry picked from commit 44c7b80bffc3a657a36857098d5d9c49d94e652b)
[Trivial conflict in kernel/sched/fair.c and sched.h due to code shuffling]
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00
Qais Yousef
b18cbd359d sched/uclamp: Cater for uclamp in find_energy_efficient_cpu()'s early exit condition
commit d81304bc6193554014d4372a01debdf65e1e9a4d upstream.

If the utilization of the woken up task is 0, we skip the energy
calculation because it has no impact.

But if the task is boosted (uclamp_min != 0) will have an impact on task
placement and frequency selection. Only skip if the util is truly
0 after applying uclamp values.

Change uclamp_task_cpu() signature to avoid unnecessary additional calls
to uclamp_eff_get(). feec() is the only user now.

Fixes: 732cd75b8c ("sched/fair: Select an energy-efficient CPU on task wake-up")
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-8-qais.yousef@arm.com
(cherry picked from commit d81304bc6193554014d4372a01debdf65e1e9a4d)
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00
Qais Yousef
41a880740c sched/uclamp: Make cpu_overutilized() use util_fits_cpu()
commit c56ab1b3506ba0e7a872509964b100912bde165d upstream.

So that it is now uclamp aware.

This fixes a major problem of busy tasks capped with UCLAMP_MAX keeping
the system in overutilized state which disables EAS and leads to wasting
energy in the long run.

Without this patch running a busy background activity like JIT
compilation on Pixel 6 causes the system to be in overutilized state
74.5% of the time.

With this patch this goes down to  9.79%.

It also fixes another problem when long running tasks that have their
UCLAMP_MIN changed while running such that they need to upmigrate to
honour the new UCLAMP_MIN value. The upmigration doesn't get triggered
because overutilized state never gets set in this state, hence misfit
migration never happens at tick in this case until the task wakes up
again.

Fixes: af24bde8df ("sched/uclamp: Add uclamp support to energy_compute()")
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220804143609.515789-7-qais.yousef@arm.com
(cherry picked from commit c56ab1b3506ba0e7a872509964b100912bde165d)
[Conflict in kernel/sched/fair.c: use cpu_util() instead of
cpu_util_cfs()]
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-26 11:27:39 +02:00