Linux 6.1.87
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.87 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.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
------------
Documentation/admin-guide/hw-vuln/spectre.rst | 22 Documentation/admin-guide/kernel-parameters.txt | 12 Makefile | 2 arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi | 12 arch/x86/Kconfig | 21 arch/x86/events/core.c | 1 arch/x86/include/asm/apic.h | 3 arch/x86/kernel/apic/apic.c | 6 arch/x86/kernel/cpu/bugs.c | 82 +-- arch/x86/kernel/cpu/common.c | 48 +- drivers/ata/libata-scsi.c | 9 drivers/gpu/drm/amd/amdgpu/soc21.c | 27 + drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 1 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 19 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c | 12 drivers/gpu/drm/ast/ast_dp.c | 3 drivers/gpu/drm/drm_client_modeset.c | 3 drivers/gpu/drm/i915/display/intel_cdclk.c | 7 drivers/gpu/drm/i915/display/intel_cdclk.h | 3 drivers/gpu/drm/i915/display/intel_ddi.c | 5 drivers/gpu/drm/i915/display/intel_vrr.c | 7 drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c | 7 drivers/gpu/drm/qxl/qxl_release.c | 50 +- drivers/iommu/intel/svm.c | 2 drivers/media/cec/core/cec-adap.c | 14 drivers/net/dsa/mt7530.c | 229 ++++++++-- drivers/net/dsa/mt7530.h | 5 drivers/net/ethernet/amazon/ena/ena_com.c | 2 drivers/net/ethernet/amazon/ena/ena_netdev.c | 35 + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 20 drivers/net/ethernet/mellanox/mlx5/core/en/qos.c | 33 - drivers/net/ethernet/mellanox/mlx5/core/en/selq.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 3 drivers/net/ethernet/micrel/ks8851.h | 3 drivers/net/ethernet/micrel/ks8851_common.c | 16 drivers/net/ethernet/micrel/ks8851_par.c | 11 drivers/net/ethernet/micrel/ks8851_spi.c | 11 drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 4 drivers/net/geneve.c | 4 drivers/scsi/hisi_sas/hisi_sas_main.c | 2 drivers/scsi/qla2xxx/qla_edif.c | 2 drivers/vhost/vhost.c | 24 - fs/btrfs/delayed-inode.c | 3 fs/btrfs/qgroup.c | 2 fs/btrfs/transaction.c | 17 fs/smb/client/cached_dir.c | 4 include/linux/dma-fence.h | 7 include/linux/irqflags.h | 2 include/linux/u64_stats_sync.h | 9 include/net/addrconf.h | 4 include/net/af_unix.h | 2 include/net/bluetooth/bluetooth.h | 9 include/net/ip_tunnels.h | 33 + io_uring/net.c | 1 kernel/cpu.c | 3 kernel/kprobes.c | 18 kernel/power/suspend.c | 6 kernel/trace/ring_buffer.c | 6 kernel/trace/trace_events.c | 4 net/batman-adv/translation-table.c | 2 net/bluetooth/hci_request.c | 4 net/bluetooth/l2cap_sock.c | 52 -- net/bluetooth/sco.c | 23 - net/ipv4/netfilter/arp_tables.c | 4 net/ipv4/netfilter/ip_tables.c | 4 net/ipv4/route.c | 4 net/ipv6/addrconf.c | 7 net/ipv6/ip6_fib.c | 7 net/ipv6/netfilter/ip6_tables.c | 4 net/openvswitch/conntrack.c | 5 net/unix/af_unix.c | 8 net/unix/garbage.c | 35 + net/unix/scm.c | 8 net/xdp/xsk.c | 2 tools/testing/selftests/timers/posix_timers.c | 2 77 files changed, 711 insertions(+), 378 deletions(-)
Adam Dunlap (1):
x86/apic: Force native_apic_mem_read() to use the MOV instruction
Alex Constantino (1):
Revert "drm/qxl: simplify qxl_fence_wait"
Alex Deucher (1):
drm/amdgpu: always force full reset for SOC21
Anna-Maria Behnsen (1):
PM: s2idle: Make sure CPUs will wakeup directly on resume
Arnd Bergmann (5):
nouveau: fix function cast warning
ipv6: fib: hide unused 'pn' variable
ipv4/route: avoid unused-but-set-variable warning
tracing: hide unused ftrace_event_id_fops
irqflags: Explicitly ignore lockdep_hrtimer_exit() argument
Arınç ÜNAL (1):
net: dsa: mt7530: trap link-local frames regardless of ST Port State
Boris Burkov (3):
btrfs: qgroup: correctly model root qgroup rsv in convert
btrfs: record delayed inode root in transaction
btrfs: qgroup: convert PREALLOC to PERTRANS after record_root_in_trans
Carolina Jubran (2):
net/mlx5e: Fix mlx5e_priv_init() cleanup flow net/mlx5e: HTB, Fix inconsistencies with QoS SQs number
Cosmin Ratiu (1):
net/mlx5: Properly link new fs rules into the tree
Damien Le Moal (1):
ata: libata-scsi: Fix ata_scsi_dev_rescan() error path
Dan Carpenter (1):
scsi: qla2xxx: Fix off by one in qla_edif_app_getstats()
Daniel Machon (1):
net: sparx5: fix wrong config being used when reconfiguring PCS
Daniel Sneddon (1):
x86/bugs: Fix return type of spectre_bhi_state()
David Arinzon (3):
net: ena: Fix potential sign extension issue
net: ena: Wrong missing IO completions check order
net: ena: Fix incorrect descriptor free behavior
Dmitry Antipov (1):
Bluetooth: Fix memory leak in hci_req_sync_complete()
Eric Dumazet (3):
xsk: validate user input for XDP_{UMEM|COMPLETION}_FILL_RING
geneve: fix header validation in geneve[6]_xmit_skb
netfilter: complete validation of user input
Frank Li (1):
arm64: dts: imx8-ss-conn: fix usdhc wrong lpcg clock order
Fudongwang (1):
drm/amd/display: fix disable otg wa logic in DCN316
Gavin Shan (2):
vhost: Add smp_rmb() in vhost_vq_avail_empty()
vhost: Add smp_rmb() in vhost_enable_notify()
Geetha sowjanya (1):
octeontx2-af: Fix NIX SQ mode and BP config
Greg Kroah-Hartman (1):
Linux 6.1.87
Harish Kasiviswanathan (1):
drm/amdkfd: Reset GPU on queue preemption failure
Ilya Maximets (1):
net: openvswitch: fix unwanted error log on timeout policy probing
Ingo Molnar (1):
x86/bugs: Rename various 'ia32_cap' variables to 'x86_arch_cap_msr'
Jacob Pan (1):
iommu/vt-d: Allocate local memory for page request queue
Jammy Huang (1):
drm/ast: Fix soft lockup
Jiri Benc (1):
ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr
John Stultz (1):
selftests: timers: Fix abs() warning in posix_timers test
Josh Poimboeuf (6):
x86/bugs: Fix BHI documentation
x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES
x86/bugs: Fix BHI handling of RRSBA
x86/bugs: Clarify that syscall hardening isn't a BHI mitigation x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI
Kuniyuki Iwashima (2):
af_unix: Clear stale u->oob_skb.
af_unix: Do not use atomic ops for unix_sk(sk)->inflight.Lijo Lazar (1):
drm/amdgpu: Reset dGPU if suspend got aborted
Luiz Augusto von Dentz (2):
Bluetooth: SCO: Fix not validating setsockopt user input
Bluetooth: L2CAP: Fix not validating setsockopt user input
Marek Vasut (2):
net: ks8851: Inline ks8851_rx_skb()
net: ks8851: Handle softirqs at the end of IRQ thread to fix hang
Michal Luczaj (1):
af_unix: Fix garbage collector racing against connect()
Namhyung Kim (1):
perf/x86: Fix out of range data
Nini Song (1):
media: cec: core: remove length check of Timer Status
Pavan Chebbi (1):
bnxt_en: Reset PTP tx_avail after possible firmware reset
Pavel Begunkov (1):
io_uring/net: restore msg_control on sendzc retry
Petr Tesarik (1):
u64_stats: fix u64_stats_init() for lockdep when used repeatedly in one file
Sean Christopherson (1):
x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n
Steve French (1):
smb3: fix Open files on server counter going negative
Steven Rostedt (Google) (1):
ring-buffer: Only update pages_touched when a new page is touched
Sven Eckelmann (1):
batman-adv: Avoid infinite loop trying to resize local TT
Tim Huang (1):
drm/amd/pm: fixes a random hang in S4 for SMU v13.0.4/11
Ville Syrjälä (4):
drm/i915/vrr: Disable VRR when using bigjoiner drm/client: Fully protect modes[] with dev->mode_config.mutex drm/i915/cdclk: Fix CDCLK programming order when pipes are active drm/i915: Disable port sync when bigjoiner is used
Xiang Chen (1):
scsi: hisi_sas: Modify the deadline for ata_wait_after_reset()
Zheng Yejian (1):
kprobes: Fix possible use-after-free issue on kprobe registration
Greg Kroah-Hartman
maintainerDocumentation/admin-guide/hw-vuln/spectre.rst +9 -13
@@ -439,12 +439,12 @@ The possible values in this file are: - System is protected by retpoline * - BHI: BHI_DIS_S - System is protected by BHI_DIS_S - * - BHI: SW loop; KVM SW loop + * - BHI: SW loop, KVM SW loop - System is protected by software clearing sequence - * - BHI: Syscall hardening - - Syscalls are hardened against BHI - * - BHI: Syscall hardening; KVM: SW loop - - System is protected from userspace attacks by syscall hardening; KVM is protected by software clearing sequence + * - BHI: Vulnerable + - System is vulnerable to BHI + * - BHI: Vulnerable, KVM: SW loop + - System is vulnerable; KVM is protected by software clearing sequence Full mitigation might require a microcode update from the CPU vendor. When the necessary microcode is not available, the kernel will
@@ -661,18 +661,14 @@ kernel command line. spectre_bhi= [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. Syscalls are hardened against BHI - regardless of this setting. This setting affects the deployment + (BHI) vulnerability. This setting affects the deployment of the HW BHI control and the SW BHB clearing sequence. on - unconditionally enable. + (default) Enable the HW or SW mitigation as + needed. off - unconditionally disable. - auto - enable if hardware mitigation - control(BHI_DIS_S) is available, otherwise - enable alternate mitigation in KVM. + Disable the mitigation. For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
Documentation/admin-guide/kernel-parameters.txt +5 -7
@@ -3283,6 +3283,7 @@ reg_file_data_sampling=off [X86] retbleed=off [X86] spec_store_bypass_disable=off [X86,PPC] + spectre_bhi=off [X86] spectre_v2_user=off [X86] srbds=off [X86,INTEL] ssbd=force-off [ARM64]
@@ -5734,16 +5735,13 @@ See Documentation/admin-guide/laptops/sonypi.rst spectre_bhi= [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. Syscalls are hardened against BHI - reglardless of this setting. This setting affects the + (BHI) vulnerability. This setting affects the deployment of the HW BHI control and the SW BHB clearing sequence. - on - unconditionally enable. - off - unconditionally disable. - auto - (default) enable hardware mitigation - (BHI_DIS_S) if available, otherwise enable - alternate mitigation in KVM. + on - (default) Enable the HW or SW mitigation + as needed. + off - Disable the mitigation. spectre_v2= [X86] Control mitigation of Spectre variant 2 (indirect branch speculation) vulnerability.
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 86 +SUBLEVEL = 87 EXTRAVERSION = NAME = Curry Ramen
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +6 -6
@@ -38,8 +38,8 @@ usdhc1: mmc@5b010000 { interrupts = <GIC_SPI 232 IRQ_TYPE_LEVEL_HIGH>; reg = <0x5b010000 0x10000>; clocks = <&sdhc0_lpcg IMX_LPCG_CLK_4>, - <&sdhc0_lpcg IMX_LPCG_CLK_0>, - <&sdhc0_lpcg IMX_LPCG_CLK_5>; + <&sdhc0_lpcg IMX_LPCG_CLK_5>, + <&sdhc0_lpcg IMX_LPCG_CLK_0>; clock-names = "ipg", "ahb", "per"; power-domains = <&pd IMX_SC_R_SDHC_0>; status = "disabled";
@@ -49,8 +49,8 @@ usdhc2: mmc@5b020000 { interrupts = <GIC_SPI 233 IRQ_TYPE_LEVEL_HIGH>; reg = <0x5b020000 0x10000>; clocks = <&sdhc1_lpcg IMX_LPCG_CLK_4>, - <&sdhc1_lpcg IMX_LPCG_CLK_0>, - <&sdhc1_lpcg IMX_LPCG_CLK_5>; + <&sdhc1_lpcg IMX_LPCG_CLK_5>, + <&sdhc1_lpcg IMX_LPCG_CLK_0>; clock-names = "ipg", "ahb", "per"; power-domains = <&pd IMX_SC_R_SDHC_1>; fsl,tuning-start-tap = <20>;
@@ -62,8 +62,8 @@ usdhc3: mmc@5b030000 { interrupts = <GIC_SPI 234 IRQ_TYPE_LEVEL_HIGH>; reg = <0x5b030000 0x10000>; clocks = <&sdhc2_lpcg IMX_LPCG_CLK_4>, - <&sdhc2_lpcg IMX_LPCG_CLK_0>, - <&sdhc2_lpcg IMX_LPCG_CLK_5>; + <&sdhc2_lpcg IMX_LPCG_CLK_5>, + <&sdhc2_lpcg IMX_LPCG_CLK_0>; clock-names = "ipg", "ahb", "per"; power-domains = <&pd IMX_SC_R_SDHC_2>; status = "disabled";
arch/x86/Kconfig +3 -18
@@ -2563,31 +2563,16 @@ config MITIGATION_RFDS stored in floating point, vector and integer registers. See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst> -choice - prompt "Clear branch history" +config MITIGATION_SPECTRE_BHI + bool "Mitigate Spectre-BHB (Branch History Injection)" depends on CPU_SUP_INTEL - default SPECTRE_BHI_ON + default y help Enable BHI mitigations. BHI attacks are a form of Spectre V2 attacks where the branch history buffer is poisoned to speculatively steer indirect branches. See <file:Documentation/admin-guide/hw-vuln/spectre.rst> -config SPECTRE_BHI_ON - bool "on" - help - Equivalent to setting spectre_bhi=on command line parameter. -config SPECTRE_BHI_OFF - bool "off" - help - Equivalent to setting spectre_bhi=off command line parameter. -config SPECTRE_BHI_AUTO - bool "auto" - help - Equivalent to setting spectre_bhi=auto command line parameter. - -endchoice - endif config ARCH_HAS_ADD_PAGES
arch/x86/events/core.c +1 -0
@@ -1644,6 +1644,7 @@ static void x86_pmu_del(struct perf_event *event, int flags)while (++i < cpuc->n_events) { cpuc->event_list[i-1 ] = cpuc->event_list[i]; cpuc->event_constraint[i-1 ] = cpuc->event_constraint[i]; + cpuc->assign[i-1 ] = cpuc->assign[i]; } cpuc->event_constraint[i-1 ] =NULL ; --cpuc->n_events;
arch/x86/include/asm/apic.h +2 -1
@@ -12,6 +12,7 @@#include <asm/mpspec.h> #include <asm/msr.h> #include <asm/hardirq.h> +#include <asm/io.h> #define ARCH_APICTIMER_STOPS_ON_C3 1
@@ -109,7 +110,7 @@ static inline void native_apic_mem_write(u32 reg, u32 v)static inline u32 native_apic_mem_read (u32 reg) { -return *((volatile u32 *)(APIC_BASE + reg)); +return readl ((void __iomem *)(APIC_BASE + reg)); }extern void native_apic_wait_icr_idle (void );
arch/x86/kernel/apic/apic.c +3 -3
@@ -1760,11 +1760,11 @@ static int x2apic_state;static bool x2apic_hw_locked (void ) { -u64 ia32_cap; +u64 x86_arch_cap_msr;u64 msr; - ia32_cap =x86_read_arch_cap_msr (); -if (ia32_cap &ARCH_CAP_XAPIC_DISABLE ) { + x86_arch_cap_msr =x86_read_arch_cap_msr (); +if (x86_arch_cap_msr &ARCH_CAP_XAPIC_DISABLE ) {rdmsrl (MSR_IA32_XAPIC_DISABLE_STATUS , msr);return (msr &LEGACY_XAPIC_DISABLED ); }
arch/x86/kernel/cpu/bugs.c +36 -46
222 lines not on this page · raw message
arch/x86/kernel/cpu/common.c +24 -24
137 lines not on this page · raw message
drivers/ata/libata-scsi.c +5 -4
@@ -4667,7 +4667,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)* bail out. */ if (ap->pflags &ATA_PFLAG_SUSPENDED ) - goto unlock; + goto unlock_ap;if (!sdev)continue ;
@@ -4680,7 +4680,7 @@ void ata_scsi_dev_rescan(struct work_struct *work)if (do_resume) { ret =scsi_resume_device (sdev);if (ret == -EWOULDBLOCK ) - goto unlock; + goto unlock_scan; dev->flags &= ~ATA_DFLAG_RESUMING ; } ret =scsi_rescan_device (sdev);
@@ -4688,12 +4688,13 @@ void ata_scsi_dev_rescan(struct work_struct *work)spin_lock_irqsave (ap->lock, flags);if (ret) - goto unlock; + goto unlock_ap; } } -unlock: +unlock_ap:spin_unlock_irqrestore (ap->lock, flags); +unlock_scan:mutex_unlock (&ap->scsi_scan_mutex);/* Reschedule with a delay if scsi_rescan_device() returned an error */
drivers/gpu/drm/amd/amdgpu/soc21.c +25 -2
@@ -460,10 +460,8 @@ static bool soc21_need_full_reset(struct amdgpu_device *adev) {switch (adev->ip_versions[GC_HWIP ][0 ]) {case IP_VERSION (11 ,0 ,0 ): -return amdgpu_ras_is_supported (adev,AMDGPU_RAS_BLOCK__UMC );case IP_VERSION (11 ,0 ,2 ):case IP_VERSION (11 ,0 ,3 ): -return false;default :return true; }
@@ -780,10 +778,35 @@ static int soc21_common_suspend(void *handle)return soc21_common_hw_fini (adev); } +static bool soc21_need_reset_on_resume (struct amdgpu_device *adev) +{ +u32 sol_reg1, sol_reg2; + +/* Will reset for the following suspend abort cases. +* 1) Only reset dGPU side. +* 2) S3 suspend got aborted and TOS is active. +*/ +if (!(adev->flags &AMD_IS_APU ) && adev->in_s3 && + !adev->suspend_complete) { + sol_reg1 =RREG32_SOC15 (MP0 ,0 , regMP0_SMN_C2PMSG_81); +msleep (100 ); + sol_reg2 =RREG32_SOC15 (MP0 ,0 , regMP0_SMN_C2PMSG_81); + +return (sol_reg1 != sol_reg2); + } + +return false; +} +static int soc21_common_resume (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +if (soc21_need_reset_on_resume (adev)) { +dev_info (adev->dev,"S3 suspend aborted, resetting..." ); +soc21_asic_reset (adev); + } +return soc21_common_hw_init (adev); }
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -0
@@ -1805,6 +1805,7 @@ static int unmap_queues_cpsch(struct device_queue_manager *dqm,pr_err ("HIQ MQD's queue_doorbell_id0 is not 0, Queue preemption time out\n" );while (halt_if_hws_hang)schedule (); +kfd_hws_hang (dqm);return -ETIME ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +12 -7
@@ -112,20 +112,25 @@ static int dcn316_get_active_display_cnt_wa(return display_count; } -static void dcn316_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) +static void dcn316_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context, +bool safe_to_lower,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;for (i =0 ; i < dc->res_pool->pipe_count; ++i) { -struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +struct pipe_ctx *pipe = safe_to_lower + ? &context->res_ctx.pipe_ctx[i] + : &dc->current_state->res_ctx.pipe_ctx[i];if (pipe->top_pipe || pipe->prev_odm_pipe)continue ; -if (pipe->stream && (pipe->stream->dpms_off || pipe->plane_state ==NULL || -dc_is_virtual_signal (pipe->stream->signal))) { +if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal) || + !pipe->stream->link_enc)) {if (disable) { - pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); +if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) + pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); +reset_sync_context_for_pipe (dc, context, i); }else pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg);
@@ -222,11 +227,11 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base, }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn316_disable_otg_wa (clk_mgr_base, context, true); +dcn316_disable_otg_wa (clk_mgr_base, context, safe_to_lower, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn316_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn316_disable_otg_wa (clk_mgr_base, context, false); +dcn316_disable_otg_wa (clk_mgr_base, context, safe_to_lower, false); update_dispclk = true; }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c +11 -1
@@ -222,8 +222,18 @@ static int smu_v13_0_4_system_features_control(struct smu_context *smu, bool en)struct amdgpu_device *adev = smu->adev;int ret =0 ; -if (!en && !adev->in_s0ix) +if (!en && !adev->in_s0ix) { +/* Adds a GFX reset as workaround just before sending the +* MP1_UNLOAD message to prevent GC/RLC/PMFW from entering +* an invalid state. +*/ + ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_GfxDeviceDriverReset, +SMU_RESET_MODE_2 ,NULL ); +if (ret) +return ret; + ret =smu_cmn_send_smc_msg (smu, SMU_MSG_PrepareMp1ForUnload,NULL ); + }return ret; }
drivers/gpu/drm/ast/ast_dp.c +3 -0
@@ -190,6 +190,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) {struct ast_private *ast =to_ast_private (dev);u8 video_on_off = on; +u32 i =0 ;// Video On/Off ast_set_index_reg_mask (ast,AST_IO_CRTC_PORT ,0xE3 , (u8 ) ~AST_DP_VIDEO_ENABLE , on);
@@ -202,6 +203,8 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on) ASTDP_MIRROR_VIDEO_ENABLE) != video_on_off) {// wait 1 ms mdelay (1 ); +if (++i >200 ) +break ; } } }
drivers/gpu/drm/drm_client_modeset.c +2 -1
@@ -781,6 +781,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,unsigned int total_modes_count =0 ;struct drm_client_offset *offsets;unsigned int connector_count =0 ; +/* points to modes protected by mode_config.mutex */ struct drm_display_mode **modes;struct drm_crtc **crtcs;int i, ret =0 ;
@@ -849,7 +850,6 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,drm_client_pick_crtcs (client, connectors, connector_count, crtcs, modes,0 , width, height); } -mutex_unlock (&dev->mode_config.mutex);drm_client_modeset_release (client);
@@ -879,6 +879,7 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width, modeset->y = offset->y; } } +mutex_unlock (&dev->mode_config.mutex);mutex_unlock (&client->modeset_mutex); out:
drivers/gpu/drm/i915/display/intel_cdclk.c +5 -2
@@ -2152,7 +2152,7 @@ intel_set_cdclk_pre_plane_update(struct intel_atomic_state *state) &new_cdclk_state->actual))return ; -if (pipe ==INVALID_PIPE || +if (new_cdclk_state->disable_pipes || old_cdclk_state->actual.cdclk <= new_cdclk_state->actual.cdclk) {drm_WARN_ON (&dev_priv->drm, !new_cdclk_state->base.changed);
@@ -2181,7 +2181,7 @@ intel_set_cdclk_post_plane_update(struct intel_atomic_state *state) &new_cdclk_state->actual))return ; -if (pipe !=INVALID_PIPE && +if (!new_cdclk_state->disable_pipes && old_cdclk_state->actual.cdclk > new_cdclk_state->actual.cdclk) {drm_WARN_ON (&dev_priv->drm, !new_cdclk_state->base.changed);
@@ -2634,6 +2634,7 @@ static struct intel_global_state *intel_cdclk_duplicate_state(struct intel_globareturn NULL ; cdclk_state->pipe =INVALID_PIPE ; + cdclk_state->disable_pipes = false;return &cdclk_state->base; }
@@ -2793,6 +2794,8 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)if (ret)return ret; + new_cdclk_state->disable_pipes = true; +drm_dbg_kms (&dev_priv->drm,"Modeset required for cdclk change\n" ); }
drivers/gpu/drm/i915/display/intel_cdclk.h +3 -0
@@ -51,6 +51,9 @@ struct intel_cdclk_state {/* bitmask of active pipes */ u8 active_pipes; + +/* update cdclk with pipes disabled */ +bool disable_pipes; };int intel_crtc_compute_min_cdclk (const struct intel_crtc_state *crtc_state);
drivers/gpu/drm/i915/display/intel_ddi.c +5 -0
@@ -3683,7 +3683,12 @@ static bool m_n_equal(const struct intel_link_m_n *m_n_1,static bool crtcs_port_sync_compatible (const struct intel_crtc_state *crtc_state1,const struct intel_crtc_state *crtc_state2) { +/* +* FIXME the modeset sequence is currently wrong and +* can't deal with bigjoiner + port sync at the same time. +*/ return crtc_state1->hw.active && crtc_state2->hw.active && + !crtc_state1->bigjoiner_pipes && !crtc_state2->bigjoiner_pipes && crtc_state1->output_types == crtc_state2->output_types && crtc_state1->output_format == crtc_state2->output_format && crtc_state1->lane_count == crtc_state2->lane_count &&
drivers/gpu/drm/i915/display/intel_vrr.c +7 -0
@@ -110,6 +110,13 @@ intel_vrr_compute_config(struct intel_crtc_state *crtc_state,if (!intel_vrr_is_capable (connector))return ; +/* +* FIXME all joined pipes share the same transcoder. +* Need to account for that during VRR toggle/push/etc. +*/ +if (crtc_state->bigjoiner_pipes) +return ; +if (adjusted_mode->flags &DRM_MODE_FLAG_INTERLACE )return ;
drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowof.c +6 -1
@@ -66,11 +66,16 @@ of_init(struct nvkm_bios *bios, const char *name)return ERR_PTR (-EINVAL ); } +static void of_fini (void *p) +{ +kfree (p); +} +const struct nvbios_source nvbios_of = { .name ="OpenFirmware" , .init = of_init, - .fini = (void (*)(void *))kfree, + .fini = of_fini, .read = of_read, .size = of_size, .rw = false,
drivers/gpu/drm/qxl/qxl_release.c +45 -5
61 lines not on this page · raw message
drivers/iommu/intel/svm.c +1 -1
@@ -71,7 +71,7 @@ int intel_svm_enable_prq(struct intel_iommu *iommu)struct page *pages;int irq, ret; - pages =alloc_pages (GFP_KERNEL | __GFP_ZERO,PRQ_ORDER ); + pages =alloc_pages_node (iommu->node,GFP_KERNEL | __GFP_ZERO,PRQ_ORDER );if (!pages) {pr_warn ("IOMMU: %s: Failed to allocate page request queue\n" , iommu->name);
drivers/media/cec/core/cec-adap.c +0 -14
@@ -1121,20 +1121,6 @@ void cec_received_msg_ts(struct cec_adapter *adap,if (valid_la && min_len) {/* These messages have special length requirements */ switch (cmd) { -case CEC_MSG_TIMER_STATUS : -if (msg->msg[2 ] &0x10 ) { -switch (msg->msg[2 ] &0xf ) { -case CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE : -case CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE : -if (msg->len <5 ) - valid_la = false; -break ; - } - }else if ((msg->msg[2 ] &0xf ) ==CEC_OP_PROG_ERROR_DUPLICATE ) { -if (msg->len <5 ) - valid_la = false; - } -break ;case CEC_MSG_RECORD_ON :switch (msg->msg[2 ]) {case CEC_OP_RECORD_SRC_OWN :
drivers/net/dsa/mt7530.c +195 -34
250 lines not on this page · raw message
drivers/net/dsa/mt7530.h +5 -0
@@ -63,6 +63,7 @@ enum mt753x_id {/* Registers for BPDU and PAE frame control*/ #define MT753X_BPC 0x24 +#define MT753X_PAE_BPDU_FR BIT(25)#define MT753X_PAE_EG_TAG_MASK GENMASK(24, 22)#define MT753X_PAE_EG_TAG (x) FIELD_PREP(MT753X_PAE_EG_TAG_MASK, x)#define MT753X_PAE_PORT_FW_MASK GENMASK(18, 16)
@@ -73,20 +74,24 @@ enum mt753x_id {/* Register for :01 and :02 MAC DA frame control */ #define MT753X_RGAC1 0x28 +#define MT753X_R02_BPDU_FR BIT(25)#define MT753X_R02_EG_TAG_MASK GENMASK(24, 22)#define MT753X_R02_EG_TAG (x) FIELD_PREP(MT753X_R02_EG_TAG_MASK, x)#define MT753X_R02_PORT_FW_MASK GENMASK(18, 16)#define MT753X_R02_PORT_FW (x) FIELD_PREP(MT753X_R02_PORT_FW_MASK, x) +#define MT753X_R01_BPDU_FR BIT(9)#define MT753X_R01_EG_TAG_MASK GENMASK(8, 6)#define MT753X_R01_EG_TAG (x) FIELD_PREP(MT753X_R01_EG_TAG_MASK, x)#define MT753X_R01_PORT_FW_MASK GENMASK(2, 0)/* Register for :03 and :0E MAC DA frame control */ #define MT753X_RGAC2 0x2c +#define MT753X_R0E_BPDU_FR BIT(25)#define MT753X_R0E_EG_TAG_MASK GENMASK(24, 22)#define MT753X_R0E_EG_TAG (x) FIELD_PREP(MT753X_R0E_EG_TAG_MASK, x)#define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16)#define MT753X_R0E_PORT_FW (x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x) +#define MT753X_R03_BPDU_FR BIT(9)#define MT753X_R03_EG_TAG_MASK GENMASK(8, 6)#define MT753X_R03_EG_TAG (x) FIELD_PREP(MT753X_R03_EG_TAG_MASK, x)#define MT753X_R03_PORT_FW_MASK GENMASK(2, 0)
drivers/net/ethernet/amazon/ena/ena_com.c +1 -1
@@ -362,7 +362,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_dev,ENA_COM_BOUNCE_BUFFER_CNTRL_CNT ; io_sq->bounce_buf_ctrl.next_to_use =0 ; - size = io_sq->bounce_buf_ctrl.buffer_size * + size = (size_t )io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; dev_node =dev_to_node (ena_dev->dmadev);
drivers/net/ethernet/amazon/ena/ena_netdev.c +23 -12
@@ -1203,8 +1203,11 @@ static void ena_unmap_tx_buff(struct ena_ring *tx_ring,static void ena_free_tx_bufs (struct ena_ring *tx_ring) {bool print_once = true; +bool is_xdp_ring;u32 i; + is_xdp_ring =ENA_IS_XDP_INDEX (tx_ring->adapter, tx_ring->qid); +for (i =0 ; i < tx_ring->ring_size; i++) {struct ena_tx_buffer *tx_info = &tx_ring->tx_buffer_info[i];
@@ -1224,10 +1227,15 @@ static void ena_free_tx_bufs(struct ena_ring *tx_ring)ena_unmap_tx_buff (tx_ring, tx_info); -dev_kfree_skb_any (tx_info->skb); +if (is_xdp_ring) +xdp_return_frame (tx_info->xdpf); +else +dev_kfree_skb_any (tx_info->skb); } -netdev_tx_reset_queue (netdev_get_tx_queue (tx_ring->netdev, - tx_ring->qid)); + +if (!is_xdp_ring) +netdev_tx_reset_queue (netdev_get_tx_queue (tx_ring->netdev, + tx_ring->qid)); }static void ena_free_all_tx_bufs (struct ena_adapter *adapter)
@@ -3797,10 +3805,11 @@ static void check_for_missing_completions(struct ena_adapter *adapter) {struct ena_ring *tx_ring;struct ena_ring *rx_ring; -int i, budget, rc; +int qid, budget, rc;int io_queue_count; io_queue_count = adapter->xdp_num_queues + adapter->num_io_queues; +/* Make sure the driver doesn't turn the device in other process */ smp_rmb ();
@@ -3813,27 +3822,29 @@ static void check_for_missing_completions(struct ena_adapter *adapter)if (adapter->missing_tx_completion_to ==ENA_HW_HINTS_NO_TIMEOUT )return ; - budget =ENA_MONITORED_TX_QUEUES ; + budget =min_t (u32, io_queue_count,ENA_MONITORED_TX_QUEUES ); -for (i = adapter->last_monitored_tx_qid; i < io_queue_count; i++) { - tx_ring = &adapter->tx_ring[i]; - rx_ring = &adapter->rx_ring[i]; + qid = adapter->last_monitored_tx_qid; + +while (budget) { + qid = (qid +1 ) % io_queue_count; + + tx_ring = &adapter->tx_ring[qid]; + rx_ring = &adapter->rx_ring[qid]; rc =check_missing_comp_in_tx_queue (adapter, tx_ring);if (unlikely (rc))return ; - rc = !ENA_IS_XDP_INDEX (adapter, i) ? + rc = !ENA_IS_XDP_INDEX (adapter, qid) ?check_for_rx_interrupt_queue (adapter, rx_ring) :0 ;if (unlikely (rc))return ; budget--; -if (!budget) -break ; } - adapter->last_monitored_tx_qid = i % io_queue_count; + adapter->last_monitored_tx_qid = qid; }/* trigger napi schedule after 2 consecutive detections */
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -0
@@ -10564,6 +10564,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)/* VF-reps may need to be re-opened after the PF is re-opened */ if (BNXT_PF (bp))bnxt_vf_reps_open (bp); +if (bp->ptp_cfg) +atomic_set (&bp->ptp_cfg->tx_avail,BNXT_MAX_TX_TS );bnxt_ptp_init_rtc (bp, true);bnxt_ptp_cfg_tstamp_filters (bp);return 0 ;
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +10 -10
@@ -4237,18 +4237,18 @@ static int rvu_nix_block_init(struct rvu *rvu, struct nix_hw *nix_hw)*/ rvu_write64 (rvu, blkaddr,NIX_AF_CFG ,rvu_read64 (rvu, blkaddr,NIX_AF_CFG ) |0x40ULL ); + } -/* Set chan/link to backpressure TL3 instead of TL2 */ -rvu_write64 (rvu, blkaddr,NIX_AF_PSE_CHANNEL_LEVEL ,0x01 ); +/* Set chan/link to backpressure TL3 instead of TL2 */ +rvu_write64 (rvu, blkaddr,NIX_AF_PSE_CHANNEL_LEVEL ,0x01 ); -/* Disable SQ manager's sticky mode operation (set TM6 = 0) -* This sticky mode is known to cause SQ stalls when multiple -* SQs are mapped to same SMQ and transmitting pkts at a time. -*/ - cfg =rvu_read64 (rvu, blkaddr,NIX_AF_SQM_DBG_CTL_STATUS ); - cfg &= ~BIT_ULL (15 ); -rvu_write64 (rvu, blkaddr,NIX_AF_SQM_DBG_CTL_STATUS , cfg); - } +/* Disable SQ manager's sticky mode operation (set TM6 = 0) +* This sticky mode is known to cause SQ stalls when multiple +* SQs are mapped to same SMQ and transmitting pkts at a time. +*/ + cfg =rvu_read64 (rvu, blkaddr,NIX_AF_SQM_DBG_CTL_STATUS ); + cfg &= ~BIT_ULL (15 ); +rvu_write64 (rvu, blkaddr,NIX_AF_SQM_DBG_CTL_STATUS , cfg); ltdefs = rvu->kpu.lt_def;/* Calibrate X2P bus to check if CGX/LBK links are fine */
drivers/net/ethernet/mellanox/mlx5/core/en/qos.c +17 -16
@@ -82,24 +82,25 @@ int mlx5e_open_qos_sq(struct mlx5e_priv *priv, struct mlx5e_channels *chs, txq_ix =mlx5e_qid_from_qos (chs, node_qid); -WARN_ON (node_qid > priv->htb_max_qos_sqs); -if (node_qid == priv->htb_max_qos_sqs) { -struct mlx5e_sq_stats *stats, **stats_list =NULL ; - -if (priv->htb_max_qos_sqs ==0 ) { - stats_list =kvcalloc (mlx5e_qos_max_leaf_nodes (priv->mdev), -sizeof (*stats_list), -GFP_KERNEL ); -if (!stats_list) -return -ENOMEM ; - } +WARN_ON (node_qid >=mlx5e_htb_cur_leaf_nodes (priv->htb)); +if (!priv->htb_qos_sq_stats) { +struct mlx5e_sq_stats **stats_list; + + stats_list =kvcalloc (mlx5e_qos_max_leaf_nodes (priv->mdev), +sizeof (*stats_list),GFP_KERNEL ); +if (!stats_list) +return -ENOMEM ; + +WRITE_ONCE (priv->htb_qos_sq_stats, stats_list); + } + +if (!priv->htb_qos_sq_stats[node_qid]) { +struct mlx5e_sq_stats *stats; + stats =kzalloc (sizeof (*stats),GFP_KERNEL ); -if (!stats) { -kvfree (stats_list); +if (!stats)return -ENOMEM ; - } -if (stats_list) -WRITE_ONCE (priv->htb_qos_sq_stats, stats_list); +WRITE_ONCE (priv->htb_qos_sq_stats[node_qid], stats);/* Order htb_max_qos_sqs increment after writing the array pointer. * Pairs with smp_load_acquire in en_stats.c.
drivers/net/ethernet/mellanox/mlx5/core/en/selq.c +2 -0
@@ -57,6 +57,7 @@ int mlx5e_selq_init(struct mlx5e_selq *selq, struct mutex *state_lock)void mlx5e_selq_cleanup (struct mlx5e_selq *selq) { +mutex_lock (selq->state_lock);WARN_ON_ONCE (selq->is_prepared);kvfree (selq->standby);
@@ -67,6 +68,7 @@ void mlx5e_selq_cleanup(struct mlx5e_selq *selq)kvfree (selq->standby); selq->standby =NULL ; +mutex_unlock (selq->state_lock); }void mlx5e_selq_prepare_params (struct mlx5e_selq *selq,struct mlx5e_params *params)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -2
@@ -5578,9 +5578,7 @@ void mlx5e_priv_cleanup(struct mlx5e_priv *priv)kfree (priv->tx_rates);kfree (priv->txq2sq);destroy_workqueue (priv->wq); -mutex_lock (&priv->state_lock);mlx5e_selq_cleanup (&priv->selq); -mutex_unlock (&priv->state_lock);free_cpumask_var (priv->scratchpad.cpumask);for (i =0 ; i < priv->htb_max_qos_sqs; i++)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -1
@@ -1752,8 +1752,9 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg, }trace_mlx5_fs_set_fte (fte, false); +/* Link newly added rules into the tree. */ for (i =0 ; i < handle->num_rules; i++) { -if (refcount_read (&handle->rule[i]->node.refcount) ==1 ) { +if (!handle->rule[i]->node.parent) {tree_add_node (&handle->rule[i]->node, &fte->node);trace_mlx5_fs_add_rule (handle->rule[i]); }
drivers/net/ethernet/micrel/ks8851.h +0 -3
@@ -368,7 +368,6 @@ union ks8851_tx_hdr {* @rdfifo: FIFO read callback * @wrfifo: FIFO write callback * @start_xmit: start_xmit() implementation callback -* @rx_skb: rx_skb() implementation callback * @flush_tx_work: flush_tx_work() implementation callback * * The @statelock is used to protect information in the structure which may
@@ -423,8 +422,6 @@ struct ks8851_net { struct sk_buff *txp, bool irq);netdev_tx_t (*start_xmit)(struct sk_buff *skb,struct net_device *dev); -void (*rx_skb)(struct ks8851_net *ks, -struct sk_buff *skb);void (*flush_tx_work)(struct ks8851_net *ks); };
drivers/net/ethernet/micrel/ks8851_common.c +5 -11
@@ -231,16 +231,6 @@ static void ks8851_dbg_dumpkkt(struct ks8851_net *ks, u8 *rxpkt) rxpkt[12], rxpkt[13], rxpkt[14], rxpkt[15]); } -/** -* ks8851_rx_skb - receive skbuff -* @ks: The device state. -* @skb: The skbuff -*/ -static void ks8851_rx_skb (struct ks8851_net *ks,struct sk_buff *skb) -{ - ks->rx_skb (ks, skb); -} -/** * ks8851_rx_pkts - receive packets from the host * @ks: The device information.
@@ -309,7 +299,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)ks8851_dbg_dumpkkt (ks, rxpkt); skb->protocol =eth_type_trans (skb, ks->netdev); -ks8851_rx_skb (ks, skb); +__netif_rx (skb); ks->netdev->stats.rx_packets++; ks->netdev->stats.rx_bytes += rxlen;
@@ -340,6 +330,8 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)unsigned long flags;unsigned int status; +local_bh_disable (); +ks8851_lock (ks, &flags); status =ks8851_rdreg16 (ks,KS_ISR );
@@ -416,6 +408,8 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)if (status &IRQ_LCI )mii_check_link (&ks->mii); +local_bh_enable (); +return IRQ_HANDLED ; }
drivers/net/ethernet/micrel/ks8851_par.c +0 -11
@@ -210,16 +210,6 @@ static void ks8851_wrfifo_par(struct ks8851_net *ks, struct sk_buff *txp,iowrite16_rep (ksp->hw_addr, txp->data, len /2 ); } -/** -* ks8851_rx_skb_par - receive skbuff -* @ks: The device state. -* @skb: The skbuff -*/ -static void ks8851_rx_skb_par (struct ks8851_net *ks,struct sk_buff *skb) -{ -netif_rx (skb); -} -static unsigned int ks8851_rdreg16_par_txqcr (struct ks8851_net *ks) {return ks8851_rdreg16_par (ks,KS_TXQCR );
@@ -298,7 +288,6 @@ static int ks8851_probe_par(struct platform_device *pdev) ks->rdfifo = ks8851_rdfifo_par; ks->wrfifo = ks8851_wrfifo_par; ks->start_xmit = ks8851_start_xmit_par; - ks->rx_skb = ks8851_rx_skb_par;#define STD_IRQ (IRQ_LCI |/* Link Change */ \ IRQ_RXI | /* RX done */ \
drivers/net/ethernet/micrel/ks8851_spi.c +0 -11
@@ -298,16 +298,6 @@ static unsigned int calc_txlen(unsigned int len)return ALIGN (len +4 ,4 ); } -/** -* ks8851_rx_skb_spi - receive skbuff -* @ks: The device state -* @skb: The skbuff -*/ -static void ks8851_rx_skb_spi (struct ks8851_net *ks,struct sk_buff *skb) -{ -netif_rx (skb); -} -/** * ks8851_tx_work - process tx packet(s) * @work: The work strucutre what was scheduled.
@@ -435,7 +425,6 @@ static int ks8851_probe_spi(struct spi_device *spi) ks->rdfifo = ks8851_rdfifo_spi; ks->wrfifo = ks8851_wrfifo_spi; ks->start_xmit = ks8851_start_xmit_spi; - ks->rx_skb = ks8851_rx_skb_spi; ks->flush_tx_work = ks8851_flush_tx_work_spi;#define STD_IRQ (IRQ_LCI |/* Link Change */ \
drivers/net/ethernet/microchip/sparx5/sparx5_port.c +2 -2
@@ -730,7 +730,7 @@ static int sparx5_port_pcs_low_set(struct sparx5 *sparx5,bool sgmii = false, inband_aneg = false;int err; -if (port->conf.inband) { +if (conf->inband) {if (conf->portmode ==PHY_INTERFACE_MODE_SGMII || conf->portmode ==PHY_INTERFACE_MODE_QSGMII ) inband_aneg = true;/* Cisco-SGMII in-band-aneg */
@@ -947,7 +947,7 @@ int sparx5_port_pcs_set(struct sparx5 *sparx5,if (err)return -EINVAL ; -if (port->conf.inband) { +if (conf->inband) {/* Enable/disable 1G counters in ASM */ spx5_rmw(ASM_PORT_CFG_CSC_STAT_DIS_SET(high_speed_dev), ASM_PORT_CFG_CSC_STAT_DIS,
drivers/net/geneve.c +2 -2
@@ -930,7 +930,7 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,__be16 sport;int err; -if (!pskb_inet_may_pull (skb)) +if (!skb_vlan_inet_prepare (skb))return -EINVAL ; sport =udp_flow_src_port (geneve->net, skb,1 ,USHRT_MAX , true);
@@ -1028,7 +1028,7 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,__be16 sport;int err; -if (!pskb_inet_may_pull (skb)) +if (!skb_vlan_inet_prepare (skb))return -EINVAL ; sport =udp_flow_src_port (geneve->net, skb,1 ,USHRT_MAX , true);
drivers/scsi/hisi_sas/hisi_sas_main.c +1 -1
@@ -1715,7 +1715,7 @@ static int hisi_sas_debug_I_T_nexus_reset(struct domain_device *device)if (dev_is_sata (device)) {struct ata_link *link = &device->sata_dev.ap->link; - rc =ata_wait_after_reset (link,HISI_SAS_WAIT_PHYUP_TIMEOUT , + rc =ata_wait_after_reset (link, jiffies +HISI_SAS_WAIT_PHYUP_TIMEOUT , smp_ata_check_ready_type); }else {msleep (2000 );
drivers/scsi/qla2xxx/qla_edif.c +1 -1
@@ -1058,7 +1058,7 @@ qla_edif_app_getstats(scsi_qla_host_t *vha, struct bsg_job *bsg_job)list_for_each_entry_safe (fcport, tf, &vha->vp_fcports, list) {if (fcport->edif.enable) { -if (pcnt > app_req.num_ports) +if (pcnt >= app_req.num_ports)break ; app_reply->elem[pcnt].rekey_count =
drivers/vhost/vhost.c +22 -2
@@ -2523,9 +2523,19 @@ bool vhost_vq_avail_empty(struct vhost_dev *dev, struct vhost_virtqueue *vq) r =vhost_get_avail_idx (vq, &avail_idx);if (unlikely (r))return false; + vq->avail_idx =vhost16_to_cpu (vq, avail_idx); +if (vq->avail_idx != vq->last_avail_idx) { +/* Since we have updated avail_idx, the following +* call to vhost_get_vq_desc() will read available +* ring entries. Make sure that read happens after +* the avail_idx read. +*/ +smp_rmb (); +return false; + } -return vq->avail_idx == vq->last_avail_idx; +return true; }EXPORT_SYMBOL_GPL (vhost_vq_avail_empty);
@@ -2562,9 +2572,19 @@ bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) &vq->avail->idx, r);return false; } + vq->avail_idx =vhost16_to_cpu (vq, avail_idx); +if (vq->avail_idx != vq->last_avail_idx) { +/* Since we have updated avail_idx, the following +* call to vhost_get_vq_desc() will read available +* ring entries. Make sure that read happens after +* the avail_idx read. +*/ +smp_rmb (); +return true; + } -return vq->avail_idx != vq->last_avail_idx; +return false; }EXPORT_SYMBOL_GPL (vhost_enable_notify);
fs/btrfs/delayed-inode.c +3 -0
@@ -1115,6 +1115,9 @@ __btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,if (ret)return ret; + ret =btrfs_record_root_in_trans (trans, node->root); +if (ret) +return ret; ret =btrfs_update_delayed_inode (trans, node->root, path, node);return ret; }
fs/btrfs/qgroup.c +2 -0
@@ -4154,6 +4154,8 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes) BTRFS_QGROUP_RSV_META_PREALLOC);trace_qgroup_meta_convert (root, num_bytes);qgroup_convert_meta (fs_info, root->root_key.objectid, num_bytes); +if (!sb_rdonly (fs_info->sb)) +add_root_meta_rsv (root, num_bytes,BTRFS_QGROUP_RSV_META_PERTRANS ); }/*
fs/btrfs/transaction.c +8 -9
@@ -700,14 +700,6 @@ start_transaction(struct btrfs_root *root, unsigned int num_items, h->reloc_reserved = reloc_reserved; } -/* -* Now that we have found a transaction to be a part of, convert the -* qgroup reservation from prealloc to pertrans. A different transaction -* can't race in and free our pertrans out from under us. -*/ -if (qgroup_reserved) -btrfs_qgroup_convert_reserved_meta (root, qgroup_reserved); - got_it:if (!current->journal_info) current->journal_info = h;
@@ -741,8 +733,15 @@ start_transaction(struct btrfs_root *root, unsigned int num_items,* not just freed. */ btrfs_end_transaction (h); -return ERR_PTR (ret); + goto reserve_fail; } +/* +* Now that we have found a transaction to be a part of, convert the +* qgroup reservation from prealloc to pertrans. A different transaction +* can't race in and free our pertrans out from under us. +*/ +if (qgroup_reserved) +btrfs_qgroup_convert_reserved_meta (root, qgroup_reserved);return h;
fs/smb/client/cached_dir.c +2 -2
@@ -386,8 +386,8 @@ smb2_close_cached_fid(struct kref *ref)if (cfid->is_open) { rc =SMB2_close (0 , cfid->tcon, cfid->fid.persistent_fid, cfid->fid.volatile_fid); -if (rc != -EBUSY && rc != -EAGAIN ) -atomic_dec (&cfid->tcon->num_remote_opens); +if (rc)/* should we retry on -EBUSY or -EAGAIN? */ +cifs_dbg (VFS ,"close cached dir rc %d\n" , rc); }free_cached_dir (cfid);
include/linux/dma-fence.h +7 -0
@@ -659,4 +659,11 @@ static inline bool dma_fence_is_container(struct dma_fence *fence)return dma_fence_is_array (fence) ||dma_fence_is_chain (fence); } +#define DMA_FENCE_WARN(f, fmt, args...) \ + do { \ + struct dma_fence *__ff = (f); \ + pr_warn("f %llu#%llu: " fmt, __ff->context, __ff->seqno,\ + ##args); \ + } while (0) +#endif /* __LINUX_DMA_FENCE_H */
include/linux/irqflags.h +1 -1
@@ -126,7 +126,7 @@ do { \# define lockdep_softirq_enter () do { } while (0)# define lockdep_softirq_exit () do { } while (0)# define lockdep_hrtimer_enter (__hrtimer) false -# define lockdep_hrtimer_exit (__context) do { } while (0) +# define lockdep_hrtimer_exit (__context) do { (void)(__context); } while (0)# define lockdep_posixtimer_enter () do { } while (0)# define lockdep_posixtimer_exit () do { } while (0)# define lockdep_irq_work_enter (__work) do { } while (0)
include/linux/u64_stats_sync.h +5 -4
@@ -135,10 +135,11 @@ static inline void u64_stats_inc(u64_stats_t *p) p->v++; } -static inline void u64_stats_init (struct u64_stats_sync *syncp) -{ -seqcount_init (&syncp->seq); -} +#define u64_stats_init (syncp) \ + do { \ + struct u64_stats_sync *__s = (syncp); \ + seqcount_init(&__s->seq); \ + } while (0)static inline void __u64_stats_update_begin (struct u64_stats_sync *syncp) {
include/net/addrconf.h +4 -0
@@ -437,6 +437,10 @@ static inline void in6_ifa_hold(struct inet6_ifaddr *ifp)refcount_inc (&ifp->refcnt); } +static inline bool in6_ifa_hold_safe (struct inet6_ifaddr *ifp) +{ +return refcount_inc_not_zero (&ifp->refcnt); +}/* * compute link-local solicited-node multicast address
include/net/af_unix.h +1 -1
@@ -54,7 +54,7 @@ struct unix_sock {struct mutex iolock, bindlock;struct sock *peer;struct list_head link; -atomic_long_t inflight; +unsigned long inflight;spinlock_t lock;unsigned long gc_flags;#define UNIX_GC_CANDIDATE 0
include/net/bluetooth/bluetooth.h +9 -0
@@ -565,6 +565,15 @@ static inline struct sk_buff *bt_skb_sendmmsg(struct sock *sk,return skb; } +static inline int bt_copy_from_sockptr (void *dst,size_t dst_size, +sockptr_t src,size_t src_size) +{ +if (dst_size > src_size) +return -EINVAL ; + +return copy_from_sockptr (dst, src, dst_size); +} +int bt_to_errno (u16 code);__u8 bt_status (int err);
include/net/ip_tunnels.h +33 -0
@@ -351,6 +351,39 @@ static inline bool pskb_inet_may_pull(struct sk_buff *skb)return pskb_network_may_pull (skb, nhlen); } +/* Variant of pskb_inet_may_pull(). +*/ +static inline bool skb_vlan_inet_prepare (struct sk_buff *skb) +{ +int nhlen =0 , maclen =ETH_HLEN ; +__be16 type = skb->protocol; + +/* Essentially this is skb_protocol(skb, true) +* And we get MAC len. +*/ +if (eth_type_vlan (type)) + type =__vlan_get_protocol (skb, type, &maclen); + +switch (type) { +#if IS_ENABLED (CONFIG_IPV6 ) +case htons (ETH_P_IPV6 ): + nhlen =sizeof (struct ipv6hdr ); +break ; +#endif +case htons (ETH_P_IP ): + nhlen =sizeof (struct iphdr ); +break ; + } +/* For ETH_P_IPV6/ETH_P_IP we make sure to pull +* a base network header in skb->head. +*/ +if (!pskb_may_pull (skb, maclen + nhlen)) +return false; + +skb_set_network_header (skb, maclen); +return true; +} +static inline int ip_encap_hlen (struct ip_tunnel_encap *e) {const struct ip_tunnel_encap_ops *ops;
io_uring/net.c +1 -0
@@ -1229,6 +1229,7 @@ int io_sendmsg_zc(struct io_kiocb *req, unsigned int issue_flags)if (req_has_async_data (req)) { kmsg = req->async_data; + kmsg->msg.msg_control_user = sr->msg_control; }else { ret =io_sendmsg_copy_hdr (req, &iomsg);if (ret)
kernel/cpu.c +2 -1
@@ -2788,7 +2788,8 @@ enum cpu_mitigations { };static enum cpu_mitigations cpu_mitigations__ro_after_init = -CPU_MITIGATIONS_AUTO ; +IS_ENABLED (CONFIG_SPECULATION_MITIGATIONS ) ?CPU_MITIGATIONS_AUTO : +CPU_MITIGATIONS_OFF ;static int __init mitigations_parse_cmdline (char *arg) {
kernel/kprobes.c +12 -6
@@ -1567,10 +1567,17 @@ static int check_kprobe_address_safe(struct kprobe *p,jump_label_lock ();preempt_disable (); -/* Ensure it is not in reserved area nor out of text */ - if (!(core_kernel_text((unsigned long) p->addr) || - is_module_text_address((unsigned long) p->addr)) || - in_gate_area_no_mm((unsigned long) p->addr) || +/* Ensure the address is in a text area, and find a module if exists. */ + *probed_mod =NULL ; +if (!core_kernel_text ((unsigned long ) p->addr)) { + *probed_mod =__module_text_address ((unsigned long ) p->addr); +if (!(*probed_mod)) { + ret = -EINVAL ; + goto out; + } + } +/* Ensure it is not in reserved area. */ + if (in_gate_area_no_mm((unsigned long) p->addr) || within_kprobe_blacklist((unsigned long) p->addr) || jump_label_text_reserved(p->addr, p->addr) || static_call_text_reserved(p->addr, p->addr) ||
@@ -1580,8 +1587,7 @@ static int check_kprobe_address_safe(struct kprobe *p, goto out; } -/* Check if 'p' is probing a module. */ - *probed_mod =__module_text_address ((unsigned long ) p->addr); +/* Get module refcount and reject __init functions for loaded modules. */ if (*probed_mod) {/* * We must hold a refcount of the probed module while updating
kernel/power/suspend.c +6 -0
@@ -106,6 +106,12 @@ static void s2idle_enter(void)swait_event_exclusive (s2idle_wait_head, s2idle_state ==S2IDLE_STATE_WAKE ); +/* +* Kick all CPUs to ensure that they resume their timers and restore +* consistent system state. +*/ +wake_up_all_idle_cpus (); +cpus_read_unlock ();raw_spin_lock_irq (&s2idle_lock);
kernel/trace/ring_buffer.c +3 -3
@@ -1543,7 +1543,6 @@ static void rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer, old_write =local_add_return (RB_WRITE_INTCNT , &next_page->write); old_entries =local_add_return (RB_WRITE_INTCNT , &next_page->entries); -local_inc (&cpu_buffer->pages_touched);/* * Just make sure we have seen our old_write and synchronize * with any interrupts that come in.
@@ -1580,8 +1579,9 @@ static void rb_tail_page_update(struct ring_buffer_per_cpu *cpu_buffer,*/ local_set (&next_page->page->commit,0 ); -/* Again, either we update tail_page or an interrupt does */ - (void )cmpxchg (&cpu_buffer->tail_page, tail_page, next_page); +/* Either we update tail_page or an interrupt does */ +if (try_cmpxchg (&cpu_buffer->tail_page, &tail_page, next_page)) +local_inc (&cpu_buffer->pages_touched); } }
kernel/trace/trace_events.c +4 -0
@@ -1669,6 +1669,7 @@ static int trace_format_open(struct inode *inode, struct file *file)return 0 ; } +#ifdef CONFIG_PERF_EVENTS static ssize_t event_id_read (struct file *filp,char __user *ubuf,size_t cnt,loff_t *ppos) {
@@ -1683,6 +1684,7 @@ event_id_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos)return simple_read_from_buffer (ubuf, cnt, ppos, buf, len); } +#endif static ssize_t event_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
@@ -2127,10 +2129,12 @@ static const struct file_operations ftrace_event_format_fops = { .release = seq_release, }; +#ifdef CONFIG_PERF_EVENTS static const struct file_operations ftrace_event_id_fops = { .read = event_id_read, .llseek = default_llseek, }; +#endif static const struct file_operations ftrace_event_filter_fops = { .open = tracing_open_file_tr,
net/batman-adv/translation-table.c +1 -1
@@ -3948,7 +3948,7 @@ void batadv_tt_local_resize_to_mtu(struct net_device *soft_iface)spin_lock_bh (&bat_priv->tt.commit_lock); -while (true) { +while (timeout) { table_size =batadv_tt_local_table_transmit_size (bat_priv);if (packet_size_max >= table_size)break ;
net/bluetooth/hci_request.c +3 -1
@@ -105,8 +105,10 @@ void hci_req_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode,if (hdev->req_status ==HCI_REQ_PEND ) { hdev->req_result = result; hdev->req_status =HCI_REQ_DONE ; -if (skb) +if (skb) { +kfree_skb (hdev->req_skb); hdev->req_skb =skb_get (skb); + }wake_up_interruptible (&hdev->req_wait_q); } }
net/bluetooth/l2cap_sock.c +20 -32
127 lines not on this page · raw message
net/bluetooth/sco.c +10 -13
@@ -831,7 +831,7 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, sockptr_t optval, unsigned int optlen) {struct sock *sk = sock->sk; -int len, err =0 ; +int err =0 ;struct bt_voice voice;u32 opt;struct bt_codecs *codecs;
@@ -850,10 +850,9 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,break ; } -if (copy_from_sockptr (&opt, optval,sizeof (u32))) { - err = -EFAULT ; + err =bt_copy_from_sockptr (&opt,sizeof (opt), optval, optlen); +if (err)break ; - }if (opt)set_bit (BT_SK_DEFER_SETUP , &bt_sk (sk)->flags);
@@ -870,11 +869,10 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname, voice.setting =sco_pi (sk)->setting; - len = min_t(unsigned int, sizeof(voice), optlen); -if (copy_from_sockptr (&voice, optval, len)) { - err = -EFAULT ; + err =bt_copy_from_sockptr (&voice,sizeof (voice), optval, + optlen); +if (err)break ; - }/* Explicitly check for these values */ if (voice.setting != BT_VOICE_TRANSPARENT &&
@@ -897,10 +895,9 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,break ;case BT_PKT_STATUS : -if (copy_from_sockptr (&opt, optval,sizeof (u32))) { - err = -EFAULT ; + err =bt_copy_from_sockptr (&opt,sizeof (opt), optval, optlen); +if (err)break ; - }if (opt)sco_pi (sk)->cmsg_mask |=SCO_CMSG_PKT_STATUS ;
@@ -941,9 +938,9 @@ static int sco_sock_setsockopt(struct socket *sock, int level, int optname,break ; } -if (copy_from_sockptr (buffer, optval, optlen)) { + err =bt_copy_from_sockptr (buffer, optlen, optval, optlen); +if (err) {hci_dev_put (hdev); - err = -EFAULT ;break ; }
net/ipv4/netfilter/arp_tables.c +4 -0
@@ -966,6 +966,8 @@ static int do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
@@ -1266,6 +1268,8 @@ static int compat_do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
net/ipv4/netfilter/ip_tables.c +4 -0
@@ -1120,6 +1120,8 @@ do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
@@ -1506,6 +1508,8 @@ compat_do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
net/ipv4/route.c +1 -3
@@ -926,13 +926,11 @@ void ip_rt_send_redirect(struct sk_buff *skb)icmp_send (skb,ICMP_REDIRECT ,ICMP_REDIR_HOST , gw); peer->rate_last = jiffies; ++peer->n_redirects; -#ifdef CONFIG_IP_ROUTE_VERBOSE -if (log_martians && +if (IS_ENABLED (CONFIG_IP_ROUTE_VERBOSE ) && log_martians && peer->n_redirects == ip_rt_redirect_number)net_warn_ratelimited ("host %pI4/if%d ignores redirects for %pI4 to %pI4\n" , &ip_hdr (skb)->saddr,inet_iif (skb), &ip_hdr (skb)->daddr, &gw); -#endif } out_put_peer:inet_putpeer (peer);
net/ipv6/addrconf.c +4 -3
@@ -2050,9 +2050,10 @@ struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, const struct in6_addr *addif (ipv6_addr_equal (&ifp->addr, addr)) {if (!dev || ifp->idev->dev == dev || !(ifp->scope&(IFA_LINK |IFA_HOST ) || strict)) { - result = ifp; -in6_ifa_hold (ifp); -break ; +if (in6_ifa_hold_safe (ifp)) { + result = ifp; +break ; + } } } }
net/ipv6/ip6_fib.c +5 -2
@@ -1376,7 +1376,10 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt, struct nl_info *info, struct netlink_ext_ack *extack) { struct fib6_table *table = rt->fib6_table; -struct fib6_node *fn, *pn =NULL ; +struct fib6_node *fn; +#ifdef CONFIG_IPV6_SUBTREES +struct fib6_node *pn =NULL ; +#endif int err = -ENOMEM ;int allow_create =1 ;int replace_required =0 ;
@@ -1400,9 +1403,9 @@ int fib6_add(struct fib6_node *root, struct fib6_info *rt, goto out; } +#ifdef CONFIG_IPV6_SUBTREES pn = fn; -#ifdef CONFIG_IPV6_SUBTREES if (rt->fib6_src.plen) {struct fib6_node *sn;
net/ipv6/netfilter/ip6_tables.c +4 -0
@@ -1137,6 +1137,8 @@ do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
@@ -1515,6 +1517,8 @@ compat_do_replace(struct net *net, sockptr_t arg, unsigned int len)return -ENOMEM ;if (tmp.num_counters ==0 )return -EINVAL ; +if ((u64 )len < (u64 )tmp.size +sizeof (tmp)) +return -EINVAL ; tmp.name[sizeof (tmp.name)-1 ] =0 ;
net/openvswitch/conntrack.c +3 -2
@@ -1711,8 +1711,9 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,if (ct_info.timeout[0 ]) {if (nf_ct_set_timeout (net, ct_info.ct, family, key->ip.proto, ct_info.timeout)) -pr_info_ratelimited ("Failed to associated timeout " -"policy `%s'\n" , ct_info.timeout); +OVS_NLERR (log, +"Failed to associated timeout policy '%s'" , + ct_info.timeout);else ct_info.nf_ct_timeout =rcu_dereference (nf_ct_timeout_find (ct_info.ct)->timeout);
net/unix/af_unix.c +5 -3
@@ -968,11 +968,11 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern, sk->sk_write_space = unix_write_space; sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen; sk->sk_destruct = unix_sock_destructor; - u =unix_sk (sk); + u =unix_sk (sk); + u->inflight =0 ; u->path.dentry =NULL ; u->path.mnt =NULL ;spin_lock_init (&u->lock); -atomic_long_set (&u->inflight,0 );INIT_LIST_HEAD (&u->link);mutex_init (&u->iolock);/* single task reading lock */ mutex_init (&u->bindlock);/* single task binding lock */
@@ -2677,7 +2677,9 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk, } }else if (!(flags &MSG_PEEK )) {skb_unlink (skb, &sk->sk_receive_queue); -consume_skb (skb); +WRITE_ONCE (u->oob_skb,NULL ); +if (!WARN_ON_ONCE (skb_unref (skb))) +kfree_skb (skb); skb =skb_peek (&sk->sk_receive_queue); } }
net/unix/garbage.c +25 -10
@@ -166,17 +166,18 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),static void dec_inflight (struct unix_sock *usk) { -atomic_long_dec (&usk->inflight); + usk->inflight--; }static void inc_inflight (struct unix_sock *usk) { -atomic_long_inc (&usk->inflight); + usk->inflight++; }static void inc_inflight_move_tail (struct unix_sock *u) { -atomic_long_inc (&u->inflight); + u->inflight++; +/* If this still might be part of a cycle, move it to the end * of the list, so that it's checked even if it was already * passed over
@@ -234,20 +235,34 @@ void unix_gc(void)* receive queues. Other, non candidate sockets _can_ be * added to queue, so we must make sure only to touch * candidates. +* +* Embryos, though never candidates themselves, affect which +* candidates are reachable by the garbage collector. Before +* being added to a listener's queue, an embryo may already +* receive data carrying SCM_RIGHTS, potentially making the +* passed socket a candidate that is not yet reachable by the +* collector. It becomes reachable once the embryo is +* enqueued. Therefore, we must ensure that no SCM-laden +* embryo appears in a (candidate) listener's queue between +* consecutive scan_children() calls. */ list_for_each_entry_safe (u, next, &gc_inflight_list, link) { +struct sock *sk = &u->sk;long total_refs; -long inflight_refs; - total_refs =file_count (u->sk.sk_socket->file); - inflight_refs =atomic_long_read (&u->inflight); + total_refs =file_count (sk->sk_socket->file); -BUG_ON (inflight_refs <1 ); -BUG_ON (total_refs < inflight_refs); -if (total_refs == inflight_refs) { +BUG_ON (!u->inflight); +BUG_ON (total_refs < u->inflight); +if (total_refs == u->inflight) {list_move_tail (&u->link, &gc_candidates);__set_bit (UNIX_GC_CANDIDATE , &u->gc_flags);__set_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags); + +if (sk->sk_state ==TCP_LISTEN ) { +unix_state_lock (sk); +unix_state_unlock (sk); + } } }
@@ -271,7 +286,7 @@ void unix_gc(void)/* Move cursor to after the current position. */ list_move (&cursor, &u->link); -if (atomic_long_read (&u->inflight) >0 ) { +if (u->inflight) {list_move_tail (&u->link, ¬_cycle_list);__clear_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags);scan_children (&u->sk, inc_inflight_move_tail,NULL );
net/unix/scm.c +5 -3
@@ -52,12 +52,13 @@ void unix_inflight(struct user_struct *user, struct file *fp)if (s) {struct unix_sock *u =unix_sk (s); -if (atomic_long_inc_return (&u->inflight) ==1 ) { +if (!u->inflight) {BUG_ON (!list_empty (&u->link));list_add_tail (&u->link, &gc_inflight_list); }else {BUG_ON (list_empty (&u->link)); } + u->inflight++;/* Paired with READ_ONCE() in wait_for_unix_gc() */ WRITE_ONCE (unix_tot_inflight, unix_tot_inflight +1 ); }
@@ -74,10 +75,11 @@ void unix_notinflight(struct user_struct *user, struct file *fp)if (s) {struct unix_sock *u =unix_sk (s); -BUG_ON (!atomic_long_read (&u->inflight)); +BUG_ON (!u->inflight);BUG_ON (list_empty (&u->link)); -if (atomic_long_dec_and_test (&u->inflight)) + u->inflight--; +if (!u->inflight)list_del_init (&u->link);/* Paired with READ_ONCE() in wait_for_unix_gc() */ WRITE_ONCE (unix_tot_inflight, unix_tot_inflight -1 );
net/xdp/xsk.c +2 -0
@@ -1127,6 +1127,8 @@ static int xsk_setsockopt(struct socket *sock, int level, int optname,struct xsk_queue **q;int entries; +if (optlen <sizeof (entries)) +return -EINVAL ;if (copy_from_sockptr (&entries, optval,sizeof (entries)))return -EFAULT ;
tools/testing/selftests/timers/posix_timers.c +1 -1
@@ -66,7 +66,7 @@ static int check_diff(struct timeval start, struct timeval end) diff = end.tv_usec - start.tv_usec; diff += (end.tv_sec - start.tv_sec) *USECS_PER_SEC ; -if (abs (diff -DELAY *USECS_PER_SEC ) >USECS_PER_SEC /2 ) { +if (llabs (diff -DELAY *USECS_PER_SEC ) >USECS_PER_SEC /2 ) {printf ("Diff too high: %lld.." , diff);return -1 ; }