Linux 5.15.147
Greg Kroah-Hartman
maintainerI'm announcing the release of the 5.15.147 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/mach-sunxi/mc_smp.c | 4 arch/x86/kernel/kprobes/core.c | 3 block/fops.c | 21 +- drivers/firewire/ohci.c | 51 +++++ drivers/gpu/drm/bridge/ti-sn65dsi86.c | 4 drivers/gpu/drm/i915/display/intel_dp.c | 2 drivers/i2c/i2c-core.h | 4 drivers/mmc/core/block.c | 7 drivers/mmc/core/host.c | 1 drivers/mmc/host/meson-mx-sdhc-mmc.c | 26 -- drivers/mmc/host/sdhci-sprd.c | 10 - drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 drivers/net/ethernet/intel/i40e/i40e_main.c | 11 + drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 34 +++ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 3 drivers/net/ethernet/intel/igc/igc.h | 1 drivers/net/ethernet/intel/igc/igc_ethtool.c | 42 ++++ drivers/net/ethernet/intel/igc/igc_tsn.c | 2 drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 68 ++++-- drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h | 1 drivers/net/ethernet/marvell/octeontx2/af/npc.h | 4 drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 77 ++++--- drivers/net/ethernet/marvell/octeontx2/af/rpm.h | 1 drivers/net/ethernet/marvell/octeontx2/af/rvu.h | 3 drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c | 33 +++ drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 146 ++------------- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 1 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 15 - drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 12 - drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c | 9 drivers/net/ethernet/qlogic/qla3xxx.c | 2 drivers/net/ethernet/realtek/r8169_main.c | 2 drivers/net/ethernet/sfc/rx_common.c | 4 drivers/net/usb/ax88172a.c | 4 drivers/net/usb/ax88179_178a.c | 115 ++--------- drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 4 drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 8 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 17 - drivers/pci/pci.c | 6 drivers/pci/pci.h | 2 drivers/pci/pcie/aspm.c | 19 + include/linux/module.h | 9 include/net/dst_ops.h | 2 kernel/module.c | 2 kernel/trace/trace_kprobe.c | 2 mm/memory-failure.c | 6 mm/memory.c | 4 net/can/raw.c | 12 + net/core/dst.c | 8 net/core/sock.c | 12 + net/dns_resolver/dns_key.c | 19 - net/ipv4/ip_output.c | 2 net/ipv6/ip6_output.c | 2 net/ipv6/route.c | 13 - net/netfilter/nf_tables_api.c | 27 ++ net/netfilter/nft_immediate.c | 2 net/nfc/llcp_core.c | 39 +++- net/sched/em_text.c | 4 net/socket.c | 2 net/tls/tls_sw.c | 2 sound/pci/hda/patch_realtek.c | 1 sound/soc/fsl/fsl_rpmsg.c | 10 - sound/soc/meson/g12a-toacodec.c | 5 sound/soc/meson/g12a-tohdmitx.c | 8 tools/perf/util/genelf.h | 4 tools/testing/selftests/vm/memfd_secret.c | 3 68 files changed, 587 insertions(+), 402 deletions(-)
Adrian Cinal (1):
net: bcmgenet: Fix FCS generation for fragmented skbuffs
Adrian Hunter (1):
perf inject: Fix GEN_ELF_TEXT_OFFSET for jit
Andrii Nakryiko (1):
tracing/kprobes: Fix symbol counting logic by looking at modules as well
Andrii Staikov (1):
i40e: Restore VF MSI-X state during PCI reset
Benjamin Bara (1):
i2c: core: Fix atomic xfer check for non-preempt config
Bjorn Helgaas (1):
Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()"
Chancel Liu (1):
ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable
Chen Ni (1):
asix: Add check for usbnet_get_endpoints
David Thompson (1):
mlxbf_gige: fix receive packet race condition
Dinghao Liu (1):
net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues
Douglas Anderson (1):
drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer
Edward Adam Davis (1):
keys, dns: Fix missing size check of V1 server-list header
Geert Uytterhoeven (1):
mmc: core: Cancel delayed work before releasing host
Greg Kroah-Hartman (1):
Linux 5.15.147
Hangyu Hua (1):
net: sched: em_text: fix possible memory leak in em_text_destroy()
Hariprasad Kelam (1):
octeontx2-af: Don't enable Pause frames by default
Jiajun Xie (1):
mm: fix unmap_mapping_range high bits shift bug
Jinghao Jia (1):
x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect
Jiri Olsa (1):
kallsyms: Make module_kallsyms_on_each_symbol generally available
Johannes Berg (1):
wifi: iwlwifi: pcie: don't synchronize IRQs from IRQ
John Fastabend (1):
net: tls, update curr on splice as well
Jon Maxwell (1):
ipv6: remove max_size check inline with ipv4
Jorge Ramirez-Ortiz (1):
mmc: rpmb: fixes pause retune on all RPMB partitions.
Justin Chen (2):
net: usb: ax88179_178a: remove redundant init code
net: usb: ax88179_178a: move priv to driver_priv
Jörn-Thorben Hinz (1):
net: Implement missing getsockopt(SO_TIMESTAMPING_NEW)
Kai-Heng Feng (1):
r8169: Fix PCI error on system resume
Ke Xiao (1):
i40e: fix use-after-free in i40e_aqc_add_filters()
Khaled Almahallawy (1):
drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern
Kurt Kanzenbach (3):
igc: Report VLAN EtherType matching back to user
igc: Check VLAN TCI mask
igc: Check VLAN EtherType mask
Marc Dionne (1):
net: Save and restore msg_namelen in sock_sendmsg
Marc Kleine-Budde (2):
can: raw: add support for SO_TXTIME/SCM_TXTIME
can: raw: add support for SO_MARK
Mark Brown (4):
ASoC: meson: g12a-toacodec: Validate written enum values
ASoC: meson: g12a-tohdmitx: Validate written enum values
ASoC: meson: g12a-toacodec: Fix event generation
ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
Matthew Wilcox (Oracle) (1):
mm/memory-failure: check the mapcount of the precise page
Michael Chan (1):
bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters()
Muhammad Usama Anjum (1):
selftests: secretmem: floor the memory size to the multiple of page_size
Naveen Mamindlapalli (2):
octeontx2-af: Always configure NIX TX link credits based on max frame size
octeontx2-af: Re-enable MAC TX in otx2_stop processing
Pablo Neira Ayuso (1):
netfilter: nft_immediate: drop chain reference counter on error
Phil Sutter (1):
netfilter: nf_tables: Reject tables of unsupported family
Rodrigo Cataldo (1):
igc: Fix hicredit calculation
Sarthak Kukreti (1):
block: Don't invalidate pagecache for invalid falloc modes
Siddh Raman Pant (1):
nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local
Siddhesh Dharme (1):
ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
Stefan Wahren (1):
ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init
Sudheer Mogilappagari (1):
i40e: Fix filter input checks to prevent config with invalid values
Suman Ghosh (1):
octeontx2-af: Fix marking couple of structure as __packed
Sunil Goutham (1):
octeontx2-af: Set NIX link credits based on max LMAC
Takashi Sakamoto (1):
firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards
Thomas Lange (1):
net: Implement missing SO_TIMESTAMPING_NEW cmsg support
Vadim Fedorenko (1):
net-timestamp: extend SOF_TIMESTAMPING_OPT_ID to HW timestamps
Wenchao Chen (1):
mmc: sdhci-sprd: Fix eMMC init failure after hw reset
Zhipeng Lu (1):
sfc: fix a double-free bug in efx_probe_filters
Ziyang Huang (1):
mmc: meson-mx-sdhc: Fix initialization frozen issue
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 15 -SUBLEVEL = 146 +SUBLEVEL = 147 EXTRAVERSION = NAME = Trick or Treat
arch/arm/mach-sunxi/mc_smp.c +2 -2
@@ -808,12 +808,12 @@ static int __init sunxi_mc_smp_init(void)break ; } - is_a83t = sunxi_mc_smp_data[i].is_a83t; -of_node_put (node);if (ret)return -ENODEV ; + is_a83t = sunxi_mc_smp_data[i].is_a83t; +if (!sunxi_mc_smp_cpu_table_init ())return -EINVAL ;
arch/x86/kernel/kprobes/core.c +2 -1
@@ -563,7 +563,8 @@ static void kprobe_emulate_call_indirect(struct kprobe *p, struct pt_regs *regs) {unsigned long offs = addrmode_regoffs[p->ainsn.indirect.reg]; -int3_emulate_call (regs,regs_get_register (regs, offs)); +int3_emulate_push (regs, regs->ip -INT3_INSN_SIZE + p->ainsn.size); +int3_emulate_jmp (regs,regs_get_register (regs, offs)); }NOKPROBE_SYMBOL (kprobe_emulate_call_indirect);
block/fops.c +16 -5
@@ -599,22 +599,33 @@ static long blkdev_fallocate(struct file *file, int mode, loff_t start,filemap_invalidate_lock (inode->i_mapping); -/* Invalidate the page cache, including dirty pages. */ - error =truncate_bdev_range (bdev, file->f_mode, start, end); -if (error) - goto fail; - +/* +* Invalidate the page cache, including dirty pages, for valid +* de-allocate mode calls to fallocate(). +*/ switch (mode) {case FALLOC_FL_ZERO_RANGE :case FALLOC_FL_ZERO_RANGE |FALLOC_FL_KEEP_SIZE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) + goto fail; + error =blkdev_issue_zeroout (bdev, start >>9 , len >>9 ,GFP_KERNEL ,BLKDEV_ZERO_NOUNMAP );break ;case FALLOC_FL_PUNCH_HOLE |FALLOC_FL_KEEP_SIZE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) + goto fail; + error =blkdev_issue_zeroout (bdev, start >>9 , len >>9 ,GFP_KERNEL ,BLKDEV_ZERO_NOFALLBACK );break ;case FALLOC_FL_PUNCH_HOLE |FALLOC_FL_KEEP_SIZE |FALLOC_FL_NO_HIDE_STALE : + error =truncate_bdev_range (bdev, file->f_mode, start, end); +if (error) + goto fail; + error =blkdev_issue_discard (bdev, start >>9 , len >>9 ,GFP_KERNEL ,0 );break ;
drivers/firewire/ohci.c +51 -0
69 lines not on this page · raw message
drivers/gpu/drm/bridge/ti-sn65dsi86.c +3 -1
@@ -471,6 +471,7 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux,u32 request_val =AUX_CMD_REQ (msg->request);u8 *buf = msg->buffer;unsigned int len = msg->size; +unsigned int short_len;unsigned int val;int ret;u8 addr_len[SN_AUX_LENGTH_REG +1 -SN_AUX_ADDR_19_16_REG ];
@@ -544,7 +545,8 @@ static ssize_t ti_sn_aux_transfer(struct drm_dp_aux *aux, }if (val &AUX_IRQ_STATUS_AUX_SHORT ) { - ret =regmap_read (pdata->regmap,SN_AUX_LENGTH_REG , &len); + ret =regmap_read (pdata->regmap,SN_AUX_LENGTH_REG , &short_len); + len =min (len, short_len);if (ret) goto exit; }else if (val &AUX_IRQ_STATUS_NAT_I2C_FAIL ) {
drivers/gpu/drm/i915/display/intel_dp.c +1 -1
@@ -3275,7 +3275,7 @@ static void intel_dp_process_phy_request(struct intel_dp *intel_dp, intel_dp->train_set, crtc_state->lane_count);drm_dp_set_phy_test_pattern (&intel_dp->aux, data, - link_status[DP_DPCD_REV ]); + intel_dp->dpcd[DP_DPCD_REV ]); }static u8 intel_dp_autotest_phy_pattern (struct intel_dp *intel_dp)
drivers/i2c/i2c-core.h +3 -1
@@ -3,6 +3,7 @@* i2c-core.h - interfaces internal to the I2C framework */ +#include <linux/kconfig.h> #include <linux/rwsem.h> struct i2c_devinfo {
@@ -29,7 +30,8 @@ int i2c_dev_irq_from_resources(const struct resource *resources,*/ static inline bool i2c_in_atomic_xfer_mode (void ) { -return system_state >SYSTEM_RUNNING && !preemptible (); +return system_state >SYSTEM_RUNNING && + (IS_ENABLED (CONFIG_PREEMPT_COUNT ) ? !preemptible () :irqs_disabled ()); }static inline int __i2c_lock_bus_helper (struct i2c_adapter *adap)
drivers/mmc/core/block.c +4 -3
@@ -839,9 +839,10 @@ static const struct block_device_operations mmc_bdops = {static int mmc_blk_part_switch_pre (struct mmc_card *card,unsigned int part_type) { +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if (part_type ==EXT_CSD_PART_CONFIG_ACC_RPMB ) { +if ((part_type & mask) == mask) {if (card->ext_csd.cmdq_en) { ret =mmc_cmdq_disable (card);if (ret)
@@ -856,9 +857,10 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,static int mmc_blk_part_switch_post (struct mmc_card *card,unsigned int part_type) { +const unsigned int mask =EXT_CSD_PART_CONFIG_ACC_RPMB ;int ret =0 ; -if (part_type ==EXT_CSD_PART_CONFIG_ACC_RPMB ) { +if ((part_type & mask) == mask) {mmc_retune_unpause (card->host);if (card->reenable_cmdq && !card->ext_csd.cmdq_en) ret =mmc_cmdq_enable (card);
@@ -3126,4 +3128,3 @@ module_exit(mmc_blk_exit);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("Multimedia Card (MMC) block device driver" ); -
drivers/mmc/core/host.c +1 -0
@@ -661,6 +661,7 @@ EXPORT_SYMBOL(mmc_remove_host);*/ void mmc_free_host (struct mmc_host *host) { +cancel_delayed_work_sync (&host->detect);mmc_pwrseq_free (host);put_device (&host->class_dev); }
drivers/mmc/host/meson-mx-sdhc-mmc.c +5 -21
@@ -269,7 +269,7 @@ static int meson_mx_sdhc_enable_clks(struct mmc_host *mmc)static int meson_mx_sdhc_set_clk (struct mmc_host *mmc,struct mmc_ios *ios) {struct meson_mx_sdhc_host *host =mmc_priv (mmc); -u32 rx_clk_phase; +u32 val, rx_clk_phase;int ret;meson_mx_sdhc_disable_clks (mmc);
@@ -290,27 +290,11 @@ static int meson_mx_sdhc_set_clk(struct mmc_host *mmc, struct mmc_ios *ios) mmc->actual_clock =clk_get_rate (host->sd_clk);/* -* according to Amlogic the following latching points are -* selected with empirical values, there is no (known) formula -* to calculate these. +* Phase 90 should work in most cases. For data transmission, +* meson_mx_sdhc_execute_tuning() will find a accurate value */ -if (mmc->actual_clock >100000000 ) { - rx_clk_phase =1 ; - }else if (mmc->actual_clock >45000000 ) { -if (ios->signal_voltage ==MMC_SIGNAL_VOLTAGE_330 ) - rx_clk_phase =15 ; -else - rx_clk_phase =11 ; - }else if (mmc->actual_clock >=25000000 ) { - rx_clk_phase =15 ; - }else if (mmc->actual_clock >5000000 ) { - rx_clk_phase =23 ; - }else if (mmc->actual_clock >1000000 ) { - rx_clk_phase =55 ; - }else { - rx_clk_phase =1061 ; - } - +regmap_read (host->regmap,MESON_SDHC_CLKC , &val); + rx_clk_phase =FIELD_GET (MESON_SDHC_CLKC_CLK_DIV , val) /4 ; regmap_update_bits(host->regmap, MESON_SDHC_CLK2, MESON_SDHC_CLK2_RX_CLK_PHASE, FIELD_PREP(MESON_SDHC_CLK2_RX_CLK_PHASE,
drivers/mmc/host/sdhci-sprd.c +7 -3
@@ -224,15 +224,19 @@ static inline void _sdhci_sprd_set_clock(struct sdhci_host *host, div = ((div &0x300 ) >>2 ) | ((div &0xFF ) <<8 );sdhci_enable_clk (host, div); + val =sdhci_readl (host,SDHCI_SPRD_REG_32_BUSY_POSI ); + mask =SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN |SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN ;/* Enable CLK_AUTO when the clock is greater than 400K. */ if (clk >400000 ) { - val =sdhci_readl (host,SDHCI_SPRD_REG_32_BUSY_POSI ); - mask =SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | -SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN ;if (mask != (val & mask)) { val |= mask;sdhci_writel (host, val,SDHCI_SPRD_REG_32_BUSY_POSI ); } + }else { +if (val & mask) { + val &= ~mask; +sdhci_writel (host, val,SDHCI_SPRD_REG_32_BUSY_POSI ); + } } }
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -2
@@ -11749,6 +11749,8 @@ static void bnxt_sp_task(struct work_struct *work)bnxt_cfg_ntp_filters (bp);if (test_and_clear_bit (BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT , &bp->sp_event))bnxt_hwrm_exec_fwd_req (bp); +if (test_and_clear_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , &bp->sp_event)) +netdev_info (bp->dev,"Receive PF driver unload event!\n" );if (test_and_clear_bit (BNXT_PERIODIC_STATS_SP_EVENT , &bp->sp_event)) {bnxt_hwrm_port_qstats (bp,0 );bnxt_hwrm_port_qstats_ext (bp,0 );
@@ -12694,8 +12696,6 @@ static void bnxt_cfg_ntp_filters(struct bnxt *bp) } } } -if (test_and_clear_bit (BNXT_HWRM_PF_UNLOAD_SP_EVENT , &bp->sp_event)) -netdev_info (bp->dev,"Receive PF driver unload event!\n" ); }#else
drivers/net/ethernet/broadcom/genet/bcmgenet.c +3 -1
@@ -2090,8 +2090,10 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)/* Note: if we ever change from DMA_TX_APPEND_CRC below we * will need to restore software padding of "runt" packets */ + len_stat |=DMA_TX_APPEND_CRC ; +if (!i) { - len_stat |=DMA_TX_APPEND_CRC |DMA_SOP ; + len_stat |=DMA_SOP ;if (skb->ip_summed ==CHECKSUM_PARTIAL ) len_stat |=DMA_TX_DO_CSUM ; }
drivers/net/ethernet/intel/i40e/i40e_main.c +10 -1
@@ -102,12 +102,18 @@ static struct workqueue_struct *i40e_wq;static void netdev_hw_addr_refcnt (struct i40e_mac_filter *f,struct net_device *netdev,int delta) { +struct netdev_hw_addr_list *ha_list;struct netdev_hw_addr *ha;if (!f || !netdev)return ; -netdev_for_each_mc_addr (ha, netdev) { +if (is_unicast_ether_addr (f->macaddr) ||is_link_local_ether_addr (f->macaddr)) + ha_list = &netdev->uc; +else + ha_list = &netdev->mc; + +netdev_hw_addr_list_for_each (ha, ha_list) {if (ether_addr_equal (ha->addr, f->macaddr)) { ha->refcount += delta;if (ha->refcount <=0 )
@@ -16418,6 +16424,9 @@ static void i40e_pci_error_reset_done(struct pci_dev *pdev)return ;i40e_reset_and_rebuild (pf, false, false); +#ifdef CONFIG_PCI_IOV +i40e_restore_all_vfs_msi_state (pdev); +#endif /* CONFIG_PCI_IOV */ }/**
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +30 -4
@@ -152,6 +152,32 @@ void i40e_vc_notify_reset(struct i40e_pf *pf) (u8 *)&pfe, sizeof(struct virtchnl_pf_event)); } +#ifdef CONFIG_PCI_IOV +void i40e_restore_all_vfs_msi_state (struct pci_dev *pdev) +{ +u16 vf_id; +u16 pos; + +/* Continue only if this is a PF */ +if (!pdev->is_physfn) +return ; + +if (!pci_num_vf (pdev)) +return ; + + pos =pci_find_ext_capability (pdev,PCI_EXT_CAP_ID_SRIOV ); +if (pos) { +struct pci_dev *vf_dev =NULL ; + +pci_read_config_word (pdev, pos +PCI_SRIOV_VF_DID , &vf_id); +while ((vf_dev =pci_get_device (pdev->vendor, vf_id, vf_dev))) { +if (vf_dev->is_virtfn && vf_dev->physfn == pdev) +pci_restore_msi_state (vf_dev); + } + } +} +#endif /* CONFIG_PCI_IOV */ +/** * i40e_vc_notify_vf_reset * @vf: pointer to the VF structure
@@ -3427,16 +3453,16 @@ static int i40e_validate_cloud_filter(struct i40e_vf *vf,bool found = false;int bkt; -if (!tc_filter->action) { +if (tc_filter->action !=VIRTCHNL_ACTION_TC_REDIRECT ) {dev_info (&pf->pdev->dev, -"VF %d: Currently ADq doesn't support Drop Action\n" , - vf->vf_id); +"VF %d: ADQ doesn't support this action (%d)\n" , + vf->vf_id, tc_filter->action); goto err; }/* action_meta is TC number here to which the filter is applied */ if (!tc_filter->action_meta || - tc_filter->action_meta >I40E_MAX_VF_VSI ) { + tc_filter->action_meta > vf->num_tc) {dev_info (&pf->pdev->dev,"VF %d: Invalid TC number %u\n" , vf->vf_id, tc_filter->action_meta); goto err;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +3 -0
@@ -135,6 +135,9 @@ int i40e_ndo_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool enable);void i40e_vc_notify_link_state (struct i40e_pf *pf);void i40e_vc_notify_reset (struct i40e_pf *pf); +#ifdef CONFIG_PCI_IOV +void i40e_restore_all_vfs_msi_state (struct pci_dev *pdev); +#endif /* CONFIG_PCI_IOV */ int i40e_get_vf_stats (struct net_device *netdev,int vf_id,struct ifla_vf_stats *vf_stats);
drivers/net/ethernet/intel/igc/igc.h +1 -0
@@ -537,6 +537,7 @@ struct igc_nfc_filter {u16 etype;__be16 vlan_etype;u16 vlan_tci; +u16 vlan_tci_mask;u8 src_addr[ETH_ALEN ];u8 dst_addr[ETH_ALEN ];u8 user_data[8 ];
drivers/net/ethernet/intel/igc/igc_ethtool.c +39 -3
78 lines not on this page · raw message
drivers/net/ethernet/intel/igc/igc_tsn.c +1 -1
@@ -185,7 +185,7 @@ static int igc_tsn_enable_offload(struct igc_adapter *adapter)wr32 (IGC_TQAVCC (i), tqavcc);wr32 (IGC_TQAVHC (i), -0x80000000 + ring->hicredit *0x7735 ); +0x80000000 + ring->hicredit *0x7736 ); }else {/* Disable any CBS for the queue */ txqctl &= ~(IGC_TXQCTL_QAV_SEL_MASK );
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +41 -27
95 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h +1 -0
@@ -76,6 +76,7 @@ struct mac_ops {*/ int (*get_nr_lmacs)(void *cgx);u8 (*get_lmac_type)(void *cgx,int lmac_id); +u32 (*lmac_fifo_len)(void *cgx,int lmac_id);int (*mac_lmac_intl_lbk)(void *cgx,int lmac_id,bool enable);/* Register Stats related functions */
drivers/net/ethernet/marvell/octeontx2/af/npc.h +2 -2
@@ -490,7 +490,7 @@ struct npc_lt_def {u8 ltype_mask;u8 ltype_match;u8 lid; -}; +} __packed;struct npc_lt_def_ipsec {u8 ltype_mask;
@@ -498,7 +498,7 @@ struct npc_lt_def_ipsec {u8 lid;u8 spi_offset;u8 spi_nz; -}; +} __packed;struct npc_lt_def_apad {u8 ltype_mask;
drivers/net/ethernet/marvell/octeontx2/af/rpm.c +43 -34
104 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/af/rpm.h +1 -0
@@ -49,6 +49,7 @@/* Function Declarations */ int rpm_get_nr_lmacs (void *rpmd);u8 rpm_get_lmac_type (void *rpmd,int lmac_id); +u32 rpm_get_lmac_fifo_len (void *rpmd,int lmac_id);int rpm_lmac_internal_loopback (void *rpmd,int lmac_id,bool enable);void rpm_lmac_enadis_rx_pause_fwding (void *rpmd,int lmac_id,bool enable); int rpm_lmac_get_pause_frm_status(void *cgxd, int lmac_id, u8 *tx_pause,
drivers/net/ethernet/marvell/octeontx2/af/rvu.h +2 -1
@@ -813,7 +813,8 @@ u32 rvu_cgx_get_fifolen(struct rvu *rvu);void *rvu_first_cgx_pdata (struct rvu *rvu);int cgxlmac_to_pf (struct rvu *rvu,int cgx_id,int lmac_id);int rvu_cgx_config_tx (void *cgxd,int lmac_id,bool enable); - +int rvu_cgx_tx_enable (struct rvu *rvu,u16 pcifunc,bool enable); +u32 rvu_cgx_get_lmac_fifolen (struct rvu *rvu,int cgx,int lmac);int npc_get_nixlf_mcam_index (struct npc_mcam *mcam,u16 pcifunc,int nixlf,int type); bool is_mcam_entry_enabled(struct rvu *rvu, struct npc_mcam *mcam, int blkaddr,
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +33 -0
@@ -456,6 +456,23 @@ int rvu_cgx_config_rxtx(struct rvu *rvu, u16 pcifunc, bool start)return mac_ops->mac_rx_tx_enable (cgxd, lmac_id, start); } +int rvu_cgx_tx_enable (struct rvu *rvu,u16 pcifunc,bool enable) +{ +int pf =rvu_get_pf (pcifunc); +struct mac_ops *mac_ops; +u8 cgx_id, lmac_id; +void *cgxd; + +if (!is_cgx_config_permitted (rvu, pcifunc)) +return LMAC_AF_ERR_PERM_DENIED ; + +rvu_get_cgx_lmac_id (rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id); + cgxd =rvu_cgx_pdata (cgx_id, rvu); + mac_ops =get_mac_ops (cgxd); + +return mac_ops->mac_tx_enable (cgxd, lmac_id, enable); +} +int rvu_cgx_config_tx (void *cgxd,int lmac_id,bool enable) {struct mac_ops *mac_ops;
@@ -831,6 +848,22 @@ u32 rvu_cgx_get_fifolen(struct rvu *rvu)return fifo_len; } +u32 rvu_cgx_get_lmac_fifolen (struct rvu *rvu,int cgx,int lmac) +{ +struct mac_ops *mac_ops; +void *cgxd; + + cgxd =rvu_cgx_pdata (cgx, rvu); +if (!cgxd) +return 0 ; + + mac_ops =get_mac_ops (cgxd); +if (!mac_ops->lmac_fifo_len) +return 0 ; + +return mac_ops->lmac_fifo_len (cgxd, lmac); +} +static int rvu_cgx_config_intlbk (struct rvu *rvu,u16 pcifunc,bool en) {int pf =rvu_get_pf (pcifunc);
drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +29 -117
212 lines not on this page · raw message
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 -0
@@ -262,6 +262,7 @@ int otx2_config_pause_frm(struct otx2_nic *pfvf)mutex_unlock (&pfvf->mbox.lock);return err; } +EXPORT_SYMBOL (otx2_config_pause_frm);int otx2_set_flowkey_cfg (struct otx2_nic *pfvf) {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +8 -7
@@ -1785,9 +1785,6 @@ int otx2_open(struct net_device *netdev)if (pf->linfo.link_up && !(pf->pcifunc &RVU_PFVF_FUNC_MASK ))otx2_handle_link_event (pf); -/* Restore pause frame settings */ -otx2_config_pause_frm (pf); -/* Install DMAC Filters */ if (pf->flags &OTX2_FLAG_DMACFLTR_SUPPORT )otx2_dmacflt_reinstall_flows (pf);
@@ -2777,10 +2774,6 @@ static int otx2_probe(struct pci_dev *pdev, const struct pci_device_id *id)/* Enable link notifications */ otx2_cgx_config_linkevents (pf, true); -/* Enable pause frames by default */ - pf->flags |=OTX2_FLAG_RX_PAUSE_ENABLED ; - pf->flags |=OTX2_FLAG_TX_PAUSE_ENABLED ; -return 0 ; err_pf_sriov_init:
@@ -2924,6 +2917,14 @@ static void otx2_remove(struct pci_dev *pdev)if (pf->flags &OTX2_FLAG_RX_TSTAMP_ENABLED )otx2_config_hw_rx_tstamp (pf, false); +/* Disable 802.3x pause frames */ +if (pf->flags &OTX2_FLAG_RX_PAUSE_ENABLED || + (pf->flags &OTX2_FLAG_TX_PAUSE_ENABLED )) { + pf->flags &= ~OTX2_FLAG_RX_PAUSE_ENABLED ; + pf->flags &= ~OTX2_FLAG_TX_PAUSE_ENABLED ; +otx2_config_pause_frm (pf); + } +cancel_work_sync (&pf->reset_task);/* Disable link notifications */ otx2_cgx_config_linkevents (pf, false);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +8 -4
@@ -695,10 +695,6 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (err) goto err_unreg_netdev; -/* Enable pause frames by default */ - vf->flags |=OTX2_FLAG_RX_PAUSE_ENABLED ; - vf->flags |=OTX2_FLAG_TX_PAUSE_ENABLED ; -return 0 ; err_unreg_netdev:
@@ -732,6 +728,14 @@ static void otx2vf_remove(struct pci_dev *pdev) vf =netdev_priv (netdev); +/* Disable 802.3x pause frames */ +if (vf->flags &OTX2_FLAG_RX_PAUSE_ENABLED || + (vf->flags &OTX2_FLAG_TX_PAUSE_ENABLED )) { + vf->flags &= ~OTX2_FLAG_RX_PAUSE_ENABLED ; + vf->flags &= ~OTX2_FLAG_TX_PAUSE_ENABLED ; +otx2_config_pause_frm (vf); + } +cancel_work_sync (&vf->reset_task);otx2_unregister_dl (vf);unregister_netdev (netdev);
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_rx.c +7 -2
@@ -267,6 +267,13 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts) priv->stats.rx_truncate_errors++; } +/* Read receive consumer index before replenish so that this routine +* returns accurate return value even if packet is received into +* just-replenished buffer prior to exiting this routine. +*/ + rx_ci =readq (priv->base +MLXBF_GIGE_RX_CQE_PACKET_CI ); + rx_ci_rem = rx_ci % priv->rx_q_entries; +/* Let hardware know we've replenished one buffer */ rx_pi++;
@@ -279,8 +286,6 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts) rx_pi_rem = rx_pi % priv->rx_q_entries;if (rx_pi_rem ==0 ) priv->valid_polarity ^=1 ; - rx_ci =readq (priv->base +MLXBF_GIGE_RX_CQE_PACKET_CI ); - rx_ci_rem = rx_ci % priv->rx_q_entries;if (skb)netif_receive_skb (skb);
drivers/net/ethernet/qlogic/qla3xxx.c +2 -0
@@ -2589,6 +2589,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev)if (qdev->lrg_buf_q_alloc_virt_addr ==NULL ) {netdev_err (qdev->ndev,"lBufQ failed\n" ); +kfree (qdev->lrg_buf);return -ENOMEM ; } qdev->lrg_buf_q_virt_addr = qdev->lrg_buf_q_alloc_virt_addr;
@@ -2613,6 +2614,7 @@ static int ql_alloc_buffer_queues(struct ql3_adapter *qdev) qdev->lrg_buf_q_alloc_size, qdev->lrg_buf_q_alloc_virt_addr, qdev->lrg_buf_q_alloc_phy_addr); +kfree (qdev->lrg_buf);return -ENOMEM ; }
drivers/net/ethernet/realtek/r8169_main.c +1 -1
@@ -1191,7 +1191,7 @@ static void rtl8168ep_driver_start(struct rtl8169_private *tp) {r8168ep_ocp_write (tp,0x01 ,0x180 ,OOB_CMD_DRIVER_START );r8168ep_ocp_write (tp,0x01 ,0x30 ,r8168ep_ocp_read (tp,0x30 ) |0x01 ); -rtl_loop_wait_high (tp, &rtl_ep_ocp_read_cond,10000 ,10 ); +rtl_loop_wait_high (tp, &rtl_ep_ocp_read_cond,10000 ,30 ); }static void rtl8168_driver_start (struct rtl8169_private *tp)
drivers/net/ethernet/sfc/rx_common.c +3 -1
@@ -837,8 +837,10 @@ int efx_probe_filters(struct efx_nic *efx) }if (!success) { -efx_for_each_channel (channel, efx) +efx_for_each_channel (channel, efx) {kfree (channel->rps_flow_id); + channel->rps_flow_id =NULL ; + } efx->type->filter_table_remove (efx); rc = -ENOMEM ; goto out_unlock;
drivers/net/usb/ax88172a.c +3 -1
@@ -161,7 +161,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf)u8 buf[ETH_ALEN ];struct ax88172a_private *priv; -usbnet_get_endpoints (dev, intf); + ret =usbnet_get_endpoints (dev, intf); +if (ret) +return ret; priv =kzalloc (sizeof (*priv),GFP_KERNEL );if (!priv)
drivers/net/usb/ax88179_178a.c +22 -93
219 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +2 -2
@@ -728,7 +728,7 @@ static inline void iwl_enable_rfkill_int(struct iwl_trans *trans) } } -void iwl_pcie_handle_rfkill_irq (struct iwl_trans *trans); +void iwl_pcie_handle_rfkill_irq (struct iwl_trans *trans,bool from_irq);static inline bool iwl_is_rfkill_set (struct iwl_trans *trans) {
@@ -775,7 +775,7 @@ static inline bool iwl_pcie_dbg_on(struct iwl_trans *trans)return (trans->dbg.dest_tlv ||iwl_trans_dbg_ini_valid (trans)); } -void iwl_trans_pcie_rf_kill (struct iwl_trans *trans,bool state); +void iwl_trans_pcie_rf_kill (struct iwl_trans *trans,bool state,bool from_irq);void iwl_trans_pcie_dump_regs (struct iwl_trans *trans);#ifdef CONFIG_IWLWIFI_DEBUGFS
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +4 -4
@@ -1780,7 +1780,7 @@ static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans)return inta; } -void iwl_pcie_handle_rfkill_irq (struct iwl_trans *trans) +void iwl_pcie_handle_rfkill_irq (struct iwl_trans *trans,bool from_irq) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);struct isr_statistics *isr_stats = &trans_pcie->isr_stats;
@@ -1804,7 +1804,7 @@ void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans) isr_stats->rfkill++;if (prev != report) -iwl_trans_pcie_rf_kill (trans, report); +iwl_trans_pcie_rf_kill (trans, report, from_irq);mutex_unlock (&trans_pcie->mutex);if (hw_rfkill) {
@@ -1944,7 +1944,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)/* HW RF KILL switch toggled */ if (inta &CSR_INT_BIT_RF_KILL ) { -iwl_pcie_handle_rfkill_irq (trans); +iwl_pcie_handle_rfkill_irq (trans, true); handled |=CSR_INT_BIT_RF_KILL ; }
@@ -2332,7 +2332,7 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id)/* HW RF KILL switch toggled */ if (inta_hw &MSIX_HW_INT_CAUSES_REG_RF_KILL ) -iwl_pcie_handle_rfkill_irq (trans); +iwl_pcie_handle_rfkill_irq (trans, true);if (inta_hw &MSIX_HW_INT_CAUSES_REG_HW_ERR ) { IWL_ERR(trans,
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +9 -8
@@ -1046,7 +1046,7 @@ bool iwl_pcie_check_hw_rf_kill(struct iwl_trans *trans) report =test_bit (STATUS_RFKILL_OPMODE , &trans->status);if (prev != report) -iwl_trans_pcie_rf_kill (trans, report); +iwl_trans_pcie_rf_kill (trans, report, false);return hw_rfkill; }
@@ -1170,7 +1170,7 @@ static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie) trans_pcie->hw_mask = trans_pcie->hw_init_mask; } -static void _iwl_trans_pcie_stop_device (struct iwl_trans *trans) +static void _iwl_trans_pcie_stop_device (struct iwl_trans *trans,bool from_irq) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);
@@ -1197,7 +1197,8 @@ static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)if (test_and_clear_bit (STATUS_DEVICE_ENABLED , &trans->status)) {IWL_DEBUG_INFO (trans,"DEVICE_ENABLED bit was set and is now cleared\n" ); -iwl_pcie_synchronize_irqs (trans); +if (!from_irq) +iwl_pcie_synchronize_irqs (trans);iwl_pcie_rx_napi_sync (trans);iwl_pcie_tx_stop (trans);iwl_pcie_rx_stop (trans);
@@ -1385,7 +1386,7 @@ void iwl_trans_pcie_handle_stop_rfkill(struct iwl_trans *trans,clear_bit (STATUS_RFKILL_OPMODE , &trans->status); }if (hw_rfkill != was_in_rfkill) -iwl_trans_pcie_rf_kill (trans, hw_rfkill); +iwl_trans_pcie_rf_kill (trans, hw_rfkill, false); }static void iwl_trans_pcie_stop_device (struct iwl_trans *trans)
@@ -1400,12 +1401,12 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)mutex_lock (&trans_pcie->mutex); trans_pcie->opmode_down = true; was_in_rfkill =test_bit (STATUS_RFKILL_OPMODE , &trans->status); -_iwl_trans_pcie_stop_device (trans); +_iwl_trans_pcie_stop_device (trans, false);iwl_trans_pcie_handle_stop_rfkill (trans, was_in_rfkill);mutex_unlock (&trans_pcie->mutex); } -void iwl_trans_pcie_rf_kill (struct iwl_trans *trans,bool state) +void iwl_trans_pcie_rf_kill (struct iwl_trans *trans,bool state,bool from_irq) {struct iwl_trans_pcie __maybe_unused *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);
@@ -1418,7 +1419,7 @@ void iwl_trans_pcie_rf_kill(struct iwl_trans *trans, bool state)if (trans->trans_cfg->gen2)_iwl_trans_pcie_gen2_stop_device (trans);else -_iwl_trans_pcie_stop_device (trans); +_iwl_trans_pcie_stop_device (trans, from_irq); } }
@@ -2741,7 +2742,7 @@ static ssize_t iwl_dbgfs_rfkill_write(struct file *file,IWL_WARN (trans,"changing debug rfkill %d->%d\n" , trans_pcie->debug_rfkill, new_value); trans_pcie->debug_rfkill = new_value; -iwl_pcie_handle_rfkill_irq (trans); +iwl_pcie_handle_rfkill_irq (trans, false);return count; }
drivers/pci/pci.c +6 -0
@@ -820,6 +820,9 @@ int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask)return 1 ; } +if (dev->bus->self) +pcie_aspm_pm_state_change (dev->bus->self); +return 0 ; }
@@ -1140,6 +1143,9 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)if (need_restore)pci_restore_bars (dev); +if (dev->bus->self) +pcie_aspm_pm_state_change (dev->bus->self); +return 0 ; }
drivers/pci/pci.h +2 -0
@@ -595,10 +595,12 @@ bool pcie_wait_for_link(struct pci_dev *pdev, bool active);#ifdef CONFIG_PCIEASPM void pcie_aspm_init_link_state (struct pci_dev *pdev);void pcie_aspm_exit_link_state (struct pci_dev *pdev); +void pcie_aspm_pm_state_change (struct pci_dev *pdev);void pcie_aspm_powersave_config_link (struct pci_dev *pdev);#else static inline void pcie_aspm_init_link_state (struct pci_dev *pdev) { }static inline void pcie_aspm_exit_link_state (struct pci_dev *pdev) { } +static inline void pcie_aspm_pm_state_change (struct pci_dev *pdev) { }static inline void pcie_aspm_powersave_config_link (struct pci_dev *pdev) { }#endif
drivers/pci/pcie/aspm.c +19 -0
@@ -1038,6 +1038,25 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)up_read (&pci_bus_sem); } +/* @pdev: the root port or switch downstream port */ +void pcie_aspm_pm_state_change (struct pci_dev *pdev) +{ +struct pcie_link_state *link = pdev->link_state; + +if (aspm_disabled || !link) +return ; +/* +* Devices changed PM state, we should recheck if latency +* meets all functions' requirement +*/ +down_read (&pci_bus_sem); +mutex_lock (&aspm_lock); +pcie_update_aspm_capable (link->root); +pcie_config_aspm_path (link); +mutex_unlock (&aspm_lock); +up_read (&pci_bus_sem); +} +void pcie_aspm_powersave_config_link (struct pci_dev *pdev) {struct pcie_link_state *link = pdev->link_state;
include/linux/module.h +9 -0
@@ -867,8 +867,17 @@ static inline bool module_sig_ok(struct module *module) }#endif /* CONFIG_MODULE_SIG */ +#if defined(CONFIG_MODULES ) && defined(CONFIG_KALLSYMS )int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *,struct module *,unsigned long ),void *data); +#else +static inline int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *, +struct module *,unsigned long ), +void *data) +{ +return -EOPNOTSUPP ; +} +#endif /* CONFIG_MODULES && CONFIG_KALLSYMS */ #endif /* _LINUX_MODULE_H */
include/net/dst_ops.h +1 -1
@@ -16,7 +16,7 @@ struct dst_ops {unsigned short family;unsigned int gc_thresh; -int (*gc)(struct dst_ops *ops); +void (*gc)(struct dst_ops *ops);struct dst_entry * (*check)(struct dst_entry *,__u32 cookie);unsigned int (*default_advmss)(const struct dst_entry *);unsigned int (*mtu)(const struct dst_entry *);
kernel/module.c +0 -2
@@ -4482,7 +4482,6 @@ unsigned long module_kallsyms_lookup_name(const char *name)return ret; } -#ifdef CONFIG_LIVEPATCH int module_kallsyms_on_each_symbol (int (*fn)(void *,const char *,struct module *,unsigned long ),void *data)
@@ -4514,7 +4513,6 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,mutex_unlock (&module_mutex); return ret; } -#endif /* CONFIG_LIVEPATCH */ #endif /* CONFIG_KALLSYMS */ static void cfi_init (struct module *mod)
kernel/trace/trace_kprobe.c +2 -0
@@ -735,6 +735,8 @@ static unsigned int number_of_same_symbols(char *func_name)kallsyms_on_each_symbol (count_symbols, &args); +module_kallsyms_on_each_symbol (count_symbols, &args); +return args.count; }
mm/memory-failure.c +3 -3
@@ -1331,7 +1331,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,* This check implies we don't kill processes if their pages * are in the swap cache early. Those are always late kills. */ -if (!page_mapped (hpage)) +if (!page_mapped (p))return true;if (PageKsm (p)) {
@@ -1397,10 +1397,10 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, } } - unmap_success = !page_mapped (hpage); + unmap_success = !page_mapped (p);if (!unmap_success)pr_err ("Memory failure: %#lx: failed to unmap page (mapcount=%d)\n" , - pfn,page_mapcount (hpage)); + pfn,page_mapcount (p));/* * try_to_unmap() might put mlocked page in lru cache, so call
mm/memory.c +2 -2
@@ -3451,8 +3451,8 @@ EXPORT_SYMBOL_GPL(unmap_mapping_pages);void unmap_mapping_range (struct address_space *mapping,loff_t const holebegin,loff_t const holelen,int even_cows) { -pgoff_t hba = holebegin >>PAGE_SHIFT ; -pgoff_t hlen = (holelen +PAGE_SIZE -1 ) >>PAGE_SHIFT ; +pgoff_t hba = (pgoff_t)(holebegin) >>PAGE_SHIFT ; +pgoff_t hlen = ((pgoff_t)(holelen) +PAGE_SIZE -1 ) >>PAGE_SHIFT ;/* Check for overflow. */ if (sizeof (holelen) >sizeof (hlen)) {
net/can/raw.c +11 -1
@@ -780,6 +780,7 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) {struct sock *sk = sock->sk;struct raw_sock *ro =raw_sk (sk); +struct sockcm_cookie sockc;struct sk_buff *skb;struct net_device *dev;int ifindex;
@@ -825,11 +826,20 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)if (err <0 ) goto free_skb; -skb_setup_tx_timestamp (skb, sk->sk_tsflags); +sockcm_init (&sockc, sk); +if (msg->msg_controllen) { + err =sock_cmsg_send (sk, msg, &sockc); +if (unlikely (err)) + goto free_skb; + } skb->dev = dev; skb->sk = sk; skb->priority = sk->sk_priority; + skb->mark = sk->sk_mark; + skb->tstamp = sockc.transmit_time; + +skb_setup_tx_timestamp (skb, sockc.tsflags); err =can_send (skb, ro->loopback);
net/core/dst.c +2 -6
@@ -82,12 +82,8 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,if (ops->gc && !(flags &DST_NOCOUNT ) && -dst_entries_get_fast (ops) > ops->gc_thresh) { -if (ops->gc (ops)) { -pr_notice_ratelimited ("Route cache is full: consider increasing sysctl net.ipv6.route.max_size.\n" ); -return NULL ; - } - } +dst_entries_get_fast (ops) > ops->gc_thresh) + ops->gc (ops); dst =kmem_cache_alloc (ops->kmem_cachep,GFP_ATOMIC );if (!dst)
net/core/sock.c +10 -2
@@ -1534,9 +1534,16 @@ int sock_getsockopt(struct socket *sock, int level, int optname,break ;case SO_TIMESTAMPING_OLD : +case SO_TIMESTAMPING_NEW : lv =sizeof (v.timestamping); - v.timestamping.flags = sk->sk_tsflags; - v.timestamping.bind_phc = sk->sk_bind_phc; +/* For the later-added case SO_TIMESTAMPING_NEW: Be strict about only +* returning the flags when they were set through the same option. +* Don't change the beviour for the old case SO_TIMESTAMPING_OLD. +*/ +if (optname ==SO_TIMESTAMPING_OLD ||sock_flag (sk,SOCK_TSTAMP_NEW )) { + v.timestamping.flags = sk->sk_tsflags; + v.timestamping.bind_phc = sk->sk_bind_phc; + }break ;case SO_RCVTIMEO_OLD :
@@ -2544,6 +2551,7 @@ int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg, sockc->mark = *(u32 *)CMSG_DATA (cmsg);break ;case SO_TIMESTAMPING_OLD : +case SO_TIMESTAMPING_NEW :if (cmsg->cmsg_len !=CMSG_LEN (sizeof (u32)))return -EINVAL ;
net/dns_resolver/dns_key.c +9 -10
@@ -91,8 +91,6 @@ const struct cred *dns_resolver_cache;static int dns_resolver_preparse (struct key_preparsed_payload *prep) { -const struct dns_server_list_v1_header *v1; -const struct dns_payload_header *bin;struct user_key_payload *upayload;unsigned long derrno;int ret;
@@ -103,27 +101,28 @@ dns_resolver_preparse(struct key_preparsed_payload *prep)return -EINVAL ;if (data[0 ] ==0 ) { +const struct dns_server_list_v1_header *v1; +/* It may be a server list. */ -if (datalen <=sizeof (*bin)) +if (datalen <=sizeof (*v1))return -EINVAL ; - bin = (const struct dns_payload_header *)data; -kenter ("[%u,%u],%u" , bin->content, bin->version, datalen); -if (bin->content !=DNS_PAYLOAD_IS_SERVER_LIST ) { + v1 = (const struct dns_server_list_v1_header *)data; +kenter ("[%u,%u],%u" , v1->hdr.content, v1->hdr.version, datalen); +if (v1->hdr.content !=DNS_PAYLOAD_IS_SERVER_LIST ) {pr_warn_ratelimited ("dns_resolver: Unsupported content type (%u)\n" , - bin->content); + v1->hdr.content);return -EINVAL ; } -if (bin->version !=1 ) { +if (v1->hdr.version !=1 ) {pr_warn_ratelimited ("dns_resolver: Unsupported server list version (%u)\n" , - bin->version); + v1->hdr.version);return -EINVAL ; } - v1 = (const struct dns_server_list_v1_header *)bin;if ((v1->status !=DNS_LOOKUP_GOOD && v1->status !=DNS_LOOKUP_GOOD_WITH_BAD )) {if (prep->expiry ==TIME64_MAX )
net/ipv4/ip_output.c +1 -1
@@ -990,7 +990,7 @@ static int __ip_append_data(struct sock *sk, mtu = cork->gso_size ?IP_MAX_MTU : cork->fragsize; paged = !!cork->gso_size; -if (cork->tx_flags &SKBTX_ANY_SW_TSTAMP && +if (cork->tx_flags &SKBTX_ANY_TSTAMP && sk->sk_tsflags &SOF_TIMESTAMPING_OPT_ID ) tskey =atomic_inc_return (&sk->sk_tskey) -1 ;
net/ipv6/ip6_output.c +1 -1
@@ -1484,7 +1484,7 @@ static int __ip6_append_data(struct sock *sk, mtu = cork->gso_size ?IP6_MAX_MTU : cork->fragsize; orig_mtu = mtu; -if (cork->tx_flags &SKBTX_ANY_SW_TSTAMP && +if (cork->tx_flags &SKBTX_ANY_TSTAMP && sk->sk_tsflags &SOF_TIMESTAMPING_OPT_ID ) tskey =atomic_inc_return (&sk->sk_tskey) -1 ;
net/ipv6/route.c +5 -8
@@ -91,7 +91,7 @@ static struct dst_entry *ip6_negative_advice(struct dst_entry *);static void ip6_dst_destroy (struct dst_entry *);static void ip6_dst_ifdown (struct dst_entry *,struct net_device *dev,int how); -static int ip6_dst_gc (struct dst_ops *ops); +static void ip6_dst_gc (struct dst_ops *ops);static int ip6_pkt_discard (struct sk_buff *skb);static int ip6_pkt_discard_out (struct net *net,struct sock *sk,struct sk_buff *skb);
@@ -3295,11 +3295,10 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,return dst; } -static int ip6_dst_gc (struct dst_ops *ops) +static void ip6_dst_gc (struct dst_ops *ops) { struct net *net = container_of(ops, struct net, ipv6.ip6_dst_ops);int rt_min_interval = net->ipv6.sysctl.ip6_rt_gc_min_interval; -int rt_max_size = net->ipv6.sysctl.ip6_rt_max_size;int rt_elasticity = net->ipv6.sysctl.ip6_rt_gc_elasticity;int rt_gc_timeout = net->ipv6.sysctl.ip6_rt_gc_timeout;unsigned long rt_last_gc = net->ipv6.ip6_rt_last_gc;
@@ -3307,11 +3306,10 @@ static int ip6_dst_gc(struct dst_ops *ops)int entries; entries =dst_entries_get_fast (ops); -if (entries > rt_max_size) +if (entries > ops->gc_thresh) entries =dst_entries_get_slow (ops); -if (time_after (rt_last_gc + rt_min_interval, jiffies) && - entries <= rt_max_size) +if (time_after (rt_last_gc + rt_min_interval, jiffies)) goto out;fib6_run_gc (atomic_inc_return (&net->ipv6.ip6_rt_gc_expire), net, true);
@@ -3321,7 +3319,6 @@ static int ip6_dst_gc(struct dst_ops *ops) out: val =atomic_read (&net->ipv6.ip6_rt_gc_expire);atomic_set (&net->ipv6.ip6_rt_gc_expire, val - (val >> rt_elasticity)); -return entries > rt_max_size; } static int ip6_nh_lookup_table(struct net *net, struct fib6_config *cfg,
@@ -6528,7 +6525,7 @@ static int __net_init ip6_route_net_init(struct net *net)#endif net->ipv6.sysctl.flush_delay =0 ; - net->ipv6.sysctl.ip6_rt_max_size =4096 ; + net->ipv6.sysctl.ip6_rt_max_size =INT_MAX ; net->ipv6.sysctl.ip6_rt_gc_min_interval =HZ /2 ; net->ipv6.sysctl.ip6_rt_gc_timeout =60 *HZ ; net->ipv6.sysctl.ip6_rt_gc_interval =30 *HZ ;
net/netfilter/nf_tables_api.c +27 -0
@@ -1247,6 +1247,30 @@ static int nft_objname_hash_cmp(struct rhashtable_compare_arg *arg,return strcmp (obj->key.name, k->name); } +static bool nft_supported_family (u8 family) +{ + return false +#ifdef CONFIG_NF_TABLES_INET + || family ==NFPROTO_INET +#endif +#ifdef CONFIG_NF_TABLES_IPV4 + || family ==NFPROTO_IPV4 +#endif +#ifdef CONFIG_NF_TABLES_ARP + || family ==NFPROTO_ARP +#endif +#ifdef CONFIG_NF_TABLES_NETDEV + || family == NFPROTO_NETDEV +#endif +#if IS_ENABLED(CONFIG_NF_TABLES_BRIDGE) + || family ==NFPROTO_BRIDGE +#endif +#ifdef CONFIG_NF_TABLES_IPV6 + || family ==NFPROTO_IPV6 +#endif + ; +} +static int nf_tables_newtable (struct sk_buff *skb,const struct nfnl_info *info,const struct nlattr *const nla[]) {
@@ -1261,6 +1285,9 @@ static int nf_tables_newtable(struct sk_buff *skb, const struct nfnl_info *info,u32 flags =0 ;int err; +if (!nft_supported_family (family)) +return -EOPNOTSUPP ; +lockdep_assert_held (&nft_net->commit_mutex); attr = nla[NFTA_TABLE_NAME ]; table = nft_table_lookup(net, attr, family, genmask,
net/netfilter/nft_immediate.c +1 -1
@@ -78,7 +78,7 @@ static int nft_immediate_init(const struct nft_ctx *ctx,case NFT_GOTO : err =nf_tables_bind_chain (ctx, chain);if (err <0 ) -return err; + goto err1;break ;default :break ;
net/nfc/llcp_core.c +36 -3
@@ -147,6 +147,13 @@ static void nfc_llcp_socket_release(struct nfc_llcp_local *local, bool device,static struct nfc_llcp_local *nfc_llcp_local_get (struct nfc_llcp_local *local) { +/* Since using nfc_llcp_local may result in usage of nfc_dev, whenever +* we hold a reference to local, we also need to hold a reference to +* the device to avoid UAF. +*/ +if (!nfc_get_device (local->dev->idx)) +return NULL ; +kref_get (&local->ref);return local;
@@ -179,10 +186,18 @@ static void local_release(struct kref *ref)int nfc_llcp_local_put (struct nfc_llcp_local *local) { +struct nfc_dev *dev; +int ret; +if (local ==NULL )return 0 ; -return kref_put (&local->ref, local_release); + dev = local->dev; + + ret =kref_put (&local->ref, local_release); +nfc_put_device (dev); + +return ret; } static struct nfc_llcp_sock *nfc_llcp_sock_get(struct nfc_llcp_local *local,
@@ -968,8 +983,17 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local, } new_sock =nfc_llcp_sock (new_sk); - new_sock->dev = local->dev; + new_sock->local =nfc_llcp_local_get (local); +if (!new_sock->local) { + reason =LLCP_DM_REJ ; +sock_put (&new_sock->sk); +release_sock (&sock->sk); +sock_put (&sock->sk); + goto fail; + } + + new_sock->dev = local->dev; new_sock->rw = sock->rw; new_sock->miux = sock->miux; new_sock->nfc_protocol = sock->nfc_protocol;
@@ -1607,7 +1631,16 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)if (local ==NULL )return -ENOMEM ; - local->dev = ndev; +/* As we are going to initialize local's refcount, we need to get the +* nfc_dev to avoid UAF, otherwise there is no point in continuing. +* See nfc_llcp_local_get(). +*/ + local->dev =nfc_get_device (ndev->idx); +if (!local->dev) { +kfree (local); +return -ENODEV ; + } +INIT_LIST_HEAD (&local->list);kref_init (&local->ref);mutex_init (&local->sdp_lock);
net/sched/em_text.c +3 -1
@@ -97,8 +97,10 @@ static int em_text_change(struct net *net, void *data, int len,static void em_text_destroy (struct tcf_ematch *m) { -if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) +if (EM_TEXT_PRIV (m) &&EM_TEXT_PRIV (m)->config) {textsearch_destroy (EM_TEXT_PRIV (m)->config); +kfree (EM_TEXT_PRIV (m)); + } }static int em_text_dump (struct sk_buff *skb,struct tcf_ematch *m)
net/socket.c +2 -0
@@ -728,6 +728,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg) {struct sockaddr_storage *save_addr = (struct sockaddr_storage *)msg->msg_name;struct sockaddr_storage address; +int save_len = msg->msg_namelen;int ret;if (msg->msg_name) {
@@ -737,6 +738,7 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg) ret =__sock_sendmsg (sock, msg); msg->msg_name = save_addr; + msg->msg_namelen = save_len;return ret; }
net/tls/tls_sw.c +2 -0
@@ -1216,6 +1216,8 @@ static int tls_sw_do_sendpage(struct sock *sk, struct page *page, }sk_msg_page_add (msg_pl, page, copy, offset); + msg_pl->sg.copybreak =0 ; + msg_pl->sg.curr = msg_pl->sg.end;sk_mem_charge (sk, copy); offset += copy;
sound/pci/hda/patch_realtek.c +1 -0
@@ -9054,6 +9054,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x84da ,"HP OMEN dc0019-ur" ,ALC295_FIXUP_HP_OMEN ),SND_PCI_QUIRK (0x103c ,0x84e7 ,"HP Pavilion 15" ,ALC269_FIXUP_HP_MUTE_LED_MIC3 ),SND_PCI_QUIRK (0x103c ,0x8519 ,"HP Spectre x360 15-df0xxx" ,ALC285_FIXUP_HP_SPECTRE_X360 ), +SND_PCI_QUIRK (0x103c ,0x8537 ,"HP ProBook 440 G6" ,ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF ),SND_PCI_QUIRK (0x103c ,0x860f ,"HP ZBook 15 G6" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ),SND_PCI_QUIRK (0x103c ,0x861f ,"HP Elite Dragonfly G1" ,ALC285_FIXUP_HP_GPIO_AMP_INIT ), SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
sound/soc/fsl/fsl_rpmsg.c +8 -2
@@ -191,7 +191,7 @@ static int fsl_rpmsg_probe(struct platform_device *pdev) ret =devm_snd_soc_register_component (&pdev->dev, &fsl_component, &fsl_rpmsg_dai,1 );if (ret) -return ret; + goto err_pm_disable; rpmsg->card_pdev = platform_device_register_data(&pdev->dev, "imx-audio-rpmsg",
@@ -201,16 +201,22 @@ static int fsl_rpmsg_probe(struct platform_device *pdev)if (IS_ERR (rpmsg->card_pdev)) {dev_err (&pdev->dev,"failed to register rpmsg card\n" ); ret =PTR_ERR (rpmsg->card_pdev); -return ret; + goto err_pm_disable; }return 0 ; + +err_pm_disable: +pm_runtime_disable (&pdev->dev); +return ret; }static int fsl_rpmsg_remove (struct platform_device *pdev) {struct fsl_rpmsg *rpmsg =platform_get_drvdata (pdev); +pm_runtime_disable (&pdev->dev); +if (rpmsg->card_pdev)platform_device_unregister (rpmsg->card_pdev);
sound/soc/meson/g12a-toacodec.c +4 -1
@@ -71,6 +71,9 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, reg; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]);regmap_field_read (priv->field_dat_sel, ®);
@@ -101,7 +104,7 @@ static int g12a_toacodec_mux_put_enum(struct snd_kcontrol *kcontrol,snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); -return 0 ; +return 1 ; } static SOC_ENUM_SINGLE_DECL(g12a_toacodec_mux_enum, TOACODEC_CTRL0,
sound/soc/meson/g12a-tohdmitx.c +7 -1
@@ -45,6 +45,9 @@ static int g12a_tohdmitx_i2s_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, changed; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]); changed = snd_soc_component_test_bits(component, e->reg, CTRL0_I2S_DAT_SEL,
@@ -93,6 +96,9 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;unsigned int mux, changed; +if (ucontrol->value.enumerated.item[0 ] >= e->items) +return -EINVAL ; + mux =snd_soc_enum_item_to_val (e, ucontrol->value.enumerated.item[0 ]); changed = snd_soc_component_test_bits(component, TOHDMITX_CTRL0, CTRL0_SPDIF_SEL,
@@ -112,7 +118,7 @@ static int g12a_tohdmitx_spdif_mux_put_enum(struct snd_kcontrol *kcontrol,snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); -return 0 ; +return 1 ; } static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_spdif_mux_enum, TOHDMITX_CTRL0,
tools/perf/util/genelf.h +3 -1
@@ -2,6 +2,8 @@#ifndef __GENELF_H__#define __GENELF_H__ +#include <linux/kernel.h> +/* genelf.c */ int jit_write_elf(int fd, uint64_t code_addr, const char *sym, const void *code, int csize, void *debug, int nr_debug_entries,
@@ -73,6 +75,6 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent#endif /* The .text section is directly after the ELF header */ -#define GEN_ELF_TEXT_OFFSET sizeof(Elf_Ehdr) +#define GEN_ELF_TEXT_OFFSET round_up(sizeof(Elf_Ehdr) + sizeof(Elf_Phdr), 16)#endif
tools/testing/selftests/vm/memfd_secret.c +3 -0
@@ -62,6 +62,9 @@ static void test_mlock_limit(int fd)char *mem; len = mlock_limit_cur; +if (len % page_size !=0 ) + len = (len/page_size) * page_size; + mem =mmap (NULL , len, prot, mode, fd,0 );if (mem ==MAP_FAILED ) {fail ("unable to mmap secret memory\n" );