2020-02-21 00:13:26 +09:00
|
|
|
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2015, Sony Mobile Communications Inc.
|
2021-03-23 04:07:05 +09:00
|
|
|
* Copyright (c) 2013, 2020-2021, The Linux Foundation. All rights reserved.
|
2020-02-21 00:13:26 +09:00
|
|
|
* Copyright (c) 2020, Linaro Ltd.
|
|
|
|
*/
|
|
|
|
|
2020-05-06 07:45:35 +09:00
|
|
|
#define pr_fmt(fmt) "qrtr: %s(): " fmt, __func__
|
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
#include <linux/ipc_logging.h>
|
2020-02-21 00:13:26 +09:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/qrtr.h>
|
|
|
|
#include <linux/workqueue.h>
|
2020-06-18 09:32:42 +09:00
|
|
|
#include <linux/xarray.h>
|
2020-02-21 00:13:26 +09:00
|
|
|
#include <net/sock.h>
|
|
|
|
|
|
|
|
#include "qrtr.h"
|
|
|
|
|
2020-04-21 16:40:54 +09:00
|
|
|
#define CREATE_TRACE_POINTS
|
|
|
|
#include <trace/events/qrtr.h>
|
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
#define NS_LOG_PAGE_CNT 4
|
|
|
|
static void *ns_ilc;
|
|
|
|
#define NS_INFO(x, ...) ipc_log_string(ns_ilc, x, ##__VA_ARGS__)
|
|
|
|
|
2020-06-18 09:32:42 +09:00
|
|
|
static DEFINE_XARRAY(nodes);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
static struct {
|
|
|
|
struct socket *sock;
|
|
|
|
struct sockaddr_qrtr bcast_sq;
|
|
|
|
struct list_head lookups;
|
2020-09-16 02:57:06 +09:00
|
|
|
struct kthread_worker kworker;
|
|
|
|
struct kthread_work work;
|
|
|
|
struct task_struct *task;
|
2020-02-21 00:13:26 +09:00
|
|
|
int local_node;
|
|
|
|
} qrtr_ns;
|
|
|
|
|
|
|
|
static const char * const qrtr_ctrl_pkt_strings[] = {
|
|
|
|
[QRTR_TYPE_HELLO] = "hello",
|
|
|
|
[QRTR_TYPE_BYE] = "bye",
|
|
|
|
[QRTR_TYPE_NEW_SERVER] = "new-server",
|
|
|
|
[QRTR_TYPE_DEL_SERVER] = "del-server",
|
|
|
|
[QRTR_TYPE_DEL_CLIENT] = "del-client",
|
|
|
|
[QRTR_TYPE_RESUME_TX] = "resume-tx",
|
|
|
|
[QRTR_TYPE_EXIT] = "exit",
|
|
|
|
[QRTR_TYPE_PING] = "ping",
|
|
|
|
[QRTR_TYPE_NEW_LOOKUP] = "new-lookup",
|
|
|
|
[QRTR_TYPE_DEL_LOOKUP] = "del-lookup",
|
|
|
|
};
|
|
|
|
|
|
|
|
struct qrtr_server_filter {
|
|
|
|
unsigned int service;
|
|
|
|
unsigned int instance;
|
|
|
|
unsigned int ifilter;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct qrtr_lookup {
|
|
|
|
unsigned int service;
|
|
|
|
unsigned int instance;
|
|
|
|
|
|
|
|
struct sockaddr_qrtr sq;
|
|
|
|
struct list_head li;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct qrtr_server {
|
|
|
|
unsigned int service;
|
|
|
|
unsigned int instance;
|
|
|
|
|
|
|
|
unsigned int node;
|
|
|
|
unsigned int port;
|
|
|
|
|
|
|
|
struct list_head qli;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct qrtr_node {
|
|
|
|
unsigned int id;
|
2020-06-19 05:35:08 +09:00
|
|
|
struct xarray servers;
|
2020-02-21 00:13:26 +09:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct qrtr_node *node_get(unsigned int node_id)
|
|
|
|
{
|
|
|
|
struct qrtr_node *node;
|
|
|
|
|
2020-06-18 09:32:42 +09:00
|
|
|
node = xa_load(&nodes, node_id);
|
2020-02-21 00:13:26 +09:00
|
|
|
if (node)
|
|
|
|
return node;
|
|
|
|
|
|
|
|
/* If node didn't exist, allocate and insert it to the tree */
|
|
|
|
node = kzalloc(sizeof(*node), GFP_KERNEL);
|
|
|
|
if (!node)
|
2020-02-26 23:51:53 +09:00
|
|
|
return NULL;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
node->id = node_id;
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_init(&node->servers);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
Merge keystone/android12-5.10-keystone-qcom-release.168+ (60b964d) into msm-5.10
* refs/heads/tmp-60b964d:
BACKPORT: f2fs: introduce gc_urgent_mid mode
ANDROID: clear memory trylock-bit when page_locked.
UPSTREAM: ext4: fix kernel BUG in 'ext4_write_inline_data_end()'
ANDROID: GKI: Update symbols to symbol list
ANDROID: incremental fs: Evict inodes before freeing mount data
UPSTREAM: mm: memcontrol: set the correct memcg swappiness restriction
UPSTREAM: media: rc: Fix use-after-free bugs caused by ene_tx_irqsim()
ANDROID: Fix kernelci break: eventfd_signal_mask redefined
ANDROID: dm-default-key: update for blk_crypto_evict_key() returning void
BACKPORT: FROMGIT: blk-crypto: make blk_crypto_evict_key() more robust
BACKPORT: FROMGIT: blk-crypto: make blk_crypto_evict_key() return void
BACKPORT: FROMGIT: blk-mq: release crypto keyslot before reporting I/O complete
BACKPORT: of: base: Skip CPU nodes with "fail"/"fail-..." status
UPSTREAM: hid: bigben_probe(): validate report count
UPSTREAM: HID: bigben: use spinlock to safely schedule workers
UPSTREAM: HID: bigben_worker() remove unneeded check on report_field
UPSTREAM: HID: bigben: use spinlock to protect concurrent accesses
BACKPORT: USB: gadget: Fix use-after-free during usb config switch
ANDROID: ABI: Add page_pinner_inited into symbols list
ANDROID: page_pinner: prevent pp_buffer access before initialization
UPSTREAM: hwrng: virtio - add an internal buffer
ANDROID: fix ABI by undoing atomic64_t -> u64 type conversion
UPSTREAM: net: retrieve netns cookie via getsocketopt
UPSTREAM: net: initialize net->net_cookie at netns setup
UPSTREAM: ext4: fix another off-by-one fsmap error on 1k block filesystems
UPSTREAM: ext4: block range must be validated before use in ext4_mb_clear_bb()
UPSTREAM: ext4: add strict range checks while freeing blocks
UPSTREAM: ext4: add ext4_sb_block_valid() refactored out of ext4_inode_block_valid()
UPSTREAM: ext4: refactor ext4_free_blocks() to pull out ext4_mb_clear_bb()
UPSTREAM: usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode
ANDROID: GKI: rockchip: Add symbols for clk api
BACKPORT: arm64: mte: move register initialization to C
UPSTREAM: rcu: Remove __read_mostly annotations from rcu_scheduler_active externs
ANDROID: GKI: Update symbol list for mtk
Revert "nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property"
Revert "xhci: Add update_hub_device override for PCI xHCI hosts"
Revert "xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables"
Revert "xhci: Add a flag to disable USB3 lpm on a xhci root port level."
Revert "xhci: Prevent infinite loop in transaction errors recovery for streams"
Revert "ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire"
Revert "ASoC: Intel/SOF: use set_stream() instead of set_tdm_slots() for HDAudio"
Linux 5.10.168
Fix page corruption caused by racy check in __free_pages
arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive
arm64: dts: meson-g12-common: Make mmc host controller interrupts level-sensitive
arm64: dts: meson-gx: Make mmc host controller interrupts level-sensitive
riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte
ceph: flush cap releases when the session is flushed
usb: typec: altmodes/displayport: Fix probe pin assign check
usb: core: add quirk for Alcor Link AK9563 smartcard reader
btrfs: free device in btrfs_close_devices for a single device filesystem
net: USB: Fix wrong-direction WARNING in plusb.c
cifs: Fix use-after-free in rdata->read_into_pages()
pinctrl: intel: Restore the pins that used to be in Direct IRQ mode
spi: dw: Fix wrong FIFO level setting for long xfers
pinctrl: single: fix potential NULL dereference
pinctrl: aspeed: Fix confusing types in return value
ALSA: pci: lx6464es: fix a debug loop
selftests: forwarding: lib: quote the sysctl values
rds: rds_rm_zerocopy_callback() use list_first_entry()
net/mlx5: fw_tracer, Zero consumer index when reloading the tracer
net/mlx5: fw_tracer, Clear load bit when freeing string DBs buffers
net/mlx5e: IPoIB, Show unknown speed instead of error
net: mscc: ocelot: fix VCAP filters not matching on MAC with "protocol 802.1Q"
ice: Do not use WQ_MEM_RECLAIM flag for workqueue
uapi: add missing ip/ipv6 header dependencies for linux/stddef.h
ionic: clean interrupt before enabling queue to avoid credit race
net: phy: meson-gxl: use MMD access dummy stubs for GXL, internal PHY
bonding: fix error checking in bond_debug_reregister()
xfrm: fix bug with DSCP copy to v6 from v4 tunnel
RDMA/usnic: use iommu_map_atomic() under spin_lock()
IB/IPoIB: Fix legacy IPoIB due to wrong number of queues
xfrm/compat: prevent potential spectre v1 gadget in xfrm_xlate32_attr()
IB/hfi1: Restore allocated resources on failed copyout
xfrm: compat: change expression for switch in xfrm_xlate64
can: j1939: do not wait 250 ms if the same addr was already claimed
of/address: Return an error when no valid dma-ranges are found
tracing: Fix poll() and select() do not work on per_cpu trace_pipe and trace_pipe_raw
ALSA: hda/realtek: Fix the speaker output on Samsung Galaxy Book2 Pro 360
ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control()
ALSA: hda/realtek: Add Positivo N14KP6-TG
btrfs: zlib: zero-initialize zlib workspace
btrfs: limit device extents to the device size
migrate: hugetlb: check for hugetlb shared PMD in node migration
mm/migration: return errno when isolate_huge_page failed
iio:adc:twl6030: Enable measurement of VAC
bpf: Do not reject when the stack read size is different from the tracked scalar size
nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property
wifi: brcmfmac: Check the count value of channel spec to prevent out-of-bounds reads
f2fs: fix to do sanity check on i_extra_isize in is_alive()
fbdev: smscufx: fix error handling code in ufx_usb_probe
serial: 8250_dma: Fix DMA Rx rearm race
serial: 8250_dma: Fix DMA Rx completion race
nvmem: core: fix cell removal on error
nvmem: core: initialise nvmem->id early
drm/i915: Fix potential bit_17 double-free
Squashfs: fix handling and sanity checking of xattr_ids count
mm/swapfile: add cond_resched() in get_swap_pages()
fpga: stratix10-soc: Fix return value check in s10_ops_write_init()
x86/debug: Fix stack recursion caused by wrongly ordered DR7 accesses
mm: hugetlb: proc: check for hugetlb shared PMD in /proc/PID/smaps
riscv: disable generation of unwind tables
parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case
parisc: Fix return code of pdc_iodc_print()
nvmem: qcom-spmi-sdam: fix module autoloading
iio: imu: fxos8700: fix MAGN sensor scale and unit
iio: imu: fxos8700: remove definition FXOS8700_CTRL_ODR_MIN
iio: imu: fxos8700: fix failed initialization ODR mode assignment
iio: imu: fxos8700: fix incorrect ODR mode readback
iio: imu: fxos8700: fix swapped ACCEL and MAGN channels readback
iio: imu: fxos8700: fix map label of channel type to MAGN sensor
iio: imu: fxos8700: fix IMU data bits returned to user space
iio: imu: fxos8700: fix incomplete ACCEL and MAGN channels readback
iio: imu: fxos8700: fix ACCEL measurement range selection
iio:adc:twl6030: Enable measurements of VUSB, VBAT and others
iio: adc: berlin2-adc: Add missing of_node_put() in error path
iio: hid: fix the retval in accel_3d_capture_sample
efi: Accept version 2 of memory attributes table
ALSA: hda/realtek: Add Acer Predator PH315-54
watchdog: diag288_wdt: fix __diag288() inline assembly
watchdog: diag288_wdt: do not use stack buffers for hardware data
net: qrtr: free memory on error path in radix_tree_insert()
fbcon: Check font dimension limits
Input: i8042 - add Clevo PCX0DX to i8042 quirk table
Input: i8042 - add TUXEDO devices to i8042 quirk tables
Input: i8042 - merge quirk tables
Input: i8042 - move __initconst to fix code styling warning
vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF
usb: gadget: f_fs: Fix unbalanced spinlock in __ffs_ep0_queue_wait
usb: dwc3: qcom: enable vbus override when in OTG dr-mode
usb: dwc3: dwc3-qcom: Fix typo in the dwc3 vbus override API
iio: adc: stm32-dfsdm: fill module aliases
net/x25: Fix to not accept on connected socket
platform/x86: dell-wmi: Add a keymap for KEY_MUTE in type 0x0010 table
i2c: rk3x: fix a bunch of kernel-doc warnings
scsi: iscsi_tcp: Fix UAF during login when accessing the shost ipaddress
scsi: target: core: Fix warning on RT kernels
i2c: mxs: suppress probe-deferral error message
qede: execute xdp_do_flush() before napi_complete_done()
qede: add netpoll support for qede driver
efi: fix potential NULL deref in efi_mem_reserve_persistent
net: openvswitch: fix flow memory leak in ovs_flow_cmd_new
virtio-net: Keep stop() to follow mirror sequence of open()
selftests: net: udpgso_bench_tx: Cater for pending datagrams zerocopy benchmarking
selftests: net: udpgso_bench: Fix racing bug between the rx/tx programs
selftests: net: udpgso_bench_rx/tx: Stop when wrong CLI args are provided
selftests: net: udpgso_bench_rx: Fix 'used uninitialized' compiler warning
ata: libata: Fix sata_down_spd_limit() when no link speed is reported
can: j1939: fix errant WARN_ON_ONCE in j1939_session_deactivate
igc: return an error if the mac type is unknown in igc_ptp_systim_to_hwtstamp()
net: phy: meson-gxl: Add generic dummy stubs for MMD register access
squashfs: harden sanity check in squashfs_read_xattr_id_table
netfilter: br_netfilter: disable sabotage_in hook after first suppression
netrom: Fix use-after-free caused by accept on already connected socket
net: phy: dp83822: Fix null pointer access on DP83825/DP83826 devices
sfc: correctly advertise tunneled IPv6 segmentation
virtio-net: execute xdp_do_flush() before napi_complete_done()
fix "direction" argument of iov_iter_kvec()
fix iov_iter_bvec() "direction" argument
READ is "data destination", not source...
WRITE is "data source", not destination...
vhost/net: Clear the pending messages when the backend is removed
scsi: Revert "scsi: core: map PQ=1, PDT=other values to SCSI_SCAN_TARGET_PRESENT"
drm/vc4: hdmi: make CEC adapter name unique
arm64: dts: imx8mm: Fix pad control for UART1_DTE_RX
bpf, sockmap: Check for any of tcp_bpf_prots when cloning a listener
bpf: Fix to preserve reg parent/live fields when copying range info
bpf: Support <8-byte scalar spill and refill
ALSA: hda/via: Avoid potential array out-of-bound in add_secret_dac_path()
bpf: Fix a possible task gone issue with bpf_send_signal[_thread]() helpers
powerpc/imc-pmu: Revert nest_init_lock to being a mutex
bpf: Fix incorrect state pruning for <8B spill/fill
bus: sunxi-rsb: Fix error handling in sunxi_rsb_init()
firewire: fix memory leak for payload of request subaction to IEC 61883-1 FCP region
Revert "net: add atomic_long_t to net_device_stats fields"
Revert "PM/devfreq: governor: Add a private governor_data for governor"
Linux 5.10.167
net: fix NULL pointer in skb_segment_list
Bluetooth: fix null ptr deref on hci_sync_conn_complete_evt
ACPI: processor idle: Practically limit "Dummy wait" workaround to old Intel systems
dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init
blk-cgroup: fix missing pd_online_fn() while activating policy
bpf: Skip task with pid=1 in send_signal_common()
arm64: dts: imx8mq-thor96: fix no-mmc property for SDHCI
ARM: dts: vf610: Fix pca9548 i2c-mux node names
ARM: dts: imx: Fix pca9547 i2c-mux node name
ANDROID: Update .xml due to ABI preservation fix
ANDROID: struct io_uring ABI preservation hack for 5.10.162 changes
ANDROID: fix up struct task_struct ABI change in 5.10.162
ANDROID: add flags variable back to struct proto_ops
Linux 5.10.166
clk: Fix pointer casting to prevent oops in devm_clk_release()
perf/x86/amd: fix potential integer overflow on shift of a int
netfilter: conntrack: unify established states for SCTP paths
x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL
block: fix and cleanup bio_check_ro
Revert "selftests/ftrace: Update synthetic event syntax errors"
nfsd: Ensure knfsd shuts down when the "nfsd" pseudofs is unmounted
nouveau: explicitly wait on the fence in nouveau_bo_move_m2mf
Revert "Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode"
tools: gpio: fix -c option of gpio-event-mon
net: mdio-mux-meson-g12a: force internal PHY off on mux switch
net/tg3: resolve deadlock in tg3_reset_task() during EEH
thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type()
net: ravb: Fix possible hang if RIS2_QFF1 happen
sctp: fail if no bound addresses can be used for a given scope
net/sched: sch_taprio: do not schedule in taprio_reset()
netrom: Fix use-after-free of a listening socket.
netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE
ipv4: prevent potential spectre v1 gadget in fib_metrics_match()
ipv4: prevent potential spectre v1 gadget in ip_metrics_convert()
netlink: annotate data races around sk_state
netlink: annotate data races around dst_portid and dst_group
netlink: annotate data races around nlk->portid
netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
net: fix UaF in netns ops registration error path
netlink: prevent potential spectre v1 gadgets
i2c: designware: use casting of u64 in clock multiplication to avoid overflow
i2c: designware: Use DIV_ROUND_CLOSEST() macro
units: Add SI metric prefix definitions
units: Add Watt units
EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info
EDAC/device: Respect any driver-supplied workqueue polling value
ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment
thermal: intel: int340x: Protect trip temperature from concurrent updates
KVM: x86/vmx: Do not skip segment attributes if unusable bit is set
cifs: Fix oops due to uncleared server->smbd_conn in reconnect
ftrace/scripts: Update the instructions for ftrace-bisect.sh
trace_events_hist: add check for return value of 'create_hist_field'
tracing: Make sure trace_printk() can output as soon as it can be used
module: Don't wait for GOING modules
scsi: hpsa: Fix allocation size for scsi_host_alloc()
xhci: Set HCD flag to defer primary roothub registration
Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
exit: Use READ_ONCE() for all oops/warn limit reads
docs: Fix path paste-o for /sys/kernel/warn_count
panic: Expose "warn_count" to sysfs
panic: Introduce warn_limit
panic: Consolidate open-coded panic_on_warn checks
exit: Allow oops_limit to be disabled
exit: Expose "oops_count" to sysfs
exit: Put an upper limit on how often we can oops
panic: Separate sysctl logic from CONFIG_SMP
ia64: make IA64_MCA_RECOVERY bool instead of tristate
csky: Fix function name in csky_alignment() and die()
h8300: Fix build errors from do_exit() to make_task_dead() transition
hexagon: Fix function name in die()
objtool: Add a missing comma to avoid string concatenation
exit: Add and use make_task_dead.
kasan: no need to unset panic_on_warn in end_report()
ubsan: no need to unset panic_on_warn in ubsan_epilogue()
panic: unset panic_on_warn inside panic()
kernel/panic: move panic sysctls to its own file
sysctl: add a new register_sysctl_init() interface
fs: reiserfs: remove useless new_opts in reiserfs_remount
x86: ACPI: cstate: Optimize C3 entry on AMD CPUs
netfilter: conntrack: do not renew entry stuck in tcp SYN_SENT state
Revert "selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID"
lockref: stop doing cpu_relax in the cmpxchg loop
platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK
platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD
scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id
KVM: s390: interrupt: use READ_ONCE() before cmpxchg()
spi: spidev: remove debug messages that access spidev->spi without locking
ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC
cpufreq: armada-37xx: stop using 0 as NULL pointer
s390/debug: add _ASM_S390_ prefix to header guard
drm: Add orientation quirk for Lenovo ideapad D330-10IGL
ASoC: fsl_micfil: Correct the number of steps on SX controls
kcsan: test: don't put the expect array on the stack
cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist
scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace
tcp: fix rate_app_limited to default to 1
net: dsa: microchip: ksz9477: port map correction in ALU table entry register
driver core: Fix test_async_probe_init saves device in wrong array
w1: fix WARNING after calling w1_process()
w1: fix deadloop in __w1_remove_master_device()
tcp: avoid the lookup process failing to get sk in ehash table
nvme-pci: fix timeout request state check
dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
HID: betop: check shape of output reports
l2tp: prevent lockdep issue in l2tp_tunnel_register()
net: macb: fix PTP TX timestamp failure due to packet padding
dmaengine: Fix double increment of client_count in dma_chan_get()
drm/panfrost: fix GENERIC_ATOMIC64 dependency
net: mlx5: eliminate anonymous module_init & module_exit
usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
HID: revert CHERRY_MOUSE_000C quirk
net: stmmac: fix invalid call to mdiobus_get_phy()
HID: check empty report_list in bigben_probe()
HID: check empty report_list in hid_validate_values()
net: mdio: validate parameter addr in mdiobus_get_phy()
net: usb: sr9700: Handle negative len
l2tp: close all race conditions in l2tp_tunnel_register()
l2tp: convert l2tp_tunnel_list to idr
l2tp: Don't sleep and disable BH under writer-side sk_callback_lock
l2tp: Serialize access to sk_user_data with sk_callback_lock
net/sched: sch_taprio: fix possible use-after-free
wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid
gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
net: nfc: Fix use-after-free in local_cleanup()
phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in rockchip_usb2phy_power_on()
bpf: Fix pointer-leak due to insufficient speculative store bypass mitigation
amd-xgbe: Delay AN timeout during KR training
amd-xgbe: TX Flow Ctrl Registers are h/w ver dependent
ARM: dts: at91: sam9x60: fix the ddr clock for sam9x60
phy: ti: fix Kconfig warning and operator precedence
PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe()
affs: initialize fsdata in affs_truncate()
IB/hfi1: Remove user expected buffer invalidate race
IB/hfi1: Immediately remove invalid memory from hardware
IB/hfi1: Fix expected receive setup error exit issues
IB/hfi1: Reserve user expected TIDs
IB/hfi1: Reject a zero-length user expected buffer
RDMA/core: Fix ib block iterator counter overflow
tomoyo: fix broken dependency on *.conf.default
firmware: arm_scmi: Harden shared memory access in fetch_notification
firmware: arm_scmi: Harden shared memory access in fetch_response
EDAC/highbank: Fix memory leak in highbank_mc_probe()
HID: intel_ish-hid: Add check for ishtp_dma_tx_map
ARM: imx: add missing of_node_put()
arm64: dts: imx8mm-beacon: Fix ecspi2 pinmux
ARM: dts: imx6qdl-gw560x: Remove incorrect 'uart-has-rtscts'
ARM: dts: imx7d-pico: Use 'clock-frequency'
ARM: dts: imx6ul-pico-dwarf: Use 'clock-frequency'
memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe()
memory: atmel-sdramc: Fix missing clk_disable_unprepare in atmel_ramc_probe()
clk: Provide new devm_clk helpers for prepared and enabled clocks
clk: generalize devm_clk_get() a bit
Linux 5.10.165
io_uring/rw: remove leftover debug statement
io_uring/rw: ensure kiocb_end_write() is always called
io_uring: fix double poll leak on repolling
io_uring: Clean up a false-positive warning from GCC 9.3.0
mm/khugepaged: fix collapse_pte_mapped_thp() to allow anon_vma
Bluetooth: hci_qca: Fixed issue during suspend
Bluetooth: hci_qca: check for SSR triggered flag while suspend
Bluetooth: hci_qca: Wait for SSR completion during suspend
soc: qcom: apr: Make qcom,protection-domain optional again
Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()"
net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work()
net/ulp: use consistent error code when blocking ULP
io_uring/net: fix fast_iov assignment in io_setup_async_msg()
io_uring: io_kiocb_update_pos() should not touch file for non -1 offset
tracing: Use alignof__(struct {type b;}) instead of offsetof()
x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN
Revert "drm/amdgpu: make display pinning more flexible (v2)"
efi: rt-wrapper: Add missing include
arm64: efi: Execute runtime services from a dedicated stack
drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix
drm/amd/display: Calculate output_color_space after pixel encoding adjustment
drm/amd/display: Fix set scaling doesn's work
drm/i915: re-disable RC6p on Sandy Bridge
mei: me: add meteor lake point M DID
gsmi: fix null-deref in gsmi_get_variable
serial: atmel: fix incorrect baudrate setup
dmaengine: tegra210-adma: fix global intr clear
serial: pch_uart: Pass correct sg to dma_unmap_sg()
dt-bindings: phy: g12a-usb3-pcie-phy: fix compatible string documentation
dt-bindings: phy: g12a-usb2-phy: fix compatible string documentation
usb-storage: apply IGNORE_UAS only for HIKSEMI MD202 on RTL9210
usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
usb: gadget: g_webcam: Send color matching descriptor per frame
usb: typec: altmodes/displayport: Fix pin assignment calculation
usb: typec: altmodes/displayport: Add pin assignment helper
usb: host: ehci-fsl: Fix module alias
USB: serial: cp210x: add SCALANCE LPE-9000 device id
USB: gadgetfs: Fix race between mounting and unmounting
tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
thunderbolt: Use correct function to calculate maximum USB3 link rate
cifs: do not include page data when checking signature
btrfs: fix race between quota rescan and disable leading to NULL pointer deref
mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting
mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
comedi: adv_pci1760: Fix PWM instruction handling
usb: core: hub: disable autosuspend for TI TUSB8041
misc: fastrpc: Fix use-after-free race condition for maps
misc: fastrpc: Don't remove map on creater_process and device_release
USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100
staging: vchiq_arm: fix enum vchiq_status return types
USB: serial: option: add Quectel EM05CN modem
USB: serial: option: add Quectel EM05CN (SG) modem
USB: serial: option: add Quectel EC200U modem
USB: serial: option: add Quectel EM05-G (RS) modem
USB: serial: option: add Quectel EM05-G (CS) modem
USB: serial: option: add Quectel EM05-G (GR) modem
prlimit: do_prlimit needs to have a speculation check
xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables
usb: acpi: add helper to check port lpm capability using acpi _DSM
xhci: Add a flag to disable USB3 lpm on a xhci root port level.
xhci: Add update_hub_device override for PCI xHCI hosts
xhci: Fix null pointer dereference when host dies
usb: xhci: Check endpoint is valid before dereferencing it
xhci-pci: set the dma max_seg_size
io_uring/rw: defer fsnotify calls to task context
io_uring: do not recalculate ppos unnecessarily
io_uring: update kiocb->ki_pos at execution time
io_uring: remove duplicated calls to io_kiocb_ppos
io_uring: ensure that cached task references are always put on exit
io_uring: fix CQ waiting timeout handling
io_uring: lock overflowing for IOPOLL
io_uring: check for valid register opcode earlier
io_uring: fix async accept on O_NONBLOCK sockets
io_uring: allow re-poll if we made progress
io_uring: support MSG_WAITALL for IORING_OP_SEND(MSG)
io_uring: add flag for disabling provided buffer recycling
io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly
io_uring: improve send/recv error handling
io_uring: don't gate task_work run on TIF_NOTIFY_SIGNAL
Bluetooth: hci_qca: Fix driver shutdown on closed serdev
Bluetooth: hci_qca: Wait for timeout during suspend
drm/i915/gt: Reset twice
ALSA: hda/realtek - Turn on power early
efi: fix userspace infinite retry read efivars after EFI runtime services page fault
nilfs2: fix general protection fault in nilfs_btree_insert()
zonefs: Detect append writes at invalid locations
Add exception protection processing for vd in axi_chan_handle_err function
wifi: mac80211: sdata can be NULL during AMPDU start
wifi: brcmfmac: fix regression for Broadcom PCIe wifi devices
f2fs: let's avoid panic if extent_tree is not created
x86/asm: Fix an assembler warning with current binutils
btrfs: always report error in run_one_delayed_ref()
RDMA/srp: Move large values to a new enum for gcc13
net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats
tools/virtio: initialize spinlocks in vring_test.c
selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID
pNFS/filelayout: Fix coalescing test for single DS
btrfs: fix trace event name typo for FLUSH_DELAYED_REFS
Linux 5.10.164
Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout"
io_uring/io-wq: only free worker if it was allocated for creation
io_uring/io-wq: free worker if task_work creation is canceled
drm/virtio: Fix GEM handle creation UAF
efi: fix NULL-deref in init error path
arm64: cmpxchg_double*: hazard against entire exchange variable
arm64: atomics: remove LL/SC trampolines
arm64: atomics: format whitespace consistently
x86/resctrl: Fix task CLOSID/RMID update race
x86/resctrl: Use task_curr() instead of task_struct->on_cpu to prevent unnecessary IPI
KVM: x86: Do not return host topology information from KVM_GET_SUPPORTED_CPUID
Documentation: KVM: add API issues section
iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe()
iommu/mediatek-v1: Add error handle for mtk_iommu_probe
mm: Always release pages to the buddy allocator in memblock_free_late().
net/mlx5e: Don't support encap rules with gbp option
net/mlx5: Fix ptp max frequency adjustment range
net/sched: act_mpls: Fix warning during failed attribute validation
nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()
hvc/xen: lock console list traversal
octeontx2-af: Fix LMAC config in cgx_lmac_rx_tx_enable
octeontx2-af: Map NIX block from CGX connection
octeontx2-af: Update get/set resource count functions
tipc: fix unexpected link reset due to discovery messages
ASoC: wm8904: fix wrong outputs volume after power reactivation
regulator: da9211: Use irq handler when ready
EDAC/device: Fix period calculation in edac_device_reset_delay_period()
x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
powerpc/imc-pmu: Fix use of mutex in IRQs disabled section
netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
xfrm: fix rcu lock in xfrm_notify_userpolicy()
ext4: fix uninititialized value in 'ext4_evict_inode'
usb: ulpi: defer ulpi_register on ulpi_read_id timeout
xhci: Prevent infinite loop in transaction errors recovery for streams
xhci: move and rename xhci_cleanup_halted_endpoint()
xhci: store TD status in the td struct instead of passing it along
xhci: move xhci_td_cleanup so it can be called by more functions
xhci: Add xhci_reset_halted_ep() helper function
xhci: adjust parameters passed to cleanup_halted_endpoint()
xhci: get isochronous ring directly from endpoint structure
xhci: Avoid parsing transfer events several times
clk: imx: imx8mp: add shared clk gate for usb suspend clk
dt-bindings: clocks: imx8mp: Add ID for usb suspend clock
clk: imx8mp: add clkout1/2 support
clk: imx8mp: Add DISP2 pixel clock
iommu/amd: Fix ill-formed ivrs_ioapic, ivrs_hpet and ivrs_acpihid options
iommu/amd: Add PCI segment support for ivrs_[ioapic/hpet/acpihid] commands
bus: mhi: host: Fix race between channel preparation and M0 event
ipv6: raw: Deduct extension header length in rawv6_push_pending_frames
ixgbe: fix pci device refcount leak
platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer
drm/msm/adreno: Make adreno quirks not overwrite each other
cifs: Fix uninitialized memory read for smb311 posix symlink create
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops
ASoC: qcom: lpass-cpu: Fix fallback SD line index handling
s390/kexec: fix ipl report address for kdump
perf auxtrace: Fix address filter duplicate symbol selection
docs: Fix the docs build with Sphinx 6.0
efi: tpm: Avoid READ_ONCE() for accessing the event log
KVM: arm64: Fix S1PTW handling on RO memslots
ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx
netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
Linux 5.10.163
ALSA: hda - Enable headset mic on another Dell laptop with ALC3254
ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
net/ulp: prevent ULP without clone op from entering the LISTEN status
net: sched: disallow noqueue for qdisc classes
mptcp: use proper req destructor for IPv6
mptcp: dedicated request sock for subflow in v6
mptcp: remove MPTCP 'ifdef' in TCP SYN cookies
mptcp: mark ops structures as ro_after_init
serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way"
fsl_lpuart: Don't enable interrupts too early
ext4: don't set up encryption key during jbd2 transaction
ext4: disable fast-commit of encrypted dir operations
parisc: Align parisc MADV_XXX constants with all other architectures
io_uring: Fix unsigned 'res' comparison with zero in io_fixup_rw_res()
efi: random: combine bootloader provided RNG seed with RNG protocol output
mbcache: Avoid nesting of cache->c_list_lock under bit locks
hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
hfs/hfsplus: use WARN_ON for sanity check
selftests: set the BUILD variable to absolute path
ext4: don't allow journal inode to have encrypt flag
drm/i915/gvt: fix vgpu debugfs clean in remove
drm/i915/gvt: fix gvt debugfs destroy
riscv: uaccess: fix type of 0 variable on error in get_user()
fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB
nfsd: fix handling of readdir in v4root vs. mount upcall timeout
x86/bugs: Flush IBP in ib_prctl_set()
nvme: fix multipath crash caused by flush request when blktrace is enabled
ASoC: Intel: bytcr_rt5640: Add quirk for the Advantech MICA-071 tablet
udf: Fix extension of the last extent in the file
caif: fix memory leak in cfctrl_linkup_request()
drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
usb: rndis_host: Secure rndis_query check against int overflow
drivers/net/bonding/bond_3ad: return when there's no aggregator
perf tools: Fix resources leak in perf_data__open_dir()
netfilter: ipset: Rework long task execution when adding/deleting entries
netfilter: ipset: fix hash:net,port,net hang with /0 subnet
net: sched: cbq: dont intepret cls results when asked to drop
net: sched: atm: dont intepret cls results when asked to drop
gpio: sifive: Fix refcount leak in sifive_gpio_probe
ceph: switch to vfs_inode_has_locks() to fix file lock bug
filelock: new helper: vfs_inode_has_locks
drm/meson: Reduce the FIFO lines held when AFBC is not used
RDMA/mlx5: Fix validation of max_rd_atomic caps for DC
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
net: amd-xgbe: add missed tasklet_kill
net/mlx5e: Fix hw mtu initializing at XDP SQ allocation
net/mlx5e: IPoIB, Don't allow CQE compression to be turned on by default
net/mlx5: Avoid recovery in probe flows
net/mlx5: Add forgotten cleanup calls into mlx5_init_once() error path
vhost: fix range used in translate_desc()
vringh: fix range used in iotlb_translate()
vhost/vsock: Fix error handling in vhost_vsock_init()
nfc: Fix potential resource leaks
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
net: sched: fix memory leak in tcindex_set_parms
net: hns3: add interrupts re-initialization while doing VF FLR
nfsd: shut down the NFSv4 state objects before the filecache
veth: Fix race with AF_XDP exposing old or uninitialized descriptors
vmxnet3: correctly report csum_level for encapsulated packet
drm/panfrost: Fix GEM handle creation ref-counting
bpf: pull before calling skb_postpull_rcsum()
SUNRPC: ensure the matching upcall is in-flight upon downcall
ext4: fix deadlock due to mbcache entry corruption
mbcache: automatically delete entries from cache on freeing
ext4: fix race when reusing xattr blocks
ext4: unindent codeblock in ext4_xattr_block_set()
ext4: remove EA inode entry from mbcache on inode eviction
mbcache: add functions to delete entry if unused
mbcache: don't reclaim used entries
ext4: use kmemdup() to replace kmalloc + memcpy
ext4: fix leaking uninitialized memory in fast-commit journal
ext4: fix various seppling typos
ext4: simplify ext4 error translation
ext4: move functions in super.c
fs: ext4: initialize fsdata in pagecache_write()
ext4: use memcpy_to_page() in pagecache_write()
mm/highmem: Lift memcpy_[to|from]_page to core
ext4: correct inconsistent error msg in nojournal mode
ext4: goto right label 'failed_mount3a'
riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument
riscv/stacktrace: Fix stack output without ra on the stack top
ravb: Fix "failed to switch device to config mode" message during unbind
staging: media: tegra-video: fix device_node use after free
x86/kprobes: Fix optprobe optimization check with CONFIG_RETHUNK
x86/kprobes: Convert to insn_decode()
perf probe: Fix to get the DW_AT_decl_file and DW_AT_call_file as unsinged data
perf probe: Use dwarf_attr_integrate as generic DWARF attr accessor
media: s5p-mfc: Fix in register read and write for H264
media: s5p-mfc: Clear workbit to handle error condition
media: s5p-mfc: Fix to handle reference queue during finishing
x86/MCE/AMD: Clear DFR errors found in THR handler
x86/mce: Get rid of msr_ops
btrfs: replace strncpy() with strscpy()
perf/x86/intel/uncore: Clear attr_update properly
perf/x86/intel/uncore: Generalize I/O stacks to PMON mapping procedure
ARM: renumber bits related to _TIF_WORK_MASK
drm/amdgpu: make display pinning more flexible (v2)
drm/amdgpu: handle polaris10/11 overlap asics (v2)
ext4: allocate extended attribute value in vmalloc area
ext4: avoid unaccounted block allocation when expanding inode
ext4: initialize quota before expanding inode in setproject ioctl
ext4: fix inode leak in ext4_xattr_inode_create() on an error path
ext4: avoid BUG_ON when creating xattrs
ext4: fix error code return to user-space in ext4_get_branch()
ext4: fix corruption when online resizing a 1K bigalloc fs
ext4: fix delayed allocation bug in ext4_clu_mapped for bigalloc + inline
ext4: init quota for 'old.inode' in 'ext4_rename'
ext4: fix bug_on in __es_tree_search caused by bad boot loader inode
ext4: check and assert if marking an no_delete evicting inode dirty
ext4: fix reserved cluster accounting in __es_remove_extent()
ext4: fix bug_on in __es_tree_search caused by bad quota inode
ext4: add helper to check quota inums
ext4: add EXT4_IGET_BAD flag to prevent unexpected bad inode
ext4: fix undefined behavior in bit shift for ext4_check_flag_values
ext4: fix use-after-free in ext4_orphan_cleanup
ext4: add inode table check in __ext4_get_inode_loc to aovid possible infinite loop
ext4: silence the warning when evicting inode with dioread_nolock
drm/ingenic: Fix missing platform_driver_unregister() call in ingenic_drm_init()
drm/i915/dsi: fix VBT send packet port selection for dual link DSI
drm/vmwgfx: Validate the box size for the snooped cursor
drm/connector: send hotplug uevent on connector cleanup
device_cgroup: Roll back to original exceptions after copy failure
parisc: led: Fix potential null-ptr-deref in start_task()
remoteproc: core: Do pm_relax when in RPROC_OFFLINE state
iommu/amd: Fix ivrs_acpihid cmdline parsing code
driver core: Fix bus_type.match() error handling in __driver_attach()
crypto: n2 - add missing hash statesize
PCI/sysfs: Fix double free in error path
PCI: Fix pci_device_is_present() for VFs by checking PF
ipmi: fix use after free in _ipmi_destroy_user()
ima: Fix a potential NULL pointer access in ima_restore_measurement_list
mtd: spi-nor: Check for zero erase size in spi_nor_find_best_erase_type()
ipmi: fix long wait in unload when IPMI disconnect
ASoC: jz4740-i2s: Handle independent FIFO flush bits
wifi: wilc1000: sdio: fix module autoloading
efi: Add iMac Pro 2017 to uefi skip cert quirk
md/bitmap: Fix bitmap chunk size overflow issues
rtc: ds1347: fix value written to century register
cifs: fix missing display of three mount options
cifs: fix confusing debug message
media: dvb-core: Fix UAF due to refcount races at releasing
media: dvb-core: Fix double free in dvb_register_device()
ARM: 9256/1: NWFPE: avoid compiler-generated __aeabi_uldivmod
staging: media: tegra-video: fix chan->mipi value on error
tracing: Fix infinite loop in tracing_read_pipe on overflowed print_trace_line
tracing/hist: Fix wrong return value in parse_action_params()
x86/kprobes: Fix kprobes instruction boudary check with CONFIG_RETHUNK
ftrace/x86: Add back ftrace_expected for ftrace bug reports
x86/microcode/intel: Do not retry microcode reloading on the APs
KVM: nVMX: Inject #GP, not #UD, if "generic" VMXON CR0/CR4 check fails
perf/core: Call LSM hook after copying perf_event_attr
tracing/hist: Fix out-of-bound write on 'action_data.var_ref_idx'
dm cache: set needs_check flag after aborting metadata
dm cache: Fix UAF in destroy()
dm clone: Fix UAF in clone_dtr()
dm integrity: Fix UAF in dm_integrity_dtr()
dm thin: Fix UAF in run_timer_softirq()
dm thin: resume even if in FAIL mode
dm thin: Use last transaction's pmd->root when commit failed
dm thin: Fix ABBA deadlock between shrink_slab and dm_pool_abort_metadata
dm cache: Fix ABBA deadlock between shrink_slab and dm_cache_metadata_abort
ALSA: hda/realtek: Apply dual codec fixup for Dell Latitude laptops
ALSA: patch_realtek: Fix Dell Inspiron Plus 16
cpufreq: Init completion before kobject_init_and_add()
PM/devfreq: governor: Add a private governor_data for governor
selftests: Use optional USERCFLAGS and USERLDFLAGS
arm64: dts: qcom: sdm850-lenovo-yoga-c630: correct I2C12 pins drive strength
ARM: ux500: do not directly dereference __iomem
btrfs: fix resolving backrefs for inline extent followed by prealloc
mmc: sdhci-sprd: Disable CLK_AUTO when the clock is less than 400K
arm64: dts: qcom: sdm845-db845c: correct SPI2 pins drive strength
jbd2: use the correct print format
ktest.pl minconfig: Unset configs instead of just removing them
kest.pl: Fix grub2 menu handling for rebooting
soc: qcom: Select REMAP_MMIO for LLCC driver
media: stv0288: use explicitly signed char
net/af_packet: make sure to pull mac header
net/af_packet: add VLAN support for AF_PACKET SOCK_RAW GSO
rcu: Prevent lockdep-RCU splats on lock acquisition/release
torture: Exclude "NOHZ tick-stop error" from fatal errors
wifi: rtlwifi: 8192de: correct checking of IQK reload
wifi: rtlwifi: remove always-true condition pointed out by GCC 12
net/mlx5e: Fix nullptr in mlx5e_tc_add_fdb_flow()
ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire
ASoC: Intel/SOF: use set_stream() instead of set_tdm_slots() for HDAudio
kcsan: Instrument memcpy/memset/memmove with newer Clang
SUNRPC: Don't leak netobj memory when gss_read_proxy_verf() fails
tpm: tpm_tis: Add the missed acpi_put_table() to fix memory leak
tpm: tpm_crb: Add the missed acpi_put_table() to fix memory leak
tpm: acpi: Call acpi_put_table() to fix memory leak
mmc: vub300: fix warning - do not call blocking ops when !TASK_RUNNING
f2fs: should put a page when checking the summary info
mm, compaction: fix fast_isolate_around() to stay within boundaries
md: fix a crash in mempool_free
pnode: terminate at peers of source
ALSA: line6: fix stack overflow in line6_midi_transmit
ALSA: line6: correct midi status byte when receiving data from podxt
ovl: Use ovl mounter's fsuid and fsgid in ovl_link()
binfmt: Fix error return code in load_elf_fdpic_binary()
hfsplus: fix bug causing custom uid and gid being unable to be assigned with mount
pstore/zone: Use GFP_ATOMIC to allocate zone buffer
HID: plantronics: Additional PIDs for double volume key presses quirk
HID: multitouch: fix Asus ExpertBook P2 P2451FA trackpoint
powerpc/rtas: avoid scheduling in rtas_os_term()
powerpc/rtas: avoid device tree lookups in rtas_os_term()
objtool: Fix SEGFAULT
nvmet: don't defer passthrough commands with trivial effects to the workqueue
nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
ata: ahci: Fix PCS quirk application for suspend
nvme-pci: fix page size checks
nvme-pci: fix mempool alloc size
nvme-pci: fix doorbell buffer value endianness
cifs: fix oops during encryption
usb: dwc3: qcom: Fix memory leak in dwc3_qcom_interconnect_init
pwm: tegra: Fix 32 bit build
media: dvbdev: fix refcnt bug
media: dvbdev: fix build warning due to comments
ovl: fix use inode directly in rcu-walk mode
gcov: add support for checksum field
regulator: core: fix deadlock on regulator enable
iio: adc128s052: add proper .data members in adc128_of_match table
iio: adc: ad_sigma_delta: do not use internal iio_dev lock
reiserfs: Add missing calls to reiserfs_security_free()
HID: mcp2221: don't connect hidraw
HID: wacom: Ensure bootloader PID is usable in hidraw mode
usb: dwc3: core: defer probe on ulpi_read_id timeout
usb: dwc3: Fix race between dwc3_set_mode and __dwc3_set_mode
ALSA: hda/hdmi: Add HP Device 0x8711 to force connect list
ALSA: hda/realtek: Add quirk for Lenovo TianYi510Pro-14IOB
ALSA: usb-audio: add the quirk for KT0206 device
ima: Simplify ima_lsm_copy_rule
pstore: Make sure CONFIG_PSTORE_PMSG selects CONFIG_RT_MUTEXES
afs: Fix lost servers_outstanding count
perf debug: Set debug_peo_args and redirect_to_stderr variable to correct values in perf_quiet_option()
pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion
LoadPin: Ignore the "contents" argument of the LSM hooks
ASoC: rt5670: Remove unbalanced pm_runtime_put()
ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
ASoC: wm8994: Fix potential deadlock
ASoC: rockchip: pdm: Add missing clk_disable_unprepare() in rockchip_pdm_runtime_resume()
ASoC: audio-graph-card: fix refcount leak of cpu_ep in __graph_for_each_link()
ASoC: mediatek: mt8173-rt5650-rt5514: fix refcount leak in mt8173_rt5650_rt5514_dev_probe()
ASoC: Intel: Skylake: Fix driver hang during shutdown
ALSA: hda: add snd_hdac_stop_streams() helper
ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to hdac_stream.c
hwmon: (jc42) Fix missing unlock on error in jc42_write()
orangefs: Fix kmemleak in orangefs_{kernel,client}_debug_init()
orangefs: Fix kmemleak in orangefs_prepare_debugfs_help_string()
drm/sti: Fix return type of sti_{dvo,hda,hdmi}_connector_mode_valid()
drm/fsl-dcu: Fix return type of fsl_dcu_drm_connector_mode_valid()
hugetlbfs: fix null-ptr-deref in hugetlbfs_parse_param()
clk: st: Fix memory leak in st_of_quadfs_setup()
media: si470x: Fix use-after-free in si470x_int_in_callback()
mmc: renesas_sdhi: better reset from HS400 mode
mmc: f-sdh30: Add quirks for broken timeout clock capability
regulator: core: fix use_count leakage when handling boot-on
libbpf: Avoid enum forward-declarations in public API in C++ mode
blk-mq: fix possible memleak when register 'hctx' failed
media: dvb-usb: fix memory leak in dvb_usb_adapter_init()
media: dvbdev: adopts refcnt to avoid UAF
media: dvb-frontends: fix leak of memory fw
ethtool: avoiding integer overflow in ethtool_phys_id()
bpf: Prevent decl_tag from being referenced in func_proto arg
ppp: associate skb with a device at tx
mrp: introduce active flags to prevent UAF when applicant uninit
net: add atomic_long_t to net_device_stats fields
drm/amd/display: fix array index out of bound error in bios parser
md/raid1: stop mdx_raid1 thread when raid1 array run failed
drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()
drm/sti: Use drm_mode_copy()
drm/rockchip: Use drm_mode_copy()
drm/msm: Use drm_mode_copy()
s390/lcs: Fix return type of lcs_start_xmit()
s390/netiucv: Fix return type of netiucv_tx()
s390/ctcm: Fix return type of ctc{mp,}m_tx()
drm/amdgpu: Fix type of second parameter in odn_edit_dpm_table() callback
drm/amdgpu: Fix type of second parameter in trans_msg() callback
igb: Do not free q_vector unless new one was allocated
wifi: brcmfmac: Fix potential shift-out-of-bounds in brcmf_fw_alloc_request()
hamradio: baycom_epp: Fix return type of baycom_send_packet()
net: ethernet: ti: Fix return type of netcp_ndo_start_xmit()
bpf: make sure skb->len != 0 when redirecting to a tunneling device
qed (gcc13): use u16 for fid to be big enough
drm/amd/display: prevent memory leak
ipmi: fix memleak when unload ipmi driver
ASoC: codecs: rt298: Add quirk for KBL-R RVP platform
wifi: ar5523: Fix use-after-free on ar5523_cmd() timed out
wifi: ath9k: verify the expected usb_endpoints are present
brcmfmac: return error when getting invalid max_flowrings from dongle
drm/etnaviv: add missing quirks for GC300
hfs: fix OOB Read in __hfs_brec_find
acct: fix potential integer overflow in encode_comp_t()
nilfs2: fix shift-out-of-bounds due to too large exponent of block size
nilfs2: fix shift-out-of-bounds/overflow in nilfs_sb2_bad_offset()
ACPICA: Fix error code path in acpi_ds_call_control_method()
fs: jfs: fix shift-out-of-bounds in dbDiscardAG
udf: Avoid double brelse() in udf_rename()
fs: jfs: fix shift-out-of-bounds in dbAllocAG
binfmt_misc: fix shift-out-of-bounds in check_special_flags
x86/hyperv: Remove unregister syscore call from Hyper-V cleanup
video: hyperv_fb: Avoid taking busy spinlock on panic path
arm64: make is_ttbrX_addr() noinstr-safe
rcu: Fix __this_cpu_read() lockdep warning in rcu_force_quiescent_state()
net: stream: purge sk_error_queue in sk_stream_kill_queues()
myri10ge: Fix an error handling path in myri10ge_probe()
rxrpc: Fix missing unlock in rxrpc_do_sendmsg()
net_sched: reject TCF_EM_SIMPLE case for complex ematch module
mailbox: zynq-ipi: fix error handling while device_register() fails
skbuff: Account for tail adjustment during pull operations
openvswitch: Fix flow lookup to use unmasked key
selftests: devlink: fix the fd redirect in dummy_reporter_test
rtc: mxc_v2: Add missing clk_disable_unprepare()
igc: Set Qbv start_time and end_time to end_time if not being configured in GCL
igc: Lift TAPRIO schedule restriction
igc: recalculate Qbv end_time by considering cycle time
igc: Add checking for basetime less than zero
igc: Use strict cycles for Qbv scheduling
igc: Enhance Qbv scheduling by using first flag bit
net: add a helper to avoid issues with HW TX timestamping and SO_TXTIME
net: igc: use skb_csum_is_sctp instead of protocol check
net: add inline function skb_csum_is_sctp
net: switch to storing KCOV handle directly in sk_buff
r6040: Fix kmemleak in probe and remove
nfc: pn533: Clear nfc_target before being used
mISDN: hfcmulti: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
mISDN: hfcpci: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
mISDN: hfcsusb: don't call dev_kfree_skb/kfree_skb() under spin_lock_irqsave()
net: macsec: fix net device access prior to holding a lock
nfsd: under NFSv4.1, fix double svc_xprt_put on rpc_create failure
NFSD: Remove spurious cb_setup_err tracepoint
rtc: pcf85063: fix pcf85063_clkout_control
rtc: pic32: Move devm_rtc_allocate_device earlier in pic32_rtc_probe()
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
netfilter: flowtable: really fix NAT IPv6 offload
powerpc/pseries/eeh: use correct API for error log size
powerpc/eeh: Drop redundant spinlock initialization
remoteproc: qcom_q6v5_pas: Fix missing of_node_put() in adsp_alloc_memory_region()
remoteproc: qcom_q6v5_pas: detach power domains on remove
remoteproc: qcom_q6v5_pas: disable wakeup on probe fail or remove
remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev()
pwm: sifive: Call pwm_sifive_update_clock() while mutex is held
iommu/sun50i: Remove IOMMU_DOMAIN_IDENTITY
selftests/powerpc: Fix resource leaks
powerpc/hv-gpci: Fix hv_gpci event list
powerpc/83xx/mpc832x_rdb: call platform_device_put() in error case in of_fsl_spi_probe()
powerpc/perf: callchain validate kernel stack pointer bounds
kbuild: refactor single builds of *.ko
kbuild: unify modules(_install) for in-tree and external modules
kbuild: remove unneeded mkdir for external modules_install
powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data()
powerpc/xmon: Fix -Wswitch-unreachable warning in bpt_cmds
powerpc/xmon: Enable breakpoints on 8xx
cxl: Fix refcount leak in cxl_calc_capp_routing
powerpc/52xx: Fix a resource leak in an error handling path
macintosh/macio-adb: check the return value of ioremap()
macintosh: fix possible memory leak in macio_add_one_device()
iommu/fsl_pamu: Fix resource leak in fsl_pamu_probe()
iommu/amd: Fix pci device refcount leak in ppr_notifier()
rtc: pcf85063: Fix reading alarm
rtc: snvs: Allow a time difference on clock register read
rtc: cmos: Disable ACPI RTC event on removal
rtc: cmos: Rename ACPI-related functions
rtc: cmos: Eliminate forward declarations of some functions
rtc: cmos: Call rtc_wake_setup() from cmos_do_probe()
rtc: cmos: Call cmos_wake_setup() from cmos_do_probe()
rtc: cmos: fix build on non-ACPI platforms
rtc: cmos: Fix wake alarm breakage
rtc: cmos: Fix event handler registration ordering issue
rtc: rtc-cmos: Do not check ACPI_FADT_LOW_POWER_S0
dmaengine: idxd: Fix crc_val field for completion record
pwm: tegra: Improve required rate calculation
include/uapi/linux/swab: Fix potentially missing __always_inline
phy: usb: s2 WoL wakeup_count not incremented for USB->Eth devices
iommu/sun50i: Fix flush size
iommu/sun50i: Fix R/W permission check
iommu/sun50i: Consider all fault sources for reset
iommu/sun50i: Fix reset release
RDMA/siw: Fix pointer cast warning
power: supply: fix null pointer dereferencing in power_supply_get_battery_info
HSI: omap_ssi_core: Fix error handling in ssi_init()
perf symbol: correction while adjusting symbol
perf trace: Handle failure when trace point folder is missed
perf trace: Use macro RAW_SYSCALL_ARGS_NUM to replace number
perf trace: Return error if a system call doesn't exist
power: supply: fix residue sysfs file in error handle route of __power_supply_register()
HSI: omap_ssi_core: fix possible memory leak in ssi_probe()
HSI: omap_ssi_core: fix unbalanced pm_runtime_disable()
fbdev: uvesafb: Fixes an error handling path in uvesafb_probe()
fbdev: vermilion: decrease reference count in error path
fbdev: via: Fix error in via_core_init()
fbdev: pm2fb: fix missing pci_disable_device()
fbdev: ssd1307fb: Drop optional dependency
thermal/drivers/imx8mm_thermal: Validate temperature range
samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe()
tracing/hist: Fix issue of losting command info in error_log
usb: storage: Add check for kcalloc
i2c: ismt: Fix an out-of-bounds bug in ismt_access()
i2c: mux: reg: check return value after calling platform_get_resource()
gpiolib: cdev: fix NULL-pointer dereferences
gpiolib: Get rid of redundant 'else'
vme: Fix error not catched in fake_init()
staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()
staging: rtl8192u: Fix use after free in ieee80211_rx()
i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
chardev: fix error handling in cdev_device_add()
mcb: mcb-parse: fix error handing in chameleon_parse_gdd()
drivers: mcb: fix resource leak in mcb_probe()
usb: gadget: f_hid: fix refcount leak on error path
usb: gadget: f_hid: fix f_hidg lifetime vs cdev
usb: gadget: f_hid: optional SETUP/SET_REPORT mode
usb: roles: fix of node refcount leak in usb_role_switch_is_parent()
counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update
iio: adis: add '__adis_enable_irq()' implementation
iio:imu:adis: Move exports into IIO_ADISLIB namespace
iio: adis: stylistic changes
iio: adis: handle devices that cannot unmask the drdy pin
iio:imu:adis: Use IRQF_NO_AUTOEN instead of irq request then disable
genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()
iio: temperature: ltc2983: make bulk write buffer DMA-safe
cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()
cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()
misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
ocxl: fix pci device refcount leak when calling get_function_0()
misc: ocxl: fix possible name leak in ocxl_file_register_afu()
test_firmware: fix memory leak in test_firmware_init()
serial: sunsab: Fix error handling in sunsab_init()
serial: altera_uart: fix locking in polling mode
tty: serial: altera_uart_{r,t}x_chars() need only uart_port
tty: serial: clean up stop-tx part in altera_uart_tx_chars()
serial: pch: Fix PCI device refcount leak in pch_request_dma()
serial: pl011: Do not clear RX FIFO & RX interrupt in unthrottle.
serial: amba-pl011: avoid SBSA UART accessing DMACR register
usb: typec: tipd: Fix spurious fwnode_handle_put in error path
usb: typec: tcpci: fix of node refcount leak in tcpci_register_port()
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
staging: vme_user: Fix possible UAF in tsi148_dma_list_add
usb: fotg210-udc: Fix ages old endianness issues
uio: uio_dmem_genirq: Fix deadlock between irq config and handling
uio: uio_dmem_genirq: Fix missing unlock in irq configuration
vfio: platform: Do not pass return buffer to ACPI _RST method
class: fix possible memory leak in __class_register()
serial: tegra: Read DMA status before terminating
drivers: dio: fix possible memory leak in dio_init()
IB/IPoIB: Fix queue count inconsistency for PKEY child interfaces
hwrng: geode - Fix PCI device refcount leak
hwrng: amd - Fix PCI device refcount leak
crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
RDMA/hns: Fix page size cap from firmware
RDMA/hns: Fix PBL page MTR find
orangefs: Fix sysfs not cleanup when dev init failed
RDMA/srp: Fix error return code in srp_parse_options()
RDMA/hfi1: Fix error return code in parse_platform_config()
riscv/mm: add arch hook arch_clear_hugepage_flags
crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe()
crypto: amlogic - Remove kcalloc without check
RDMA/nldev: Fix failure to send large messages
f2fs: avoid victim selection from previous victim section
RDMA/nldev: Add checks for nla_nest_start() in fill_stat_counter_qps()
scsi: snic: Fix possible UAF in snic_tgt_create()
scsi: fcoe: Fix transport not deattached when fcoe_if_init() fails
scsi: ipr: Fix WARNING in ipr_init()
scsi: scsi_debug: Fix possible name leak in sdebug_add_host_helper()
scsi: fcoe: Fix possible name leak when device_register() fails
scsi: scsi_debug: Fix a warning in resp_report_zones()
scsi: scsi_debug: Fix a warning in resp_verify()
scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
scsi: hpsa: Fix error handling in hpsa_add_sas_host()
scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add()
padata: Fix list iterator in padata_do_serial()
padata: Always leave BHs disabled when running ->parallel()
crypto: tcrypt - Fix multibuffer skcipher speed test mem leak
scsi: hpsa: Fix possible memory leak in hpsa_init_one()
RDMA/rxe: Fix NULL-ptr-deref in rxe_qp_do_cleanup() when socket create failed
RDMA/hns: fix memory leak in hns_roce_alloc_mr()
crypto: ccree - Make cc_debugfs_global_fini() available for module init function
RDMA/hfi: Decrease PCI device reference count in error path
PCI: Check for alloc failure in pci_request_irq()
RDMA/hns: Fix ext_sge num error when post send
RDMA/hns: Repacing 'dseg_len' by macros in fill_ext_sge_inl_data()
crypto: hisilicon/qm - add missing pci_dev_put() in q_num_set()
crypto: cryptd - Use request context instead of stack for sub-request
crypto: ccree - Remove debugfs when platform_driver_register failed
scsi: scsi_debug: Fix a warning in resp_write_scat()
RDMA/siw: Set defined status for work completion with undefined status
RDMA/nldev: Return "-EAGAIN" if the cm_id isn't from expected port
RDMA/siw: Fix immediate work request flush to completion queue
f2fs: fix normal discard process
apparmor: Fix memleak in alloc_ns()
crypto: rockchip - rework by using crypto_engine
crypto: rockchip - delete unneeded variable initialization
crypto: rockchip - remove non-aligned handling
crypto: rockchip - better handle cipher key
crypto: rockchip - add fallback for ahash
crypto: rockchip - add fallback for cipher
crypto: rockchip - do not store mode globally
crypto: rockchip - do not do custom power management
f2fs: Fix the race condition of resize flag between resizefs
PCI: pci-epf-test: Register notifier if only core_init_notifier is enabled
RDMA/core: Fix order of nldev_exit call
PCI: dwc: Fix n_fts[] array overrun
apparmor: Use pointer to struct aa_label for lbs_cred
scsi: core: Fix a race between scsi_done() and scsi_timeout()
crypto: nitrox - avoid double free on error path in nitrox_sriov_init()
crypto: sun8i-ss - use dma_addr instead u32
apparmor: Fix abi check to include v8 abi
apparmor: fix lockdep warning when removing a namespace
apparmor: fix a memleak in multi_transaction_new()
stmmac: fix potential division by 0
Bluetooth: RFCOMM: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: hci_core: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: hci_bcsp: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: hci_h5: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: hci_ll: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: hci_qca: don't call kfree_skb() under spin_lock_irqsave()
Bluetooth: btusb: don't call kfree_skb() under spin_lock_irqsave()
sctp: sysctl: make extra pointers netns aware
ntb_netdev: Use dev_kfree_skb_any() in interrupt context
net: lan9303: Fix read error execution path
can: tcan4x5x: Remove invalid write in clear_interrupts
net: amd-xgbe: Check only the minimum speed for active/passive cables
net: amd-xgbe: Fix logic around active and passive cables
net: amd: lance: don't call dev_kfree_skb() under spin_lock_irqsave()
hamradio: don't call dev_kfree_skb() under spin_lock_irqsave()
net: ethernet: dnet: don't call dev_kfree_skb() under spin_lock_irqsave()
net: emaclite: don't call dev_kfree_skb() under spin_lock_irqsave()
net: apple: bmac: don't call dev_kfree_skb() under spin_lock_irqsave()
net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave()
net/tunnel: wait until all sk_user_data reader finish before releasing the sock
net: farsync: Fix kmemleak when rmmods farsync
ethernet: s2io: don't call dev_kfree_skb() under spin_lock_irqsave()
of: overlay: fix null pointer dereferencing in find_dup_cset_node_entry() and find_dup_cset_prop()
drivers: net: qlcnic: Fix potential memory leak in qlcnic_sriov_init()
net: stmmac: selftests: fix potential memleak in stmmac_test_arpoffload()
net: defxx: Fix missing err handling in dfx_init()
net: vmw_vsock: vmci: Check memcpy_from_msg()
clk: socfpga: Fix memory leak in socfpga_gate_init()
clk: socfpga: use clk_hw_register for a5/c5
clk: socfpga: clk-pll: Remove unused variable 'rc'
blktrace: Fix output non-blktrace event when blk_classic option enabled
wifi: brcmfmac: Fix error return code in brcmf_sdio_download_firmware()
wifi: rtl8xxxu: Fix the channel width reporting
wifi: rtl8xxxu: Add __packed to struct rtl8723bu_c2h
spi: spi-gpio: Don't set MOSI as an input if not 3WIRE mode
clk: samsung: Fix memory leak in _samsung_clk_register_pll()
media: coda: Add check for kmalloc
media: coda: Add check for dcoda_iram_alloc
media: c8sectpfe: Add of_node_put() when breaking out of loop
mmc: mmci: fix return value check of mmc_add_host()
mmc: wbsd: fix return value check of mmc_add_host()
mmc: via-sdmmc: fix return value check of mmc_add_host()
mmc: meson-gx: fix return value check of mmc_add_host()
mmc: omap_hsmmc: fix return value check of mmc_add_host()
mmc: atmel-mci: fix return value check of mmc_add_host()
mmc: wmt-sdmmc: fix return value check of mmc_add_host()
mmc: vub300: fix return value check of mmc_add_host()
mmc: toshsd: fix return value check of mmc_add_host()
mmc: rtsx_usb_sdmmc: fix return value check of mmc_add_host()
mmc: pxamci: fix return value check of mmc_add_host()
mmc: mxcmmc: fix return value check of mmc_add_host()
mmc: moxart: fix return value check of mmc_add_host()
mmc: alcor: fix return value check of mmc_add_host()
NFSv4.x: Fail client initialisation if state manager thread can't run
SUNRPC: Fix missing release socket in rpc_sockname()
xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt
media: saa7164: fix missing pci_disable_device()
ALSA: pcm: Set missing stop_operating flag at undoing trigger start
bpf, sockmap: fix race in sock_map_free()
hwmon: (jc42) Restore the min/max/critical temperatures on resume
hwmon: (jc42) Convert register access and caching to regmap/regcache
regulator: core: fix resource leak in regulator_register()
configfs: fix possible memory leak in configfs_create_dir()
hsr: Synchronize sequence number updates.
hsr: Synchronize sending frames to have always incremented outgoing seq nr.
hsr: Disable netpoll.
net: hsr: generate supervision frame without HSR/PRP tag
hsr: Add a rcu-read lock to hsr_forward_skb().
clk: qcom: clk-krait: fix wrong div2 functions
regulator: core: fix module refcount leak in set_supply()
wifi: mt76: fix coverity overrun-call in mt76_get_txpower()
wifi: cfg80211: Fix not unregister reg_pdev when load_builtin_regdb_keys() fails
wifi: mac80211: fix memory leak in ieee80211_if_add()
spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE
bonding: uninitialized variable in bond_miimon_inspect()
bpf, sockmap: Fix data loss caused by using apply_bytes on ingress redirect
bpf, sockmap: Fix repeated calls to sock_put() when msg has more_data
netfilter: conntrack: set icmpv6 redirects as RELATED
ASoC: pcm512x: Fix PM disable depth imbalance in pcm512x_probe
drm/amdgpu: Fix PCI device refcount leak in amdgpu_atrm_get_bios()
drm/radeon: Fix PCI device refcount leak in radeon_atrm_get_bios()
drm/amd/pm/smu11: BACO is supported when it's in BACO state
ASoC: mediatek: mt8173: Enable IRQ when pdata is ready
ASoC: mediatek: mt8173: Fix debugfs registration for components
wifi: iwlwifi: mvm: fix double free on tx path.
ALSA: asihpi: fix missing pci_disable_device()
NFS: Fix an Oops in nfs_d_automount()
NFSv4: Fix a deadlock between nfs4_open_recover_helper() and delegreturn
NFSv4.2: Fix initialisation of struct nfs4_label
NFSv4.2: Fix a memory stomp in decode_attr_security_label
NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding
ASoC: mediatek: mtk-btcvsd: Add checks for write and read of mtk_btcvsd_snd
ASoC: dt-bindings: wcd9335: fix reset line polarity in example
drm/tegra: Add missing clk_disable_unprepare() in tegra_dc_probe()
media: s5p-mfc: Add variant data for MFC v7 hardware for Exynos 3250 SoC
media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()
media: dvb-core: Fix ignored return value in dvb_register_frontend()
pinctrl: pinconf-generic: add missing of_node_put()
clk: imx: replace osc_hdmi with dummy
media: imon: fix a race condition in send_packet()
media: vimc: Fix wrong function called when vimc_init() fails
ASoC: qcom: Add checks for devm_kcalloc
drbd: fix an invalid memory access caused by incorrect use of list iterator
mtd: maps: pxa2xx-flash: fix memory leak in probe
bonding: fix link recovery in mode 2 when updelay is nonzero
drm/amdgpu: fix pci device refcount leak
clk: rockchip: Fix memory leak in rockchip_clk_register_pll()
regulator: core: use kfree_const() to free space conditionally
ALSA: seq: fix undefined behavior in bit shift for SNDRV_SEQ_FILTER_USE_EVENT
ALSA: pcm: fix undefined behavior in bit shift for SNDRV_PCM_RATE_KNOT
HID: hid-sensor-custom: set fixed size for custom attributes
bpf: Move skb->len == 0 checks into __bpf_redirect
inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict()
media: videobuf-dma-contig: use dma_mmap_coherent
media: platform: exynos4-is: Fix error handling in fimc_md_init()
media: solo6x10: fix possible memory leak in solo_sysfs_init()
media: vidtv: Fix use-after-free in vidtv_bridge_dvb_init()
Input: elants_i2c - properly handle the reset GPIO when power is off
mtd: lpddr2_nvm: Fix possible null-ptr-deref
wifi: ath10k: Fix return value in ath10k_pci_init()
ima: Fix misuse of dereference of pointer in template_desc_init_fields()
integrity: Fix memory leakage in keyring allocation error path
drm/fourcc: Fix vsub/hsub for Q410 and Q401
drm/fourcc: Add packed 10bit YUV 4:2:0 format
amdgpu/pm: prevent array underflow in vega20_odn_edit_dpm_table()
regulator: core: fix unbalanced of node refcount in regulator_dev_lookup()
ASoC: pxa: fix null-pointer dereference in filter()
drm/mediatek: Modify dpi power on/off sequence.
drm/radeon: Add the missed acpi_put_table() to fix memory leak
rxrpc: Fix ack.bufferSize to be 0 when generating an ack
net, proc: Provide PROC_FS=n fallback for proc_create_net_single_write()
media: camss: Clean up received buffers on failed start of streaming
wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port
Input: joystick - fix Kconfig warning for JOYSTICK_ADC
mtd: Fix device name leak when register device failed in add_mtd_device()
clk: qcom: gcc-sm8250: Use retention mode for USB GDSCs
bpf: propagate precision across all frames, not just the last one
bpf: Check the other end of slot_type for STACK_SPILL
bpf: propagate precision in ALU/ALU64 operations
media: platform: exynos4-is: fix return value check in fimc_md_probe()
media: vivid: fix compose size exceed boundary
bpf: Fix slot type check in check_stack_write_var_off
drm/msm/hdmi: drop unused GPIO support
drm/msm/hdmi: switch to drm_bridge_connector
ima: Handle -ESTALE returned by ima_filter_rule_match()
ima: Fix fall-through warnings for Clang
drm/panel/panel-sitronix-st7701: Remove panel on DSI attach failure
spi: Update reference to struct spi_controller
clk: renesas: r9a06g032: Repair grave increment error
drm/rockchip: lvds: fix PM usage counter unbalance in poweron
can: kvaser_usb: Compare requested bittiming parameters with actual parameters in do_set_{,data}_bittiming
can: kvaser_usb: Add struct kvaser_usb_busparams
can: kvaser_usb_leaf: Fix bogus restart events
can: kvaser_usb_leaf: Fix wrong CAN state after stopping
can: kvaser_usb_leaf: Fix improved state not being reported
can: kvaser_usb_leaf: Set Warning state even without bus errors
can: kvaser_usb: kvaser_usb_leaf: Handle CMD_ERROR_EVENT
can: kvaser_usb: kvaser_usb_leaf: Rename {leaf,usbcan}_cmd_error_event to {leaf,usbcan}_cmd_can_error_event
can: kvaser_usb: kvaser_usb_leaf: Get capabilities from device
can: kvaser_usb: do not increase tx statistics when sending error message frames
media: exynos4-is: don't rely on the v4l2_async_subdev internals
media: exynos4-is: Use v4l2_async_notifier_add_fwnode_remote_subdev
venus: pm_helpers: Fix error check in vcodec_domains_get()
media: i2c: ad5820: Fix error path
media: coda: jpeg: Add check for kmalloc
pata_ipx4xx_cf: Fix unsigned comparison with less than zero
libbpf: Fix null-pointer dereference in find_prog_by_sec_insn()
libbpf: Fix use-after-free in btf_dump_name_dups
drm/bridge: adv7533: remove dynamic lane switching from adv7533 bridge
wifi: rtl8xxxu: Fix reading the vendor of combo chips
wifi: ath9k: hif_usb: Fix use-after-free in ath9k_hif_usb_reg_in_cb()
wifi: ath9k: hif_usb: fix memory leak of urbs in ath9k_hif_usb_dealloc_tx_urbs()
rapidio: devices: fix missing put_device in mport_cdev_open
hfs: Fix OOB Write in hfs_asc2mac
relay: fix type mismatch when allocating memory in relay_create_buf()
eventfd: change int to __u64 in eventfd_signal() ifndef CONFIG_EVENTFD
rapidio: fix possible UAF when kfifo_alloc() fails
fs: sysv: Fix sysv_nblocks() returns wrong value
MIPS: OCTEON: warn only once if deprecated link status is being used
MIPS: BCM63xx: Add check for NULL for clk in clk_enable
platform/x86: intel_scu_ipc: fix possible name leak in __intel_scu_ipc_register()
platform/x86: mxm-wmi: fix memleak in mxm_wmi_call_mx[ds|mx]()
PM: runtime: Do not call __rpm_callback() from rpm_idle()
PM: runtime: Improve path in rpm_idle() when no callback
xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource()
x86/xen: Fix memory leak in xen_init_lock_cpu()
x86/xen: Fix memory leak in xen_smp_intr_init{_pv}()
uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix
ACPICA: Fix use-after-free in acpi_ut_copy_ipackage_to_ipackage()
clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
cpu/hotplug: Make target_store() a nop when target == state
futex: Resend potentially swallowed owner death notification
futex: Move to kernel/futex/
clocksource/drivers/sh_cmt: Access registers according to spec
clocksource/drivers/sh_cmt: Make sure channel clock supply is enabled
rapidio: rio: fix possible name leak in rio_register_mport()
rapidio: fix possible name leaks when rio_add_device() fails
ocfs2: fix memory leak in ocfs2_mount_volume()
ocfs2: rewrite error handling of ocfs2_fill_super
ocfs2: ocfs2_mount_volume does cleanup job before return error
debugfs: fix error when writing negative value to atomic_t debugfs file
docs: fault-injection: fix non-working usage of negative values
lib/notifier-error-inject: fix error when writing -errno to debugfs file
libfs: add DEFINE_SIMPLE_ATTRIBUTE_SIGNED for signed value
cpufreq: amd_freq_sensitivity: Add missing pci_dev_put()
genirq/irqdesc: Don't try to remove non-existing sysfs files
nfsd: don't call nfsd_file_put from client states seqfile display
EDAC/i10nm: fix refcount leak in pci_get_dev_wrapper()
irqchip: gic-pm: Use pm_runtime_resume_and_get() in gic_probe()
platform/chrome: cros_usbpd_notify: Fix error handling in cros_usbpd_notify_init()
perf/x86/intel/uncore: Fix reference count leak in __uncore_imc_init_box()
perf/x86/intel/uncore: Fix reference count leak in snr_uncore_mmio_map()
perf/x86/intel/uncore: Fix reference count leak in hswep_has_limit_sbox()
PNP: fix name memory leak in pnp_alloc_dev()
selftests/efivarfs: Add checking of the test return value
MIPS: vpe-cmp: fix possible memory leak while module exiting
MIPS: vpe-mt: fix possible memory leak while module exiting
ocfs2: fix memory leak in ocfs2_stack_glue_init()
lib/fonts: fix undefined behavior in bit shift for get_default_font
proc: fixup uptime selftest
timerqueue: Use rb_entry_safe() in timerqueue_getnext()
platform/x86: huawei-wmi: fix return value calculation
lib/debugobjects: fix stat count and optimize debug_objects_mem_init
perf: Fix possible memleak in pmu_dev_alloc()
selftests/ftrace: event_triggers: wait longer for test_event_enable
cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()
fs: don't audit the capability check in simple_xattr_list()
PM: hibernate: Fix mistake in kerneldoc comment
alpha: fix syscall entry in !AUDUT_SYSCALL case
cpuidle: dt: Return the correct numbers of parsed idle states
sched/uclamp: Fix relationship between uclamp and migration margin
sched/fair: Cleanup task_util and capacity type
tpm/tpm_crb: Fix error message in __crb_relinquish_locality()
tpm/tpm_ftpm_tee: Fix error handling in ftpm_mod_init()
pstore: Avoid kcore oops by vmap()ing with VM_IOREMAP
ARM: mmp: fix timer_read delay
pstore/ram: Fix error return code in ramoops_probe()
arm64: dts: armada-3720-turris-mox: Add missing interrupt for RTC
ARM: dts: turris-omnia: Add switch port 6 node
ARM: dts: turris-omnia: Add ethernet aliases
ARM: dts: armada-39x: Fix assigned-addresses for every PCIe Root Port
ARM: dts: armada-38x: Fix assigned-addresses for every PCIe Root Port
ARM: dts: armada-375: Fix assigned-addresses for every PCIe Root Port
ARM: dts: armada-xp: Fix assigned-addresses for every PCIe Root Port
ARM: dts: armada-370: Fix assigned-addresses for every PCIe Root Port
ARM: dts: dove: Fix assigned-addresses for every PCIe Root Port
arm64: dts: mediatek: mt6797: Fix 26M oscillator unit name
arm64: dts: mediatek: pumpkin-common: Fix devicetree warnings
arm64: dts: mt2712-evb: Fix usb vbus regulators unit names
arm64: dts: mt2712-evb: Fix vproc fixed regulators unit names
arm64: dts: mt2712e: Fix unit address for pinctrl node
arm64: dts: mt2712e: Fix unit_address_vs_reg warning for oscillators
arm64: dts: ti: k3-j721e-main: Drop dma-coherent in crypto node
arm64: dts: ti: k3-am65-main: Drop dma-coherent in crypto node
perf/smmuv3: Fix hotplug callback leak in arm_smmu_pmu_init()
perf: arm_dsu: Fix hotplug callback leak in dsu_pmu_init()
soc: ti: smartreflex: Fix PM disable depth imbalance in omap_sr_probe
soc: ti: knav_qmss_queue: Fix PM disable depth imbalance in knav_queue_probe
soc: ti: knav_qmss_queue: Use pm_runtime_resume_and_get instead of pm_runtime_get_sync
arm: dts: spear600: Fix clcd interrupt
soc: qcom: apr: Add check for idr_alloc and of_property_read_string_index
soc: qcom: apr: make code more reuseable
soc: qcom: llcc: make irq truly optional
drivers: soc: ti: knav_qmss_queue: Mark knav_acc_firmwares as static
ARM: dts: stm32: Fix AV96 WLAN regulator gpio property
ARM: dts: stm32: Drop stm32mp15xc.dtsi from Avenger96
objtool, kcsan: Add volatile read/write instrumentation to whitelist
arm64: dts: qcom: msm8916: Drop MSS fallback compatible
arm64: dts: qcom: sdm845-cheza: fix AP suspend pin bias
arm64: dts: qcom: sdm630: fix UART1 pin bias
ARM: dts: qcom: apq8064: fix coresight compatible
arm64: dts: qcom: msm8996: fix GPU OPP table
arm64: dts: qcom: ipq6018-cp01-c1: use BLSPI1 pins
usb: musb: remove extra check in musb_gadget_vbus_draw
Linux 5.10.162
io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups
eventfd: provide a eventfd_signal_mask() helper
eventpoll: add EPOLL_URING_WAKE poll wakeup flag
Revert "proc: don't allow async path resolution of /proc/self components"
Revert "proc: don't allow async path resolution of /proc/thread-self components"
net: remove cmsg restriction from io_uring based send/recvmsg calls
task_work: unconditionally run task_work from get_signal()
signal: kill JOBCTL_TASK_WORK
io_uring: import 5.15-stable io_uring
task_work: add helper for more targeted task_work canceling
kernel: don't call do_exit() for PF_IO_WORKER threads
kernel: stop masking signals in create_io_thread()
x86/process: setup io_threads more like normal user space threads
arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
arch: setup PF_IO_WORKER threads like PF_KTHREAD
entry/kvm: Exit to user mode when TIF_NOTIFY_SIGNAL is set
kernel: allow fork with TIF_NOTIFY_SIGNAL pending
coredump: Limit what can interrupt coredumps
kernel: remove checking for TIF_NOTIFY_SIGNAL
task_work: remove legacy TWA_SIGNAL path
alpha: fix TIF_NOTIFY_SIGNAL handling
ARC: unbork 5.11 bootup: fix snafu in _TIF_NOTIFY_SIGNAL handling
ia64: don't call handle_signal() unless there's actually a signal queued
sparc: add support for TIF_NOTIFY_SIGNAL
riscv: add support for TIF_NOTIFY_SIGNAL
nds32: add support for TIF_NOTIFY_SIGNAL
ia64: add support for TIF_NOTIFY_SIGNAL
h8300: add support for TIF_NOTIFY_SIGNAL
c6x: add support for TIF_NOTIFY_SIGNAL
alpha: add support for TIF_NOTIFY_SIGNAL
xtensa: add support for TIF_NOTIFY_SIGNAL
arm: add support for TIF_NOTIFY_SIGNAL
microblaze: add support for TIF_NOTIFY_SIGNAL
hexagon: add support for TIF_NOTIFY_SIGNAL
csky: add support for TIF_NOTIFY_SIGNAL
openrisc: add support for TIF_NOTIFY_SIGNAL
sh: add support for TIF_NOTIFY_SIGNAL
um: add support for TIF_NOTIFY_SIGNAL
s390: add support for TIF_NOTIFY_SIGNAL
mips: add support for TIF_NOTIFY_SIGNAL
powerpc: add support for TIF_NOTIFY_SIGNAL
parisc: add support for TIF_NOTIFY_SIGNAL
nios32: add support for TIF_NOTIFY_SIGNAL
m68k: add support for TIF_NOTIFY_SIGNAL
arm64: add support for TIF_NOTIFY_SIGNAL
arc: add support for TIF_NOTIFY_SIGNAL
x86: Wire up TIF_NOTIFY_SIGNAL
task_work: Use TIF_NOTIFY_SIGNAL if available
entry: Add support for TIF_NOTIFY_SIGNAL
fs: provide locked helper variant of close_fd_get_file()
file: Rename __close_fd_get_file close_fd_get_file
fs: make do_renameat2() take struct filename
signal: Add task_sigpending() helper
net: add accept helper not installing fd
net: provide __sys_shutdown_sock() that takes a socket
tools headers UAPI: Sync openat2.h with the kernel sources
fs: expose LOOKUP_CACHED through openat2() RESOLVE_CACHED
Make sure nd->path.mnt and nd->path.dentry are always valid pointers
fix handling of nd->depth on LOOKUP_CACHED failures in try_to_unlazy*
fs: add support for LOOKUP_CACHED
saner calling conventions for unlazy_child()
iov_iter: add helper to save iov_iter state
kernel: provide create_io_thread() helper
Linux 5.10.161
net: loopback: use NET_NAME_PREDICTABLE for name_assign_type
Bluetooth: L2CAP: Fix u8 overflow
HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk
HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch V 10
HID: ite: Enable QUIRK_TOUCHPAD_ON_OFF_REPORT on Acer Aspire Switch 10E
HID: ite: Add support for Acer S1002 keyboard-dock
igb: Initialize mailbox message for VF reset
xhci: Apply XHCI_RESET_TO_DEFAULT quirk to ADL-N
USB: serial: f81534: fix division by zero on line-speed change
USB: serial: f81232: fix division by zero on line-speed change
USB: serial: cp210x: add Kamstrup RF sniffer PIDs
USB: serial: option: add Quectel EM05-G modem
usb: gadget: uvc: Prevent buffer overflow in setup handler
udf: Fix extending file within last block
udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size
udf: Fix preallocation discarding at indirect extent boundary
udf: Discard preallocation before extending file with a hole
Conflicts:
Documentation/devicetree/bindings
Documentation/devicetree/bindings/phy/amlogic,g12a-usb2-phy.yaml
Documentation/devicetree/bindings/phy/amlogic,g12a-usb3-pcie-phy.yaml
Documentation/devicetree/bindings/sound/qcom,wcd9335.txt
drivers/cpufreq/qcom-cpufreq-hw.c
drivers/remoteproc/qcom_q6v5_pas.c
drivers/soc/qcom/llcc-qcom.c
net/qrtr/ns.c
Change-Id: Ic972b7c946b804f910715bd2def82725a42d266e
Signed-off-by: Srinivasarao Pathipati <quic_c_spathi@quicinc.com>
2023-05-11 18:15:07 +09:00
|
|
|
if (xa_is_err(xa_store(&nodes, node_id, node, GFP_KERNEL))) {
|
2023-01-25 22:48:31 +09:00
|
|
|
kfree(node);
|
|
|
|
return NULL;
|
|
|
|
}
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2021-07-14 22:30:59 +09:00
|
|
|
int qrtr_get_service_id(unsigned int node_id, unsigned int port_id)
|
2021-05-18 17:54:54 +09:00
|
|
|
{
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct qrtr_node *node;
|
|
|
|
unsigned long index;
|
|
|
|
|
2022-06-01 19:03:10 +09:00
|
|
|
node = xa_load(&nodes, node_id);
|
2021-05-18 17:54:54 +09:00
|
|
|
if (!node)
|
2021-07-14 22:30:59 +09:00
|
|
|
return -EINVAL;
|
2021-05-18 17:54:54 +09:00
|
|
|
|
|
|
|
xa_for_each(&node->servers, index, srv) {
|
|
|
|
if (srv->node == node_id && srv->port == port_id)
|
|
|
|
return srv->service;
|
|
|
|
}
|
|
|
|
|
2021-07-14 22:30:59 +09:00
|
|
|
return -EINVAL;
|
2021-05-18 17:54:54 +09:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(qrtr_get_service_id);
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
static int server_match(const struct qrtr_server *srv,
|
|
|
|
const struct qrtr_server_filter *f)
|
|
|
|
{
|
|
|
|
unsigned int ifilter = f->ifilter;
|
|
|
|
|
|
|
|
if (f->service != 0 && srv->service != f->service)
|
|
|
|
return 0;
|
|
|
|
if (!ifilter && f->instance)
|
|
|
|
ifilter = ~0;
|
|
|
|
|
|
|
|
return (srv->instance & ifilter) == f->instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int service_announce_new(struct sockaddr_qrtr *dest,
|
|
|
|
struct qrtr_server *srv)
|
|
|
|
{
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct kvec iv;
|
|
|
|
|
2020-04-21 16:40:54 +09:00
|
|
|
trace_qrtr_ns_service_announce_new(srv->service, srv->instance,
|
|
|
|
srv->node, srv->port);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
NS_INFO("%s: [0x%x:0x%x]@[0x%x:0x%x]\n", __func__, srv->service,
|
|
|
|
srv->instance, srv->node, srv->port);
|
2020-02-21 00:13:26 +09:00
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = cpu_to_le32(QRTR_TYPE_NEW_SERVER);
|
|
|
|
pkt.server.service = cpu_to_le32(srv->service);
|
|
|
|
pkt.server.instance = cpu_to_le32(srv->instance);
|
|
|
|
pkt.server.node = cpu_to_le32(srv->node);
|
|
|
|
pkt.server.port = cpu_to_le32(srv->port);
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)dest;
|
|
|
|
msg.msg_namelen = sizeof(*dest);
|
|
|
|
|
|
|
|
return kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int service_announce_del(struct sockaddr_qrtr *dest,
|
|
|
|
struct qrtr_server *srv)
|
|
|
|
{
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct kvec iv;
|
|
|
|
int ret;
|
|
|
|
|
2020-04-21 16:40:54 +09:00
|
|
|
trace_qrtr_ns_service_announce_del(srv->service, srv->instance,
|
|
|
|
srv->node, srv->port);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
NS_INFO("%s: [0x%x:0x%x]@[0x%x:0x%x]\n", __func__, srv->service,
|
|
|
|
srv->instance, srv->node, srv->port);
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = cpu_to_le32(QRTR_TYPE_DEL_SERVER);
|
|
|
|
pkt.server.service = cpu_to_le32(srv->service);
|
|
|
|
pkt.server.instance = cpu_to_le32(srv->instance);
|
|
|
|
pkt.server.node = cpu_to_le32(srv->node);
|
|
|
|
pkt.server.port = cpu_to_le32(srv->port);
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)dest;
|
|
|
|
msg.msg_namelen = sizeof(*dest);
|
|
|
|
|
|
|
|
ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
2020-05-06 08:11:44 +09:00
|
|
|
if (ret < 0 && ret != -ENODEV)
|
2020-07-22 11:35:05 +09:00
|
|
|
pr_err_ratelimited("failed to announce del service %d\n", ret);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void lookup_notify(struct sockaddr_qrtr *to, struct qrtr_server *srv,
|
|
|
|
bool new)
|
|
|
|
{
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct kvec iv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = new ? cpu_to_le32(QRTR_TYPE_NEW_SERVER) :
|
|
|
|
cpu_to_le32(QRTR_TYPE_DEL_SERVER);
|
|
|
|
if (srv) {
|
|
|
|
pkt.server.service = cpu_to_le32(srv->service);
|
|
|
|
pkt.server.instance = cpu_to_le32(srv->instance);
|
|
|
|
pkt.server.node = cpu_to_le32(srv->node);
|
|
|
|
pkt.server.port = cpu_to_le32(srv->port);
|
|
|
|
}
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)to;
|
|
|
|
msg.msg_namelen = sizeof(*to);
|
|
|
|
|
|
|
|
ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
2020-05-06 08:11:44 +09:00
|
|
|
if (ret < 0 && ret != -ENODEV)
|
2020-07-22 11:35:05 +09:00
|
|
|
pr_err_ratelimited("failed to send lookup notification %d\n",
|
|
|
|
ret);
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
static int announce_servers(struct sockaddr_qrtr *sq)
|
|
|
|
{
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct qrtr_node *node;
|
2020-06-19 05:35:08 +09:00
|
|
|
unsigned long index;
|
2020-10-05 16:16:42 +09:00
|
|
|
int ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2022-05-23 21:22:23 +09:00
|
|
|
node = node_get(qrtr_ns.local_node);
|
|
|
|
if (!node)
|
|
|
|
return 0;
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
/* Announce the list of servers registered in this node */
|
2022-05-23 21:22:23 +09:00
|
|
|
xa_for_each(&node->servers, index, srv) {
|
|
|
|
ret = service_announce_new(sq, srv);
|
|
|
|
if (ret < 0) {
|
|
|
|
if (ret == -ENODEV)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
pr_err("failed to announce new service %d\n", ret);
|
|
|
|
return ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
}
|
2022-05-23 21:22:23 +09:00
|
|
|
|
2020-10-05 16:16:42 +09:00
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct qrtr_server *server_add(unsigned int service,
|
|
|
|
unsigned int instance,
|
|
|
|
unsigned int node_id,
|
|
|
|
unsigned int port)
|
|
|
|
{
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct qrtr_server *old;
|
|
|
|
struct qrtr_node *node;
|
|
|
|
|
|
|
|
if (!service || !port)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
srv = kzalloc(sizeof(*srv), GFP_KERNEL);
|
|
|
|
if (!srv)
|
2020-02-26 23:51:53 +09:00
|
|
|
return NULL;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
srv->service = service;
|
|
|
|
srv->instance = instance;
|
|
|
|
srv->node = node_id;
|
|
|
|
srv->port = port;
|
|
|
|
|
|
|
|
node = node_get(node_id);
|
|
|
|
if (!node)
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
/* Delete the old server on the same port */
|
2020-06-19 05:35:08 +09:00
|
|
|
old = xa_store(&node->servers, port, srv, GFP_KERNEL);
|
2020-02-21 00:13:26 +09:00
|
|
|
if (old) {
|
2020-06-19 05:35:08 +09:00
|
|
|
if (xa_is_err(old)) {
|
|
|
|
pr_err("failed to add server [0x%x:0x%x] ret:%d\n",
|
|
|
|
srv->service, srv->instance, xa_err(old));
|
|
|
|
goto err;
|
|
|
|
} else {
|
|
|
|
kfree(old);
|
|
|
|
}
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
2020-04-21 16:40:54 +09:00
|
|
|
trace_qrtr_ns_server_add(srv->service, srv->instance,
|
|
|
|
srv->node, srv->port);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
NS_INFO("%s: [0x%x:0x%x]@[0x%x:0x%x]\n", __func__, srv->service,
|
|
|
|
srv->instance, srv->node, srv->port);
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
return srv;
|
|
|
|
|
|
|
|
err:
|
|
|
|
kfree(srv);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-04-03 15:58:51 +09:00
|
|
|
static int server_del(struct qrtr_node *node, unsigned int port, bool bcast)
|
2020-02-21 00:13:26 +09:00
|
|
|
{
|
|
|
|
struct qrtr_lookup *lookup;
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct list_head *li;
|
|
|
|
|
2020-06-19 05:35:08 +09:00
|
|
|
srv = xa_load(&node->servers, port);
|
2020-02-21 00:13:26 +09:00
|
|
|
if (!srv)
|
2021-03-23 04:07:05 +09:00
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_erase(&node->servers, port);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
/* Broadcast the removal of local servers */
|
2023-04-03 15:58:51 +09:00
|
|
|
if (srv->node == qrtr_ns.local_node && bcast)
|
2020-02-21 00:13:26 +09:00
|
|
|
service_announce_del(&qrtr_ns.bcast_sq, srv);
|
|
|
|
|
|
|
|
/* Announce the service's disappearance to observers */
|
|
|
|
list_for_each(li, &qrtr_ns.lookups) {
|
|
|
|
lookup = container_of(li, struct qrtr_lookup, li);
|
|
|
|
if (lookup->service && lookup->service != srv->service)
|
|
|
|
continue;
|
|
|
|
if (lookup->instance && lookup->instance != srv->instance)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
lookup_notify(&lookup->sq, srv, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
kfree(srv);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-02 16:03:04 +09:00
|
|
|
static int say_hello(struct sockaddr_qrtr *dest)
|
|
|
|
{
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct kvec iv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = cpu_to_le32(QRTR_TYPE_HELLO);
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)dest;
|
|
|
|
msg.msg_namelen = sizeof(*dest);
|
|
|
|
|
|
|
|
ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
|
|
|
if (ret < 0)
|
2020-05-06 08:11:44 +09:00
|
|
|
pr_err("failed to send hello msg %d\n", ret);
|
2020-03-02 16:03:04 +09:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
/* Announce the list of servers registered on the local node */
|
|
|
|
static int ctrl_cmd_hello(struct sockaddr_qrtr *sq)
|
|
|
|
{
|
2020-03-02 16:03:04 +09:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = say_hello(sq);
|
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
return announce_servers(sq);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ctrl_cmd_bye(struct sockaddr_qrtr *from)
|
|
|
|
{
|
|
|
|
struct qrtr_node *local_node;
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct sockaddr_qrtr sq;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct qrtr_node *node;
|
2020-06-19 05:35:08 +09:00
|
|
|
unsigned long index;
|
2020-02-21 00:13:26 +09:00
|
|
|
struct kvec iv;
|
2020-10-05 16:16:42 +09:00
|
|
|
int ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
node = node_get(from->sq_node);
|
|
|
|
if (!node)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Advertise removal of this client to all servers of remote node */
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_for_each(&node->servers, index, srv)
|
2023-04-03 15:58:51 +09:00
|
|
|
server_del(node, srv->port, true);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
/* Advertise the removal of this client to all local servers */
|
|
|
|
local_node = node_get(qrtr_ns.local_node);
|
|
|
|
if (!local_node)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = cpu_to_le32(QRTR_TYPE_BYE);
|
|
|
|
pkt.client.node = cpu_to_le32(from->sq_node);
|
|
|
|
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_for_each(&local_node->servers, index, srv) {
|
2020-02-21 00:13:26 +09:00
|
|
|
sq.sq_family = AF_QIPCRTR;
|
|
|
|
sq.sq_node = srv->node;
|
|
|
|
sq.sq_port = srv->port;
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)&sq;
|
|
|
|
msg.msg_namelen = sizeof(sq);
|
|
|
|
|
|
|
|
ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
2020-06-18 06:29:36 +09:00
|
|
|
if (ret < 0 && ret != -ENODEV)
|
2020-07-22 11:35:05 +09:00
|
|
|
pr_err_ratelimited("send bye failed: [0x%x:0x%x] 0x%x ret: %d\n",
|
|
|
|
srv->service, srv->instance,
|
|
|
|
srv->port, ret);
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
2020-10-05 16:16:42 +09:00
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
static int ctrl_cmd_del_client(struct sockaddr_qrtr *from,
|
|
|
|
unsigned int node_id, unsigned int port)
|
|
|
|
{
|
|
|
|
struct qrtr_node *local_node;
|
|
|
|
struct qrtr_lookup *lookup;
|
|
|
|
struct qrtr_ctrl_pkt pkt;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct sockaddr_qrtr sq;
|
|
|
|
struct qrtr_node *node;
|
|
|
|
struct list_head *tmp;
|
|
|
|
struct list_head *li;
|
2020-06-19 05:35:08 +09:00
|
|
|
unsigned long index;
|
2020-02-21 00:13:26 +09:00
|
|
|
struct kvec iv;
|
2020-10-05 16:16:42 +09:00
|
|
|
int ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
iv.iov_base = &pkt;
|
|
|
|
iv.iov_len = sizeof(pkt);
|
|
|
|
|
|
|
|
/* Local DEL_CLIENT messages comes from the port being closed */
|
|
|
|
if (from->sq_node == qrtr_ns.local_node && from->sq_port != port)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/* Remove any lookups by this client */
|
|
|
|
list_for_each_safe(li, tmp, &qrtr_ns.lookups) {
|
|
|
|
lookup = container_of(li, struct qrtr_lookup, li);
|
|
|
|
if (lookup->sq.sq_node != node_id)
|
|
|
|
continue;
|
|
|
|
if (lookup->sq.sq_port != port)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
list_del(&lookup->li);
|
|
|
|
kfree(lookup);
|
|
|
|
}
|
|
|
|
|
2023-04-03 15:58:51 +09:00
|
|
|
/* Remove the server belonging to this port but don't broadcast
|
|
|
|
* DEL_SERVER. Neighbours would've already removed the server belonging
|
|
|
|
* to this port due to the DEL_CLIENT broadcast from qrtr_port_remove().
|
|
|
|
*/
|
2020-02-21 00:13:26 +09:00
|
|
|
node = node_get(node_id);
|
|
|
|
if (node)
|
2023-04-03 15:58:51 +09:00
|
|
|
server_del(node, port, false);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
/* Advertise the removal of this client to all local servers */
|
|
|
|
local_node = node_get(qrtr_ns.local_node);
|
|
|
|
if (!local_node)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
memset(&pkt, 0, sizeof(pkt));
|
|
|
|
pkt.cmd = cpu_to_le32(QRTR_TYPE_DEL_CLIENT);
|
|
|
|
pkt.client.node = cpu_to_le32(node_id);
|
|
|
|
pkt.client.port = cpu_to_le32(port);
|
|
|
|
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_for_each(&local_node->servers, index, srv) {
|
2020-02-21 00:13:26 +09:00
|
|
|
sq.sq_family = AF_QIPCRTR;
|
|
|
|
sq.sq_node = srv->node;
|
|
|
|
sq.sq_port = srv->port;
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)&sq;
|
|
|
|
msg.msg_namelen = sizeof(sq);
|
|
|
|
|
|
|
|
ret = kernel_sendmsg(qrtr_ns.sock, &msg, &iv, 1, sizeof(pkt));
|
2020-06-18 06:29:36 +09:00
|
|
|
if (ret < 0 && ret != -ENODEV)
|
2020-07-22 11:35:05 +09:00
|
|
|
pr_err_ratelimited("del client cmd failed: [0x%x:0x%x] 0x%x %d\n",
|
|
|
|
srv->service, srv->instance,
|
|
|
|
srv->port, ret);
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
2020-10-05 16:16:42 +09:00
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
static int ctrl_cmd_new_server(struct sockaddr_qrtr *from,
|
|
|
|
unsigned int service, unsigned int instance,
|
|
|
|
unsigned int node_id, unsigned int port)
|
|
|
|
{
|
|
|
|
struct qrtr_lookup *lookup;
|
|
|
|
struct qrtr_server *srv;
|
|
|
|
struct list_head *li;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
/* Ignore specified node and port for local servers */
|
|
|
|
if (from->sq_node == qrtr_ns.local_node) {
|
|
|
|
node_id = from->sq_node;
|
|
|
|
port = from->sq_port;
|
|
|
|
}
|
|
|
|
|
|
|
|
srv = server_add(service, instance, node_id, port);
|
|
|
|
if (!srv)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (srv->node == qrtr_ns.local_node) {
|
|
|
|
ret = service_announce_new(&qrtr_ns.bcast_sq, srv);
|
|
|
|
if (ret < 0) {
|
2020-05-06 08:11:44 +09:00
|
|
|
pr_err("failed to announce new service %d\n", ret);
|
2020-02-21 00:13:26 +09:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Notify any potential lookups about the new server */
|
|
|
|
list_for_each(li, &qrtr_ns.lookups) {
|
|
|
|
lookup = container_of(li, struct qrtr_lookup, li);
|
|
|
|
if (lookup->service && lookup->service != service)
|
|
|
|
continue;
|
|
|
|
if (lookup->instance && lookup->instance != instance)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
lookup_notify(&lookup->sq, srv, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ctrl_cmd_del_server(struct sockaddr_qrtr *from,
|
|
|
|
unsigned int service, unsigned int instance,
|
|
|
|
unsigned int node_id, unsigned int port)
|
|
|
|
{
|
|
|
|
struct qrtr_node *node;
|
|
|
|
|
|
|
|
/* Ignore specified node and port for local servers*/
|
|
|
|
if (from->sq_node == qrtr_ns.local_node) {
|
|
|
|
node_id = from->sq_node;
|
|
|
|
port = from->sq_port;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Local servers may only unregister themselves */
|
|
|
|
if (from->sq_node == qrtr_ns.local_node && from->sq_port != port)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
node = node_get(node_id);
|
|
|
|
if (!node)
|
|
|
|
return -ENOENT;
|
|
|
|
|
2023-12-21 19:06:51 +09:00
|
|
|
server_del(node, port, true);
|
|
|
|
|
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
static int ctrl_cmd_new_lookup(struct sockaddr_qrtr *from,
|
|
|
|
unsigned int service, unsigned int instance)
|
|
|
|
{
|
|
|
|
struct qrtr_server_filter filter;
|
|
|
|
struct qrtr_lookup *lookup;
|
2020-06-19 05:35:08 +09:00
|
|
|
struct qrtr_server *srv;
|
2020-02-21 00:13:26 +09:00
|
|
|
struct qrtr_node *node;
|
2020-06-18 09:32:42 +09:00
|
|
|
unsigned long node_idx;
|
2020-06-19 05:35:08 +09:00
|
|
|
unsigned long srv_idx;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
/* Accept only local observers */
|
|
|
|
if (from->sq_node != qrtr_ns.local_node)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
lookup = kzalloc(sizeof(*lookup), GFP_KERNEL);
|
|
|
|
if (!lookup)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
lookup->sq = *from;
|
|
|
|
lookup->service = service;
|
|
|
|
lookup->instance = instance;
|
|
|
|
list_add_tail(&lookup->li, &qrtr_ns.lookups);
|
|
|
|
|
|
|
|
memset(&filter, 0, sizeof(filter));
|
|
|
|
filter.service = service;
|
|
|
|
filter.instance = instance;
|
|
|
|
|
2020-06-18 09:32:42 +09:00
|
|
|
xa_for_each(&nodes, node_idx, node) {
|
2020-06-19 05:35:08 +09:00
|
|
|
xa_for_each(&node->servers, srv_idx, srv) {
|
2020-02-21 00:13:26 +09:00
|
|
|
if (!server_match(srv, &filter))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
lookup_notify(from, srv, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Empty notification, to indicate end of listing */
|
|
|
|
lookup_notify(from, NULL, true);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ctrl_cmd_del_lookup(struct sockaddr_qrtr *from,
|
|
|
|
unsigned int service, unsigned int instance)
|
|
|
|
{
|
|
|
|
struct qrtr_lookup *lookup;
|
|
|
|
struct list_head *tmp;
|
|
|
|
struct list_head *li;
|
|
|
|
|
|
|
|
list_for_each_safe(li, tmp, &qrtr_ns.lookups) {
|
|
|
|
lookup = container_of(li, struct qrtr_lookup, li);
|
|
|
|
if (lookup->sq.sq_node != from->sq_node)
|
|
|
|
continue;
|
|
|
|
if (lookup->sq.sq_port != from->sq_port)
|
|
|
|
continue;
|
|
|
|
if (lookup->service != service)
|
|
|
|
continue;
|
|
|
|
if (lookup->instance && lookup->instance != instance)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
list_del(&lookup->li);
|
|
|
|
kfree(lookup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
static void ns_log_msg(const struct qrtr_ctrl_pkt *pkt,
|
|
|
|
struct sockaddr_qrtr *sq)
|
|
|
|
{
|
|
|
|
unsigned int cmd = le32_to_cpu(pkt->cmd);
|
|
|
|
|
|
|
|
if (cmd == QRTR_TYPE_HELLO || cmd == QRTR_TYPE_BYE)
|
2020-07-22 11:28:37 +09:00
|
|
|
NS_INFO("cmd:0x%x node[0x%x]\n", cmd, sq->sq_node);
|
2020-06-20 09:27:14 +09:00
|
|
|
else if (cmd == QRTR_TYPE_DEL_CLIENT)
|
2020-07-22 11:28:37 +09:00
|
|
|
NS_INFO("cmd:0x%x addr[0x%x:0x%x]\n", cmd,
|
2020-06-20 09:27:14 +09:00
|
|
|
le32_to_cpu(pkt->client.node),
|
|
|
|
le32_to_cpu(pkt->client.port));
|
|
|
|
else if (cmd == QRTR_TYPE_NEW_SERVER || cmd == QRTR_TYPE_DEL_SERVER)
|
|
|
|
NS_INFO("cmd:0x%x SVC[0x%x:0x%x] addr[0x%x:0x%x]\n", cmd,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance),
|
|
|
|
le32_to_cpu(pkt->server.node),
|
|
|
|
le32_to_cpu(pkt->server.port));
|
|
|
|
else if (cmd == QRTR_TYPE_NEW_LOOKUP || cmd == QRTR_TYPE_DEL_LOOKUP)
|
|
|
|
NS_INFO("cmd:0x%x SVC[0x%x:0x%x]\n", cmd,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance));
|
|
|
|
}
|
|
|
|
|
2020-09-16 02:57:06 +09:00
|
|
|
static void qrtr_ns_worker(struct kthread_work *work)
|
2020-02-21 00:13:26 +09:00
|
|
|
{
|
|
|
|
const struct qrtr_ctrl_pkt *pkt;
|
|
|
|
size_t recv_buf_size = 4096;
|
|
|
|
struct sockaddr_qrtr sq;
|
|
|
|
struct msghdr msg = { };
|
|
|
|
unsigned int cmd;
|
|
|
|
ssize_t msglen;
|
|
|
|
void *recv_buf;
|
|
|
|
struct kvec iv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
msg.msg_name = (struct sockaddr *)&sq;
|
|
|
|
msg.msg_namelen = sizeof(sq);
|
|
|
|
|
|
|
|
recv_buf = kzalloc(recv_buf_size, GFP_KERNEL);
|
|
|
|
if (!recv_buf)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
iv.iov_base = recv_buf;
|
|
|
|
iv.iov_len = recv_buf_size;
|
|
|
|
|
|
|
|
msglen = kernel_recvmsg(qrtr_ns.sock, &msg, &iv, 1,
|
|
|
|
iv.iov_len, MSG_DONTWAIT);
|
|
|
|
|
|
|
|
if (msglen == -EAGAIN)
|
|
|
|
break;
|
|
|
|
|
|
|
|
if (msglen < 0) {
|
|
|
|
pr_err("error receiving packet: %zd\n", msglen);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
pkt = recv_buf;
|
|
|
|
cmd = le32_to_cpu(pkt->cmd);
|
|
|
|
if (cmd < ARRAY_SIZE(qrtr_ctrl_pkt_strings) &&
|
|
|
|
qrtr_ctrl_pkt_strings[cmd])
|
2020-04-21 16:40:54 +09:00
|
|
|
trace_qrtr_ns_message(qrtr_ctrl_pkt_strings[cmd],
|
|
|
|
sq.sq_node, sq.sq_port);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-06-20 09:27:14 +09:00
|
|
|
ns_log_msg(pkt, &sq);
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
ret = 0;
|
|
|
|
switch (cmd) {
|
|
|
|
case QRTR_TYPE_HELLO:
|
|
|
|
ret = ctrl_cmd_hello(&sq);
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_BYE:
|
|
|
|
ret = ctrl_cmd_bye(&sq);
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_DEL_CLIENT:
|
|
|
|
ret = ctrl_cmd_del_client(&sq,
|
|
|
|
le32_to_cpu(pkt->client.node),
|
|
|
|
le32_to_cpu(pkt->client.port));
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_NEW_SERVER:
|
|
|
|
ret = ctrl_cmd_new_server(&sq,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance),
|
|
|
|
le32_to_cpu(pkt->server.node),
|
|
|
|
le32_to_cpu(pkt->server.port));
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_DEL_SERVER:
|
|
|
|
ret = ctrl_cmd_del_server(&sq,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance),
|
|
|
|
le32_to_cpu(pkt->server.node),
|
|
|
|
le32_to_cpu(pkt->server.port));
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_EXIT:
|
|
|
|
case QRTR_TYPE_PING:
|
|
|
|
case QRTR_TYPE_RESUME_TX:
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_NEW_LOOKUP:
|
|
|
|
ret = ctrl_cmd_new_lookup(&sq,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance));
|
|
|
|
break;
|
|
|
|
case QRTR_TYPE_DEL_LOOKUP:
|
|
|
|
ctrl_cmd_del_lookup(&sq,
|
|
|
|
le32_to_cpu(pkt->server.service),
|
|
|
|
le32_to_cpu(pkt->server.instance));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret < 0)
|
|
|
|
pr_err("failed while handling packet from %d:%d",
|
|
|
|
sq.sq_node, sq.sq_port);
|
|
|
|
}
|
|
|
|
|
|
|
|
kfree(recv_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void qrtr_ns_data_ready(struct sock *sk)
|
|
|
|
{
|
2020-09-16 02:57:06 +09:00
|
|
|
kthread_queue_work(&qrtr_ns.kworker, &qrtr_ns.work);
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
2021-01-05 14:57:54 +09:00
|
|
|
int qrtr_ns_init(void)
|
2020-02-21 00:13:26 +09:00
|
|
|
{
|
|
|
|
struct sockaddr_qrtr sq;
|
2021-12-23 10:59:20 +09:00
|
|
|
int rx_buf_sz = SZ_1M;
|
2020-02-21 00:13:26 +09:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
INIT_LIST_HEAD(&qrtr_ns.lookups);
|
2020-09-16 02:57:06 +09:00
|
|
|
kthread_init_worker(&qrtr_ns.kworker);
|
|
|
|
kthread_init_work(&qrtr_ns.work, qrtr_ns_worker);
|
2020-02-21 00:13:26 +09:00
|
|
|
|
2020-07-22 11:28:37 +09:00
|
|
|
ns_ilc = ipc_log_context_create(NS_LOG_PAGE_CNT, "qrtr_ns", 0);
|
2020-06-20 09:27:14 +09:00
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
ret = sock_create_kern(&init_net, AF_QIPCRTR, SOCK_DGRAM,
|
|
|
|
PF_QIPCRTR, &qrtr_ns.sock);
|
|
|
|
if (ret < 0)
|
2021-01-05 14:57:54 +09:00
|
|
|
return ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
ret = kernel_getsockname(qrtr_ns.sock, (struct sockaddr *)&sq);
|
|
|
|
if (ret < 0) {
|
|
|
|
pr_err("failed to get socket name\n");
|
|
|
|
goto err_sock;
|
|
|
|
}
|
|
|
|
|
2020-09-16 02:57:06 +09:00
|
|
|
qrtr_ns.task = kthread_run(kthread_worker_fn, &qrtr_ns.kworker,
|
|
|
|
"qrtr_ns");
|
|
|
|
if (IS_ERR(qrtr_ns.task)) {
|
|
|
|
pr_err("failed to spawn worker thread %ld\n",
|
|
|
|
PTR_ERR(qrtr_ns.task));
|
2020-05-29 08:05:26 +09:00
|
|
|
goto err_sock;
|
2020-09-16 02:57:06 +09:00
|
|
|
}
|
2020-05-29 08:05:26 +09:00
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
qrtr_ns.sock->sk->sk_data_ready = qrtr_ns_data_ready;
|
|
|
|
|
|
|
|
sq.sq_port = QRTR_PORT_CTRL;
|
|
|
|
qrtr_ns.local_node = sq.sq_node;
|
|
|
|
|
|
|
|
ret = kernel_bind(qrtr_ns.sock, (struct sockaddr *)&sq, sizeof(sq));
|
|
|
|
if (ret < 0) {
|
|
|
|
pr_err("failed to bind to socket\n");
|
2020-05-29 08:05:26 +09:00
|
|
|
goto err_wq;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
|
2021-12-23 10:59:20 +09:00
|
|
|
sock_setsockopt(qrtr_ns.sock, SOL_SOCKET, SO_RCVBUFFORCE,
|
2021-03-26 07:47:05 +09:00
|
|
|
KERNEL_SOCKPTR((void *)&rx_buf_sz), sizeof(rx_buf_sz));
|
|
|
|
|
2020-02-21 00:13:26 +09:00
|
|
|
qrtr_ns.bcast_sq.sq_family = AF_QIPCRTR;
|
|
|
|
qrtr_ns.bcast_sq.sq_node = QRTR_NODE_BCAST;
|
|
|
|
qrtr_ns.bcast_sq.sq_port = QRTR_PORT_CTRL;
|
|
|
|
|
2020-03-02 16:03:04 +09:00
|
|
|
ret = say_hello(&qrtr_ns.bcast_sq);
|
2020-02-21 00:13:26 +09:00
|
|
|
if (ret < 0)
|
|
|
|
goto err_wq;
|
|
|
|
|
2024-05-14 02:31:46 +09:00
|
|
|
/* As the qrtr ns socket owner and creator is the same module, we have
|
|
|
|
* to decrease the qrtr module reference count to guarantee that it
|
|
|
|
* remains zero after the ns socket is created, otherwise, executing
|
|
|
|
* "rmmod" command is unable to make the qrtr module deleted after the
|
|
|
|
* qrtr module is inserted successfully.
|
|
|
|
*
|
|
|
|
* However, the reference count is increased twice in
|
|
|
|
* sock_create_kern(): one is to increase the reference count of owner
|
|
|
|
* of qrtr socket's proto_ops struct; another is to increment the
|
|
|
|
* reference count of owner of qrtr proto struct. Therefore, we must
|
|
|
|
* decrement the module reference count twice to ensure that it keeps
|
|
|
|
* zero after server's listening socket is created. Of course, we
|
|
|
|
* must bump the module reference count twice as well before the socket
|
|
|
|
* is closed.
|
|
|
|
*/
|
|
|
|
module_put(qrtr_ns.sock->ops->owner);
|
|
|
|
module_put(qrtr_ns.sock->sk->sk_prot_creator->owner);
|
|
|
|
|
2021-01-05 14:57:54 +09:00
|
|
|
return 0;
|
2020-02-21 00:13:26 +09:00
|
|
|
|
|
|
|
err_wq:
|
2020-09-16 02:57:06 +09:00
|
|
|
kthread_stop(qrtr_ns.task);
|
2020-02-21 00:13:26 +09:00
|
|
|
err_sock:
|
|
|
|
sock_release(qrtr_ns.sock);
|
2021-01-05 14:57:54 +09:00
|
|
|
return ret;
|
2020-02-21 00:13:26 +09:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(qrtr_ns_init);
|
|
|
|
|
|
|
|
void qrtr_ns_remove(void)
|
|
|
|
{
|
2020-09-16 02:57:06 +09:00
|
|
|
kthread_flush_worker(&qrtr_ns.kworker);
|
|
|
|
kthread_stop(qrtr_ns.task);
|
2024-05-14 02:31:46 +09:00
|
|
|
|
|
|
|
/* sock_release() expects the two references that were put during
|
|
|
|
* qrtr_ns_init(). This function is only called during module remove,
|
|
|
|
* so try_stop_module() has already set the refcnt to 0. Use
|
|
|
|
* __module_get() instead of try_module_get() to successfully take two
|
|
|
|
* references.
|
|
|
|
*/
|
|
|
|
__module_get(qrtr_ns.sock->ops->owner);
|
|
|
|
__module_get(qrtr_ns.sock->sk->sk_prot_creator->owner);
|
2020-02-21 00:13:26 +09:00
|
|
|
sock_release(qrtr_ns.sock);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(qrtr_ns_remove);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
|
|
|
|
MODULE_DESCRIPTION("Qualcomm IPC Router Nameservice");
|
|
|
|
MODULE_LICENSE("Dual BSD/GPL");
|