Linux 6.6.135
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.6.135 kernel.
All users of the 6.6 kernel series must upgrade.
The updated 6.6.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.6.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts | 2 arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 24 - arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts | 2 arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 1 arch/mips/include/asm/cpu-features.h | 1 arch/mips/include/asm/cpu-info.h | 2 arch/mips/include/asm/mipsregs.h | 2 arch/mips/kernel/cpu-probe.c | 13 arch/mips/kernel/cpu-r3k-probe.c | 2 arch/mips/mm/tlb-r4k.c | 285 +++++++++++++---- arch/x86/include/asm/msr-index.h | 3 arch/x86/kernel/cpu/amd.c | 3 crypto/asymmetric_keys/x509_cert_parser.c | 8 drivers/edac/edac_mc.c | 6 drivers/gpu/drm/drm_file.c | 5 drivers/gpu/drm/drm_mode_config.c | 9 drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 26 + drivers/input/misc/uinput.c | 35 +- drivers/mmc/host/vub300.c | 2 drivers/net/ethernet/altera/altera_tse_main.c | 1 drivers/net/ethernet/mellanox/mlx5/core/main.c | 1 drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c | 2 drivers/net/ethernet/qualcomm/qca_uart.c | 2 drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 11 drivers/net/virtio_net.c | 16 drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c | 2 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 2 drivers/nfc/pn533/uart.c | 11 drivers/pci/pci-driver.c | 8 drivers/pci/pci.c | 10 drivers/pci/pci.h | 1 drivers/pmdomain/imx/imx8mp-blk-ctrl.c | 8 drivers/ufs/core/ufshcd.c | 31 + drivers/ufs/host/ufshcd-pci.c | 2 drivers/ufs/host/ufshcd-pltfrm.c | 25 - drivers/usb/gadget/function/f_hid.c | 11 include/net/netfilter/nf_conntrack_timeout.h | 1 include/trace/events/rxrpc.h | 2 include/ufs/ufshcd.h | 1 lib/crypto/chacha.c | 4 mm/filemap.c | 11 net/batman-adv/bridge_loop_avoidance.c | 27 + net/batman-adv/translation-table.c | 9 net/ipv6/seg6_iptunnel.c | 41 +- net/mptcp/pm_netlink.c | 24 - net/mptcp/protocol.c | 2 net/mptcp/protocol.h | 1 net/mptcp/subflow.c | 15 net/netfilter/nft_ct.c | 2 net/netfilter/nft_set_pipapo.c | 20 - net/rfkill/core.c | 35 +- net/rxrpc/af_rxrpc.c | 6 net/rxrpc/call_object.c | 25 - net/rxrpc/io_thread.c | 3 net/rxrpc/key.c | 2 net/rxrpc/rxkad.c | 63 ++- net/rxrpc/server_key.c | 3 net/tipc/group.c | 6 net/tls/tls_sw.c | 10 net/xfrm/xfrm_user.c | 3 sound/soc/generic/simple-card-utils.c | 7 62 files changed, 596 insertions(+), 304 deletions(-)
Anderson Nascimento (1):
rxrpc: Fix key reference count leak from call->key
Andrea Mayer (1):
seg6: separate dst_cache for input and output paths in seg6 lwtunnel
André Draszik (1):
scsi: ufs: core: Fix use-after free in init error and remove paths
Baolin Wang (1):
mm: filemap: fix nr_pages calculation overflow in filemap_map_pages()
Borislav Petkov (AMD) (2):
x86/CPU: Fix FPDSS on Zen1
EDAC/mc: Fix error path ordering in edac_mc_alloc()
David Carlier (2):
net: altera-tse: fix skb leak on DMA mapping error in tse_start_xmit()
net: lan966x: fix page_pool error handling in lan966x_fdma_rx_alloc_page_pool()
David Howells (3):
rxrpc: Fix call removal to use RCU safe deletion
rxrpc: Fix key/keyring checks in setsockopt(RXRPC_SECURITY_KEY/KEYRING)
rxrpc: Fix missing error checks for rxkad encryption/decryption failure
Dmitry Torokhov (1):
Input: uinput - take event lock when submitting FF request "event"
Douya Le (1):
rxrpc: Only put the call ref if one was acquired
Eric Biggers (1):
lib/crypto: chacha: Zeroize permuted_state before it leaves scope
Florian Westphal (1):
netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR
Greg Kroah-Hartman (3):
xfrm_user: fix info leak in build_report()
net: rfkill: prevent unlimited numbers of rfkill events from being created Linux 6.6.135
Haoze Xie (1):
batman-adv: hold claim backbone gateways by reference
Jacky Bai (1):
pmdomain: imx8mp-blk-ctrl: Keep the NOC_HDCP clock enabled
Jiayuan Chen (1):
mptcp: fix slab-use-after-free in __inet_lookup_established
Johan Hovold (2):
wifi: rt2x00usb: fix devres lifetime
mmc: vub300: fix NULL-deref on disconnect
Kuninori Morimoto (1):
ASoC: simple-card-utils: Don't use __free(device_node) at graph_util_parse_dai()
Lukas Wunner (1):
X.509: Fix out-of-bounds access when parsing extensions
Luxiao Xu (1):
rxrpc: fix reference count leak in rxrpc_server_keyring()
Maarten Lankhorst (1):
Revert "drm: Fix use-after-free on framebuffers and property blobs when calling drm_dev_unplug"
Maciej W. Rozycki (3):
MIPS: Always record SEGBITS in cpu_data.vmbits
MIPS: mm: Suppress TLB uniquification on EHINV hardware
MIPS: mm: Rewrite TLB uniquification for the hidden bit feature
Manivannan Sadhasivam (1):
Revert "PCI: Enable ACS after configuring IOMMU for OF platforms"
Matthieu Baerts (NGI0) (1):
Revert "mptcp: add needs_id for netlink appending addr"
Michael Guralnik (1):
net/mlx5: Update the list of the PCI supported devices
Michael Zimmermann (1):
usb: gadget: f_hid: move list and spinlock inits from bind to alloc
Mikhail Gavrilov (1):
Input: uinput - fix circular locking dependency with ff-core
Muhammad Alifa Ramdhan (1):
net/tls: fix use-after-free in -EBUSY error path of tls_do_encryption
Oleh Konko (1):
tipc: fix bc_ackers underflow on duplicate GRP_ACK_MSG
Pengpeng Hou (2):
nfc: pn533: allocate rx skb before consuming bytes
net: qualcomm: qca_uart: report the consumed byte on RX skb allocation failure
Ruide Cao (1):
batman-adv: reject oversized global TT response buffers
Sebastian Brzezinka (1):
drm/i915/gt: fix refcount underflow in intel_engine_park_heartbeat
Sebastian Krzyszkowiak (2):
Revert "arm64: dts: imx8mq-librem5: Set the DVS voltages lower"
arm64: dts: imx8mq-librem5: Bump BUCK1 suspend voltage up to 0.85V
Shawn Guo (2):
arm64: dts: hisilicon: poplar: Correct PCIe reset GPIO polarity
arm64: dts: hisilicon: hi3798cv200: Add missing dma-ranges
Srujana Challa (1):
virtio_net: clamp rss_max_key_size to NETDEV_RSS_KEY_LEN
Thomas Fourier (1):
wifi: brcmsmac: Fix dma_free_coherent() size
Tuan Do (1):
netfilter: nft_ct: fix use-after-free in timeout object destroy
Tyllis Xu (1):
net: stmmac: fix integer underflow in chain mode
Yasuaki Torimaru (1):
xfrm: clear trailing padding in build_polexpire()
Yuqi Xu (1):
rxrpc: reject undecryptable rxkad response tickets
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 6 -SUBLEVEL = 134 +SUBLEVEL = 135 EXTRAVERSION = NAME = Pinguïn Aangedreven
arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts +1 -1
@@ -7,7 +7,7 @@ &a53_opp_table { opp-1000000000 { - opp-microvolt = <950000>; + opp-microvolt = <1000000>; }; };
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi +7 -17
@@ -847,9 +847,9 @@ buck1_reg: BUCK1 { regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <880000>; - rohm,dvs-idle-voltage = <820000>; - rohm,dvs-suspend-voltage = <810000>; + rohm,dvs-run-voltage = <900000>; + rohm,dvs-idle-voltage = <850000>; + rohm,dvs-suspend-voltage = <850000>; regulator-always-on; };
@@ -859,8 +859,8 @@ buck2_reg: BUCK2 { regulator-max-microvolt = <1300000>; regulator-boot-on; regulator-ramp-delay = <1250>; - rohm,dvs-run-voltage = <950000>; - rohm,dvs-idle-voltage = <850000>; + rohm,dvs-run-voltage = <1000000>; + rohm,dvs-idle-voltage = <900000>; regulator-always-on; };
@@ -869,14 +869,14 @@ buck3_reg: BUCK3 { regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; regulator-boot-on; - rohm,dvs-run-voltage = <850000>; + rohm,dvs-run-voltage = <900000>; }; buck4_reg: BUCK4 { regulator-name = "buck4"; regulator-min-microvolt = <700000>; regulator-max-microvolt = <1300000>; - rohm,dvs-run-voltage = <930000>; + rohm,dvs-run-voltage = <1000000>; }; buck5_reg: BUCK5 {
@@ -1410,13 +1410,3 @@ &wdog1 { fsl,ext-reset-output; status = "okay"; }; - -&a53_opp_table { - opp-1000000000 { - opp-microvolt = <850000>; - }; - - opp-1500000000 { - opp-microvolt = <950000>; - }; -};
arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts +1 -1
@@ -179,7 +179,7 @@ &ohci { }; &pcie { - reset-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>; + reset-gpios = <&gpio4 4 GPIO_ACTIVE_LOW>; vpcie-supply = <®_pcie>; status = "okay"; };
arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi +1 -0
@@ -81,6 +81,7 @@ soc: soc@f0000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x0 0xf0000000 0x10000000>; + dma-ranges = <0x0 0x0 0x0 0x40000000>; crg: clock-reset-controller@8a22000 { compatible = "hisilicon,hi3798cv200-crg", "syscon", "simple-mfd";
arch/mips/include/asm/cpu-features.h +0 -1
@@ -484,7 +484,6 @@# endif # ifndef cpu_vmbits# define cpu_vmbits cpu_data[0].vmbits -# define __NEED_VMBITS_PROBE# endif #endif
arch/mips/include/asm/cpu-info.h +0 -2
@@ -80,9 +80,7 @@ struct cpuinfo_mips {int srsets;/* Shadow register sets */ int package;/* physical package number */ unsigned int globalnumber; -#ifdef CONFIG_64BIT int vmbits;/* Virtual memory size in bits */ -#endif void *data;/* Additional data */ unsigned int watch_reg_count;/* Number that exist */ unsigned int watch_reg_use_cnt;/* Usable by ptrace */
arch/mips/include/asm/mipsregs.h +2 -0
@@ -1714,6 +1714,8 @@ do { \#define read_c0_entryhi () __read_ulong_c0_register($10, 0)#define write_c0_entryhi (val) __write_ulong_c0_register($10, 0, val) +#define read_c0_entryhi_64 () __read_64bit_c0_register($10, 0) +#define write_c0_entryhi_64 (val) __write_64bit_c0_register($10, 0, val)#define read_c0_guestctl1 () __read_32bit_c0_register($10, 4)#define write_c0_guestctl1 (val) __write_32bit_c0_register($10, 4, val)
arch/mips/kernel/cpu-probe.c +8 -5
@@ -208,11 +208,14 @@ static inline void set_elf_base_platform(const char *plat)static inline void cpu_probe_vmbits (struct cpuinfo_mips *c) { -#ifdef __NEED_VMBITS_PROBE -write_c0_entryhi (0x3fffffffffffe000ULL ); -back_to_back_c0_hazard (); - c->vmbits =fls64 (read_c0_entryhi () &0x3fffffffffffe000ULL ); -#endif +int vmbits =31 ; + +if (cpu_has_64bits) { +write_c0_entryhi_64 (0x3fffffffffffe000ULL ); +back_to_back_c0_hazard (); + vmbits =fls64 (read_c0_entryhi_64 () &0x3fffffffffffe000ULL ); + } + c->vmbits = vmbits; }static void set_isa (struct cpuinfo_mips *c,unsigned int isa)
arch/mips/kernel/cpu-r3k-probe.c +2 -0
@@ -138,6 +138,8 @@ void cpu_probe(void)else cpu_set_nofpu_opts (c); + c->vmbits =31 ; +reserve_exception_space (0 ,0x400 ); }
arch/mips/mm/tlb-r4k.c +230 -55
336 lines not on this page · raw message
arch/x86/include/asm/msr-index.h +3 -0
@@ -582,6 +582,9 @@#define MSR_AMD64_DC_CFG 0xc0011022#define MSR_AMD64_TW_CFG 0xc0011023 +#define MSR_AMD64_FP_CFG 0xc0011028 +#define MSR_AMD64_FP_CFG_ZEN1_DENORM_FIX_BIT 9 +#define MSR_AMD64_DE_CFG 0xc0011029#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)
arch/x86/kernel/cpu/amd.c +3 -0
@@ -1112,6 +1112,9 @@ static void init_amd_zen1(struct cpuinfo_x86 *c)msr_clear_bit (MSR_K7_HWCR ,MSR_K7_HWCR_IRPERF_EN_BIT );clear_cpu_cap (c,X86_FEATURE_IRPERF ); } + +pr_notice_once ("AMD Zen1 FPDSS bug detected, enabling mitigation.\n" ); +msr_set_bit (MSR_AMD64_FP_CFG ,MSR_AMD64_FP_CFG_ZEN1_DENORM_FIX_BIT ); }static bool cpu_has_zenbleed_microcode (void )
crypto/asymmetric_keys/x509_cert_parser.c +4 -4
@@ -592,10 +592,10 @@ int x509_process_extension(void *context, size_t hdrlen,* 0x04 is where keyCertSign lands in this bit string * 0x80 is where digitalSignature lands in this bit string */ -if (v[0 ] !=ASN1_BTS ) -return -EBADMSG ;if (vlen <4 )return -EBADMSG ; +if (v[0 ] !=ASN1_BTS ) +return -EBADMSG ;if (v[2 ] >=8 )return -EBADMSG ;if (v[3 ] &0x80 )
@@ -628,10 +628,10 @@ int x509_process_extension(void *context, size_t hdrlen,* (Expect 0xFF if the CA is TRUE) * vlen should match the entire extension size */ -if (v[0 ] != (ASN1_CONS_BIT |ASN1_SEQ )) -return -EBADMSG ;if (vlen <2 )return -EBADMSG ; +if (v[0 ] != (ASN1_CONS_BIT |ASN1_SEQ )) +return -EBADMSG ;if (v[1 ] != vlen -2 )return -EBADMSG ;/* Empty SEQUENCE means CA:FALSE (default value omitted per DER) */
drivers/edac/edac_mc.c +3 -3
@@ -369,13 +369,13 @@ struct mem_ctl_info *edac_mc_alloc(unsigned int mc_num,if (!mci->layers) goto error; + mci->dev.release = mci_release; +device_initialize (&mci->dev); + mci->pvt_info =kzalloc (sz_pvt,GFP_KERNEL );if (!mci->pvt_info) goto error; - mci->dev.release = mci_release; -device_initialize (&mci->dev); -/* setup index and various internal pointers */ mci->mc_idx = mc_num; mci->tot_dimms = tot_dimms;
drivers/gpu/drm/drm_file.c +1 -4
@@ -243,7 +243,6 @@ static void drm_events_release(struct drm_file *file_priv)void drm_file_free (struct drm_file *file) {struct drm_device *dev; -int idx;if (!file)return ;
@@ -269,11 +268,9 @@ void drm_file_free(struct drm_file *file)drm_events_release (file); -if (drm_core_check_feature (dev,DRIVER_MODESET ) && -drm_dev_enter (dev, &idx)) { +if (drm_core_check_feature (dev,DRIVER_MODESET )) {drm_fb_release (file);drm_property_destroy_user_blobs (dev, file); -drm_dev_exit (idx); }if (drm_core_check_feature (dev,DRIVER_SYNCOBJ ))
drivers/gpu/drm/drm_mode_config.c +3 -6
@@ -546,13 +546,10 @@ void drm_mode_config_cleanup(struct drm_device *dev)*/ WARN_ON (!list_empty (&dev->mode_config.fb_list));list_for_each_entry_safe (fb, fbt, &dev->mode_config.fb_list, head) { -if (list_empty (&fb->filp_head) ||drm_framebuffer_read_refcount (fb) >1 ) { -struct drm_printer p =drm_debug_printer ("[leaked fb]" ); +struct drm_printer p =drm_debug_printer ("[leaked fb]" ); -drm_printf (&p,"framebuffer[%u]:\n" , fb->base.id); -drm_framebuffer_print_info (&p,1 , fb); - } -list_del_init (&fb->filp_head); +drm_printf (&p,"framebuffer[%u]:\n" , fb->base.id); +drm_framebuffer_print_info (&p,1 , fb);drm_framebuffer_free (&fb->base.refcount); }
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c +18 -8
@@ -144,10 +144,12 @@ static void heartbeat(struct work_struct *wrk)/* Just in case everything has gone horribly wrong, give it a kick */ intel_engine_flush_submission (engine); - rq = engine->heartbeat.systole; -if (rq &&i915_request_completed (rq)) { -i915_request_put (rq); - engine->heartbeat.systole =NULL ; + rq =xchg (&engine->heartbeat.systole,NULL ); +if (rq) { +if (i915_request_completed (rq)) +i915_request_put (rq); +else + engine->heartbeat.systole = rq; }if (!intel_engine_pm_get_if_awake (engine))
@@ -228,8 +230,11 @@ static void heartbeat(struct work_struct *wrk) unlock:mutex_unlock (&ce->timeline->mutex); out: -if (!engine->i915->params.enable_hangcheck || !next_heartbeat (engine)) -i915_request_put (fetch_and_zero (&engine->heartbeat.systole)); +if (!engine->i915->params.enable_hangcheck || !next_heartbeat (engine)) { + rq =xchg (&engine->heartbeat.systole,NULL ); +if (rq) +i915_request_put (rq); + }intel_engine_pm_put (engine); }
@@ -243,8 +248,13 @@ void intel_engine_unpark_heartbeat(struct intel_engine_cs *engine)void intel_engine_park_heartbeat (struct intel_engine_cs *engine) { -if (cancel_delayed_work (&engine->heartbeat.work)) -i915_request_put (fetch_and_zero (&engine->heartbeat.systole)); +if (cancel_delayed_work (&engine->heartbeat.work)) { +struct i915_request *rq; + + rq =xchg (&engine->heartbeat.systole,NULL ); +if (rq) +i915_request_put (rq); + } }void intel_gt_unpark_heartbeats (struct intel_gt *gt)
drivers/input/misc/uinput.c +28 -7
@@ -25,8 +25,10 @@#include <linux/module.h> #include <linux/init.h> #include <linux/fs.h> +#include <linux/lockdep.h> #include <linux/miscdevice.h> #include <linux/overflow.h> +#include <linux/spinlock.h> #include <linux/input/mt.h> #include "../input-compat.h"
@@ -57,6 +59,7 @@ struct uinput_device {struct input_dev *dev;struct mutex mutex;enum uinput_state state; +spinlock_t state_lock;wait_queue_head_t waitq;unsigned char ready;unsigned char head;
@@ -75,6 +78,8 @@ static int uinput_dev_event(struct input_dev *dev,struct uinput_device *udev =input_get_drvdata (dev);struct timespec64 ts; +lockdep_assert_held (&dev->event_lock); +ktime_get_ts64 (&ts); udev->buff[udev->head] = (struct input_event ) {
@@ -146,27 +151,26 @@ static void uinput_request_release_slot(struct uinput_device *udev,static int uinput_request_send (struct uinput_device *udev,struct uinput_request *request) { -int retval; +unsigned long flags; +int retval =0 ; - retval =mutex_lock_interruptible (&udev->mutex); -if (retval) -return retval; +spin_lock (&udev->state_lock);if (udev->state !=UIST_CREATED ) { retval = -ENODEV ; goto out; } -init_completion (&request->done); -/* * Tell our userspace application about this new request * by queueing an input event. */ +spin_lock_irqsave (&udev->dev->event_lock, flags);uinput_dev_event (udev->dev,EV_UINPUT , request->code, request->id); +spin_unlock_irqrestore (&udev->dev->event_lock, flags); out: -mutex_unlock (&udev->mutex); +spin_unlock (&udev->state_lock);return retval; }
@@ -175,6 +179,13 @@ static int uinput_request_submit(struct uinput_device *udev, {int retval; +/* +* Initialize completion before allocating the request slot. +* Once the slot is allocated, uinput_flush_requests() may +* complete it at any time, so it must be initialized first. +*/ +init_completion (&request->done); + retval =uinput_request_reserve_slot (udev, request);if (retval)return retval;
@@ -289,7 +300,14 @@ static void uinput_destroy_device(struct uinput_device *udev)struct input_dev *dev = udev->dev;enum uinput_state old_state = udev->state; +/* +* Update state under state_lock so that concurrent +* uinput_request_send() sees the state change before we +* flush pending requests and tear down the device. +*/ +spin_lock (&udev->state_lock); udev->state =UIST_NEW_DEVICE ; +spin_unlock (&udev->state_lock);if (dev) { name = dev->name;
@@ -366,7 +384,9 @@ static int uinput_create_device(struct uinput_device *udev)if (error) goto fail2; +spin_lock (&udev->state_lock); udev->state =UIST_CREATED ; +spin_unlock (&udev->state_lock);return 0 ;
@@ -384,6 +404,7 @@ static int uinput_open(struct inode *inode, struct file *file)return -ENOMEM ;mutex_init (&newdev->mutex); +spin_lock_init (&newdev->state_lock);spin_lock_init (&newdev->requests_lock);init_waitqueue_head (&newdev->requests_waitq);init_waitqueue_head (&newdev->waitq);
drivers/mmc/host/vub300.c +1 -1
@@ -2369,8 +2369,8 @@ static void vub300_disconnect(struct usb_interface *interface)usb_set_intfdata (interface,NULL );/* prevent more I/O from starting */ vub300->interface =NULL ; -kref_put (&vub300->kref, vub300_delete);mmc_remove_host (mmc); +kref_put (&vub300->kref, vub300_delete);pr_info ("USB vub300 remote SDIO host controller[%d]" " now disconnected" , ifnum);return ;
drivers/net/ethernet/altera/altera_tse_main.c +1 -0
@@ -574,6 +574,7 @@ static netdev_tx_t tse_start_xmit(struct sk_buff *skb, struct net_device *dev) DMA_TO_DEVICE);if (dma_mapping_error (priv->device, dma_addr)) {netdev_err (priv->dev,"%s: DMA mapping error\n" , __func__); +dev_kfree_skb_any (skb); ret =NETDEV_TX_OK ; goto out; }
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -0
@@ -2208,6 +2208,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, 0x1023) }, /* ConnectX-8 */ { PCI_VDEVICE(MELLANOX, 0x1025) }, /* ConnectX-9 */ { PCI_VDEVICE(MELLANOX, 0x1027) }, /* ConnectX-10 */ + { PCI_VDEVICE(MELLANOX, 0x2101) }, /* ConnectX-10 NVLink-C2C */ { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */ { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */ { PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c +2 -0
@@ -85,6 +85,8 @@ static int lan966x_fdma_rx_alloc_page_pool(struct lan966x_rx *rx) pp_params.dma_dir =DMA_BIDIRECTIONAL ; rx->page_pool =page_pool_create (&pp_params); +if (unlikely (IS_ERR (rx->page_pool))) +return PTR_ERR (rx->page_pool);for (int i =0 ; i < lan966x->num_phys_ports; ++i) {struct lan966x_port *port;
drivers/net/ethernet/qualcomm/qca_uart.c +1 -1
@@ -114,7 +114,7 @@ qca_tty_receive(struct serdev_device *serdev, const unsigned char *data,if (!qca->rx_skb) {netdev_dbg (netdev,"recv: out of RX resources\n" ); n_stats->rx_errors++; -return i; +return i +1 ; } } }
drivers/net/ethernet/stmicro/stmmac/chain_mode.c +6 -5
@@ -20,7 +20,7 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,unsigned int nopaged_len =skb_headlen (skb);struct stmmac_priv *priv = tx_q->priv_data;unsigned int entry = tx_q->cur_tx; -unsigned int bmax, des2; +unsigned int bmax, buf_len, des2;unsigned int i =1 , len;struct dma_desc *desc;
@@ -31,17 +31,18 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,else bmax = BUF_SIZE_2KiB; - len = nopaged_len - bmax; + buf_len = min_t(unsigned int, nopaged_len, bmax); + len = nopaged_len - buf_len; des2 =dma_map_single (priv->device, skb->data, - bmax,DMA_TO_DEVICE ); + buf_len,DMA_TO_DEVICE ); desc->des2 =cpu_to_le32 (des2);if (dma_mapping_error (priv->device, des2))return -1 ; tx_q->tx_skbuff_dma[entry].buf = des2; - tx_q->tx_skbuff_dma[entry].len = bmax; + tx_q->tx_skbuff_dma[entry].len = buf_len;/* do not close the descriptor and do not set own bit */ -stmmac_prepare_tx_desc (priv, desc,1 , bmax, csum,STMMAC_CHAIN_MODE , +stmmac_prepare_tx_desc (priv, desc,1 , buf_len, csum,STMMAC_CHAIN_MODE ,0 , false, skb->len);while (len !=0 ) {
drivers/net/virtio_net.c +8 -8
@@ -4465,6 +4465,7 @@ static int virtnet_probe(struct virtio_device *vdev)struct virtnet_info *vi;u16 max_queue_pairs;int mtu =0 ; +u16 key_sz;/* Find if host supports multiqueue/rss virtio_net device */ max_queue_pairs =1 ;
@@ -4589,14 +4590,13 @@ static int virtnet_probe(struct virtio_device *vdev) }if (vi->has_rss || vi->has_rss_hash_report) { - vi->rss_key_size = -virtio_cread8 (vdev, offsetof(struct virtio_net_config , rss_max_key_size)); -if (vi->rss_key_size >VIRTIO_NET_RSS_MAX_KEY_SIZE ) { -dev_err (&vdev->dev,"rss_max_key_size=%u exceeds the limit %u.\n" , - vi->rss_key_size,VIRTIO_NET_RSS_MAX_KEY_SIZE ); - err = -EINVAL ; - goto free; - } + key_sz =virtio_cread8 (vdev, offsetof(struct virtio_net_config , rss_max_key_size)); + + vi->rss_key_size =min_t (u16, key_sz,VIRTIO_NET_RSS_MAX_KEY_SIZE ); +if (key_sz > vi->rss_key_size) +dev_warn (&vdev->dev, +"rss_max_key_size=%u exceeds driver limit %u, clamping\n" , + key_sz, vi->rss_key_size); vi->rss_hash_types_supported =virtio_cread32 (vdev, offsetof(struct virtio_net_config , supported_hash_types));
drivers/net/wireless/broadcom/brcm80211/brcmsmac/dma.c +1 -1
@@ -483,7 +483,7 @@ static void *dma_ringalloc(struct dma_info *di, u32 boundary, uint size,if (((desc_strtaddr + size -1 ) & boundary) != (desc_strtaddr & boundary)) { *alignbits =dma_align_sizetobits (size); -dma_free_coherent (di->dmadev, size, va, *descpa); +dma_free_coherent (di->dmadev, *alloced, va, *descpa); va =dma_alloc_consistent (di, size, *alignbits, alloced, descpa); }
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +1 -1
@@ -830,7 +830,7 @@ int rt2x00usb_probe(struct usb_interface *usb_intf,if (retval) goto exit_free_device; - rt2x00dev->anchor =devm_kmalloc (&usb_dev->dev, + rt2x00dev->anchor =devm_kmalloc (&usb_intf->dev,sizeof (struct usb_anchor ),GFP_KERNEL );if (!rt2x00dev->anchor) {
drivers/nfc/pn533/uart.c +8 -3
@@ -211,6 +211,13 @@ static int pn532_receive_buf(struct serdev_device *serdev,del_timer (&dev->cmd_timeout);for (i =0 ; i < count; i++) { +if (!dev->recv_skb) { + dev->recv_skb =alloc_skb (PN532_UART_SKB_BUFF_LEN , +GFP_KERNEL ); +if (!dev->recv_skb) +return i; + } +if (unlikely (!skb_tailroom (dev->recv_skb)))skb_trim (dev->recv_skb,0 );
@@ -219,9 +226,7 @@ static int pn532_receive_buf(struct serdev_device *serdev,continue ;pn533_recv_frame (dev->priv, dev->recv_skb,0 ); - dev->recv_skb =alloc_skb (PN532_UART_SKB_BUFF_LEN ,GFP_KERNEL ); -if (!dev->recv_skb) -return 0 ; + dev->recv_skb =NULL ; }return i;
drivers/pci/pci-driver.c +0 -8
@@ -1668,14 +1668,6 @@ static int pci_dma_configure(struct device *dev) ret =acpi_dma_configure (dev,acpi_get_dma_attr (adev)); } -/* -* Attempt to enable ACS regardless of capability because some Root -* Ports (e.g. those quirked with *_intel_pch_acs_*) do not have -* the standard ACS capability but still support ACS via those -* quirks. -*/ -pci_enable_acs (to_pci_dev (dev)); -pci_put_host_bridge_device (bridge);if (!ret && !driver->driver_managed_dma) {
drivers/pci/pci.c +9 -1
@@ -1046,7 +1046,7 @@ static void pci_std_enable_acs(struct pci_dev *dev)* pci_enable_acs - enable ACS if hardware support it * @dev: the PCI device */ -void pci_enable_acs (struct pci_dev *dev) +static void pci_enable_acs (struct pci_dev *dev) {if (!pci_acs_enable) goto disable_acs_redir;
@@ -3823,6 +3823,14 @@ bool pci_acs_path_enabled(struct pci_dev *start,void pci_acs_init (struct pci_dev *dev) { dev->acs_cap =pci_find_ext_capability (dev,PCI_EXT_CAP_ID_ACS ); + +/* +* Attempt to enable ACS regardless of capability because some Root +* Ports (e.g. those quirked with *_intel_pch_acs_*) do not have +* the standard ACS capability but still support ACS via those +* quirks. +*/ +pci_enable_acs (dev); }/**
drivers/pci/pci.h +0 -1
@@ -557,7 +557,6 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, }void pci_acs_init (struct pci_dev *dev); -void pci_enable_acs (struct pci_dev *dev);#ifdef CONFIG_PCI_QUIRKS int pci_dev_specific_acs_enabled (struct pci_dev *dev,u16 acs_flags);int pci_dev_specific_enable_acs (struct pci_dev *dev);
drivers/pmdomain/imx/imx8mp-blk-ctrl.c +1 -7
@@ -352,9 +352,6 @@ static void imx8mp_hdmi_blk_ctrl_power_on(struct imx8mp_blk_ctrl *bc,regmap_set_bits (bc->regmap,HDMI_RTX_RESET_CTL0 ,BIT (12 ));regmap_clear_bits (bc->regmap,HDMI_TX_CONTROL0 ,BIT (3 ));break ; -case IMX8MP_HDMIBLK_PD_HDCP : -regmap_set_bits (bc->regmap,HDMI_RTX_CLK_CTL0 ,BIT (11 )); -break ;case IMX8MP_HDMIBLK_PD_HRV :regmap_set_bits (bc->regmap,HDMI_RTX_CLK_CTL1 ,BIT (3 ) |BIT (4 ) |BIT (5 ));regmap_set_bits (bc->regmap,HDMI_RTX_RESET_CTL0 ,BIT (15 ));
@@ -408,9 +405,6 @@ static void imx8mp_hdmi_blk_ctrl_power_off(struct imx8mp_blk_ctrl *bc,regmap_clear_bits (bc->regmap,HDMI_RTX_CLK_CTL0 ,BIT (7 ));regmap_clear_bits (bc->regmap,HDMI_RTX_CLK_CTL1 ,BIT (22 ) |BIT (24 ));break ; -case IMX8MP_HDMIBLK_PD_HDCP : -regmap_clear_bits (bc->regmap,HDMI_RTX_CLK_CTL0 ,BIT (11 )); -break ;case IMX8MP_HDMIBLK_PD_HRV :regmap_clear_bits (bc->regmap,HDMI_RTX_RESET_CTL0 ,BIT (15 ));regmap_clear_bits (bc->regmap,HDMI_RTX_CLK_CTL1 ,BIT (3 ) |BIT (4 ) |BIT (5 ));
@@ -439,7 +433,7 @@ static int imx8mp_hdmi_power_notifier(struct notifier_block *nb,regmap_write (bc->regmap,HDMI_RTX_CLK_CTL0 ,0x0 );regmap_write (bc->regmap,HDMI_RTX_CLK_CTL1 ,0x0 );regmap_set_bits (bc->regmap,HDMI_RTX_CLK_CTL0 , -BIT (0 ) |BIT (1 ) |BIT (10 )); +BIT (0 ) |BIT (1 ) |BIT (10 ) |BIT (11 ));regmap_set_bits (bc->regmap,HDMI_RTX_RESET_CTL0 ,BIT (0 ));/*
drivers/ufs/core/ufshcd.c +21 -10
@@ -10475,16 +10475,6 @@ int ufshcd_system_thaw(struct device *dev)EXPORT_SYMBOL_GPL (ufshcd_system_thaw);#endif /* CONFIG_PM_SLEEP */ -/** -* ufshcd_dealloc_host - deallocate Host Bus Adapter (HBA) -* @hba: pointer to Host Bus Adapter (HBA) -*/ -void ufshcd_dealloc_host (struct ufs_hba *hba) -{ -scsi_host_put (hba->host); -} -EXPORT_SYMBOL_GPL (ufshcd_dealloc_host); -/** * ufshcd_set_dma_mask - Set dma mask based on the controller * addressing capability
@@ -10503,12 +10493,26 @@ static int ufshcd_set_dma_mask(struct ufs_hba *hba)return dma_set_mask_and_coherent (hba->dev,DMA_BIT_MASK (32 )); } +/** +* ufshcd_devres_release - devres cleanup handler, invoked during release of +* hba->dev +* @host: pointer to SCSI host +*/ +static void ufshcd_devres_release (void *host) +{ +scsi_host_put (host); +} +/** * ufshcd_alloc_host - allocate Host Bus Adapter (HBA) * @dev: pointer to device handle * @hba_handle: driver private handle * * Return: 0 on success, non-zero value on failure. +* +* NOTE: There is no corresponding ufshcd_dealloc_host() because this function +* keeps track of its allocations using devres and deallocates everything on +* device removal automatically. */ int ufshcd_alloc_host (struct device *dev,struct ufs_hba **hba_handle) {
@@ -10530,6 +10534,13 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle) err = -ENOMEM ; goto out_error; } + + err =devm_add_action_or_reset (dev, ufshcd_devres_release, + host); +if (err) +return dev_err_probe (dev, err, +"failed to add ufshcd dealloc action\n" ); + host->nr_maps =HCTX_TYPE_POLL +1 ; hba =shost_priv (host); hba->host = host;
drivers/ufs/host/ufshcd-pci.c +0 -2
@@ -620,7 +620,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)pm_runtime_forbid (&pdev->dev);pm_runtime_get_noresume (&pdev->dev);ufshcd_remove (hba); -ufshcd_dealloc_host (hba); }/**
@@ -665,7 +664,6 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) err =ufshcd_init (hba, mmio_base, pdev->irq);if (err) {dev_err (&pdev->dev,"Initialization failed\n" ); -ufshcd_dealloc_host (hba);return err; }
drivers/ufs/host/ufshcd-pltfrm.c +8 -17
@@ -339,21 +339,17 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,struct device *dev = &pdev->dev; mmio_base =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (mmio_base)) { - err =PTR_ERR (mmio_base); - goto out; - } +if (IS_ERR (mmio_base)) +return PTR_ERR (mmio_base); irq =platform_get_irq (pdev,0 ); -if (irq <0 ) { - err = irq; - goto out; - } +if (irq <0 ) +return irq; err =ufshcd_alloc_host (dev, &hba);if (err) {dev_err (dev,"Allocation failed\n" ); - goto out; +return err; } hba->vops = vops;
@@ -362,13 +358,13 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,if (err) {dev_err (dev,"%s: clock parse failed %d\n" , __func__, err); - goto dealloc_host; +return err; } err =ufshcd_parse_regulator_info (hba);if (err) {dev_err (dev,"%s: regulator init failed %d\n" , __func__, err); - goto dealloc_host; +return err; }ufshcd_init_lanes_per_dir (hba);
@@ -377,18 +373,13 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,if (err) {dev_err_probe (dev, err,"Initialization failed with error %d\n" , err); - goto dealloc_host; +return err; }pm_runtime_set_active (dev);pm_runtime_enable (dev);return 0 ; - -dealloc_host: -ufshcd_dealloc_host (hba); -out: -return err; }EXPORT_SYMBOL_GPL (ufshcd_pltfrm_init);
drivers/usb/gadget/function/f_hid.c +6 -5
@@ -1000,13 +1000,8 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)if (status) goto fail; -spin_lock_init (&hidg->write_spinlock); hidg->write_pending =1 ; hidg->req =NULL ; -spin_lock_init (&hidg->read_spinlock); -init_waitqueue_head (&hidg->write_queue); -init_waitqueue_head (&hidg->read_queue); -INIT_LIST_HEAD (&hidg->completed_out_req);/* create char device */ cdev_init (&hidg->cdev, &f_hidg_fops);
@@ -1275,6 +1270,12 @@ static struct usb_function *hidg_alloc(struct usb_function_instance *fi)mutex_lock (&opts->lock); +spin_lock_init (&hidg->write_spinlock); +spin_lock_init (&hidg->read_spinlock); +init_waitqueue_head (&hidg->write_queue); +init_waitqueue_head (&hidg->read_queue); +INIT_LIST_HEAD (&hidg->completed_out_req); +device_initialize (&hidg->dev); hidg->dev.release = hidg_release; hidg->dev.class = &hidg_class;
include/net/netfilter/nf_conntrack_timeout.h +1 -0
@@ -14,6 +14,7 @@struct nf_ct_timeout {__u16 l3num;const struct nf_conntrack_l4proto *l4proto; +struct rcu_head rcu;char data[]; };
include/trace/events/rxrpc.h +1 -1
@@ -294,7 +294,7 @@ EM(rxrpc_call_see_release, "SEE release ") \ EM(rxrpc_call_see_userid_exists, "SEE u-exists") \ EM(rxrpc_call_see_waiting_call, "SEE q-conn ") \ - E_(rxrpc_call_see_zap, "SEE zap ") + E_(rxrpc_call_see_still_live, "SEE !still-l")#define rxrpc_txqueue_traces \ EM(rxrpc_txqueue_await_reply, "AWR") \
include/ufs/ufshcd.h +0 -1
@@ -1286,7 +1286,6 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg) }int ufshcd_alloc_host (struct device *,struct ufs_hba **); -void ufshcd_dealloc_host (struct ufs_hba *);int ufshcd_hba_enable (struct ufs_hba *hba);int ufshcd_init (struct ufs_hba *,void __iomem *,unsigned int );int ufshcd_link_recovery (struct ufs_hba *hba);
lib/crypto/chacha.c +4 -0
@@ -86,6 +86,8 @@ void chacha_block_generic(u32 *state, u8 *stream, int nrounds)put_unaligned_le32 (x[i] + state[i], &stream[i *sizeof (u32)]); state[12 ]++; + +memzero_explicit (x,sizeof (x)); }EXPORT_SYMBOL (chacha_block_generic);
@@ -110,5 +112,7 @@ void hchacha_block_generic(const u32 *state, u32 *stream, int nrounds)memcpy (&stream[0 ], &x[0 ],16 );memcpy (&stream[4 ], &x[12 ],16 ); + +memzero_explicit (x,sizeof (x)); }EXPORT_SYMBOL (hchacha_block_generic);
mm/filemap.c +8 -3
@@ -3616,14 +3616,19 @@ vm_fault_t filemap_map_pages(struct vm_fault *vmf,unsigned int nr_pages =0 , mmap_miss =0 , mmap_miss_saved;bool can_map_large; +/* +* Recalculate end_pgoff based on file_end before calling +* next_uptodate_folio() to avoid races with concurrent +* truncation. +*/ + file_end =DIV_ROUND_UP (i_size_read (mapping->host),PAGE_SIZE ) -1 ; + end_pgoff =min (end_pgoff, file_end); +rcu_read_lock (); folio =next_uptodate_folio (&xas, mapping, end_pgoff);if (!folio) goto out; - file_end =DIV_ROUND_UP (i_size_read (mapping->host),PAGE_SIZE ) -1 ; - end_pgoff =min (end_pgoff, file_end); -/* * Do not allow to map with PTEs beyond i_size and with PMD * across i_size to preserve SIGBUS semantics.
net/batman-adv/bridge_loop_avoidance.c +18 -9
@@ -2132,6 +2132,7 @@ batadv_bla_claim_dump_entry(struct sk_buff *msg, u32 portid, struct batadv_bla_claim *claim) {const u8 *primary_addr = primary_if->net_dev->dev_addr; +struct batadv_bla_backbone_gw *backbone_gw;u16 backbone_crc;bool is_own;void *hdr;
@@ -2147,32 +2148,35 @@ batadv_bla_claim_dump_entry(struct sk_buff *msg, u32 portid,genl_dump_check_consistent (cb, hdr); - is_own =batadv_compare_eth (claim->backbone_gw->orig, - primary_addr); + backbone_gw =batadv_bla_claim_get_backbone_gw (claim); + + is_own =batadv_compare_eth (backbone_gw->orig, primary_addr); -spin_lock_bh (&claim->backbone_gw->crc_lock); - backbone_crc = claim->backbone_gw->crc; -spin_unlock_bh (&claim->backbone_gw->crc_lock); +spin_lock_bh (&backbone_gw->crc_lock); + backbone_crc = backbone_gw->crc; +spin_unlock_bh (&backbone_gw->crc_lock);if (is_own)if (nla_put_flag (msg,BATADV_ATTR_BLA_OWN )) {genlmsg_cancel (msg, hdr); - goto out; + goto put_backbone_gw; }if (nla_put (msg,BATADV_ATTR_BLA_ADDRESS ,ETH_ALEN , claim->addr) ||nla_put_u16 (msg,BATADV_ATTR_BLA_VID , claim->vid) ||nla_put (msg,BATADV_ATTR_BLA_BACKBONE ,ETH_ALEN , - claim->backbone_gw->orig) || + backbone_gw->orig) ||nla_put_u16 (msg,BATADV_ATTR_BLA_CRC , backbone_crc)) {genlmsg_cancel (msg, hdr); - goto out; + goto put_backbone_gw; }genlmsg_end (msg, hdr); ret =0 ; +put_backbone_gw: +batadv_backbone_gw_put (backbone_gw); out:return ret; }
@@ -2468,6 +2472,7 @@ int batadv_bla_backbone_dump(struct sk_buff *msg, struct netlink_callback *cb)bool batadv_bla_check_claim (struct batadv_priv *bat_priv,u8 *addr,unsigned short vid) { +struct batadv_bla_backbone_gw *backbone_gw;struct batadv_bla_claim search_claim;struct batadv_bla_claim *claim =NULL ;struct batadv_hard_iface *primary_if =NULL ;
@@ -2490,9 +2495,13 @@ bool batadv_bla_check_claim(struct batadv_priv *bat_priv,* return false. */ if (claim) { -if (!batadv_compare_eth (claim->backbone_gw->orig, + backbone_gw =batadv_bla_claim_get_backbone_gw (claim); + +if (!batadv_compare_eth (backbone_gw->orig, primary_if->net_dev->dev_addr)) ret = false; + +batadv_backbone_gw_put (backbone_gw);batadv_claim_put (claim); }
net/batman-adv/translation-table.c +7 -2
@@ -844,8 +844,8 @@ batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node, {u16 num_vlan =0 ;u16 num_entries =0 ; -u16 change_offset; -u16 tvlv_len; +u16 tvlv_len =0 ; +unsigned int change_offset;struct batadv_tvlv_tt_vlan_data *tt_vlan;struct batadv_orig_node_vlan *vlan;u8 *tt_change_ptr;
@@ -863,6 +863,11 @@ batadv_tt_prepare_tvlv_global_data(struct batadv_orig_node *orig_node,if (*tt_len <0 ) *tt_len =batadv_tt_len (num_entries); +if (change_offset >U16_MAX || *tt_len >U16_MAX - change_offset) { + *tt_len =0 ; + goto out; + } + tvlv_len = *tt_len; tvlv_len += change_offset;
net/ipv6/seg6_iptunnel.c +28 -13
87 lines not on this page · raw message
net/mptcp/pm_netlink.c +5 -19
@@ -1079,7 +1079,7 @@ static void __mptcp_pm_release_addr_entry(struct mptcp_pm_addr_entry *entry)static int mptcp_pm_nl_append_new_local_addr (struct pm_nl_pernet *pernet,struct mptcp_pm_addr_entry *entry, -bool needs_id,bool replace) +bool replace) {struct mptcp_pm_addr_entry *cur, *del_entry =NULL ;unsigned int addr_max;
@@ -1138,7 +1138,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, } } -if (!entry->addr.id && needs_id) { +if (!entry->addr.id) { find_next: entry->addr.id = find_next_zero_bit(pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1,
@@ -1149,7 +1149,7 @@ static int mptcp_pm_nl_append_new_local_addr(struct pm_nl_pernet *pernet, } } -if (!entry->addr.id && needs_id) +if (!entry->addr.id) goto out;__set_bit (entry->addr.id, pernet->id_bitmap);
@@ -1282,7 +1282,7 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc entry->ifindex =0 ; entry->flags =MPTCP_PM_ADDR_FLAG_IMPLICIT ; entry->lsk =NULL ; - ret =mptcp_pm_nl_append_new_local_addr (pernet, entry, true, false); + ret =mptcp_pm_nl_append_new_local_addr (pernet, entry, false);if (ret <0 )kfree (entry);
@@ -1524,18 +1524,6 @@ static int mptcp_nl_add_subflow_or_signal_addr(struct net *net,return 0 ; } -static bool mptcp_pm_has_addr_attr_id (const struct nlattr *attr, -struct genl_info *info) -{ -struct nlattr *tb[MPTCP_PM_ADDR_ATTR_MAX +1 ]; - -if (!nla_parse_nested_deprecated (tb,MPTCP_PM_ADDR_ATTR_MAX , attr, - mptcp_pm_addr_policy, info->extack) && - tb[MPTCP_PM_ADDR_ATTR_ID ]) -return true; -return false; -} -static int mptcp_nl_cmd_add_addr (struct sk_buff *skb,struct genl_info *info) {struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR ];
@@ -1577,9 +1565,7 @@ static int mptcp_nl_cmd_add_addr(struct sk_buff *skb, struct genl_info *info) goto out_free; } } - ret =mptcp_pm_nl_append_new_local_addr (pernet, entry, - !mptcp_pm_has_addr_attr_id (attr, info), - true); + ret =mptcp_pm_nl_append_new_local_addr (pernet, entry, true);if (ret <0 ) {GENL_SET_ERR_MSG_FMT (info,"too many addresses or duplicate one: %d" , ret); goto out_free;
net/mptcp/protocol.c +2 -0
@@ -4301,6 +4301,8 @@ int __init mptcp_proto_v6_init(void) {int err; +mptcp_subflow_v6_init (); + mptcp_v6_prot = mptcp_prot;strcpy (mptcp_v6_prot.name,"MPTCPv6" ); mptcp_v6_prot.slab =NULL ;
net/mptcp/protocol.h +1 -0
@@ -746,6 +746,7 @@ static inline void mptcp_subflow_tcp_fallback(struct sock *sk,void __init mptcp_proto_init (void );#if IS_ENABLED (CONFIG_MPTCP_IPV6 )int __init mptcp_proto_v6_init (void ); +void __init mptcp_subflow_v6_init (void );#endif struct sock *mptcp_sk_clone_init(const struct sock *sk,
net/mptcp/subflow.c +9 -6
@@ -2092,7 +2092,15 @@ void __init mptcp_subflow_init(void) tcp_prot_override.psock_update_sk_prot =NULL ;#endif +mptcp_diag_subflow_init (&subflow_ulp_ops); + +if (tcp_register_ulp (&subflow_ulp_ops) !=0 ) +panic ("MPTCP: failed to register subflows to ULP\n" ); +} +#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) +void __init mptcp_subflow_v6_init (void ) +{/* In struct mptcp_subflow_request_sock, we assume the TCP request sock * structures for v4 and v6 have the same size. It should not changed in * the future but better to make sure to be warned if it is no longer
@@ -2132,10 +2140,5 @@ void __init mptcp_subflow_init(void)/* Disable sockmap processing for subflows */ tcpv6_prot_override.psock_update_sk_prot =NULL ; #endif -#endif - -mptcp_diag_subflow_init (&subflow_ulp_ops); - -if (tcp_register_ulp (&subflow_ulp_ops) !=0 ) -panic ("MPTCP: failed to register subflows to ULP\n" ); } +#endif
net/netfilter/nft_ct.c +1 -1
@@ -1002,7 +1002,7 @@ static void nft_ct_timeout_obj_destroy(const struct nft_ctx *ctx,nf_queue_nf_hook_drop (ctx->net);nf_ct_untimeout (ctx->net, timeout);nf_ct_netns_put (ctx->net, ctx->family); -kfree (priv->timeout); +kfree_rcu (priv->timeout, rcu); } static int nft_ct_timeout_obj_dump(struct sk_buff *skb,
net/netfilter/nft_set_pipapo.c +14 -6
@@ -525,6 +525,8 @@ static struct nft_pipapo_elem *pipapo_get(const struct net *net,int i; m = priv->clone; +if (m->bsize_max ==0 ) +return ret; res_map =kmalloc_array (m->bsize_max,sizeof (*res_map),GFP_ATOMIC );if (!res_map) {
@@ -1394,14 +1396,20 @@ static struct nft_pipapo_match *pipapo_clone(struct nft_pipapo_match *old) src->bsize *sizeof (*dst->lt) * src->groups * NFT_PIPAPO_BUCKETS(src->bb)); -if (src->rules > (INT_MAX /sizeof (*src->mt))) - goto out_mt; +if (src->rules >0 ) { +if (src->rules > (INT_MAX /sizeof (*src->mt))) + goto out_mt; + + dst->mt =kvmalloc_array (src->rules,sizeof (*src->mt), +GFP_KERNEL ); +if (!dst->mt) + goto out_mt; - dst->mt =kvmalloc (src->rules *sizeof (*src->mt),GFP_KERNEL_ACCOUNT ); -if (!dst->mt) - goto out_mt; +memcpy (dst->mt, src->mt, src->rules *sizeof (*src->mt)); + }else { + dst->mt =NULL ; + } -memcpy (dst->mt, src->mt, src->rules *sizeof (*src->mt)); src++; dst++; }
net/rfkill/core.c +24 -11
@@ -73,11 +73,14 @@ struct rfkill_int_event {struct rfkill_event_ext ev; }; +/* Max rfkill events that can be "in-flight" for one data source */ +#define MAX_RFKILL_EVENT 1000struct rfkill_data {struct list_head list;struct list_head events;struct mutex mtx;wait_queue_head_t read_wait; +u32 event_count;bool input_handler;u8 max_size; };
@@ -255,10 +258,12 @@ static void rfkill_global_led_trigger_unregister(void) }#endif /* CONFIG_RFKILL_LEDS */ -static void rfkill_fill_event (struct rfkill_event_ext *ev, -struct rfkill *rfkill, -enum rfkill_operation op) +static int rfkill_fill_event (struct rfkill_int_event *int_ev, +struct rfkill *rfkill, +struct rfkill_data *data, +enum rfkill_operation op) { +struct rfkill_event_ext *ev = &int_ev->ev;unsigned long flags; ev->idx = rfkill->idx;
@@ -271,6 +276,15 @@ static void rfkill_fill_event(struct rfkill_event_ext *ev, RFKILL_BLOCK_SW_PREV)); ev->hard_block_reasons = rfkill->hard_block_reasons;spin_unlock_irqrestore (&rfkill->lock, flags); + + scoped_guard(mutex, &data->mtx) { +if (data->event_count++ >MAX_RFKILL_EVENT ) { + data->event_count--; +return -ENOSPC ; + } +list_add_tail (&int_ev->list, &data->events); + } +return 0 ; }static void rfkill_send_events (struct rfkill *rfkill,enum rfkill_operation op)
@@ -282,10 +296,10 @@ static void rfkill_send_events(struct rfkill *rfkill, enum rfkill_operation op) ev =kzalloc (sizeof (*ev),GFP_KERNEL );if (!ev)continue ; -rfkill_fill_event (&ev->ev, rfkill, op); -mutex_lock (&data->mtx); -list_add_tail (&ev->list, &data->events); -mutex_unlock (&data->mtx); +if (rfkill_fill_event (ev, rfkill, data, op)) { +kfree (ev); +continue ; + }wake_up_interruptible (&data->read_wait); } }
@@ -1190,10 +1204,8 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)if (!ev) goto free;rfkill_sync (rfkill); -rfkill_fill_event (&ev->ev, rfkill,RFKILL_OP_ADD ); -mutex_lock (&data->mtx); -list_add_tail (&ev->list, &data->events); -mutex_unlock (&data->mtx); +if (rfkill_fill_event (ev, rfkill, data,RFKILL_OP_ADD )) +kfree (ev); }list_add (&data->list, &rfkill_fds);mutex_unlock (&rfkill_global_mutex);
@@ -1263,6 +1275,7 @@ static ssize_t rfkill_fop_read(struct file *file, char __user *buf, ret = -EFAULT ;list_del (&ev->list); + data->event_count--;kfree (ev); out:mutex_unlock (&data->mtx);
net/rxrpc/af_rxrpc.c +0 -6
@@ -635,9 +635,6 @@ static int rxrpc_setsockopt(struct socket *sock, int level, int optname, goto success;case RXRPC_SECURITY_KEY : - ret = -EINVAL ; -if (rx->key) - goto error; ret = -EISCONN ;if (rx->sk.sk_state !=RXRPC_UNBOUND ) goto error;
@@ -645,9 +642,6 @@ static int rxrpc_setsockopt(struct socket *sock, int level, int optname, goto error;case RXRPC_SECURITY_KEYRING : - ret = -EINVAL ; -if (rx->key) - goto error; ret = -EISCONN ;if (rx->sk.sk_state !=RXRPC_UNBOUND ) goto error;
net/rxrpc/call_object.c +10 -15
@@ -645,11 +645,9 @@ void rxrpc_put_call(struct rxrpc_call *call, enum rxrpc_call_trace why)if (dead) { ASSERTCMP(__rxrpc_call_state(call), ==, RXRPC_CALL_COMPLETE); -if (!list_empty (&call->link)) { -spin_lock (&rxnet->call_lock); -list_del_init (&call->link); -spin_unlock (&rxnet->call_lock); - } +spin_lock (&rxnet->call_lock); +list_del_rcu (&call->link); +spin_unlock (&rxnet->call_lock);rxrpc_cleanup_call (call); }
@@ -697,6 +695,7 @@ static void rxrpc_destroy_call(struct work_struct *work)rxrpc_put_bundle (call->bundle, rxrpc_bundle_put_call);rxrpc_put_peer (call->peer, rxrpc_peer_put_call);rxrpc_put_local (call->local, rxrpc_local_put_call); +key_put (call->key);call_rcu (&call->rcu, rxrpc_rcu_free_call); }
@@ -733,24 +732,20 @@ void rxrpc_destroy_all_calls(struct rxrpc_net *rxnet)_enter ("" );if (!list_empty (&rxnet->calls)) { -spin_lock (&rxnet->call_lock); +int shown =0 ; -while (!list_empty (&rxnet->calls)) { - call =list_entry (rxnet->calls.next, - struct rxrpc_call, link); -_debug ("Zapping call %p" , call); +spin_lock (&rxnet->call_lock); -rxrpc_see_call (call, rxrpc_call_see_zap); -list_del_init (&call->link); +list_for_each_entry (call, &rxnet->calls, link) { +rxrpc_see_call (call, rxrpc_call_see_still_live);pr_err ("Call %p still in use (%d,%s,%lx,%lx)!\n" , call,refcount_read (&call->ref), rxrpc_call_states[__rxrpc_call_state (call)], call->flags, call->events); -spin_unlock (&rxnet->call_lock); -cond_resched (); -spin_lock (&rxnet->call_lock); +if (++shown >=10 ) +break ; }spin_unlock (&rxnet->call_lock);
net/rxrpc/io_thread.c +2 -1
@@ -389,7 +389,8 @@ static int rxrpc_input_packet_on_conn(struct rxrpc_connection *conn,if (sp->hdr.callNumber > chan->call_id) {if (rxrpc_to_client (sp)) { -rxrpc_put_call (call, rxrpc_call_put_input); +if (call) +rxrpc_put_call (call, rxrpc_call_put_input);return rxrpc_protocol_error (skb, rxrpc_eproto_unexpected_implicit_end); }
net/rxrpc/key.c +1 -1
@@ -452,7 +452,7 @@ int rxrpc_request_key(struct rxrpc_sock *rx, sockptr_t optval, int optlen)_enter ("" ); -if (optlen <=0 || optlen >PAGE_SIZE -1 || rx->securities) +if (optlen <=0 || optlen >PAGE_SIZE -1 || rx->key)return -EINVAL ; description =memdup_sockptr_nul (optval, optlen);
net/rxrpc/rxkad.c +43 -20
180 lines not on this page · raw message
net/rxrpc/server_key.c +3 -0
@@ -125,6 +125,9 @@ int rxrpc_server_keyring(struct rxrpc_sock *rx, sockptr_t optval, int optlen)_enter ("" ); +if (rx->securities) +return -EINVAL ; +if (optlen <=0 || optlen >PAGE_SIZE -1 )return -EINVAL ;
net/tipc/group.c +5 -1
@@ -746,6 +746,7 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,u32 port =msg_origport (hdr);struct tipc_member *m, *pm;u16 remitted, in_flight; +u16 acked;if (!grp)return ;
@@ -798,7 +799,10 @@ void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup,case GRP_ACK_MSG :if (!m)return ; - m->bc_acked =msg_grp_bc_acked (hdr); + acked =msg_grp_bc_acked (hdr); +if (less_eq (acked, m->bc_acked)) +return ; + m->bc_acked = acked;if (--grp->bc_ackers)return ;list_del_init (&m->small_win);
net/tls/tls_sw.c +10 -0
@@ -584,6 +584,16 @@ static int tls_do_encryption(struct sock *sk,if (rc == -EBUSY ) { rc =tls_encrypt_async_wait (ctx); rc = rc ?: -EINPROGRESS ; +/* +* The async callback tls_encrypt_done() has already +* decremented encrypt_pending and restored the sge on +* both success and error. Skip the synchronous cleanup +* below on error, just remove the record and return. +*/ +if (rc != -EINPROGRESS ) { +list_del (&rec->list); +return rc; + } }if (!rc || rc != -EINPROGRESS ) {atomic_dec (&ctx->encrypt_pending);
net/xfrm/xfrm_user.c +3 -0
@@ -3583,6 +3583,8 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp,return err; } upe->hard = !!hard; +/* clear the padding bytes */ +memset_after (upe,0 , hard);nlmsg_end (skb, nlh);return 0 ;
@@ -3740,6 +3742,7 @@ static int build_report(struct sk_buff *skb, u8 proto,return -EMSGSIZE ; ur =nlmsg_data (nlh); +memset (ur,0 ,sizeof (*ur)); ur->proto = proto;memcpy (&ur->sel, sel,sizeof (ur->sel));
sound/soc/generic/simple-card-utils.c +5 -2
@@ -1061,6 +1061,7 @@ static int graph_get_dai_id(struct device_node *ep)int asoc_graph_parse_dai (struct device *dev,struct device_node *ep,struct snd_soc_dai_link_component *dlc,int *is_single_link) { +struct device_node *node;struct of_phandle_args args = {};struct snd_soc_dai *dai;int ret;
@@ -1068,7 +1069,7 @@ int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,if (!ep)return 0 ; - struct device_node *node __free(device_node) = of_graph_get_port_parent(ep); + node =of_graph_get_port_parent (ep);/* * Try to find from DAI node
@@ -1110,8 +1111,10 @@ int asoc_graph_parse_dai(struct device *dev, struct device_node *ep,* if he unbinded CPU or Codec. */ ret =snd_soc_get_dlc (&args, dlc); -if (ret <0 ) +if (ret <0 ) { +of_node_put (node);return ret; + } parse_dai_end:if (is_single_link)