Linux 5.4.2
Greg KH
maintainerI'm announcing the release of the 5.4.2 kernel.
All users of the 5.4 kernel series must upgrade.
The updated 5.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.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/x86/include/asm/fpu/internal.h | 2 drivers/base/platform.c | 7 - drivers/crypto/Kconfig | 1 drivers/crypto/inside-secure/safexcel.c | 4 drivers/hid/hid-core.c | 51 ++++++- drivers/misc/mei/bus.c | 9 - drivers/misc/mei/hw-me-regs.h | 1 drivers/misc/mei/pci-me.c | 1 drivers/net/dsa/sja1105/sja1105_main.c | 10 - drivers/net/ethernet/cadence/macb_main.c | 1 drivers/net/ethernet/google/gve/gve_main.c | 3 drivers/net/ethernet/realtek/r8169_main.c | 3 drivers/net/macvlan.c | 3 drivers/net/phy/mdio_bus.c | 6 drivers/net/slip/slip.c | 1 drivers/platform/x86/hp-wmi.c | 10 - drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 5 drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 7 - drivers/staging/wilc1000/wilc_hif.c | 25 ++- drivers/thunderbolt/switch.c | 54 ++++++- drivers/usb/dwc2/core.c | 2 drivers/usb/serial/ftdi_sio.c | 3 drivers/usb/serial/ftdi_sio_ids.h | 7 + fs/ext4/inode.c | 15 ++ fs/ext4/super.c | 21 +-- fs/io_uring.c | 23 +++ fs/jffs2/nodelist.c | 2 include/linux/skmsg.h | 26 +-- include/net/sctp/structs.h | 3 include/net/tls.h | 3 net/core/filter.c | 8 - net/core/skmsg.c | 2 net/ipv4/tcp_bpf.c | 2 net/openvswitch/datapath.c | 17 ++ net/psample/psample.c | 2 net/sched/sch_mq.c | 3 net/sched/sch_mqprio.c | 4 net/sched/sch_multiq.c | 2 net/sched/sch_prio.c | 2 net/sctp/associola.c | 1 net/sctp/endpointola.c | 1 net/sctp/input.c | 4 net/sctp/sm_statefuns.c | 4 net/socket.c | 184 +++++++++++++++++++-------- net/tipc/netlink_compat.c | 4 net/tls/tls_main.c | 13 - net/tls/tls_sw.c | 32 ++-- tools/testing/selftests/bpf/test_sockmap.c | 47 ++++-- tools/testing/selftests/bpf/xdping.c | 2 tools/testing/selftests/net/pmtu.sh | 5 tools/testing/selftests/net/tls.c | 60 ++++++++ 52 files changed, 504 insertions(+), 206 deletions(-)
Ajay Singh (1):
staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param()
Alexander Usyskin (2):
mei: bus: prefix device names on bus with the bus name
mei: me: add comet point V device id
Candle Sun (1):
HID: core: check whether Usage Page item is after Usage ID items
Chuhong Yuan (1):
net: macb: add missed tasklet_kill
David Bauer (1):
mdio_bus: don't use managed reset-controller
Dust Li (1):
net: sched: fix tc -s class show no bstats on class with nolock subqueues
Fabio D'Urso (1):
USB: serial: ftdi_sio: add device IDs for U-Blox C099-F9P
Greg Kroah-Hartman (1):
Linux 5.4.2
Hans de Goede (4):
staging: rtl8723bs: Drop ACPI device ids
staging: rtl8723bs: Add 024c:0525 to the list of SDIO device-ids platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer platform/x86: hp-wmi: Fix ACPI errors caused by passing 0 as input size
Heiner Kallweit (2):
r8169: fix jumbo configuration for RTL8168evl
r8169: fix resume on cable plug-in
Herbert Xu (1):
crypto: talitos - Fix build error by selecting LIB_DES
Jakub Kicinski (8):
net/tls: take into account that bpf_exec_tx_verdict() may free the record net/tls: free the record on encryption error
net: skmsg: fix TLS 1.3 crash with full sk_msg selftests/tls: add a test for fragmented messages
net/tls: remove the dead inplace_crypto code
net/tls: use sg_next() to walk sg entries
selftests: bpf: test_sockmap: handle file creation failures gracefully
selftests: bpf: correct perror strings
Jens Axboe (3):
io_uring: async workers should inherit the user creds
net: separate out the msghdr copy from ___sys_{send,recv}msg()
net: disallow ancillary data for __sys_{send,recv}msg_file()
Jeroen de Borst (1):
gve: Fix the queue page list allocated pages count
Joel Stanley (1):
Revert "jffs2: Fix possible null-pointer dereferences in jffs2_add_frag_to_fragtree()"
John Rutherford (1):
tipc: fix link name length check
Jouni Hogander (1):
slip: Fix use-after-free Read in slip_open
Mathias Kresin (1):
usb: dwc2: use a longer core rest timeout in dwc2_core_reset()
Menglong Dong (1):
macvlan: schedule bc_work even if error
Mika Westerberg (1):
thunderbolt: Power cycle the router if NVM authentication fails
Navid Emamdoost (1):
sctp: Fix memory leak in sctp_sf_do_5_2_4_dupcook
Nikolay Aleksandrov (1):
net: psample: fix skb_over_panic
Oleksij Rempel (1):
net: dsa: sja1105: fix sja1105_parse_rgmii_delays()
Pan Bian (1):
staging: rtl8192e: fix potential use after free
Paolo Abeni (3):
openvswitch: fix flow command message size
openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info()
openvswitch: remove another BUG_ON()
Pascal van Leeuwen (1):
crypto: inside-secure - Fix stability issue with Macchiatobin
Sami Tolvanen (1):
driver core: platform: use the correct callback type for bus_find_device
Sebastian Andrzej Siewior (1):
x86/fpu: Don't cache access to fpu_fpregs_owner_ctx
Thadeu Lima de Souza Cascardo (1):
selftests: pmtu: use -oneline for ip route list cache
Theodore Ts'o (1):
ext4: add more paranoia checking in ext4_expand_extra_isize handling
Xin Long (1):
sctp: cache netns in sctp_ep_common
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 4 -SUBLEVEL = 1 +SUBLEVEL = 2 EXTRAVERSION = NAME = Kleptomaniac Octopus
arch/x86/include/asm/fpu/internal.h +1 -1
@@ -509,7 +509,7 @@ static inline void __fpu_invalidate_fpregs_state(struct fpu *fpu)static inline int fpregs_state_valid (struct fpu *fpu,unsigned int cpu) { -return fpu ==this_cpu_read_stable (fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu; +return fpu ==this_cpu_read (fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu; }/*
drivers/base/platform.c +6 -1
@@ -1278,6 +1278,11 @@ struct bus_type platform_bus_type = { };EXPORT_SYMBOL_GPL (platform_bus_type); +static inline int __platform_match (struct device *dev,const void *drv) +{ +return platform_match (dev, (struct device_driver *)drv); +} +/** * platform_find_device_by_driver - Find a platform device with a given * driver.
@@ -1288,7 +1293,7 @@ struct device *platform_find_device_by_driver(struct device *start, const struct device_driver *drv) {return bus_find_device (&platform_bus_type, start, drv, - (void *)platform_match); + __platform_match); }EXPORT_SYMBOL_GPL (platform_find_device_by_driver);
drivers/crypto/Kconfig +1 -0
@@ -287,6 +287,7 @@ config CRYPTO_DEV_TALITOS select CRYPTO_AUTHENC select CRYPTO_BLKCIPHER select CRYPTO_HASH + select CRYPTO_LIB_DES select HW_RANDOM depends on FSL_SOC help
drivers/crypto/inside-secure/safexcel.c +2 -2
@@ -221,9 +221,9 @@ static void eip197_trc_cache_init(struct safexcel_crypto_priv *priv)/* Step #3: Determine log2 of hash table size */ cs_ht_sz =__fls (asize - cs_rc_max) -2 ;/* Step #4: determine current size of hash table in dwords */ - cs_ht_wc =16 <<cs_ht_sz;/* dwords, not admin words */ + cs_ht_wc =16 << cs_ht_sz;/* dwords, not admin words */ /* Step #5: add back excess words and see if we can fit more records */ - cs_rc_max =min_t (uint, cs_rc_abs_max, asize - (cs_ht_wc >>4 )); + cs_rc_max =min_t (uint, cs_rc_abs_max, asize - (cs_ht_wc >>2 ));/* Clear the cache RAMs */ eip197_trc_cache_clear (priv, cs_rc_max, cs_ht_wc);
drivers/hid/hid-core.c +45 -6
84 lines not on this page · raw message
drivers/misc/mei/bus.c +5 -4
@@ -873,15 +873,16 @@ static const struct device_type mei_cl_device_type = {/** * mei_cl_bus_set_name - set device name for me client device +* <controller>-<client device> +* Example: 0000:00:16.0-55213584-9a29-4916-badf-0fb7ed682aeb * * @cldev: me client device */ static inline void mei_cl_bus_set_name (struct mei_cl_device *cldev) { -dev_set_name (&cldev->dev,"mei:%s:%pUl:%02X" , - cldev->name, -mei_me_cl_uuid (cldev->me_cl), -mei_me_cl_ver (cldev->me_cl)); +dev_set_name (&cldev->dev,"%s-%pUl" , +dev_name (cldev->bus->dev), +mei_me_cl_uuid (cldev->me_cl)); }/**
drivers/misc/mei/hw-me-regs.h +1 -0
@@ -81,6 +81,7 @@#define MEI_DEV_ID_CMP_LP 0x02e0/* Comet Point LP */ #define MEI_DEV_ID_CMP_LP_3 0x02e4/* Comet Point LP 3 (iTouch) */ +#define MEI_DEV_ID_CMP_V 0xA3BA/* Comet Point Lake V */ #define MEI_DEV_ID_ICP_LP 0x34E0/* Ice Lake Point LP */
drivers/misc/mei/pci-me.c +1 -0
@@ -98,6 +98,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP_3, MEI_ME_PCH8_CFG)}, + {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_V, MEI_ME_PCH12_CFG)}, {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
drivers/net/dsa/sja1105/sja1105_main.c +5 -5
@@ -594,15 +594,15 @@ static int sja1105_parse_rgmii_delays(struct sja1105_private *priv,int i;for (i =0 ; i <SJA1105_NUM_PORTS ; i++) { -if (ports->role ==XMII_MAC ) +if (ports[i].role ==XMII_MAC )continue ; -if (ports->phy_mode ==PHY_INTERFACE_MODE_RGMII_RXID || - ports->phy_mode ==PHY_INTERFACE_MODE_RGMII_ID ) +if (ports[i].phy_mode ==PHY_INTERFACE_MODE_RGMII_RXID || + ports[i].phy_mode ==PHY_INTERFACE_MODE_RGMII_ID ) priv->rgmii_rx_delay[i] = true; -if (ports->phy_mode ==PHY_INTERFACE_MODE_RGMII_TXID || - ports->phy_mode ==PHY_INTERFACE_MODE_RGMII_ID ) +if (ports[i].phy_mode ==PHY_INTERFACE_MODE_RGMII_TXID || + ports[i].phy_mode ==PHY_INTERFACE_MODE_RGMII_ID ) priv->rgmii_tx_delay[i] = true; if ((priv->rgmii_rx_delay[i] || priv->rgmii_tx_delay[i]) &&
drivers/net/ethernet/cadence/macb_main.c +1 -0
@@ -4392,6 +4392,7 @@ static int macb_remove(struct platform_device *pdev)mdiobus_free (bp->mii_bus);unregister_netdev (dev); +tasklet_kill (&bp->hresp_err_tasklet);pm_runtime_disable (&pdev->dev);pm_runtime_dont_use_autosuspend (&pdev->dev);if (!pm_runtime_suspended (&pdev->dev)) {
drivers/net/ethernet/google/gve/gve_main.c +2 -1
@@ -544,7 +544,7 @@ static int gve_alloc_queue_page_list(struct gve_priv *priv, u32 id, } qpl->id = id; - qpl->num_entries = pages; + qpl->num_entries =0 ; qpl->pages =kvzalloc (pages *sizeof (*qpl->pages),GFP_KERNEL );/* caller handles clean up */ if (!qpl->pages)
@@ -562,6 +562,7 @@ static int gve_alloc_queue_page_list(struct gve_priv *priv, u32 id,/* caller handles clean up */ if (err)return -ENOMEM ; + qpl->num_entries++; } priv->num_registered_pages += pages;
drivers/net/ethernet/realtek/r8169_main.c +2 -1
@@ -1516,6 +1516,7 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)rtl_lock_config_regs (tp);device_set_wakeup_enable (tp_to_dev (tp), wolopts); + tp->dev->wol_enabled = wolopts ?1 :0 ; }static int rtl8169_set_wol (struct net_device *dev,struct ethtool_wolinfo *wol)
@@ -4118,7 +4119,7 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28:r8168dp_hw_jumbo_enable (tp);break ; - case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_34: + case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33:r8168e_hw_jumbo_enable (tp);break ;default :
drivers/net/macvlan.c +2 -1
@@ -359,10 +359,11 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, }spin_unlock (&port->bc_queue.lock); +schedule_work (&port->bc_work); +if (err) goto free_nskb; -schedule_work (&port->bc_work);return ; free_nskb:
drivers/net/phy/mdio_bus.c +4 -2
@@ -62,8 +62,8 @@ static int mdiobus_register_reset(struct mdio_device *mdiodev)struct reset_control *reset =NULL ;if (mdiodev->dev.of_node) - reset =devm_reset_control_get_exclusive (&mdiodev->dev, -"phy" ); + reset =of_reset_control_get_exclusive (mdiodev->dev.of_node, +"phy" );if (IS_ERR (reset)) {if (PTR_ERR (reset) == -ENOENT ||PTR_ERR (reset) == -ENOTSUPP ) reset =NULL ;
@@ -107,6 +107,8 @@ int mdiobus_unregister_device(struct mdio_device *mdiodev)if (mdiodev->bus->mdio_map[mdiodev->addr] != mdiodev)return -EINVAL ; +reset_control_put (mdiodev->reset_ctrl); + mdiodev->bus->mdio_map[mdiodev->addr] =NULL ;return 0 ;
drivers/net/slip/slip.c +1 -0
@@ -855,6 +855,7 @@ static int slip_open(struct tty_struct *tty) sl->tty =NULL ; tty->disc_data =NULL ;clear_bit (SLF_INUSE , &sl->flags); +sl_free_netdev (sl->dev);free_netdev (sl->dev); err_exit:
drivers/platform/x86/hp-wmi.c +5 -5
@@ -65,7 +65,7 @@ struct bios_args {u32 command;u32 commandtype;u32 datasize; -u32 data; +u8 data[128 ]; };enum hp_wmi_commandtype {
@@ -216,7 +216,7 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command, .command = command, .commandtype = query, .datasize = insize, - .data = 0, + .data = { 0 }, };struct acpi_buffer input = {sizeof (struct bios_args ), &args };struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER ,NULL };
@@ -228,7 +228,7 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command,if (WARN_ON (insize >sizeof (args.data)))return -EINVAL ; -memcpy (&args.data, buffer, insize); +memcpy (&args.data[0 ], buffer, insize);wmi_evaluate_method (HPWMI_BIOS_GUID ,0 , mid, &input, &output);
@@ -380,7 +380,7 @@ static int hp_wmi_rfkill2_refresh(void)int err, i; err =hp_wmi_perform_query (HPWMI_WIRELESS2_QUERY ,HPWMI_READ , &state, -0 ,sizeof (state)); +sizeof (state),sizeof (state));if (err)return err;
@@ -778,7 +778,7 @@ static int __init hp_wmi_rfkill2_setup(struct platform_device *device)int err, i; err =hp_wmi_perform_query (HPWMI_WIRELESS2_QUERY ,HPWMI_READ , &state, -0 ,sizeof (state)); +sizeof (state),sizeof (state));if (err)return err <0 ? err : -EINVAL ;
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -2
@@ -1616,14 +1616,15 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,memcpy ((unsigned char *)(skb->cb), &dev,sizeof (dev));skb_push (skb, priv->rtllib->tx_headroom); ret =_rtl92e_tx (dev, skb); -if (ret !=0 ) -kfree_skb (skb);if (queue_index !=MGNT_QUEUE ) { priv->rtllib->stats.tx_bytes += (skb->len - priv->rtllib->tx_headroom); priv->rtllib->stats.tx_packets++; } + +if (ret !=0 ) +kfree_skb (skb); }static int _rtl92e_hard_start_xmit (struct sk_buff *skb,struct net_device *dev)
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +1 -6
@@ -18,18 +18,13 @@static const struct sdio_device_id sdio_ids[] = { {SDIO_DEVICE (0x024c ,0x0523 ), }, + {SDIO_DEVICE (0x024c ,0x0525 ), }, {SDIO_DEVICE (0x024c ,0x0623 ), }, {SDIO_DEVICE (0x024c ,0x0626 ), }, {SDIO_DEVICE (0x024c ,0xb723 ), }, {/* end: all zeroes */ }, }; -static const struct acpi_device_id acpi_ids[] = { - {"OBDA8723" ,0x0000 }, - {} -}; -MODULE_DEVICE_TABLE (sdio, sdio_ids); -MODULE_DEVICE_TABLE (acpi, acpi_ids);static int rtw_drv_init (struct sdio_func *func,const struct sdio_device_id *id);static void rtw_dev_remove (struct sdio_func *func);
drivers/staging/wilc1000/wilc_hif.c +15 -10
@@ -477,16 +477,21 @@ void *wilc_parse_join_bss_param(struct cfg80211_bss *bss,memcpy (¶m->supp_rates[1 ], rates_ie +2 , rates_len); } - supp_rates_ie =cfg80211_find_ie (WLAN_EID_EXT_SUPP_RATES , ies->data, - ies->len); -if (supp_rates_ie) { -if (supp_rates_ie[1 ] > (WILC_MAX_RATES_SUPPORTED - rates_len)) - param->supp_rates[0 ] =WILC_MAX_RATES_SUPPORTED ; -else - param->supp_rates[0 ] += supp_rates_ie[1 ]; - -memcpy (¶m->supp_rates[rates_len +1 ], supp_rates_ie +2 , - (param->supp_rates[0 ] - rates_len)); +if (rates_len <WILC_MAX_RATES_SUPPORTED ) { + supp_rates_ie =cfg80211_find_ie (WLAN_EID_EXT_SUPP_RATES , + ies->data, ies->len); +if (supp_rates_ie) { +u8 ext_rates = supp_rates_ie[1 ]; + +if (ext_rates > (WILC_MAX_RATES_SUPPORTED - rates_len)) + param->supp_rates[0 ] =WILC_MAX_RATES_SUPPORTED ; +else + param->supp_rates[0 ] += ext_rates; + +memcpy (¶m->supp_rates[rates_len +1 ], + supp_rates_ie +2 , + (param->supp_rates[0 ] - rates_len)); + } } ht_ie =cfg80211_find_ie (WLAN_EID_HT_CAPABILITY , ies->data, ies->len);
drivers/thunderbolt/switch.c +42 -12
113 lines not on this page · raw message
drivers/usb/dwc2/core.c +1 -1
@@ -524,7 +524,7 @@ int dwc2_core_reset(struct dwc2_hsotg *hsotg, bool skip_wait) greset |=GRSTCTL_CSFTRST ;dwc2_writel (hsotg, greset,GRSTCTL ); -if (dwc2_hsotg_wait_bit_clear (hsotg,GRSTCTL ,GRSTCTL_CSFTRST ,50 )) { +if (dwc2_hsotg_wait_bit_clear (hsotg,GRSTCTL ,GRSTCTL_CSFTRST ,10000 )) {dev_warn (hsotg->dev,"%s: HANG! Soft Reset timeout GRSTCTL GRSTCTL_CSFTRST\n" , __func__);return -EBUSY ;
drivers/usb/serial/ftdi_sio.c +3 -0
@@ -1033,6 +1033,9 @@ static const struct usb_device_id id_table_combined[] = {/* Sienna devices */ { USB_DEVICE(FTDI_VID, FTDI_SIENNA_PID) }, { USB_DEVICE(ECHELON_VID, ECHELON_U20_PID) }, +/* U-Blox devices */ + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -1558,3 +1558,10 @@*/ #define UNJO_VID 0x22B7#define UNJO_ISODEBUG_V1_PID 0x150D + +/* +* U-Blox products (http://www.u-blox.com). +*/ +#define UBLOX_VID 0x1546 +#define UBLOX_C099F9P_ZED_PID 0x0502 +#define UBLOX_C099F9P_ODIN_PID 0x0503
fs/ext4/inode.c +15 -0
@@ -5912,8 +5912,23 @@ static int __ext4_expand_extra_isize(struct inode *inode, {struct ext4_inode *raw_inode;struct ext4_xattr_ibody_header *header; +unsigned int inode_size =EXT4_INODE_SIZE (inode->i_sb); +struct ext4_inode_info *ei =EXT4_I (inode);int error; +/* this was checked at iget time, but double check for good measure */ +if ((EXT4_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > inode_size) || + (ei->i_extra_isize &3 )) { +EXT4_ERROR_INODE (inode,"bad extra_isize %u (inode size %u)" , + ei->i_extra_isize, +EXT4_INODE_SIZE (inode->i_sb)); +return -EFSCORRUPTED ; + } +if ((new_extra_isize < ei->i_extra_isize) || + (new_extra_isize <4 ) || + (new_extra_isize > inode_size -EXT4_GOOD_OLD_INODE_SIZE )) +return -EINVAL ;/* Should never happen */ + raw_inode =ext4_raw_inode (iloc); header =IHDR (inode, raw_inode);
fs/ext4/super.c +12 -9
@@ -3555,12 +3555,15 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb) {struct ext4_sb_info *sbi =EXT4_SB (sb);struct ext4_super_block *es = sbi->s_es; +unsigned def_extra_isize =sizeof (struct ext4_inode ) - +EXT4_GOOD_OLD_INODE_SIZE ; -/* determine the minimum size of new large inodes, if present */ -if (sbi->s_inode_size >EXT4_GOOD_OLD_INODE_SIZE && - sbi->s_want_extra_isize ==0 ) { - sbi->s_want_extra_isize =sizeof (struct ext4_inode ) - -EXT4_GOOD_OLD_INODE_SIZE ; +if (sbi->s_inode_size ==EXT4_GOOD_OLD_INODE_SIZE ) { + sbi->s_want_extra_isize =0 ; +return ; + } +if (sbi->s_want_extra_isize <4 ) { + sbi->s_want_extra_isize = def_extra_isize;if (ext4_has_feature_extra_isize (sb)) {if (sbi->s_want_extra_isize <le16_to_cpu (es->s_want_extra_isize))
@@ -3573,10 +3576,10 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb) } }/* Check if enough inode space is available */ -if (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > - sbi->s_inode_size) { - sbi->s_want_extra_isize =sizeof (struct ext4_inode ) - -EXT4_GOOD_OLD_INODE_SIZE ; +if ((sbi->s_want_extra_isize > sbi->s_inode_size) || + (EXT4_GOOD_OLD_INODE_SIZE + sbi->s_want_extra_isize > + sbi->s_inode_size)) { + sbi->s_want_extra_isize = def_extra_isize;ext4_msg (sb,KERN_INFO ,"required extra inode space not available" ); }
fs/io_uring.c +22 -1
@@ -238,6 +238,8 @@ struct io_ring_ctx {struct user_struct *user; +struct cred *creds; +struct completion ctx_done;struct {
@@ -1752,8 +1754,11 @@ static void io_poll_complete_work(struct work_struct *work)struct io_poll_iocb *poll = &req->poll;struct poll_table_struct pt = { ._key = poll->events };struct io_ring_ctx *ctx = req->ctx; +const struct cred *old_cred;__poll_t mask =0 ; + old_cred =override_creds (ctx->creds); +if (!READ_ONCE (poll->canceled)) mask =vfs_poll (poll->file, &pt) & poll->events;
@@ -1768,7 +1773,7 @@ static void io_poll_complete_work(struct work_struct *work)if (!mask && !READ_ONCE (poll->canceled)) {add_wait_queue (poll->head, &poll->wait);spin_unlock_irq (&ctx->completion_lock); -return ; + goto out; }list_del_init (&req->list);io_poll_complete (ctx, req, mask);
@@ -1776,6 +1781,8 @@ static void io_poll_complete_work(struct work_struct *work)io_cqring_ev_posted (ctx);io_put_req (req); +out: +revert_creds (old_cred); } static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
@@ -2147,10 +2154,12 @@ static void io_sq_wq_submit_work(struct work_struct *work)struct io_ring_ctx *ctx = req->ctx;struct mm_struct *cur_mm =NULL ;struct async_list *async_list; +const struct cred *old_cred;LIST_HEAD (req_list);mm_segment_t old_fs;int ret; + old_cred =override_creds (ctx->creds); async_list =io_async_list_from_sqe (ctx, req->submit.sqe); restart: do {
@@ -2258,6 +2267,7 @@ static void io_sq_wq_submit_work(struct work_struct *work)unuse_mm (cur_mm);mmput (cur_mm); } +revert_creds (old_cred); }/*
@@ -2663,6 +2673,7 @@ static int io_sq_thread(void *data) {struct io_ring_ctx *ctx = data;struct mm_struct *cur_mm =NULL ; +const struct cred *old_cred;mm_segment_t old_fs;DEFINE_WAIT (wait);unsigned inflight;
@@ -2672,6 +2683,7 @@ static int io_sq_thread(void *data) old_fs =get_fs ();set_fs (USER_DS ); + old_cred =override_creds (ctx->creds); timeout = inflight =0 ;while (!kthread_should_park ()) {
@@ -2782,6 +2794,7 @@ static int io_sq_thread(void *data)unuse_mm (cur_mm);mmput (cur_mm); } +revert_creds (old_cred);kthread_parkme ();
@@ -3567,6 +3580,8 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx)io_unaccount_mem (ctx->user,ring_pages (ctx->sq_entries, ctx->cq_entries));free_uid (ctx->user); +if (ctx->creds) +put_cred (ctx->creds);kfree (ctx); }
@@ -3838,6 +3853,12 @@ static int io_uring_create(unsigned entries, struct io_uring_params *p) ctx->account_mem = account_mem; ctx->user = user; + ctx->creds =prepare_creds (); +if (!ctx->creds) { + ret = -ENOMEM ; + goto err; + } + ret =io_allocate_scq_urings (ctx, p);if (ret) goto err;
fs/jffs2/nodelist.c +1 -1
@@ -226,7 +226,7 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *r lastend = this->ofs + this->size; }else {dbg_fragtree2 ("lookup gave no frag\n" ); -return -EINVAL ; + lastend =0 ; }/* See if we ran off the end of the fragtree */
include/linux/skmsg.h +13 -13
@@ -14,6 +14,7 @@#include <net/strparser.h> #define MAX_MSG_FRAGS MAX_SKB_FRAGS +#define NR_MSG_FRAG_IDS (MAX_MSG_FRAGS + 1)enum __sk_action { __SK_DROP =0 ,
@@ -29,11 +30,13 @@ struct sk_msg_sg {u32 size;u32 copybreak;bool copy[MAX_MSG_FRAGS ]; -/* The extra element is used for chaining the front and sections when -* the list becomes partitioned (e.g. end < start). The crypto APIs -* require the chaining. +/* The extra two elements: +* 1) used for chaining the front and sections when the list becomes +* partitioned (e.g. end < start). The crypto APIs require the +* chaining; +* 2) to chain tailer SG entries after the message. */ -struct scatterlist data[MAX_MSG_FRAGS +1 ]; +struct scatterlist data[MAX_MSG_FRAGS +2 ]; };/* UAPI in filter.c depends on struct sk_msg_sg being first element. */
@@ -141,13 +144,13 @@ static inline void sk_msg_apply_bytes(struct sk_psock *psock, u32 bytes)static inline u32 sk_msg_iter_dist (u32 start,u32 end) { -return end >= start ? end - start : end + (MAX_MSG_FRAGS - start); +return end >= start ? end - start : end + (NR_MSG_FRAG_IDS - start); }#define sk_msg_iter_var_prev (var) \ do { \ if (var == 0) \ - var = MAX_MSG_FRAGS - 1; \ + var = NR_MSG_FRAG_IDS - 1; \ else \ var--; \ } while (0)
@@ -155,7 +158,7 @@ static inline u32 sk_msg_iter_dist(u32 start, u32 end)#define sk_msg_iter_var_next (var) \ do { \ var++; \ - if (var == MAX_MSG_FRAGS) \ + if (var == NR_MSG_FRAG_IDS) \ var = 0; \ } while (0)
@@ -172,9 +175,9 @@ static inline void sk_msg_clear_meta(struct sk_msg *msg)static inline void sk_msg_init (struct sk_msg *msg) { -BUILD_BUG_ON (ARRAY_SIZE (msg->sg.data) -1 !=MAX_MSG_FRAGS ); +BUILD_BUG_ON (ARRAY_SIZE (msg->sg.data) -1 !=NR_MSG_FRAG_IDS );memset (msg,0 ,sizeof (*msg)); -sg_init_marker (msg->sg.data,MAX_MSG_FRAGS ); +sg_init_marker (msg->sg.data,NR_MSG_FRAG_IDS ); } static inline void sk_msg_xfer(struct sk_msg *dst, struct sk_msg *src,
@@ -195,14 +198,11 @@ static inline void sk_msg_xfer_full(struct sk_msg *dst, struct sk_msg *src)static inline bool sk_msg_full (const struct sk_msg *msg) { -return (msg->sg.end == msg->sg.start) && msg->sg.size; +return sk_msg_iter_dist (msg->sg.start, msg->sg.end) ==MAX_MSG_FRAGS ; }static inline u32 sk_msg_elem_used (const struct sk_msg *msg) { -if (sk_msg_full (msg)) -return MAX_MSG_FRAGS ; -return sk_msg_iter_dist (msg->sg.start, msg->sg.end); }
include/net/sctp/structs.h +3 -0
@@ -1239,6 +1239,9 @@ struct sctp_ep_common {/* What socket does this endpoint belong to? */ struct sock *sk; +/* Cache netns and it won't change once set */ +struct net *net; +/* This is where we receive inbound chunks. */ struct sctp_inq inqueue;
include/net/tls.h +1 -2
@@ -122,7 +122,6 @@ struct tls_rec {struct list_head list;int tx_ready;int tx_flags; -int inplace_crypto;struct sk_msg msg_plaintext;struct sk_msg msg_encrypted;
@@ -396,7 +395,7 @@ int tls_push_sg(struct sock *sk, struct tls_context *ctx, int flags);int tls_push_partial_record (struct sock *sk,struct tls_context *ctx,int flags); -bool tls_free_partial_record (struct sock *sk,struct tls_context *ctx); +void tls_free_partial_record (struct sock *sk,struct tls_context *ctx);static inline struct tls_msg *tls_msg (struct sk_buff *skb) {
net/core/filter.c +4 -4
@@ -2299,7 +2299,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start,WARN_ON_ONCE (last_sge == first_sge); shift = last_sge > first_sge ? last_sge - first_sge -1 : -MAX_SKB_FRAGS - first_sge + last_sge -1 ; +NR_MSG_FRAG_IDS - first_sge + last_sge -1 ;if (!shift) goto out;
@@ -2308,8 +2308,8 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, do { u32 move_from; - if (i + shift >= MAX_MSG_FRAGS) - move_from = i + shift - MAX_MSG_FRAGS; + if (i + shift >= NR_MSG_FRAG_IDS) + move_from = i + shift - NR_MSG_FRAG_IDS; else move_from = i + shift; if (move_from == msg->sg.end)
@@ -2323,7 +2323,7 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, }while (1 ); msg->sg.end = msg->sg.end - shift > msg->sg.end ? - msg->sg.end - shift +MAX_MSG_FRAGS : + msg->sg.end - shift +NR_MSG_FRAG_IDS : msg->sg.end - shift; out: msg->data =sg_virt (&msg->sg.data[first_sge]) + start - offset;
net/core/skmsg.c +1 -1
@@ -421,7 +421,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb) copied = skb->len; msg->sg.start =0 ; msg->sg.size = copied; - msg->sg.end = num_sge ==MAX_MSG_FRAGS ?0 : num_sge; + msg->sg.end = num_sge; msg->skb = skb;sk_psock_queue_msg (psock, msg);
net/ipv4/tcp_bpf.c +1 -1
@@ -301,7 +301,7 @@ EXPORT_SYMBOL_GPL(tcp_bpf_sendmsg_redir);static int tcp_bpf_send_verdict (struct sock *sk,struct sk_psock *psock,struct sk_msg *msg,int *copied,int flags) { -bool cork = false, enospc = msg->sg.start == msg->sg.end; +bool cork = false, enospc =sk_msg_full (msg);struct sock *sk_redir;u32 tosend, delta =0 ;int ret;
net/openvswitch/datapath.c +14 -3
@@ -704,9 +704,13 @@ static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts, {size_t len =NLMSG_ALIGN (sizeof (struct ovs_header )); -/* OVS_FLOW_ATTR_UFID */ +/* OVS_FLOW_ATTR_UFID, or unmasked flow key as fallback +* see ovs_nla_put_identifier() +*/ if (sfid &&ovs_identifier_is_ufid (sfid)) len +=nla_total_size (sfid->ufid_len); +else + len +=nla_total_size (ovs_key_attr_size ());/* OVS_FLOW_ATTR_KEY */ if (!sfid ||should_fill_key (sfid, ufid_flags))
@@ -882,7 +886,10 @@ static struct sk_buff *ovs_flow_cmd_build_info(const struct sw_flow *flow, retval =ovs_flow_cmd_fill_info (flow, dp_ifindex, skb, info->snd_portid, info->snd_seq,0 , cmd, ufid_flags); -BUG_ON (retval <0 ); +if (WARN_ON_ONCE (retval <0 )) { +kfree_skb (skb); + skb =ERR_PTR (retval); + }return skb; }
@@ -1346,7 +1353,10 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)OVS_FLOW_CMD_DEL , ufid_flags);rcu_read_unlock (); -BUG_ON (err <0 ); +if (WARN_ON_ONCE (err <0 )) { +kfree_skb (reply); + goto out_free; + }ovs_notify (&dp_flow_genl_family, reply, info); }else {
@@ -1354,6 +1364,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info) } } +out_free:ovs_flow_free (flow, true);return 0 ; unlock:
net/psample/psample.c +1 -1
@@ -229,7 +229,7 @@ void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, data_len =PSAMPLE_MAX_PACKET_SIZE - meta_len -NLA_HDRLEN -NLA_ALIGNTO ; - nl_skb =genlmsg_new (meta_len + data_len,GFP_ATOMIC ); + nl_skb =genlmsg_new (meta_len +nla_total_size (data_len),GFP_ATOMIC );if (unlikely (!nl_skb))return ;
net/sched/sch_mq.c +2 -1
@@ -245,7 +245,8 @@ static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl,struct netdev_queue *dev_queue =mq_queue_get (sch, cl); sch = dev_queue->qdisc_sleeping; -if (gnet_stats_copy_basic (&sch->running, d,NULL , &sch->bstats) <0 || +if (gnet_stats_copy_basic (&sch->running, d, sch->cpu_bstats, + &sch->bstats) <0 ||qdisc_qstats_copy (d, sch) <0 )return -1 ;return 0 ;
net/sched/sch_mqprio.c +2 -2
@@ -557,8 +557,8 @@ static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl,struct netdev_queue *dev_queue =mqprio_queue_get (sch, cl); sch = dev_queue->qdisc_sleeping; -if (gnet_stats_copy_basic (qdisc_root_sleeping_running (sch), - d,NULL , &sch->bstats) <0 || +if (gnet_stats_copy_basic (qdisc_root_sleeping_running (sch), d, + sch->cpu_bstats, &sch->bstats) <0 ||qdisc_qstats_copy (d, sch) <0 )return -1 ; }
net/sched/sch_multiq.c +1 -1
@@ -339,7 +339,7 @@ static int multiq_dump_class_stats(struct Qdisc *sch, unsigned long cl, cl_q = q->queues[cl -1 ];if (gnet_stats_copy_basic (qdisc_root_sleeping_running (sch), - d,NULL , &cl_q->bstats) <0 || + d, cl_q->cpu_bstats, &cl_q->bstats) <0 ||qdisc_qstats_copy (d, cl_q) <0 )return -1 ;
net/sched/sch_prio.c +1 -1
@@ -356,7 +356,7 @@ static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl, cl_q = q->queues[cl -1 ];if (gnet_stats_copy_basic (qdisc_root_sleeping_running (sch), - d,NULL , &cl_q->bstats) <0 || + d, cl_q->cpu_bstats, &cl_q->bstats) <0 ||qdisc_qstats_copy (d, cl_q) <0 )return -1 ;
net/sctp/associola.c +1 -0
@@ -64,6 +64,7 @@ static struct sctp_association *sctp_association_init(/* Discarding const is appropriate here. */ asoc->ep = (struct sctp_endpoint *)ep; asoc->base.sk = (struct sock *)sk; + asoc->base.net =sock_net (sk);sctp_endpoint_hold (asoc->ep);sock_hold (asoc->base.sk);
net/sctp/endpointola.c +1 -0
@@ -110,6 +110,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,/* Remember who we are attached to. */ ep->base.sk = sk; + ep->base.net =sock_net (sk);sock_hold (ep->base.sk);return ep;
net/sctp/input.c +2 -2
@@ -882,7 +882,7 @@ static inline int sctp_hash_cmp(struct rhashtable_compare_arg *arg,if (!sctp_transport_hold (t))return err; -if (!net_eq (sock_net (t->asoc->base.sk), x->net)) +if (!net_eq (t->asoc->base.net, x->net)) goto out;if (x->lport !=htons (t->asoc->base.bind_addr.port)) goto out;
@@ -897,7 +897,7 @@ static inline __u32 sctp_hash_obj(const void *data, u32 len, u32 seed) {const struct sctp_transport *t = data; -return sctp_hashfn (sock_net (t->asoc->base.sk), +return sctp_hashfn (t->asoc->base.net,htons (t->asoc->base.bind_addr.port), &t->ipaddr, seed); }
net/sctp/sm_statefuns.c +3 -1
@@ -2160,8 +2160,10 @@ enum sctp_disposition sctp_sf_do_5_2_4_dupcook(/* Update socket peer label if first association. */ if (security_sctp_assoc_request ((struct sctp_endpoint *)ep, - chunk->skb)) + chunk->skb)) { +sctp_association_free (new_asoc);return sctp_sf_pdiscard (net, ep, asoc, type, arg, commands); + }/* Set temp so that it won't be added into hashtable */ new_asoc->temp =1 ;
net/socket.c +132 -52
273 lines not on this page · raw message
net/tipc/netlink_compat.c +2 -2
@@ -550,7 +550,7 @@ static int tipc_nl_compat_link_stat_dump(struct tipc_nl_compat_msg *msg,if (len <=0 )return -EINVAL ; - len =min_t (int, len,TIPC_MAX_BEARER_NAME ); + len =min_t (int, len,TIPC_MAX_LINK_NAME );if (!string_is_valid (name, len))return -EINVAL ;
@@ -822,7 +822,7 @@ static int tipc_nl_compat_link_reset_stats(struct tipc_nl_compat_cmd_doit *cmd,if (len <=0 )return -EINVAL ; - len =min_t (int, len,TIPC_MAX_BEARER_NAME ); + len =min_t (int, len,TIPC_MAX_LINK_NAME );if (!string_is_valid (name, len))return -EINVAL ;
net/tls/tls_main.c +2 -11
@@ -209,24 +209,15 @@ int tls_push_partial_record(struct sock *sk, struct tls_context *ctx,return tls_push_sg (sk, ctx, sg, offset, flags); } -bool tls_free_partial_record (struct sock *sk,struct tls_context *ctx) +void tls_free_partial_record (struct sock *sk,struct tls_context *ctx) {struct scatterlist *sg; - sg = ctx->partially_sent_record; -if (!sg) -return false; - -while (1 ) { +for (sg = ctx->partially_sent_record; sg; sg =sg_next (sg)) {put_page (sg_page (sg));sk_mem_uncharge (sk, sg->length); - -if (sg_is_last (sg)) -break ; - sg++; } ctx->partially_sent_record =NULL ; -return true; }static void tls_write_space (struct sock *sk)
net/tls/tls_sw.c +19 -13
@@ -705,8 +705,7 @@ static int tls_push_record(struct sock *sk, int flags, } i = msg_pl->sg.start; -sg_chain (rec->sg_aead_in,2 , rec->inplace_crypto ? - &msg_en->sg.data[i] : &msg_pl->sg.data[i]); +sg_chain (rec->sg_aead_in,2 , &msg_pl->sg.data[i]); i = msg_en->sg.end;sk_msg_iter_var_prev (i);
@@ -766,8 +765,14 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk, policy = !(flags &MSG_SENDPAGE_NOPOLICY ); psock =sk_psock_get (sk); -if (!psock || !policy) -return tls_push_record (sk, flags, record_type); +if (!psock || !policy) { + err =tls_push_record (sk, flags, record_type); +if (err) { + *copied -=sk_msg_free (sk, msg); +tls_free_open_rec (sk); + } +return err; + } more_data: enospc =sk_msg_full (msg);if (psock->eval == __SK_NONE) {
@@ -965,8 +970,6 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)if (ret) goto fallback_to_reg_send; - rec->inplace_crypto =0 ; - num_zc++; copied += try_to_copy;
@@ -979,7 +982,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) num_async++; else if (ret == -ENOMEM) goto wait_for_memory; - else if (ret == -ENOSPC) + else if (ctx->open_rec && ret == -ENOSPC) goto rollback_iter; else if (ret != -EAGAIN) goto send_end;
@@ -1048,11 +1051,12 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ret =sk_stream_wait_memory (sk, &timeo);if (ret) { trim_sgl: -tls_trim_both_msgs (sk, orig_size); +if (ctx->open_rec) +tls_trim_both_msgs (sk, orig_size); goto send_end; } -if (msg_en->sg.size < required_size) +if (ctx->open_rec && msg_en->sg.size < required_size) goto alloc_encrypted; }
@@ -1164,7 +1168,6 @@ static int tls_sw_do_sendpage(struct sock *sk, struct page *page, tls_ctx->pending_open_record_frags = true;if (full_record || eor ||sk_msg_full (msg_pl)) { - rec->inplace_crypto =0 ; ret =bpf_exec_tx_verdict (msg_pl, sk, full_record, record_type, &copied, flags);if (ret) {
@@ -1185,11 +1188,13 @@ static int tls_sw_do_sendpage(struct sock *sk, struct page *page, wait_for_memory: ret =sk_stream_wait_memory (sk, &timeo);if (ret) { -tls_trim_both_msgs (sk, msg_pl->sg.size); +if (ctx->open_rec) +tls_trim_both_msgs (sk, msg_pl->sg.size); goto sendpage_end; } - goto alloc_payload; +if (ctx->open_rec) + goto alloc_payload; }if (num_async) {
@@ -2079,7 +2084,8 @@ void tls_sw_release_resources_tx(struct sock *sk)/* Free up un-sent records in tx_list. First, free * the partially sent record if any at head of tx_list. */ -if (tls_free_partial_record (sk, tls_ctx)) { +if (tls_ctx->partially_sent_record) { +tls_free_partial_record (sk, tls_ctx); rec =list_first_entry (&ctx->tx_list, struct tls_rec, list);list_del (&rec->list);
tools/testing/selftests/bpf/test_sockmap.c +28 -19
171 lines not on this page · raw message
tools/testing/selftests/bpf/xdping.c +1 -1
@@ -45,7 +45,7 @@ static int get_stats(int fd, __u16 count, __u32 raddr)printf ("\nXDP RTT data:\n" );if (bpf_map_lookup_elem (fd, &raddr, &pinginfo)) { -perror ("bpf_map_lookup elem: " ); +perror ("bpf_map_lookup elem" );return 1 ; }
tools/testing/selftests/net/pmtu.sh +2 -3
@@ -1249,8 +1249,7 @@ test_list_flush_ipv4_exception() { done run_cmd ${ns_a} ping -q -M want -i 0.1 -c 2 -s 1800 "${dst2}" - # Each exception is printed as two lines - if [ "$(${ns_a} ip route list cache | wc -l)" -ne 202 ]; then + if [ "$(${ns_a} ip -oneline route list cache | wc -l)" -ne 101 ]; then err " can't list cached exceptions" fail=1 fi
@@ -1300,7 +1299,7 @@ test_list_flush_ipv6_exception() { run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}" done run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst2}" - if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 101 ]; then + if [ "$(${ns_a} ip -oneline -6 route list cache | wc -l)" -ne 101 ]; then err " can't list cached exceptions" fail=1 fi
tools/testing/selftests/net/tls.c +60 -0
72 lines not on this page · raw message