Linux 5.15.95
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.15.95 kernel.
All users of the 5.15 kernel series must upgrade.
The updated 5.15.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.15.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/arm/probes/kprobes/core.c | 4 arch/arm64/kernel/probes/kprobes.c | 5 arch/csky/kernel/probes/kprobes.c | 10 arch/mips/kernel/kprobes.c | 11 - arch/riscv/kernel/probes/kprobes.c | 17 - arch/s390/boot/compressed/decompressor.c | 2 arch/s390/kernel/kprobes.c | 4 arch/x86/kvm/x86.c | 3 drivers/acpi/x86/s2idle.c | 40 +++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 17 + drivers/gpu/drm/i915/gt/intel_workarounds.c | 32 +- drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c | 23 ++ drivers/mmc/core/sdio_bus.c | 17 + drivers/mmc/core/sdio_cis.c | 12 - drivers/mmc/host/jz4740_mmc.c | 10 drivers/mmc/host/mmc_spi.c | 8 drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 drivers/net/ethernet/intel/i40e/i40e_main.c | 4 drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 28 +- drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 3 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 drivers/net/ethernet/ti/am65-cpsw-nuss.c | 12 + drivers/net/ethernet/ti/am65-cpsw-nuss.h | 1 drivers/net/usb/kalmia.c | 8 drivers/nvme/target/fc.c | 4 drivers/nvmem/core.c | 41 ++- drivers/of/of_reserved_mem.c | 3 drivers/platform/x86/Kconfig | 1 drivers/platform/x86/amd-pmc.c | 116 ++++++++++ drivers/platform/x86/touchscreen_dmi.c | 9 fs/aio.c | 4 fs/nilfs2/ioctl.c | 7 fs/nilfs2/super.c | 9 fs/nilfs2/the_nilfs.c | 8 fs/squashfs/xattr_id.c | 2 fs/xfs/libxfs/xfs_ag.c | 3 fs/xfs/libxfs/xfs_btree.c | 175 ++++++++++++---- fs/xfs/libxfs/xfs_inode_fork.c | 12 - fs/xfs/libxfs/xfs_sb.c | 70 +++++- fs/xfs/xfs_bmap_item.c | 2 fs/xfs/xfs_icreate_item.c | 1 fs/xfs/xfs_qm.c | 9 fs/xfs/xfs_refcount_item.c | 2 fs/xfs/xfs_rmap_item.c | 2 include/linux/acpi.h | 10 include/linux/hugetlb.h | 5 include/linux/stmmac.h | 1 include/net/sock.h | 13 + kernel/kprobes.c | 36 +-- kernel/sched/psi.c | 7 kernel/time/alarmtimer.c | 33 ++- mm/filemap.c | 5 mm/memblock.c | 8 net/core/dev.c | 2 net/core/sock_map.c | 61 +++-- net/dccp/ipv6.c | 7 net/ipv4/inet_connection_sock.c | 1 net/ipv6/datagram.c | 2 net/ipv6/tcp_ipv6.c | 11 - net/mpls/af_mpls.c | 4 net/mptcp/pm_netlink.c | 10 net/mptcp/protocol.c | 9 net/mptcp/subflow.c | 2 net/netfilter/nft_tproxy.c | 8 net/openvswitch/meter.c | 4 net/rose/af_rose.c | 8 net/sched/act_bpf.c | 2 net/sched/act_connmark.c | 2 net/sched/act_ctinfo.c | 6 net/sched/act_gate.c | 2 net/sched/act_ife.c | 2 net/sched/act_ipt.c | 2 net/sched/act_mpls.c | 2 net/sched/act_nat.c | 2 net/sched/act_pedit.c | 2 net/sched/act_police.c | 2 net/sched/act_sample.c | 2 net/sched/act_simple.c | 2 net/sched/act_skbedit.c | 2 net/sched/act_skbmod.c | 2 net/sched/cls_tcindex.c | 34 ++- net/sched/sch_htb.c | 5 net/sctp/diag.c | 4 sound/pci/hda/hda_bind.c | 2 sound/pci/hda/hda_codec.c | 1 sound/pci/hda/patch_conexant.c | 1 sound/pci/hda/patch_realtek.c | 2 sound/soc/codecs/cs42l56.c | 6 sound/soc/intel/boards/sof_cs42l42.c | 3 sound/soc/intel/boards/sof_rt5682.c | 5 sound/soc/sof/intel/hda-dai.c | 8 tools/testing/selftests/bpf/verifier/search_pruning.c | 36 +++ tools/testing/selftests/lkdtm/stack-entropy.sh | 16 + tools/virtio/linux/bug.h | 8 tools/virtio/linux/build_bug.h | 7 tools/virtio/linux/cpumask.h | 7 tools/virtio/linux/gfp.h | 7 tools/virtio/linux/kernel.h | 1 tools/virtio/linux/kmsan.h | 12 + tools/virtio/linux/scatterlist.h | 1 tools/virtio/linux/topology.h | 7 106 files changed, 934 insertions(+), 294 deletions(-)
Aaron Thompson (1):
Revert "mm: Always release pages to the buddy allocator in memblock_free_late()."
Alex Deucher (1):
drm/amd/display: Properly handle additional cases where DCN is not supported
Amit Engel (1):
nvme-fc: fix a missing queue put in nvmet_fc_ls_create_association
Andrew Morton (1):
revert "squashfs: harden sanity check in squashfs_read_xattr_id_table"
Andrey Konovalov (1):
net: stmmac: do not stop RX_CLK in Rx LPI state for qcs404 SoC
Arnd Bergmann (2):
ASoC: cs42l56: fix DT probe platform/x86/amd: pmc: add CONFIG_SERIO dependency
Baowen Zheng (1):
flow_offload: fill flags to action structure
Ben Skeggs (1):
drm/nouveau/devinit/tu102-: wait for GFW_BOOT_PROGRESS == COMPLETED
Bo Liu (1):
ALSA: hda/conexant: add a new hda codec SN6180
Cezary Rojewski (1):
ALSA: hda: Do not unset preset when cleaning up codec
Cristian Ciocaltea (1):
net: stmmac: Restrict warning on disabling DMA store and fwd mode
Dan Carpenter (1):
net: sched: sch: Fix off by one in htb_activate_prios()
Darrick J. Wong (2):
xfs: purge dquots after inode walk fails during quotacheck
xfs: don't leak btree cursor when insrec fails after a split
Dave Chinner (8):
xfs: zero inode fork buffer at allocation
xfs: fix potential log item leak
xfs: detect self referencing btree sibling pointers
xfs: set XFS_FEAT_NLINK correctly
xfs: validate v5 feature fields
xfs: avoid unnecessary runtime sibling pointer endian conversions
xfs: don't assert fail on perag references on teardown
xfs: assert in xfs_btree_del_cursor should take into account error
Eduard Zingerman (1):
selftests/bpf: Verify copy_register_state() preserves parent/live fields
Felix Riemann (1):
net: Fix unwanted sign extension in netdev_stats_to_stats64()
Florian Westphal (1):
netfilter: nft_tproxy: restrict to prerouting hook
Gaosheng Cui (1):
nvmem: core: add error handling for dev_set_name
Greg Kroah-Hartman (2):
kvm: initialize all of the kvm_debugregs structure before sending it to userspace Linux 5.15.95
Guillaume Nault (2):
ipv6: Fix datagram socket connection with DSCP.
ipv6: Fix tcp socket connection with DSCP.
Guo Ren (1):
riscv: kprobe: Fixup misaligned load text
Hangyu Hua (1):
net: openvswitch: fix possible memory leak in ovs_meter_cmd_set()
Hans de Goede (2):
platform/x86: touchscreen_dmi: Add Chuwi Vi8 (CWI501) DMI match platform/x86: amd-pmc: Fix compilation when CONFIG_DEBUGFS is disabled
Hyunwoo Kim (1):
net/rose: Fix to not accept on connected socket
Isaac J. Manjarres (1):
of: reserved_mem: Have kmemleak ignore dynamically allocated reserved mem
Jakub Kicinski (1):
net: mpls: fix stale pointer if allocation fails during device rename
Jakub Sitnicki (1):
bpf, sockmap: Don't let sock_map_{close,destroy,unhash} call itself
Jason Xing (3):
ixgbe: allow to increase MTU to 3K with XDP enabled
i40e: add double of VLAN header when computing the max MTU
ixgbe: add double of VLAN header when computing the max MTU
Johannes Zink (1):
net: stmmac: fix order of dwmac5 FlexPPS parametrization sequence
Kailang Yang (1):
ALSA: hda/realtek - fixed wrong gpio assigned
Kees Cook (1):
net: sched: sch: Bounds check priority
Kuniyuki Iwashima (2):
tcp: Fix listen() regression in 5.15.88.
dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions.
Leo Li (1):
drm/amd/display: Fail atomic_check early on normalize_zpos error
Mario Limonciello (3):
ACPI / x86: Add support for LPS0 callback handler platform/x86: amd-pmc: Correct usage of SMU version platform/x86/amd: pmc: Disable IRQ1 wakeup for RN/CZN
Masami Hiramatsu (1):
kprobes: treewide: Cleanup the error messages for kprobes
Matt Roper (1):
drm/i915/gen11: Wa_1408615072/Wa_1407596294 should be on GT list
Michael Chan (1):
bnxt_en: Fix mqprio and XDP ring checking logic
Mike Kravetz (1):
hugetlb: check for undefined shift on 32 bit architectures
Miko Larsson (1):
net/usb: kalmia: Don't pass act_len in usb_bulk_msg error path
Misono Tomohiro (1):
selftest/lkdtm: Skip stack-entropy test if lkdtm is not available
Munehisa Kamata (1):
sched/psi: Fix use-after-free in ep_remove_wait_queue()
Natalia Petrova (1):
i40e: Add checking for null for nlmsg_find_attr()
Paolo Abeni (2):
mptcp: fix locking for in-kernel listener creation
mptcp: do not wait for bare sockets' timeout
Paul Cercueil (1):
mmc: jz4740: Work around bug on JZ4760(B)
Pedro Tammela (3):
net/sched: tcindex: update imperfect hash filters respecting rcu net/sched: act_ctinfo: use percpu stats
net/sched: tcindex: search key must be 16 bits
Pierre-Louis Bossart (3):
ASoC: Intel: sof_rt5682: always set dpcm_capture for amplifiers
ASoC: Intel: sof_cs42l42: always set dpcm_capture for amplifiers
ASoC: SOF: Intel: hda-dai: fix possible stream_tag leak
Pietro Borrello (1):
sctp: sctp_sock_filter(): avoid list_entry() on possibly empty list
Qian Yingjin (1):
mm/filemap: fix page end in filemap_get_read_batch
Rafał Miłecki (1):
net: bgmac: fix BCM5358 support by setting correct flags
Raviteja Goud Talla (1):
drm/i915/gen11: Moving WAs to icl_gt_workarounds_init()
Russell King (Oracle) (3):
nvmem: core: fix cleanup after dev_set_name()
nvmem: core: fix registration vs use race
nvmem: core: fix return value
Ryusuke Konishi (1):
nilfs2: fix underflow in second superblock position calculations
Sanket Goswami (1):
platform/x86: amd-pmc: Export Idlemask values based on the APU
Seth Jenkins (1):
aio: fix mremap after fork null-deref
Shunsuke Mie (1):
tools/virtio: fix the vringh test for virtio ring changes
Siddharth Vadapalli (1):
net: ethernet: ti: am65-cpsw: Add RX DMA Channel Teardown Quirk
Thomas Gleixner (1):
alarmtimer: Prevent starvation by small intervals and SIG_IGN
Vasily Gorbik (1):
s390/decompressor: specify __decompress() buf len to avoid overflow
Yang Yingliang (2):
mmc: sdio: fix possible resource leaks in some error paths
mmc: mmc_spi: fix error handling in mmc_spi_probe()
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 15 -SUBLEVEL = 94 +SUBLEVEL = 95 EXTRAVERSION = NAME = Trick or Treat
arch/arm/probes/kprobes/core.c +3 -1
@@ -11,6 +11,8 @@* Copyright (C) 2007 Marvell Ltd. */ +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/kernel.h> #include <linux/kprobes.h> #include <linux/module.h>
@@ -278,7 +280,7 @@ void __kprobes kprobe_handler(struct pt_regs *regs)break ;case KPROBE_REENTER :/* A nested probe was hit in FIQ, it is a BUG */ -pr_warn ("Unrecoverable kprobe detected.\n" ); +pr_warn ("Failed to recover from reentered kprobes.\n" );dump_kprobe (p); fallthrough;default :
arch/arm64/kernel/probes/kprobes.c +4 -1
@@ -7,6 +7,9 @@* Copyright (C) 2013 Linaro Limited. * Author: Sandeepa Prabhu <[email protected]> */ + +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/extable.h> #include <linux/kasan.h> #include <linux/kernel.h>
@@ -218,7 +221,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p,break ;case KPROBE_HIT_SS :case KPROBE_REENTER : -pr_warn ("Unrecoverable kprobe detected.\n" ); +pr_warn ("Failed to recover from reentered kprobes.\n" );dump_kprobe (p);BUG ();break ;
arch/csky/kernel/probes/kprobes.c +5 -5
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/kprobes.h> #include <linux/extable.h> #include <linux/slab.h>
@@ -77,10 +79,8 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) {unsigned long probe_addr = (unsigned long )p->addr; -if (probe_addr &0x1 ) { -pr_warn ("Address not aligned.\n" ); -return -EINVAL ; - } +if (probe_addr &0x1 ) +return -EILSEQ ;/* copy instruction */ p->opcode =le32_to_cpu (*p->addr);
@@ -229,7 +229,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p,break ;case KPROBE_HIT_SS :case KPROBE_REENTER : -pr_warn ("Unrecoverable kprobe detected.\n" ); +pr_warn ("Failed to recover from reentered kprobes.\n" );dump_kprobe (p);BUG ();break ;
arch/mips/kernel/kprobes.c +5 -6
@@ -11,6 +11,8 @@* Copyright (C) IBM Corporation, 2002, 2004 */ +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/kprobes.h> #include <linux/preempt.h> #include <linux/uaccess.h>
@@ -80,8 +82,7 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) insn = p->addr[0 ];if (insn_has_ll_or_sc (insn)) { -pr_notice ("Kprobes for ll and sc instructions are not" -"supported\n" ); +pr_notice ("Kprobes for ll and sc instructions are not supported\n" ); ret = -EINVAL ; goto out; }
@@ -219,7 +220,7 @@ static int evaluate_branch_instruction(struct kprobe *p, struct pt_regs *regs,return 0 ; unaligned: -pr_notice ("%s: unaligned epc - sending SIGBUS.\n" , current->comm); +pr_notice ("Failed to emulate branch instruction because of unaligned epc - sending SIGBUS to %s.\n" , current->comm);force_sig (SIGBUS );return -EFAULT ;
@@ -238,10 +239,8 @@ static void prepare_singlestep(struct kprobe *p, struct pt_regs *regs, regs->cp0_epc = (unsigned long )p->addr; else if (insn_has_delayslot(p->opcode)) { ret =evaluate_branch_instruction (p, regs, kcb); -if (ret <0 ) { -pr_notice ("Kprobes: Error in evaluating branch\n" ); +if (ret <0 )return ; - } } regs->cp0_epc = (unsigned long )&p->ainsn.insn[0 ]; }
arch/riscv/kernel/probes/kprobes.c +9 -8
@@ -1,5 +1,7 @@// SPDX-License-Identifier: GPL-2.0+ +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/kprobes.h> #include <linux/extable.h> #include <linux/slab.h>
@@ -63,19 +65,18 @@ static bool __kprobes arch_check_kprobe(struct kprobe *p)int __kprobes arch_prepare_kprobe (struct kprobe *p) { -unsigned long probe_addr = (unsigned long )p->addr; - -if (probe_addr &0x1 ) { -pr_warn ("Address not aligned.\n" ); +u16 *insn = (u16 *)p->addr; -return -EINVAL ; - } +if ((unsigned long )insn &0x1 ) +return -EILSEQ ;if (!arch_check_kprobe (p))return -EILSEQ ;/* copy instruction */ - p->opcode = *p->addr; + p->opcode = (kprobe_opcode_t)(*insn++); +if (GET_INSN_LENGTH (p->opcode) ==4 ) + p->opcode |= (kprobe_opcode_t)(*insn) <<16 ;/* decode instruction */ switch (riscv_probe_decode_insn (p->addr, &p->ainsn.api)) {
@@ -209,7 +210,7 @@ static int __kprobes reenter_kprobe(struct kprobe *p,break ;case KPROBE_HIT_SS :case KPROBE_REENTER : -pr_warn ("Unrecoverable kprobe detected.\n" ); +pr_warn ("Failed to recover from reentered kprobes.\n" );dump_kprobe (p);BUG ();break ;
arch/s390/boot/compressed/decompressor.c +1 -1
@@ -80,6 +80,6 @@ void *decompress_kernel(void)void *output = (void *)decompress_offset;__decompress (_compressed_start, _compressed_end - _compressed_start, -NULL ,NULL , output,0 ,NULL , error); +NULL ,NULL , output, vmlinux.image_size,NULL , error);return output; }
arch/s390/kernel/kprobes.c +3 -1
@@ -7,6 +7,8 @@* s390 port, used ppc64 as template. Mike Grundy <[email protected]> */ +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/moduleloader.h> #include <linux/kprobes.h> #include <linux/ptrace.h>
@@ -259,7 +261,7 @@ static void kprobe_reenter_check(struct kprobe_ctlblk *kcb, struct kprobe *p)* is a BUG. The code path resides in the .kprobes.text * section and is executed with interrupts disabled. */ -pr_err ("Invalid kprobe detected.\n" ); +pr_err ("Failed to recover from reentered kprobes.\n" );dump_kprobe (p);BUG (); }
arch/x86/kvm/x86.c +1 -2
@@ -4821,12 +4821,11 @@ static void kvm_vcpu_ioctl_x86_get_debugregs(struct kvm_vcpu *vcpu, {unsigned long val; +memset (dbgregs,0 ,sizeof (*dbgregs));memcpy (dbgregs->db, vcpu->arch.db,sizeof (vcpu->arch.db));kvm_get_dr (vcpu,6 , &val); dbgregs->dr6 = val; dbgregs->dr7 = vcpu->arch.dr7; - dbgregs->flags =0 ; -memset (&dbgregs->reserved,0 ,sizeof (dbgregs->reserved)); } static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu,
drivers/acpi/x86/s2idle.c +40 -0
@@ -86,6 +86,8 @@ struct lpi_device_constraint_amd {int min_dstate; }; +static LIST_HEAD (lps0_s2idle_devops_head); +static struct lpi_constraints *lpi_constraints_table;static int lpi_constraints_table_size;static int rev_id;
@@ -434,6 +436,8 @@ static struct acpi_scan_handler lps0_handler = {int acpi_s2idle_prepare_late (void ) { +struct acpi_s2idle_dev_ops *handler; +if (!lps0_device_handle || sleep_no_lps0)return 0 ;
@@ -464,14 +468,26 @@ int acpi_s2idle_prepare_late(void)acpi_sleep_run_lps0_dsm (ACPI_LPS0_MS_ENTRY , lps0_dsm_func_mask_microsoft, lps0_dsm_guid_microsoft); } + +list_for_each_entry (handler, &lps0_s2idle_devops_head, list_node) { +if (handler->prepare) + handler->prepare (); + } +return 0 ; }void acpi_s2idle_restore_early (void ) { +struct acpi_s2idle_dev_ops *handler; +if (!lps0_device_handle || sleep_no_lps0)return ; +list_for_each_entry (handler, &lps0_s2idle_devops_head, list_node) +if (handler->restore) + handler->restore (); +/* Modern standby exit */ if (lps0_dsm_func_mask_microsoft >0 ) acpi_sleep_run_lps0_dsm(ACPI_LPS0_MS_EXIT,
@@ -514,4 +530,28 @@ void acpi_s2idle_setup(void) s2idle_set_ops(&acpi_s2idle_ops_lps0); } +int acpi_register_lps0_dev (struct acpi_s2idle_dev_ops *arg) +{ +if (!lps0_device_handle || sleep_no_lps0) +return -ENODEV ; + +lock_system_sleep (); +list_add (&arg->list_node, &lps0_s2idle_devops_head); +unlock_system_sleep (); + +return 0 ; +} +EXPORT_SYMBOL_GPL (acpi_register_lps0_dev); + +void acpi_unregister_lps0_dev (struct acpi_s2idle_dev_ops *arg) +{ +if (!lps0_device_handle || sleep_no_lps0) +return ; + +lock_system_sleep (); +list_del (&arg->list_node); +unlock_system_sleep (); +} +EXPORT_SYMBOL_GPL (acpi_unregister_lps0_dev); +#endif /* CONFIG_SUSPEND */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +16 -1
@@ -4428,6 +4428,17 @@ DEVICE_ATTR_WO(s3_debug);static int dm_early_init (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +struct amdgpu_mode_info *mode_info = &adev->mode_info; +struct atom_context *ctx = mode_info->atom_context; +int index =GetIndexIntoMasterTable (DATA , Object_Header); +u16 data_offset; + +/* if there is no object header, skip DM */ +if (!amdgpu_atom_parse_data_header (ctx, index,NULL ,NULL ,NULL , &data_offset)) { + adev->harvest_ip_mask |=AMD_HARVEST_IP_DMU_MASK ; +dev_info (adev->dev,"No object header, skipping DM\n" ); +return -ENOENT ; + }switch (adev->asic_type) {#if defined(CONFIG_DRM_AMD_DC_SI )
@@ -10878,7 +10889,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,* `dcn10_can_pipe_disable_cursor`). By now, all modified planes are in * atomic state, so call drm helper to normalize zpos. */ -drm_atomic_normalize_zpos (dev, state); + ret =drm_atomic_normalize_zpos (dev, state); +if (ret) { +drm_dbg (dev,"drm_atomic_normalize_zpos() failed\n" ); + goto fail; + }/* Remove exiting planes if they are modified */ for_each_oldnew_plane_in_state_reverse (state, plane, old_plane_state, new_plane_state, i) {
drivers/gpu/drm/i915/gt/intel_workarounds.c +16 -16
@@ -1049,6 +1049,22 @@ icl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)GAMT_CHKN_BIT_REG , GAMT_CHKN_DISABLE_L3_COH_PIPE); +/* +* Wa_1408615072:icl,ehl (vsunit) +* Wa_1407596294:icl,ehl (hsunit) +*/ +wa_write_or (wal,UNSLICE_UNIT_LEVEL_CLKGATE , +VSUNIT_CLKGATE_DIS |HSUNIT_CLKGATE_DIS ); + +/* Wa_1407352427:icl,ehl */ +wa_write_or (wal,UNSLICE_UNIT_LEVEL_CLKGATE2 , +PSDUNIT_CLKGATE_DIS ); + +/* Wa_1406680159:icl,ehl */ +wa_write_or (wal, +SUBSLICE_UNIT_LEVEL_CLKGATE , +GWUNIT_CLKGATE_DIS ); +/* Wa_1607087056:icl,ehl,jsl */ if (IS_ICELAKE (i915) ||IS_JSL_EHL_GT_STEP (i915,STEP_A0 ,STEP_B0 ))
@@ -1738,22 +1754,6 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)wa_masked_en (wal,GEN9_CSFE_CHICKEN1_RCS ,GEN11_ENABLE_32_PLANE_MODE ); -/* -* Wa_1408615072:icl,ehl (vsunit) -* Wa_1407596294:icl,ehl (hsunit) -*/ -wa_write_or (wal,UNSLICE_UNIT_LEVEL_CLKGATE , -VSUNIT_CLKGATE_DIS |HSUNIT_CLKGATE_DIS ); - -/* Wa_1407352427:icl,ehl */ -wa_write_or (wal,UNSLICE_UNIT_LEVEL_CLKGATE2 , -PSDUNIT_CLKGATE_DIS ); - -/* Wa_1406680159:icl,ehl */ -wa_write_or (wal, -SUBSLICE_UNIT_LEVEL_CLKGATE , -GWUNIT_CLKGATE_DIS ); -/* * Wa_1408767742:icl[a2..forever],ehl[all] * Wa_1605460711:icl[a0..c0]
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/tu102.c +23 -0
@@ -65,10 +65,33 @@ tu102_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)return ret; } +static int +tu102_devinit_wait (struct nvkm_device *device) +{ +unsigned timeout =50 +2000 ; + +do { +if (nvkm_rd32 (device,0x118128 ) &0x00000001 ) { +if ((nvkm_rd32 (device,0x118234 ) &0x000000ff ) ==0xff ) +return 0 ; + } + +usleep_range (1000 ,2000 ); + }while (timeout--); + +return -ETIMEDOUT ; +} +int tu102_devinit_post (struct nvkm_devinit *base,bool post) {struct nv50_devinit *init =nv50_devinit (base); +int ret; + + ret =tu102_devinit_wait (init->base.subdev.device); +if (ret) +return ret; +gm200_devinit_preos (init, post);return 0 ; }
drivers/mmc/core/sdio_bus.c +14 -3
@@ -293,6 +293,12 @@ static void sdio_release_func(struct device *dev)if (!(func->card->quirks &MMC_QUIRK_NONSTD_SDIO ))sdio_free_func_cis (func); +/* +* We have now removed the link to the tuples in the +* card structure, so remove the reference. +*/ +put_device (&func->card->dev); +kfree (func->info);kfree (func->tmpbuf);kfree (func);
@@ -323,6 +329,12 @@ struct sdio_func *sdio_alloc_func(struct mmc_card *card)device_initialize (&func->dev); +/* +* We may link to tuples in the card structure, +* we need make sure we have a reference to it. +*/ +get_device (&func->card->dev); + func->dev.parent = &card->dev; func->dev.bus = &sdio_bus_type; func->dev.release = sdio_release_func;
@@ -376,10 +388,9 @@ int sdio_add_func(struct sdio_func *func)*/ void sdio_remove_func (struct sdio_func *func) { -if (!sdio_func_present (func)) -return ; +if (sdio_func_present (func)) +device_del (&func->dev); -device_del (&func->dev);of_node_put (func->dev.of_node);put_device (&func->dev); }
drivers/mmc/core/sdio_cis.c +0 -12
@@ -403,12 +403,6 @@ int sdio_read_func_cis(struct sdio_func *func)if (ret)return ret; -/* -* Since we've linked to tuples in the card structure, -* we must make sure we have a reference to it. -*/ -get_device (&func->card->dev); -/* * Vendor/device id is optional for function CIS, so * copy it from the card structure as needed.
@@ -434,11 +428,5 @@ void sdio_free_func_cis(struct sdio_func *func) } func->tuples =NULL ; - -/* -* We have now removed the link to the tuples in the -* card structure, so remove the reference. -*/ -put_device (&func->card->dev); }
drivers/mmc/host/jz4740_mmc.c +10 -0
@@ -1038,6 +1038,16 @@ static int jz4740_mmc_probe(struct platform_device* pdev) mmc->ops = &jz4740_mmc_ops;if (!mmc->f_max) mmc->f_max =JZ_MMC_CLK_RATE ; + +/* +* There seems to be a problem with this driver on the JZ4760 and +* JZ4760B SoCs. There, when using the maximum rate supported (50 MHz), +* the communication fails with many SD cards. +* Until this bug is sorted out, limit the maximum rate to 24 MHz. +*/ +if (host->version ==JZ_MMC_JZ4760 && mmc->f_max >JZ_MMC_CLK_RATE ) + mmc->f_max =JZ_MMC_CLK_RATE ; + mmc->f_min = mmc->f_max /128 ; mmc->ocr_avail =MMC_VDD_32_33 |MMC_VDD_33_34 ;
drivers/mmc/host/mmc_spi.c +4 -4
@@ -1441,7 +1441,7 @@ static int mmc_spi_probe(struct spi_device *spi) status =mmc_add_host (mmc);if (status !=0 ) - goto fail_add_host; + goto fail_glue_init;/* * Index 0 is card detect
@@ -1449,7 +1449,7 @@ static int mmc_spi_probe(struct spi_device *spi)*/ status =mmc_gpiod_request_cd (mmc,NULL ,0 , false,1000 );if (status == -EPROBE_DEFER ) - goto fail_add_host; + goto fail_gpiod_request;if (!status) {/* * The platform has a CD GPIO signal that may support
@@ -1464,7 +1464,7 @@ static int mmc_spi_probe(struct spi_device *spi)/* Index 1 is write protect/read only */ status =mmc_gpiod_request_ro (mmc,NULL ,1 ,0 );if (status == -EPROBE_DEFER ) - goto fail_add_host; + goto fail_gpiod_request;if (!status) has_ro = true;
@@ -1478,7 +1478,7 @@ static int mmc_spi_probe(struct spi_device *spi) ? ", cd polling" : "");return 0 ; -fail_add_host: +fail_gpiod_request:mmc_remove_host (mmc); fail_glue_init:mmc_spi_dma_free (host);
drivers/net/ethernet/broadcom/bgmac-bcma.c +3 -3
@@ -228,12 +228,12 @@ static int bgmac_probe(struct bcma_device *core) bgmac->feature_flags |=BGMAC_FEAT_CLKCTLST ; bgmac->feature_flags |=BGMAC_FEAT_FLW_CTRL1 ; bgmac->feature_flags |=BGMAC_FEAT_SW_TYPE_PHY ; -if (ci->pkg ==BCMA_PKG_ID_BCM47188 || - ci->pkg ==BCMA_PKG_ID_BCM47186 ) { +if ((ci->id ==BCMA_CHIP_ID_BCM5357 && ci->pkg ==BCMA_PKG_ID_BCM47186 ) || + (ci->id ==BCMA_CHIP_ID_BCM53572 && ci->pkg ==BCMA_PKG_ID_BCM47188 )) { bgmac->feature_flags |=BGMAC_FEAT_SW_TYPE_RGMII ; bgmac->feature_flags |=BGMAC_FEAT_IOST_ATTACHED ; } -if (ci->pkg ==BCMA_PKG_ID_BCM5358 ) +if (ci->id ==BCMA_CHIP_ID_BCM5357 && ci->pkg ==BCMA_PKG_ID_BCM5358 ) bgmac->feature_flags |=BGMAC_FEAT_SW_TYPE_EPHYRMII ;break ;case BCMA_CHIP_ID_BCM53573 :
drivers/net/ethernet/broadcom/bnxt/bnxt.c +6 -2
@@ -9023,10 +9023,14 @@ int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)netdev_err (bp->dev,"ring reservation/IRQ init failure rc: %d\n" , rc);return rc; } -if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) { +if (tcs && (bp->tx_nr_rings_per_tc * tcs != + bp->tx_nr_rings - bp->tx_nr_rings_xdp)) {netdev_err (bp->dev,"tx ring reservation failure\n" );netdev_reset_tc (bp->dev); - bp->tx_nr_rings_per_tc = bp->tx_nr_rings; +if (bp->tx_nr_rings_xdp) + bp->tx_nr_rings_per_tc = bp->tx_nr_rings_xdp; +else + bp->tx_nr_rings_per_tc = bp->tx_nr_rings;return -ENOMEM ; }return 0 ;
drivers/net/ethernet/intel/i40e/i40e_main.c +3 -1
@@ -2789,7 +2789,7 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)struct i40e_pf *pf = vsi->back;if (i40e_enabled_xdp_vsi (vsi)) { -int frame_size = new_mtu +ETH_HLEN +ETH_FCS_LEN +VLAN_HLEN ; +int frame_size = new_mtu +I40E_PACKET_HDR_PAD ;if (frame_size >i40e_max_xdp_frame_size (vsi))return -EINVAL ;
@@ -13005,6 +13005,8 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev, } br_spec =nlmsg_find_attr (nlh,sizeof (struct ifinfomsg ),IFLA_AF_SPEC ); +if (!br_spec) +return -EINVAL ;nla_for_each_nested (attr, br_spec, rem) {__u16 mode;
drivers/net/ethernet/intel/ixgbe/ixgbe.h +2 -0
@@ -67,6 +67,8 @@#define IXGBE_RXBUFFER_4K 4096#define IXGBE_MAX_RXBUFFER 16384/* largest size for a single descriptor */ +#define IXGBE_PKT_HDR_PAD (ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2)) +/* Attempt to maximize the headroom available for incoming frames. We * use a 2K buffer for receives and need 1536/1534 to store the data for * the frame. This leaves us with 512 bytes of room. From that we need
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +17 -11
@@ -6729,6 +6729,18 @@ static void ixgbe_free_all_rx_resources(struct ixgbe_adapter *adapter)ixgbe_free_rx_resources (adapter->rx_ring[i]); } +/** +* ixgbe_max_xdp_frame_size - returns the maximum allowed frame size for XDP +* @adapter: device handle, pointer to adapter +*/ +static int ixgbe_max_xdp_frame_size (struct ixgbe_adapter *adapter) +{ +if (PAGE_SIZE >=8192 || adapter->flags2 &IXGBE_FLAG2_RX_LEGACY ) +return IXGBE_RXBUFFER_2K ; +else +return IXGBE_RXBUFFER_3K ; +} +/** * ixgbe_change_mtu - Change the Maximum Transfer Unit * @netdev: network interface device structure
@@ -6740,18 +6752,12 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu) {struct ixgbe_adapter *adapter =netdev_priv (netdev); -if (adapter->xdp_prog) { -int new_frame_size = new_mtu +ETH_HLEN +ETH_FCS_LEN + -VLAN_HLEN ; -int i; - -for (i =0 ; i < adapter->num_rx_queues; i++) { -struct ixgbe_ring *ring = adapter->rx_ring[i]; +if (ixgbe_enabled_xdp_adapter (adapter)) { +int new_frame_size = new_mtu +IXGBE_PKT_HDR_PAD ; -if (new_frame_size >ixgbe_rx_bufsz (ring)) { -e_warn (probe,"Requested MTU size is not supported with XDP\n" ); -return -EINVAL ; - } +if (new_frame_size >ixgbe_max_xdp_frame_size (adapter)) { +e_warn (probe,"Requested MTU size is not supported with XDP\n" ); +return -EINVAL ; } }
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c +2 -0
@@ -505,6 +505,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev) plat_dat->has_gmac4 =1 ; plat_dat->pmt =1 ; plat_dat->tso_en =of_property_read_bool (np,"snps,tso" ); +if (of_device_is_compatible (np,"qcom,qcs404-ethqos" )) + plat_dat->rx_clk_runs_in_lpi =1 ; ret =stmmac_dvr_probe (&pdev->dev, plat_dat, &stmmac_res);if (ret)
drivers/net/ethernet/stmicro/stmmac/dwmac5.c +2 -1
@@ -541,9 +541,9 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,return 0 ; } - val |=PPSCMDx (index,0x2 ); val |=TRGTMODSELx (index,0x2 ); val |=PPSEN0 ; +writel (val, ioaddr +MAC_PPS_CONTROL );writel (cfg->start.tv_sec, ioaddr +MAC_PPSx_TARGET_TIME_SEC (index));
@@ -568,6 +568,7 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,writel (period -1 , ioaddr +MAC_PPSx_WIDTH (index));/* Finally, activate it */ + val |=PPSCMDx (index,0x2 );writel (val, ioaddr +MAC_PPS_CONTROL );return 0 ; }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 -1
@@ -1174,7 +1174,8 @@ static void stmmac_mac_link_up(struct phylink_config *config,stmmac_mac_set (priv, priv->ioaddr, true);if (phy && priv->dma_cap.eee) { - priv->eee_active =phy_init_eee (phy,1 ) >=0 ; + priv->eee_active = +phy_init_eee (phy, !priv->plat->rx_clk_runs_in_lpi) >=0 ; priv->eee_enabled =stmmac_eee_init (priv); priv->tx_lpi_enabled = priv->eee_enabled;stmmac_set_eee_pls (priv, priv->hw, true);
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +1 -1
@@ -558,7 +558,7 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) dma_cfg->mixed_burst =of_property_read_bool (np,"snps,mixed-burst" ); plat->force_thresh_dma_mode =of_property_read_bool (np,"snps,force_thresh_dma_mode" ); -if (plat->force_thresh_dma_mode) { +if (plat->force_thresh_dma_mode && plat->force_sf_dma_mode) { plat->force_sf_dma_mode =0 ;dev_warn (&pdev->dev,"force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n" );
drivers/net/ethernet/ti/am65-cpsw-nuss.c +11 -1
@@ -564,7 +564,15 @@ static int am65_cpsw_nuss_common_stop(struct am65_cpsw_common *common)k3_udma_glue_disable_tx_chn (common->tx_chns[i].tx_chn); } +reinit_completion (&common->tdown_complete);k3_udma_glue_tdown_rx_chn (common->rx_chns.rx_chn, true); + +if (common->pdata.quirks &AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ ) { + i =wait_for_completion_timeout (&common->tdown_complete,msecs_to_jiffies (1000 )); +if (!i) +dev_err (common->dev,"rx teardown timeout\n" ); + } +napi_disable (&common->napi_rx);for (i =0 ; i <AM65_CPSW_MAX_RX_FLOWS ; i++)
@@ -786,6 +794,8 @@ static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_common *common,if (cppi5_desc_is_tdcm (desc_dma)) {dev_dbg (dev,"%s RX tdown flow: %u\n" , __func__, flow_idx); +if (common->pdata.quirks &AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ ) +complete (&common->tdown_complete);return 0 ; }
@@ -2609,7 +2619,7 @@ static const struct am65_cpsw_pdata j721e_pdata = { };static const struct am65_cpsw_pdata am64x_cpswxg_pdata = { - .quirks =0 , + .quirks =AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ , .ale_dev_id ="am64-cpswxg" , .fdqring_mode =K3_RINGACC_RING_MODE_RING , };
drivers/net/ethernet/ti/am65-cpsw-nuss.h +1 -0
@@ -84,6 +84,7 @@ struct am65_cpsw_rx_chn { };#define AM65_CPSW_QUIRK_I2027_NO_TX_CSUM BIT(0) +#define AM64_CPSW_QUIRK_DMA_RX_TDOWN_IRQ BIT(1)struct am65_cpsw_pdata {u32 quirks;
drivers/net/usb/kalmia.c +4 -4
@@ -65,8 +65,8 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len, init_msg, init_msg_len, &act_len, KALMIA_USB_TIMEOUT);if (status !=0 ) {netdev_err (dev->net, -"Error sending init packet. Status %i, length %i\n" , - status, act_len); +"Error sending init packet. Status %i\n" , + status);return status; }else if (act_len != init_msg_len) {
@@ -83,8 +83,8 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,if (status !=0 )netdev_err (dev->net, -"Error receiving init result. Status %i, length %i\n" , - status, act_len); +"Error receiving init result. Status %i\n" , + status);else if (act_len != expected_len)netdev_err (dev->net,"Unexpected init result length: %i\n" , act_len);
drivers/nvme/target/fc.c +3 -1
@@ -1685,8 +1685,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport,else { queue =nvmet_fc_alloc_target_queue (iod->assoc,0 ,be16_to_cpu (rqst->assoc_cmd.sqsize)); -if (!queue) +if (!queue) { ret =VERR_QUEUE_ALLOC_FAIL ; +nvmet_fc_tgt_a_put (iod->assoc); + } } }
drivers/nvmem/core.c +22 -19
99 lines not on this page · raw message
drivers/of/of_reserved_mem.c +2 -1
@@ -47,9 +47,10 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, err =memblock_mark_nomap (base, size);if (err)memblock_free (base, size); -kmemleak_ignore_phys (base); } +kmemleak_ignore_phys (base); +return err; }
drivers/platform/x86/Kconfig +1 -0
@@ -171,6 +171,7 @@ config ACER_WMI config AMD_PMC tristate "AMD SoC PMC driver" depends on ACPI && PCI + select SERIO help The driver provides support for AMD Power Management Controller primarily responsible for S2Idle transactions that are driven from
drivers/platform/x86/amd-pmc.c +116 -0
180 lines not on this page · raw message
drivers/platform/x86/touchscreen_dmi.c +9 -0
@@ -1073,6 +1073,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = { DMI_MATCH(DMI_BIOS_DATE, "05/07/2016"), }, }, + { +/* Chuwi Vi8 (CWI501) */ + .driver_data = (void *)&chuwi_vi8_data, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Insyde" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"i86" ), + DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.W86JLBNR01"), + }, + }, {/* Chuwi Vi8 (CWI506) */ .driver_data = (void *)&chuwi_vi8_data,
fs/aio.c +4 -0
@@ -334,6 +334,9 @@ static int aio_ring_mremap(struct vm_area_struct *vma)spin_lock (&mm->ioctx_lock);rcu_read_lock (); table =rcu_dereference (mm->ioctx_table); +if (!table) + goto out_unlock; +for (i =0 ; i < table->nr; i++) {struct kioctx *ctx;
@@ -347,6 +350,7 @@ static int aio_ring_mremap(struct vm_area_struct *vma) } } +out_unlock:rcu_read_unlock ();spin_unlock (&mm->ioctx_lock);return res;
fs/nilfs2/ioctl.c +7 -0
@@ -1114,7 +1114,14 @@ static int nilfs_ioctl_set_alloc_range(struct inode *inode, void __user *argp) minseg = range[0 ] + segbytes -1 ;do_div (minseg, segbytes); + +if (range[1 ] <4096 ) + goto out; + maxseg =NILFS_SB2_OFFSET_BYTES (range[1 ]); +if (maxseg < segbytes) + goto out; +do_div (maxseg, segbytes); maxseg--;
fs/nilfs2/super.c +9 -0
@@ -408,6 +408,15 @@ int nilfs_resize_fs(struct super_block *sb, __u64 newsize)if (newsize > devsize) goto out; +/* +* Prevent underflow in second superblock position calculation. +* The exact minimum size check is done in nilfs_sufile_resize(). +*/ +if (newsize <4096 ) { + ret = -ENOSPC ; + goto out; + } +/* * Write lock is required to protect some functions depending * on the number of segments, the number of reserved segments,
fs/nilfs2/the_nilfs.c +7 -1
@@ -544,9 +544,15 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs, {struct nilfs_super_block **sbp = nilfs->ns_sbp;struct buffer_head **sbh = nilfs->ns_sbh; -u64 sb2off =NILFS_SB2_OFFSET_BYTES (nilfs->ns_bdev->bd_inode->i_size); +u64 sb2off, devsize = nilfs->ns_bdev->bd_inode->i_size;int valid[2 ], swp =0 ; +if (devsize <NILFS_SEG_MIN_BLOCKS *NILFS_MIN_BLOCK_SIZE +4096 ) { +nilfs_err (sb,"device size too small" ); +return -EINVAL ; + } + sb2off =NILFS_SB2_OFFSET_BYTES (devsize); + sbp[0 ] =nilfs_read_super_block (sb,NILFS_SB_OFFSET_BYTES , blocksize, &sbh[0 ]); sbp[1 ] =nilfs_read_super_block (sb, sb2off, blocksize, &sbh[1 ]);
fs/squashfs/xattr_id.c +1 -1
@@ -76,7 +76,7 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start,/* Sanity check values */ /* there is always at least one xattr id */ -if (*xattr_ids <=0 ) +if (*xattr_ids ==0 )return ERR_PTR (-EINVAL ); len =SQUASHFS_XATTR_BLOCK_BYTES (*xattr_ids);
fs/xfs/libxfs/xfs_ag.c +1 -2
@@ -173,7 +173,6 @@ __xfs_free_perag( struct xfs_perag *pag = container_of(head, struct xfs_perag, rcu_head);ASSERT (!delayed_work_pending (&pag->pag_blockgc_work)); -ASSERT (atomic_read (&pag->pag_ref) ==0 );kmem_free (pag); }
@@ -192,7 +191,7 @@ xfs_free_perag( pag =radix_tree_delete (&mp->m_perag_tree, agno);spin_unlock (&mp->m_perag_lock);ASSERT (pag); -ASSERT (atomic_read (&pag->pag_ref) ==0 ); +XFS_IS_CORRUPT (pag->pag_mount,atomic_read (&pag->pag_ref) !=0 );cancel_delayed_work_sync (&pag->pag_blockgc_work);xfs_iunlink_destroy (pag);
fs/xfs/libxfs/xfs_btree.c +136 -39
268 lines not on this page · raw message
fs/xfs/libxfs/xfs_inode_fork.c +9 -3
@@ -50,8 +50,13 @@ xfs_init_local_fork( mem_size++;if (size) { +/* +* As we round up the allocation here, we need to ensure the +* bytes we don't copy data into are zeroed because the log +* vectors still copy them into the journal. +*/ real_size =roundup (mem_size,4 ); - ifp->if_u1.if_data =kmem_alloc (real_size,KM_NOFS ); + ifp->if_u1.if_data =kmem_zalloc (real_size,KM_NOFS );memcpy (ifp->if_u1.if_data, data, size);if (zero_terminate) ifp->if_u1.if_data[size] ='\0' ;
@@ -500,10 +505,11 @@ xfs_idata_realloc(/* * For inline data, the underlying buffer must be a multiple of 4 bytes * in size so that it can be logged and stay on word boundaries. -* We enforce that here. +* We enforce that here, and use __GFP_ZERO to ensure that size +* extensions always zero the unused roundup area. */ ifp->if_u1.if_data =krealloc (ifp->if_u1.if_data,roundup (new_size,4 ), -GFP_NOFS | __GFP_NOFAIL); +GFP_NOFS | __GFP_NOFAIL | __GFP_ZERO); ifp->if_bytes = new_size; }
fs/xfs/libxfs/xfs_sb.c +60 -10
105 lines not on this page · raw message
fs/xfs/xfs_bmap_item.c +2 -0
@@ -39,6 +39,7 @@ STATIC voidxfs_bui_item_free ( struct xfs_bui_log_item *buip) { +kmem_free (buip->bui_item.li_lv_shadow);kmem_cache_free (xfs_bui_zone, buip); }
@@ -198,6 +199,7 @@ xfs_bud_item_release(struct xfs_bud_log_item *budp =BUD_ITEM (lip);xfs_bui_release (budp->bud_buip); +kmem_free (budp->bud_item.li_lv_shadow);kmem_cache_free (xfs_bud_zone, budp); }
fs/xfs/xfs_icreate_item.c +1 -0
@@ -63,6 +63,7 @@ STATIC voidxfs_icreate_item_release ( struct xfs_log_item *lip) { +kmem_free (ICR_ITEM (lip)->ic_item.li_lv_shadow);kmem_cache_free (xfs_icreate_zone,ICR_ITEM (lip)); }
fs/xfs/xfs_qm.c +8 -1
@@ -1317,8 +1317,15 @@ xfs_qm_quotacheck( error =xfs_iwalk_threaded (mp,0 ,0 , xfs_qm_dqusage_adjust,0 , true,NULL ); -if (error) +if (error) { +/* +* The inode walk may have partially populated the dquot +* caches. We must purge them before disabling quota and +* tearing down the quotainfo, or else the dquots will leak. +*/ +xfs_qm_dqpurge_all (mp); goto error_return; + }/* * We've made all the changes that we need to make incore. Flush them
fs/xfs/xfs_refcount_item.c +2 -0
@@ -35,6 +35,7 @@ STATIC voidxfs_cui_item_free ( struct xfs_cui_log_item *cuip) { +kmem_free (cuip->cui_item.li_lv_shadow);if (cuip->cui_format.cui_nextents >XFS_CUI_MAX_FAST_EXTENTS )kmem_free (cuip);else
@@ -204,6 +205,7 @@ xfs_cud_item_release(struct xfs_cud_log_item *cudp =CUD_ITEM (lip);xfs_cui_release (cudp->cud_cuip); +kmem_free (cudp->cud_item.li_lv_shadow);kmem_cache_free (xfs_cud_zone, cudp); }
fs/xfs/xfs_rmap_item.c +2 -0
@@ -35,6 +35,7 @@ STATIC voidxfs_rui_item_free ( struct xfs_rui_log_item *ruip) { +kmem_free (ruip->rui_item.li_lv_shadow);if (ruip->rui_format.rui_nextents >XFS_RUI_MAX_FAST_EXTENTS )kmem_free (ruip);else
@@ -227,6 +228,7 @@ xfs_rud_item_release(struct xfs_rud_log_item *rudp =RUD_ITEM (lip);xfs_rui_release (rudp->rud_ruip); +kmem_free (rudp->rud_item.li_lv_shadow);kmem_cache_free (xfs_rud_zone, rudp); }
include/linux/acpi.h +9 -1
@@ -1005,7 +1005,15 @@ void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,acpi_status acpi_os_prepare_extended_sleep (u8 sleep_state,u32 val_a,u32 val_b); - +#ifdef CONFIG_X86 +struct acpi_s2idle_dev_ops { +struct list_head list_node; +void (*prepare)(void ); +void (*restore)(void ); +}; +int acpi_register_lps0_dev (struct acpi_s2idle_dev_ops *arg); +void acpi_unregister_lps0_dev (struct acpi_s2idle_dev_ops *arg); +#endif /* CONFIG_X86 */ #ifndef CONFIG_IA64 void arch_reserve_mem_area (acpi_physical_address addr,size_t size);#else
include/linux/hugetlb.h +4 -1
@@ -684,7 +684,10 @@ static inline struct hstate *hstate_sizelog(int page_size_log)if (!page_size_log)return &default_hstate; -return size_to_hstate (1UL << page_size_log); +if (page_size_log <BITS_PER_LONG ) +return size_to_hstate (1UL << page_size_log); + +return NULL ; }static inline struct hstate *hstate_vma (struct vm_area_struct *vma)
include/linux/stmmac.h +1 -0
@@ -251,6 +251,7 @@ struct plat_stmmacenet_data {int rss_en;int mac_port_sel_speed;bool en_tx_lpi_clockgating; +bool rx_clk_runs_in_lpi;int has_xgmac;bool vlan_fail_q_en;u8 vlan_fail_q;
include/net/sock.h +13 -0
@@ -2315,6 +2315,19 @@ static inline __must_check bool skb_set_owner_sk_safe(struct sk_buff *skb, strucreturn false; } +static inline struct sk_buff *skb_clone_and_charge_r (struct sk_buff *skb,struct sock *sk) +{ + skb =skb_clone (skb,sk_gfp_mask (sk,GFP_ATOMIC )); +if (skb) { +if (sk_rmem_schedule (sk, skb, skb->truesize)) { +skb_set_owner_r (skb, sk); +return skb; + } +__kfree_skb (skb); + } +return NULL ; +} +static inline void skb_prepare_for_gro (struct sk_buff *skb) {if (skb->destructor != sock_wfree) {
kernel/kprobes.c +16 -20
@@ -18,6 +18,9 @@* <[email protected]> and Prasanna S Panchamukhi * <[email protected]> added function-return probes. */ + +#define pr_fmt (fmt) "kprobes: " fmt +#include <linux/kprobes.h> #include <linux/hash.h> #include <linux/init.h>
@@ -892,7 +895,7 @@ static void optimize_all_kprobes(void)optimize_kprobe (p); }cpus_read_unlock (); -printk (KERN_INFO "Kprobes globally optimized\n" ); +pr_info ("kprobe jump-optimization is enabled. All kprobes are optimized if possible.\n" ); out:mutex_unlock (&kprobe_mutex); }
@@ -925,7 +928,7 @@ static void unoptimize_all_kprobes(void)/* Wait for unoptimizing completion */ wait_for_kprobe_optimizer (); -printk (KERN_INFO "Kprobes globally unoptimized\n" ); +pr_info ("kprobe jump-optimization is disabled. All kprobes are based on software breakpoint.\n" ); }static DEFINE_MUTEX (kprobe_sysctl_mutex);
@@ -1003,7 +1006,7 @@ static int reuse_unused_kprobe(struct kprobe *ap)* unregistered. * Thus there should be no chance to reuse unused kprobe. */ -printk (KERN_ERR "Error: There should be no unused kprobe here.\n" ); +WARN_ON_ONCE (1 );return -EINVAL ; }
@@ -1049,18 +1052,13 @@ static int __arm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops,int ret =0 ; ret =ftrace_set_filter_ip (ops, (unsigned long )p->addr,0 ,0 ); -if (ret) { -pr_debug ("Failed to arm kprobe-ftrace at %pS (%d)\n" , - p->addr, ret); +if (WARN_ONCE (ret <0 ,"Failed to arm kprobe-ftrace at %pS (error %d)\n" , p->addr, ret))return ret; - }if (*cnt ==0 ) { ret =register_ftrace_function (ops); -if (ret) { -pr_debug ("Failed to init kprobe-ftrace (%d)\n" , ret); +if (WARN (ret <0 ,"Failed to register kprobe-ftrace (error %d)\n" , ret)) goto err_ftrace; - } } (*cnt)++;
@@ -1092,14 +1090,14 @@ static int __disarm_kprobe_ftrace(struct kprobe *p, struct ftrace_ops *ops,if (*cnt ==1 ) { ret =unregister_ftrace_function (ops); -if (WARN (ret <0 ,"Failed to unregister kprobe-ftrace (%d)\n" , ret)) +if (WARN (ret <0 ,"Failed to unregister kprobe-ftrace (error %d)\n" , ret))return ret; } (*cnt)--; ret =ftrace_set_filter_ip (ops, (unsigned long )p->addr,1 ,0 ); -WARN_ONCE (ret <0 ,"Failed to disarm kprobe-ftrace at %pS (%d)\n" , +WARN_ONCE (ret <0 ,"Failed to disarm kprobe-ftrace at %pS (error %d)\n" , p->addr, ret);return ret; }
@@ -1894,7 +1892,7 @@ unsigned long __kretprobe_trampoline_handler(struct pt_regs *regs, node = node->next; } -pr_err ("Oops! Kretprobe fails to find correct return address.\n" ); +pr_err ("kretprobe: Return address not found, not execute handler. Maybe there is a bug in the kernel.\n" );BUG_ON (1 ); found:
@@ -2229,8 +2227,7 @@ EXPORT_SYMBOL_GPL(enable_kprobe);/* Caller must NOT call this in usual path. This is only for critical case */ void dump_kprobe (struct kprobe *kp) { -pr_err ("Dumping kprobe:\n" ); -pr_err ("Name: %s\nOffset: %x\nAddress: %pS\n" , +pr_err ("Dump kprobe:\n.symbol_name = %s, .offset = %x, .addr = %pS\n" , kp->symbol_name, kp->offset, kp->addr); }NOKPROBE_SYMBOL (dump_kprobe);
@@ -2493,8 +2490,7 @@ static int __init init_kprobes(void) err =populate_kprobe_blacklist (__start_kprobe_blacklist, __stop_kprobe_blacklist);if (err) { -pr_err ("kprobes: failed to populate blacklist: %d\n" , err); -pr_err ("Please take care of using kprobes.\n" ); +pr_err ("Failed to populate blacklist (error %d), kprobes not restricted, be careful using them!\n" , err); }if (kretprobe_blacklist_size) {
@@ -2503,7 +2499,7 @@ static int __init init_kprobes(void) kretprobe_blacklist[i].addr =kprobe_lookup_name (kretprobe_blacklist[i].name,0 );if (!kretprobe_blacklist[i].addr) -printk ("kretprobe: lookup failed: %s\n" , +pr_err ("Failed to lookup symbol '%s' for kretprobe blacklist. Maybe the target function is removed or renamed.\n" , kretprobe_blacklist[i].name); } }
@@ -2707,7 +2703,7 @@ static int arm_all_kprobes(void) }if (errors) -pr_warn ("Kprobes globally enabled, but failed to arm %d out of %d probes\n" , +pr_warn ("Kprobes globally enabled, but failed to enable %d out of %d probes. Please check which kprobes are kept disabled via debugfs.\n" , errors, total);else pr_info ("Kprobes globally enabled\n" );
@@ -2750,7 +2746,7 @@ static int disarm_all_kprobes(void) }if (errors) -pr_warn ("Kprobes globally disabled, but failed to disarm %d out of %d probes\n" , +pr_warn ("Kprobes globally disabled, but failed to disable %d out of %d probes. Please check which kprobes are kept enabled via debugfs.\n" , errors, total);else pr_info ("Kprobes globally disabled\n" );
kernel/sched/psi.c +4 -3
@@ -1169,10 +1169,11 @@ void psi_trigger_destroy(struct psi_trigger *t) group = t->group;/* -* Wakeup waiters to stop polling. Can happen if cgroup is deleted -* from under a polling process. +* Wakeup waiters to stop polling and clear the queue to prevent it from +* being accessed later. Can happen if cgroup is deleted from under a +* polling process. */ -wake_up_interruptible (&t->event_wait); +wake_up_pollfree (&t->event_wait);mutex_lock (&group->trigger_lock);
kernel/time/alarmtimer.c +29 -4
@@ -470,11 +470,35 @@ u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval) }EXPORT_SYMBOL_GPL (alarm_forward); -u64 alarm_forward_now (struct alarm *alarm,ktime_t interval) +static u64 __alarm_forward_now (struct alarm *alarm,ktime_t interval,bool throttle) {struct alarm_base *base = &alarm_bases[alarm->type]; +ktime_t now = base->get_ktime (); + +if (IS_ENABLED (CONFIG_HIGH_RES_TIMERS ) && throttle) { +/* +* Same issue as with posix_timer_fn(). Timers which are +* periodic but the signal is ignored can starve the system +* with a very small interval. The real fix which was +* promised in the context of posix_timer_fn() never +* materialized, but someone should really work on it. +* +* To prevent DOS fake @now to be 1 jiffie out which keeps +* the overrun accounting correct but creates an +* inconsistency vs. timer_gettime(2). +*/ +ktime_t kj =NSEC_PER_SEC /HZ ; + +if (interval < kj) + now =ktime_add (now, kj); + } + +return alarm_forward (alarm, now, interval); +} -return alarm_forward (alarm, base->get_ktime (), interval); +u64 alarm_forward_now (struct alarm *alarm,ktime_t interval) +{ +return __alarm_forward_now (alarm, interval, false); }EXPORT_SYMBOL_GPL (alarm_forward_now);
@@ -551,9 +575,10 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,if (posix_timer_event (ptr, si_private) && ptr->it_interval) {/* * Handle ignored signals and rearm the timer. This will go -* away once we handle ignored signals proper. +* away once we handle ignored signals proper. Ensure that +* small intervals cannot starve the system. */ - ptr->it_overrun +=alarm_forward_now (alarm, ptr->it_interval); + ptr->it_overrun +=__alarm_forward_now (alarm, ptr->it_interval, true); ++ptr->it_requeue_pending; ptr->it_active =1 ; result =ALARMTIMER_RESTART ;
mm/filemap.c +3 -2
@@ -2538,18 +2538,19 @@ static int filemap_get_pages(struct kiocb *iocb, struct iov_iter *iter,struct page *page;int err =0 ; +/* "last_index" is the index of the page beyond the end of the read */ last_index =DIV_ROUND_UP (iocb->ki_pos + iter->count,PAGE_SIZE ); retry:if (fatal_signal_pending (current))return -EINTR ; -filemap_get_read_batch (mapping, index, last_index, pvec); +filemap_get_read_batch (mapping, index, last_index -1 , pvec);if (!pagevec_count (pvec)) {if (iocb->ki_flags &IOCB_NOIO )return -EAGAIN ;page_cache_sync_readahead (mapping, ra, filp, index, last_index - index); -filemap_get_read_batch (mapping, index, last_index, pvec); +filemap_get_read_batch (mapping, index, last_index -1 , pvec); }if (!pagevec_count (pvec)) {if (iocb->ki_flags & (IOCB_NOWAIT |IOCB_WAITQ ))
mm/memblock.c +1 -7
@@ -1615,13 +1615,7 @@ void __init __memblock_free_late(phys_addr_t base, phys_addr_t size) end =PFN_DOWN (base + size);for (; cursor < end; cursor++) { -/* -* Reserved pages are always initialized by the end of -* memblock_free_all() (by memmap_init() and, if deferred -* initialization is enabled, memmap_init_reserved_pages()), so -* these pages can be released directly to the buddy allocator. -*/ -__free_pages_core (pfn_to_page (cursor),0 ); +memblock_free_pages (pfn_to_page (cursor), cursor,0 );totalram_pages_inc (); } }
net/core/dev.c +1 -1
@@ -10646,7 +10646,7 @@ void netdev_stats_to_stats64(struct rtnl_link_stats64 *stats64,BUILD_BUG_ON (n >sizeof (*stats64) /sizeof (u64));for (i =0 ; i < n; i++) - dst[i] =atomic_long_read (&src[i]); + dst[i] = (unsigned long )atomic_long_read (&src[i]);/* zero out counters that only exist in rtnl_link_stats64 */ memset ((char *)stats64 + n *sizeof (u64),0 ,sizeof (*stats64) - n *sizeof (u64));
net/core/sock_map.c +34 -27
82 lines not on this page · raw message
net/dccp/ipv6.c +2 -5
@@ -551,11 +551,9 @@ static struct sock *dccp_v6_request_recv_sock(const struct sock *sk, *own_req =inet_ehash_nolisten (newsk,req_to_sk (req_unhash),NULL );/* Clone pktoptions received with SYN, if we own the req */ if (*own_req && ireq->pktopts) { - newnp->pktoptions =skb_clone (ireq->pktopts,GFP_ATOMIC ); + newnp->pktoptions =skb_clone_and_charge_r (ireq->pktopts, newsk);consume_skb (ireq->pktopts); ireq->pktopts =NULL ; -if (newnp->pktoptions) -skb_set_owner_r (newnp->pktoptions, newsk); }return newsk;
@@ -615,7 +613,7 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)--ANK (980728) */ if (np->rxopt.all) - opt_skb =skb_clone (skb,GFP_ATOMIC ); + opt_skb =skb_clone_and_charge_r (skb, sk);if (sk->sk_state ==DCCP_OPEN ) {/* Fast path */ if (dccp_rcv_established (sk, skb,dccp_hdr (skb), skb->len))
@@ -679,7 +677,6 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) np->flow_label =ip6_flowlabel (ipv6_hdr (opt_skb));if (ipv6_opt_accepted (sk, opt_skb, &DCCP_SKB_CB (opt_skb)->header.h6)) { -skb_set_owner_r (opt_skb, sk);memmove (IP6CB (opt_skb), &DCCP_SKB_CB (opt_skb)->header.h6,sizeof (struct inet6_skb_parm ));
net/ipv4/inet_connection_sock.c +1 -0
@@ -1070,6 +1070,7 @@ int inet_csk_listen_start(struct sock *sk, int backlog)* It is OK, because this socket enters to hash table only * after validation is complete. */ + err = -EADDRINUSE ;inet_sk_state_store (sk,TCP_LISTEN );if (!sk->sk_prot->get_port (sk, inet->inet_num)) { inet->inet_sport =htons (inet->inet_num);
net/ipv6/datagram.c +1 -1
@@ -51,7 +51,7 @@ static void ip6_datagram_flow_key_init(struct flowi6 *fl6, struct sock *sk) fl6->flowi6_mark = sk->sk_mark; fl6->fl6_dport = inet->inet_dport; fl6->fl6_sport = inet->inet_sport; - fl6->flowlabel = np->flow_label; + fl6->flowlabel =ip6_make_flowinfo (np->tclass, np->flow_label); fl6->flowi6_uid = sk->sk_uid;if (!fl6->flowi6_oif)
net/ipv6/tcp_ipv6.c +4 -7
@@ -269,6 +269,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, fl6.flowi6_proto =IPPROTO_TCP ; fl6.daddr = sk->sk_v6_daddr; fl6.saddr = saddr ? *saddr : np->saddr; + fl6.flowlabel =ip6_make_flowinfo (np->tclass, np->flow_label); fl6.flowi6_oif = sk->sk_bound_dev_if; fl6.flowi6_mark = sk->sk_mark; fl6.fl6_dport = usin->sin6_port;
@@ -1429,14 +1430,11 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff */* Clone pktoptions received with SYN, if we own the req */ if (ireq->pktopts) { - newnp->pktoptions =skb_clone (ireq->pktopts, -sk_gfp_mask (sk,GFP_ATOMIC )); + newnp->pktoptions =skb_clone_and_charge_r (ireq->pktopts, newsk);consume_skb (ireq->pktopts); ireq->pktopts =NULL ; -if (newnp->pktoptions) { +if (newnp->pktoptions)tcp_v6_restore_cb (newnp->pktoptions); -skb_set_owner_r (newnp->pktoptions, newsk); - } } }else {if (!req_unhash && found_dup_sk) {
@@ -1506,7 +1504,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)--ANK (980728) */ if (np->rxopt.all) - opt_skb =skb_clone (skb,sk_gfp_mask (sk,GFP_ATOMIC )); + opt_skb =skb_clone_and_charge_r (skb, sk);if (sk->sk_state ==TCP_ESTABLISHED ) {/* Fast path */ struct dst_entry *dst;
@@ -1590,7 +1588,6 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)if (np->repflow) np->flow_label =ip6_flowlabel (ipv6_hdr (opt_skb));if (ipv6_opt_accepted (sk, opt_skb, &TCP_SKB_CB (opt_skb)->header.h6)) { -skb_set_owner_r (opt_skb, sk);tcp_v6_restore_cb (opt_skb); opt_skb =xchg (&np->pktoptions, opt_skb); }else {
net/mpls/af_mpls.c +4 -0
@@ -1428,6 +1428,7 @@ static int mpls_dev_sysctl_register(struct net_device *dev, free:kfree (table); out: + mdev->sysctl =NULL ;return -ENOBUFS ; }
@@ -1437,6 +1438,9 @@ static void mpls_dev_sysctl_unregister(struct net_device *dev,struct net *net =dev_net (dev);struct ctl_table *table; +if (!mdev->sysctl) +return ; + table = mdev->sysctl->ctl_table_arg;unregister_net_sysctl_table (mdev->sysctl);kfree (table);
net/mptcp/pm_netlink.c +6 -4
@@ -891,8 +891,8 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk, {int addrlen =sizeof (struct sockaddr_in );struct sockaddr_storage addr; -struct mptcp_sock *msk;struct socket *ssock; +struct sock *newsk;int backlog =1024 ;int err;
@@ -901,13 +901,15 @@ static int mptcp_pm_nl_create_listen_socket(struct sock *sk,if (err)return err; - msk =mptcp_sk (entry->lsk->sk); -if (!msk) { + newsk = entry->lsk->sk; +if (!newsk) { err = -EINVAL ; goto out; } - ssock =__mptcp_nmpc_socket (msk); +lock_sock (newsk); + ssock =__mptcp_nmpc_socket (mptcp_sk (newsk)); +release_sock (newsk);if (!ssock) { err = -EINVAL ; goto out;
net/mptcp/protocol.c +9 -0
@@ -2726,6 +2726,7 @@ static void mptcp_close(struct sock *sk, long timeout) {struct mptcp_subflow_context *subflow;bool do_cancel_work = false; +int subflows_alive =0 ;lock_sock (sk); sk->sk_shutdown =SHUTDOWN_MASK ;
@@ -2747,11 +2748,19 @@ static void mptcp_close(struct sock *sk, long timeout)struct sock *ssk =mptcp_subflow_tcp_sock (subflow);bool slow =lock_sock_fast_nested (ssk); + subflows_alive += ssk->sk_state !=TCP_CLOSE ; +sock_orphan (ssk);unlock_sock_fast (ssk, slow); }sock_orphan (sk); +/* all the subflows are closed, only timeout can change the msk +* state, let's not keep resources busy for no reasons +*/ +if (subflows_alive ==0 ) +inet_sk_state_store (sk,TCP_CLOSE ); +sock_hold (sk);pr_debug ("msk=%p state=%d" , sk, sk->sk_state);if (sk->sk_state ==TCP_CLOSE ) {
net/mptcp/subflow.c +1 -1
@@ -1570,7 +1570,7 @@ int mptcp_subflow_create_socket(struct sock *sk, struct socket **new_sock)if (err)return err; -lock_sock (sf->sk); +lock_sock_nested (sf->sk,SINGLE_DEPTH_NESTING );/* the newly created socket has to be in the same cgroup as its parent */ mptcp_attach_cgroup (sk, sf->sk);
net/netfilter/nft_tproxy.c +8 -0
@@ -312,6 +312,13 @@ static int nft_tproxy_dump(struct sk_buff *skb,return 0 ; } +static int nft_tproxy_validate (const struct nft_ctx *ctx, +const struct nft_expr *expr, +const struct nft_data **data) +{ +return nft_chain_validate_hooks (ctx->chain,1 <<NF_INET_PRE_ROUTING ); +} +static struct nft_expr_type nft_tproxy_type;static const struct nft_expr_ops nft_tproxy_ops = { .type = &nft_tproxy_type,
@@ -320,6 +327,7 @@ static const struct nft_expr_ops nft_tproxy_ops = { .init = nft_tproxy_init, .destroy = nft_tproxy_destroy, .dump = nft_tproxy_dump, + .validate = nft_tproxy_validate, };static struct nft_expr_type nft_tproxy_type__read_mostly = {
net/openvswitch/meter.c +3 -1
@@ -450,7 +450,7 @@ static int ovs_meter_cmd_set(struct sk_buff *skb, struct genl_info *info) err =attach_meter (meter_tbl, meter);if (err) - goto exit_unlock; + goto exit_free_old_meter;ovs_unlock ();
@@ -473,6 +473,8 @@ static int ovs_meter_cmd_set(struct sk_buff *skb, struct genl_info *info)genlmsg_end (reply, ovs_reply_header);return genlmsg_reply (reply, info); +exit_free_old_meter: +ovs_meter_free (old_meter); exit_unlock:ovs_unlock ();nlmsg_free (reply);
net/rose/af_rose.c +8 -0
@@ -487,6 +487,12 @@ static int rose_listen(struct socket *sock, int backlog) {struct sock *sk = sock->sk; +lock_sock (sk); +if (sock->state !=SS_UNCONNECTED ) { +release_sock (sk); +return -EINVAL ; + } +if (sk->sk_state !=TCP_LISTEN ) {struct rose_sock *rose =rose_sk (sk);
@@ -496,8 +502,10 @@ static int rose_listen(struct socket *sock, int backlog)memset (rose->dest_digis,0 ,AX25_ADDR_LEN *ROSE_MAX_DIGIS ); sk->sk_max_ack_backlog = backlog; sk->sk_state =TCP_LISTEN ; +release_sock (sk);return 0 ; } +release_sock (sk);return -EOPNOTSUPP ; }
net/sched/act_bpf.c +1 -1
@@ -305,7 +305,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla, ret =tcf_idr_check_alloc (tn, &index, act, bind);if (!ret) { ret =tcf_idr_create (tn, index, est, act, - &act_bpf_ops, bind, true,0 ); + &act_bpf_ops, bind, true, flags);if (ret <0 ) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_connmark.c +1 -1
@@ -124,7 +124,7 @@ static int tcf_connmark_init(struct net *net, struct nlattr *nla, ret =tcf_idr_check_alloc (tn, &index, a, bind);if (!ret) { ret =tcf_idr_create (tn, index, est, a, - &act_connmark_ops, bind, false,0 ); + &act_connmark_ops, bind, false, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_ctinfo.c +3 -3
@@ -92,7 +92,7 @@ static int tcf_ctinfo_act(struct sk_buff *skb, const struct tc_action *a, cp =rcu_dereference_bh (ca->params);tcf_lastuse_update (&ca->tcf_tm); -bstats_update (&ca->tcf_bstats, skb); +tcf_action_update_bstats (&ca->common, skb); action =READ_ONCE (ca->tcf_action); wlen =skb_network_offset (skb);
@@ -211,8 +211,8 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla, index = actparm->index; err =tcf_idr_check_alloc (tn, &index, a, bind);if (!err) { - ret =tcf_idr_create (tn, index, est, a, - &act_ctinfo_ops, bind, false,0 ); + ret =tcf_idr_create_from_flags (tn, index, est, a, + &act_ctinfo_ops, bind, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_gate.c +1 -1
@@ -357,7 +357,7 @@ static int tcf_gate_init(struct net *net, struct nlattr *nla,if (!err) { ret =tcf_idr_create (tn, index, est, a, - &act_gate_ops, bind, false,0 ); + &act_gate_ops, bind, false, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_ife.c +1 -1
@@ -553,7 +553,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, &act_ife_ops, - bind, true,0 ); + bind, true, flags);if (ret) {tcf_idr_cleanup (tn, index);kfree (p);
net/sched/act_ipt.c +1 -1
@@ -145,7 +145,7 @@ static int __tcf_ipt_init(struct net *net, unsigned int id, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, ops, bind, - false,0 ); + false, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_mpls.c +1 -1
@@ -254,7 +254,7 @@ static int tcf_mpls_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, - &act_mpls_ops, bind, true,0 ); + &act_mpls_ops, bind, true, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_nat.c +1 -1
@@ -61,7 +61,7 @@ static int tcf_nat_init(struct net *net, struct nlattr *nla, struct nlattr *est, err =tcf_idr_check_alloc (tn, &index, a, bind);if (!err) { ret =tcf_idr_create (tn, index, est, a, - &act_nat_ops, bind, false,0 ); + &act_nat_ops, bind, false, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_pedit.c +1 -1
@@ -189,7 +189,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, err =tcf_idr_check_alloc (tn, &index, a, bind);if (!err) { ret =tcf_idr_create (tn, index, est, a, - &act_pedit_ops, bind, false,0 ); + &act_pedit_ops, bind, false, flags);if (ret) {tcf_idr_cleanup (tn, index); goto out_free;
net/sched/act_police.c +1 -1
@@ -90,7 +90,7 @@ static int tcf_police_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index,NULL , a, - &act_police_ops, bind, true,0 ); + &act_police_ops, bind, true, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_sample.c +1 -1
@@ -70,7 +70,7 @@ static int tcf_sample_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, - &act_sample_ops, bind, true,0 ); + &act_sample_ops, bind, true, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_simple.c +1 -1
@@ -128,7 +128,7 @@ static int tcf_simp_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, - &act_simp_ops, bind, false,0 ); + &act_simp_ops, bind, false, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_skbedit.c +1 -1
@@ -176,7 +176,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, - &act_skbedit_ops, bind, true,0 ); + &act_skbedit_ops, bind, true, act_flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/act_skbmod.c +1 -1
@@ -168,7 +168,7 @@ static int tcf_skbmod_init(struct net *net, struct nlattr *nla,if (!exists) { ret =tcf_idr_create (tn, index, est, a, - &act_skbmod_ops, bind, true,0 ); + &act_skbmod_ops, bind, true, flags);if (ret) {tcf_idr_cleanup (tn, index);return ret;
net/sched/cls_tcindex.c +30 -4
@@ -12,6 +12,7 @@#include <linux/errno.h> #include <linux/slab.h> #include <linux/refcount.h> +#include <linux/rcupdate.h> #include <net/act_api.h> #include <net/netlink.h> #include <net/pkt_cls.h>
@@ -338,6 +339,7 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,struct tcf_result cr = {};int err, balloc =0 ;struct tcf_exts e; +bool update_h = false; err =tcf_exts_init (&e, net,TCA_TCINDEX_ACT ,TCA_TCINDEX_POLICE );if (err <0 )
@@ -455,10 +457,13 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base, } } -if (cp->perfect) +if (cp->perfect) { r = cp->perfect + handle; -else - r =tcindex_lookup (cp, handle) ? : &new_filter_result; + }else { +/* imperfect area is updated in-place using rcu */ + update_h = !!tcindex_lookup (cp, handle); + r = &new_filter_result; + }if (r == &new_filter_result) { f =kzalloc (sizeof (*f),GFP_KERNEL );
@@ -484,7 +489,28 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,rcu_assign_pointer (tp->root, cp); -if (r == &new_filter_result) { +if (update_h) { +struct tcindex_filter __rcu **fp; +struct tcindex_filter *cf; + + f->result.res = r->res; +tcf_exts_change (&f->result.exts, &r->exts); + +/* imperfect area bucket */ + fp = cp->h + (handle % cp->hash); + +/* lookup the filter, guaranteed to exist */ +for (cf =rcu_dereference_bh_rtnl (*fp); cf; + fp = &cf->next, cf =rcu_dereference_bh_rtnl (*fp)) +if (cf->key == (u16 )handle) +break ; + + f->next = cf->next; + + cf =rcu_replace_pointer (*fp, f,1 ); +tcf_exts_get_net (&cf->result.exts); +tcf_queue_work (&cf->rwork, tcindex_destroy_fexts_work); + }else if (r == &new_filter_result) {struct tcindex_filter *nfp;struct tcindex_filter __rcu **fp;
net/sched/sch_htb.c +4 -1
@@ -427,7 +427,10 @@ static void htb_activate_prios(struct htb_sched *q, struct htb_class *cl)while (cl->cmode ==HTB_MAY_BORROW && p && mask) { m = mask;while (m) { -int prio =ffz (~m); +unsigned int prio =ffz (~m); + +if (WARN_ON_ONCE (prio >=ARRAY_SIZE (p->inner.clprio))) +break ; m &= ~(1 << prio);if (p->inner.clprio[prio].feed.rb_node)
net/sctp/diag.c +1 -3
@@ -343,11 +343,9 @@ static int sctp_sock_filter(struct sctp_endpoint *ep, struct sctp_transport *tspstruct sctp_comm_param *commp = p;struct sock *sk = ep->base.sk;const struct inet_diag_req_v2 *r = commp->r; -struct sctp_association *assoc = - list_entry(ep->asocs.next, struct sctp_association, asocs);/* find the ep only once through the transports by this condition */ -if (tsp->asoc != assoc) +if (!list_is_first (&tsp->asoc->asocs, &ep->asocs))return 0 ;if (r->sdiag_family !=AF_UNSPEC && sk->sk_family != r->sdiag_family)
sound/pci/hda/hda_bind.c +2 -0
@@ -144,6 +144,7 @@ static int hda_codec_driver_probe(struct device *dev) error:snd_hda_codec_cleanup_for_unbind (codec); + codec->preset =NULL ;return err; }
@@ -166,6 +167,7 @@ static int hda_codec_driver_remove(struct device *dev)if (codec->patch_ops.free) codec->patch_ops.free (codec);snd_hda_codec_cleanup_for_unbind (codec); + codec->preset =NULL ;module_put (dev->driver->owner);return 0 ; }
sound/pci/hda/hda_codec.c +0 -1
@@ -791,7 +791,6 @@ void snd_hda_codec_cleanup_for_unbind(struct hda_codec *codec)snd_array_free (&codec->cvt_setups);snd_array_free (&codec->spdif_out);snd_array_free (&codec->verbs); - codec->preset =NULL ; codec->follower_dig_outs =NULL ; codec->spdif_status_reset =0 ;snd_array_free (&codec->mixers);
sound/pci/hda/patch_conexant.c +1 -0
@@ -1124,6 +1124,7 @@ static const struct hda_device_id snd_hda_id_conexant[] = {HDA_CODEC_ENTRY (0x14f11f86 ,"CX8070" , patch_conexant_auto),HDA_CODEC_ENTRY (0x14f12008 ,"CX8200" , patch_conexant_auto),HDA_CODEC_ENTRY (0x14f120d0 ,"CX11970" , patch_conexant_auto), +HDA_CODEC_ENTRY (0x14f120d1 ,"SN6180" , patch_conexant_auto),HDA_CODEC_ENTRY (0x14f15045 ,"CX20549 (Venice)" , patch_conexant_auto),HDA_CODEC_ENTRY (0x14f15047 ,"CX20551 (Waikiki)" , patch_conexant_auto), HDA_CODEC_ENTRY(0x14f15051, "CX20561 (Hermosa)", patch_conexant_auto),
sound/pci/hda/patch_realtek.c +1 -1
@@ -826,7 +826,7 @@ static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)alc_setup_gpio (codec,0x02 );break ;case 7 : -alc_setup_gpio (codec,0x03 ); +alc_setup_gpio (codec,0x04 );break ;case 5 :default :
sound/soc/codecs/cs42l56.c +0 -6
@@ -1193,18 +1193,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,if (pdata) { cs42l56->pdata = *pdata; }else { - pdata =devm_kzalloc (&i2c_client->dev,sizeof (*pdata), -GFP_KERNEL ); -if (!pdata) -return -ENOMEM ; -if (i2c_client->dev.of_node) { ret =cs42l56_handle_of_data (i2c_client, &cs42l56->pdata);if (ret !=0 )return ret; } - cs42l56->pdata = *pdata; }if (cs42l56->pdata.gpio_nreset) {
sound/soc/intel/boards/sof_cs42l42.c +3 -0
@@ -311,6 +311,9 @@ static int create_spk_amp_dai_links(struct device *dev, links[*id].platforms = platform_component; links[*id].num_platforms =ARRAY_SIZE (platform_component); links[*id].dpcm_playback =1 ; +/* firmware-generated echo reference */ + links[*id].dpcm_capture =1 ; + links[*id].no_pcm =1 ; links[*id].cpus = &cpus[*id]; links[*id].num_cpus =1 ;
sound/soc/intel/boards/sof_rt5682.c +3 -2
@@ -737,8 +737,6 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, links[id].num_codecs =ARRAY_SIZE (max_98373_components); links[id].init = max_98373_spk_codec_init; links[id].ops = &max_98373_ops; -/* feedback stream */ - links[id].dpcm_capture =1 ; }else if (sof_rt5682_quirk &SOF_MAX98360A_SPEAKER_AMP_PRESENT ) {max_98360a_dai_link (&links[id]);
@@ -751,6 +749,9 @@ static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev, links[id].platforms = platform_component; links[id].num_platforms =ARRAY_SIZE (platform_component); links[id].dpcm_playback =1 ; +/* feedback stream or firmware-generated echo reference */ + links[id].dpcm_capture =1 ; + links[id].no_pcm =1 ; links[id].cpus = &cpus[id]; links[id].num_cpus =1 ;
sound/soc/sof/intel/hda-dai.c +4 -4
@@ -212,6 +212,10 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,int stream_tag;int ret; + link =snd_hdac_ext_bus_get_link (bus, codec_dai->component->name); +if (!link) +return -EINVAL ; +/* get stored dma data if resuming from system suspend */ link_dev =snd_soc_dai_get_dma_data (dai, substream);if (!link_dev) {
@@ -232,10 +236,6 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,if (ret <0 )return ret; - link =snd_hdac_ext_bus_get_link (bus, codec_dai->component->name); -if (!link) -return -EINVAL ; -/* set the hdac_stream in the codec dai */ snd_soc_dai_set_stream (codec_dai,hdac_stream (link_dev), substream->stream);
tools/testing/selftests/bpf/verifier/search_pruning.c +36 -0
@@ -154,3 +154,39 @@ .result_unpriv = ACCEPT, .insn_processed = 15, }, +/* The test performs a conditional 64-bit write to a stack location +* fp[-8], this is followed by an unconditional 8-bit write to fp[-8], +* then data is read from fp[-8]. This sequence is unsafe. +* +* The test would be mistakenly marked as safe w/o dst register parent +* preservation in verifier.c:copy_register_state() function. +* +* Note the usage of BPF_F_TEST_STATE_FREQ to force creation of the +* checkpoint state after conditional 64-bit assignment. +*/ +{ + "write tracking and register parent chain bug", + .insns = { +/* r6 = ktime_get_ns() */ +BPF_EMIT_CALL (BPF_FUNC_ktime_get_ns), +BPF_MOV64_REG (BPF_REG_6 ,BPF_REG_0 ), +/* r0 = ktime_get_ns() */ +BPF_EMIT_CALL (BPF_FUNC_ktime_get_ns), +/* if r0 > r6 goto +1 */ +BPF_JMP_REG (BPF_JGT ,BPF_REG_0 ,BPF_REG_6 ,1 ), +/* *(u64 *)(r10 - 8) = 0xdeadbeef */ +BPF_ST_MEM (BPF_DW ,BPF_REG_FP ,-8 ,0xdeadbeef ), +/* r1 = 42 */ +BPF_MOV64_IMM (BPF_REG_1 ,42 ), +/* *(u8 *)(r10 - 8) = r1 */ +BPF_STX_MEM (BPF_B ,BPF_REG_FP ,BPF_REG_1 ,-8 ), +/* r2 = *(u64 *)(r10 - 8) */ +BPF_LDX_MEM (BPF_DW ,BPF_REG_2 ,BPF_REG_FP ,-8 ), +/* exit(0) */ +BPF_MOV64_IMM (BPF_REG_0 ,0 ), + BPF_EXIT_INSN(), + }, + .flags =BPF_F_TEST_STATE_FREQ , + .errstr = "invalid read from stack off -8+1 size 8", + .result = REJECT, +},
tools/testing/selftests/lkdtm/stack-entropy.sh +15 -1
@@ -4,13 +4,27 @@ # Measure kernel stack entropy by sampling via LKDTM's REPORT_STACK test. set -e samples="${1:-1000}" +TRIGGER=/sys/kernel/debug/provoke-crash/DIRECT +KSELFTEST_SKIP_TEST=4 + +# Verify we have LKDTM available in the kernel. +if [ ! -r $TRIGGER ] ; then + /sbin/modprobe -q lkdtm || true + if [ ! -r $TRIGGER ] ; then + echo "Cannot find $TRIGGER (missing CONFIG_LKDTM?)" + else + echo "Cannot write $TRIGGER (need to run as root?)" + fi + # Skip this test + exit $KSELFTEST_SKIP_TEST +fi # Capture dmesg continuously since it may fill up depending on sample size. log=$(mktemp -t stack-entropy-XXXXXX) dmesg --follow >"$log" & pid=$! report=-1 for i in $(seq 1 $samples); do - echo "REPORT_STACK" >/sys/kernel/debug/provoke-crash/DIRECT + echo "REPORT_STACK" > $TRIGGER if [ -t 1 ]; then percent=$(( 100 * $i / $samples )) if [ "$percent" -ne "$report" ]; then
tools/virtio/linux/bug.h +3 -5
@@ -1,13 +1,11 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef BUG_H -#define BUG_H +#ifndef _LINUX_BUG_H +#define _LINUX_BUG_H#include <asm/bug.h> #define BUG_ON (__BUG_ON_cond) assert(!(__BUG_ON_cond)) -#define BUILD_BUG_ON (x) -#define BUG () abort() -#endif /* BUG_H */ +#endif /* _LINUX_BUG_H */
tools/virtio/linux/build_bug.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_BUILD_BUG_H +#define _LINUX_BUILD_BUG_H + +#define BUILD_BUG_ON (x) + +#endif /* _LINUX_BUILD_BUG_H */
tools/virtio/linux/cpumask.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_CPUMASK_H +#define _LINUX_CPUMASK_H + +#include <linux/kernel.h> + +#endif /* _LINUX_CPUMASK_H */
tools/virtio/linux/gfp.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_GFP_H +#define __LINUX_GFP_H + +#include <linux/topology.h> + +#endif
tools/virtio/linux/kernel.h +1 -0
@@ -10,6 +10,7 @@#include <stdarg.h> #include <linux/compiler.h> +#include <linux/log2.h> #include <linux/types.h> #include <linux/overflow.h> #include <linux/list.h>
tools/virtio/linux/kmsan.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_KMSAN_H +#define _LINUX_KMSAN_H + +#include <linux/gfp.h> + +inline void kmsan_handle_dma (struct page *page,size_t offset,size_t size, +enum dma_data_direction dir) +{ +} + +#endif /* _LINUX_KMSAN_H */
tools/virtio/linux/scatterlist.h +1 -0
@@ -2,6 +2,7 @@ #ifndef SCATTERLIST_H #define SCATTERLIST_H #include <linux/kernel.h> +#include <linux/bug.h> struct scatterlist { unsigned long page_link;
tools/virtio/linux/topology.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_TOPOLOGY_H +#define _LINUX_TOPOLOGY_H + +#include <linux/cpumask.h> + +#endif /* _LINUX_TOPOLOGY_H */