4.19.296-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 11/91 net: bridge: use DEV_STATS_INC()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 44bdb313da57322c9b3c108eb66981c6ec6509f4 ]
syzbot/KCSAN reported data-races in br_handle_frame_finish() [1] This function can run from multiple cpus without mutual exclusion.
Adopt SMP safe DEV_STATS_INC() to update dev->stats fields.
Handles updates to dev->stats.tx_dropped while we are at it.
[1]
BUG: KCSAN: data-race in br_handle_frame_finish / br_handle_frame_finish
read-write to 0xffff8881374b2178 of 8 bytes by interrupt on cpu 1:
br_handle_frame_finish+0xd4f/0xef0 net/bridge/br_input.c:189 br_nf_hook_thresh+0x1ed/0x220 br_nf_pre_routing_finish_ipv6+0x50f/0x540 NF_HOOK include/linux/netfilter.h:304 [inline] br_nf_pre_routing_ipv6+0x1e3/0x2a0 net/bridge/br_netfilter_ipv6.c:178 br_nf_pre_routing+0x526/0xba0 net/bridge/br_netfilter_hooks.c:508 nf_hook_entry_hookfn include/linux/netfilter.h:144 [inline] nf_hook_bridge_pre net/bridge/br_input.c:272 [inline] br_handle_frame+0x4c9/0x940 net/bridge/br_input.c:417 __netif_receive_skb_core+0xa8a/0x21e0 net/core/dev.c:5417 __netif_receive_skb_one_core net/core/dev.c:5521 [inline] __netif_receive_skb+0x57/0x1b0 net/core/dev.c:5637 process_backlog+0x21f/0x380 net/core/dev.c:5965 __napi_poll+0x60/0x3b0 net/core/dev.c:6527 napi_poll net/core/dev.c:6594 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6727 __do_softirq+0xc1/0x265 kernel/softirq.c:553 run_ksoftirqd+0x17/0x20 kernel/softirq.c:921 smpboot_thread_fn+0x30a/0x4a0 kernel/smpboot.c:164 kthread+0x1d7/0x210 kernel/kthread.c:388 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
read-write to 0xffff8881374b2178 of 8 bytes by interrupt on cpu 0:
br_handle_frame_finish+0xd4f/0xef0 net/bridge/br_input.c:189 br_nf_hook_thresh+0x1ed/0x220 br_nf_pre_routing_finish_ipv6+0x50f/0x540 NF_HOOK include/linux/netfilter.h:304 [inline] br_nf_pre_routing_ipv6+0x1e3/0x2a0 net/bridge/br_netfilter_ipv6.c:178 br_nf_pre_routing+0x526/0xba0 net/bridge/br_netfilter_hooks.c:508 nf_hook_entry_hookfn include/linux/netfilter.h:144 [inline] nf_hook_bridge_pre net/bridge/br_input.c:272 [inline] br_handle_frame+0x4c9/0x940 net/bridge/br_input.c:417 __netif_receive_skb_core+0xa8a/0x21e0 net/core/dev.c:5417 __netif_receive_skb_one_core net/core/dev.c:5521 [inline] __netif_receive_skb+0x57/0x1b0 net/core/dev.c:5637 process_backlog+0x21f/0x380 net/core/dev.c:5965 __napi_poll+0x60/0x3b0 net/core/dev.c:6527 napi_poll net/core/dev.c:6594 [inline] net_rx_action+0x32b/0x750 net/core/dev.c:6727 __do_softirq+0xc1/0x265 kernel/softirq.c:553 do_softirq+0x5e/0x90 kernel/softirq.c:454 __local_bh_enable_ip+0x64/0x70 kernel/softirq.c:381 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x36/0x40 kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:396 [inline] batadv_tt_local_purge+0x1a8/0x1f0 net/batman-adv/translation-table.c:1356 batadv_tt_purge+0x2b/0x630 net/batman-adv/translation-table.c:3560 process_one_work kernel/workqueue.c:2630 [inline] process_scheduled_works+0x5b8/0xa30 kernel/workqueue.c:2703 worker_thread+0x525/0x730 kernel/workqueue.c:2784 kthread+0x1d7/0x210 kernel/kthread.c:388 ret_from_fork+0x48/0x60 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304
value changed: 0x00000000000d7190 -> 0x00000000000d7191
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 14848 Comm: kworker/u4:11 Not tainted 6.6.0-rc1-syzkaller-00236-gad8a69f361b9 #0
--- net/bridge/br_forward.c | 4 ++-- net/bridge/br_input.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
net/bridge/br_forward.c +2 -2
@@ -122,7 +122,7 @@ static int deliver_clone(const struct net_bridge_port *prev, skb =skb_clone (skb,GFP_ATOMIC );if (!skb) { - dev->stats.tx_dropped++; +DEV_STATS_INC (dev, tx_dropped);return -ENOMEM ; }
@@ -261,7 +261,7 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb, skb =skb_copy (skb,GFP_ATOMIC );if (!skb) { - dev->stats.tx_dropped++; +DEV_STATS_INC (dev, tx_dropped);return ; }
net/bridge/br_input.c +2 -2
@@ -146,12 +146,12 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skbif ((mdst && mdst->host_joined) ||br_multicast_is_router (br)) { local_rcv = true; - br->dev->stats.multicast++; +DEV_STATS_INC (br->dev, multicast); } mcast_hit = true; }else { local_rcv = true; - br->dev->stats.multicast++; +DEV_STATS_INC (br->dev, multicast); }break ;case BR_PKT_UNICAST :
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 1/91 NFS/pNFS: Report EINVAL errors from connect() to the server
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit dd7d7ee3ba2a70d12d02defb478790cf57d5b87b ]
With IPv6, connect() can occasionally return EINVAL if a route is unavailable. If this happens during I/O to a data server, we want to report it using LAYOUTERROR as an inability to connect.
--- fs/nfs/flexfilelayout/flexfilelayout.c | 1 + 1 file changed, 1 insertion(+)
fs/nfs/flexfilelayout/flexfilelayout.c +1 -0
@@ -1189,6 +1189,7 @@ static void ff_layout_io_track_ds_error(struct pnfs_layout_segment *lseg,case -EPFNOSUPPORT :case -EPROTONOSUPPORT :case -EOPNOTSUPP : +case -EINVAL :case -ECONNREFUSED :case -ECONNRESET :case -EHOSTDOWN :
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 2/91 ata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <[email protected]>
[ Upstream commit 93c7711494f47f9c829321e2a8711671b02f6e4c ]
Drop pointless VPRINTK() calls for entering and existing interrupt routines and convert the remaining calls to dev_dbg().
Stable-dep-of: 737dd811a3db ("ata: libahci: clear pending interrupt status")
--- drivers/ata/ahci.c | 4 +--- drivers/ata/ahci_xgene.c | 4 ---- drivers/ata/libahci.c | 18 ++++-------------- 3 files changed, 5 insertions(+), 21 deletions(-)
drivers/ata/ahci.c +1 -3
@@ -694,7 +694,7 @@ static void ahci_pci_init_controller(struct ata_host *host)/* clear port IRQ */ tmp =readl (port_mmio +PORT_IRQ_STAT ); -VPRINTK ("PORT_IRQ_STAT 0x%x\n" , tmp); +dev_dbg (&pdev->dev,"PORT_IRQ_STAT 0x%x\n" , tmp);if (tmp)writel (tmp, port_mmio +PORT_IRQ_STAT ); }
@@ -1504,7 +1504,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance)u32 irq_stat, irq_masked;unsigned int handled =1 ; -VPRINTK ("ENTER\n" ); hpriv = host->private_data; mmio = hpriv->mmio; irq_stat =readl (mmio +HOST_IRQ_STAT );
@@ -1521,7 +1520,6 @@ static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance) irq_stat =readl (mmio +HOST_IRQ_STAT );spin_unlock (&host->lock); }while (irq_stat); -VPRINTK ("EXIT\n" );return IRQ_RETVAL (handled); }
drivers/ata/ahci_xgene.c +0 -4
@@ -601,8 +601,6 @@ static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance)void __iomem *mmio;u32 irq_stat, irq_masked; -VPRINTK ("ENTER\n" ); - hpriv = host->private_data; mmio = hpriv->mmio;
@@ -625,8 +623,6 @@ static irqreturn_t xgene_ahci_irq_intr(int irq, void *dev_instance)spin_unlock (&host->lock); -VPRINTK ("EXIT\n" ); -return IRQ_RETVAL (rc); }
drivers/ata/libahci.c +4 -14
@@ -1226,12 +1226,12 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap,/* clear SError */ tmp =readl (port_mmio +PORT_SCR_ERR ); -VPRINTK ("PORT_SCR_ERR 0x%x\n" , tmp); +dev_dbg (dev,"PORT_SCR_ERR 0x%x\n" , tmp);writel (tmp, port_mmio +PORT_SCR_ERR );/* clear port IRQ */ tmp =readl (port_mmio +PORT_IRQ_STAT ); -VPRINTK ("PORT_IRQ_STAT 0x%x\n" , tmp); +dev_dbg (dev,"PORT_IRQ_STAT 0x%x\n" , tmp);if (tmp)writel (tmp, port_mmio +PORT_IRQ_STAT );
@@ -1262,10 +1262,10 @@ void ahci_init_controller(struct ata_host *host) } tmp =readl (mmio +HOST_CTL ); -VPRINTK ("HOST_CTL 0x%x\n" , tmp); +dev_dbg (host->dev,"HOST_CTL 0x%x\n" , tmp);writel (tmp |HOST_IRQ_EN , mmio +HOST_CTL ); tmp =readl (mmio +HOST_CTL ); -VPRINTK ("HOST_CTL 0x%x\n" , tmp); +dev_dbg (host->dev,"HOST_CTL 0x%x\n" , tmp); }EXPORT_SYMBOL_GPL (ahci_init_controller);
@@ -1916,8 +1916,6 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance)void __iomem *port_mmio =ahci_port_base (ap);u32 status; -VPRINTK ("ENTER\n" ); - status =readl (port_mmio +PORT_IRQ_STAT );writel (status, port_mmio +PORT_IRQ_STAT );
@@ -1925,8 +1923,6 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance)ahci_handle_port_interrupt (ap, port_mmio, status);spin_unlock (ap->lock); -VPRINTK ("EXIT\n" ); -return IRQ_HANDLED ; }
@@ -1943,9 +1939,7 @@ u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked) ap = host->ports[i];if (ap) {ahci_port_intr (ap); -VPRINTK ("port %u\n" , i); }else { -VPRINTK ("port %u (no irq)\n" , i);if (ata_ratelimit ())dev_warn (host->dev,"interrupt on disabled port %u\n" , i);
@@ -1966,8 +1960,6 @@ static irqreturn_t ahci_single_level_irq_intr(int irq, void *dev_instance)void __iomem *mmio;u32 irq_stat, irq_masked; -VPRINTK ("ENTER\n" ); - hpriv = host->private_data; mmio = hpriv->mmio;
@@ -1995,8 +1987,6 @@ static irqreturn_t ahci_single_level_irq_intr(int irq, void *dev_instance)spin_unlock (&host->lock); -VPRINTK ("EXIT\n" ); -return IRQ_RETVAL (rc); }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 3/91 ata: libahci: clear pending interrupt status
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Szuying Chen <[email protected]>
[ Upstream commit 737dd811a3dbfd7edd4ad2ba5152e93d99074f83 ]
When a CRC error occurs, the HBA asserts an interrupt to indicate an interface fatal error (PxIS.IFS). The ISR clears PxIE and PxIS, then does error recovery. If the adapter receives another SDB FIS with an error (PxIS.TFES) from the device before the start of the EH recovery process, the interrupt signaling the new SDB cannot be serviced as PxIE was cleared already. This in turn results in the HBA inability to issue any command during the error recovery process after setting PxCMD.ST to 1 because PxIS.TFES is still set.
According to AHCI 1.3.1 specifications section 6.2.2, fatal errors notified by setting PxIS.HBFS, PxIS.HBDS, PxIS.IFS or PxIS.TFES will cause the HBA to enter the ERR:Fatal state. In this state, the HBA shall not issue any new commands.
To avoid this situation, introduce the function ahci_port_clear_pending_irq() to clear pending interrupts before executing a COMRESET. This follows the AHCI 1.3.1 - section 6.2.2.2 specification.
--- drivers/ata/libahci.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-)
drivers/ata/libahci.c +23 -12
@@ -1210,6 +1210,26 @@ static ssize_t ahci_activity_show(struct ata_device *dev, char *buf)return sprintf (buf,"%d\n" , emp->blink_policy); } +static void ahci_port_clear_pending_irq (struct ata_port *ap) +{ +struct ahci_host_priv *hpriv = ap->host->private_data; +void __iomem *port_mmio =ahci_port_base (ap); +u32 tmp; + +/* clear SError */ + tmp =readl (port_mmio +PORT_SCR_ERR ); +dev_dbg (ap->host->dev,"PORT_SCR_ERR 0x%x\n" , tmp); +writel (tmp, port_mmio +PORT_SCR_ERR ); + +/* clear port IRQ */ + tmp =readl (port_mmio +PORT_IRQ_STAT ); +dev_dbg (ap->host->dev,"PORT_IRQ_STAT 0x%x\n" , tmp); +if (tmp) +writel (tmp, port_mmio +PORT_IRQ_STAT ); + +writel (1 << ap->port_no, hpriv->mmio +HOST_IRQ_STAT ); +} +static void ahci_port_init (struct device *dev,struct ata_port *ap,int port_no,void __iomem *mmio,void __iomem *port_mmio)
@@ -1224,18 +1244,7 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap,if (rc)dev_warn (dev,"%s (%d)\n" , emsg, rc); -/* clear SError */ - tmp =readl (port_mmio +PORT_SCR_ERR ); -dev_dbg (dev,"PORT_SCR_ERR 0x%x\n" , tmp); -writel (tmp, port_mmio +PORT_SCR_ERR ); - -/* clear port IRQ */ - tmp =readl (port_mmio +PORT_IRQ_STAT ); -dev_dbg (dev,"PORT_IRQ_STAT 0x%x\n" , tmp); -if (tmp) -writel (tmp, port_mmio +PORT_IRQ_STAT ); - -writel (1 << port_no, mmio +HOST_IRQ_STAT ); +ahci_port_clear_pending_irq (ap);/* mark esata ports */ tmp =readl (port_mmio +PORT_CMD );
@@ -1565,6 +1574,8 @@ int ahci_do_hardreset(struct ata_link *link, unsigned int *class, tf.command =ATA_BUSY ;ata_tf_to_fis (&tf,0 ,0 , d2h_fis); +ahci_port_clear_pending_irq (ap); + rc =sata_link_hardreset (link, timing, deadline, online, ahci_check_ready);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 4/91 netfilter: nf_tables: disallow element removal on anonymous sets
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pablo Neira Ayuso <[email protected]>
[ Upstream commit 23a3bfd4ba7acd36abf52b78605f61b21bdac216 ]
Anonymous sets need to be populated once at creation and then they are bound to rule since 938154b93be8 ("netfilter: nf_tables: reject unbound anonymous set before commit phase"), otherwise transaction reports EINVAL.
Userspace does not need to delete elements of anonymous sets that are not yet bound, reject this with EOPNOTSUPP.
Quoted 1 line
From flush command path, skip anonymous sets, they are expected to be
bound already. Otherwise, EINVAL is hit at the end of this transaction for unbound sets.
--- net/netfilter/nf_tables_api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
net/netfilter/nf_tables_api.c +5 -4
@@ -993,8 +993,7 @@ static int nft_flush_table(struct nft_ctx *ctx)if (!nft_is_active_next (ctx->net, set))continue ; -if (nft_set_is_anonymous (set) && - !list_empty (&set->bindings)) +if (nft_set_is_anonymous (set))continue ; err =nft_delset (ctx, set);
@@ -4902,8 +4901,10 @@ static int nf_tables_delsetelem(struct net *net, struct sock *nlsk,if (IS_ERR (set))return PTR_ERR (set); -if (!list_empty (&set->bindings) && - (set->flags & (NFT_SET_CONSTANT |NFT_SET_ANONYMOUS ))) +if (nft_set_is_anonymous (set)) +return -EOPNOTSUPP ; + +if (!list_empty (&set->bindings) && (set->flags &NFT_SET_CONSTANT ))return -EBUSY ;if (nla[NFTA_SET_ELEM_LIST_ELEMENTS ] ==NULL ) {
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainercover 4.19.296-rc1 review
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.296-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.19.296-rc1
Eric Dumazet <[email protected]>
dccp: fix dccp_v4_err()/dccp_v6_err() again
John David Anglin <[email protected]>
parisc: Restore __ldcw_align for PA-RISC 2.0 processors
Shay Drory <[email protected]>
RDMA/mlx5: Fix NULL string error
Leon Romanovsky <[email protected]>
RDMA/cma: Fix truncation compilation warning in make_cma_ports
Duje Mihanović <[email protected]>
gpio: pxa: disable pinctrl calls for MMP_GPIO
Bartosz Golaszewski <[email protected]>
gpio: aspeed: fix the GPIO number passed to pinctrl_gpio_set_config()
Christophe JAILLET <[email protected]>
IB/mlx4: Fix the size of a buffer in add_port_entries()
Ivan Babrou <[email protected]>
cpupower: add Makefile dependencies for install targets
Xin Long <[email protected]>
sctp: update hb timer immediately after users change hb_interval
Xin Long <[email protected]>
sctp: update transport state when processing a dupcook packet
Neal Cardwell <[email protected]>
tcp: fix delayed ACKs for MSS boundary condition
Neal Cardwell <[email protected]>
tcp: fix quick-ack counting to count actual ACKs of new data
Ben Wolsieffer <[email protected]>
net: stmmac: dwmac-stm32: fix resume on STM32 MCU
Shigeru Yoshida <[email protected]>
net: usb: smsc75xx: Fix uninit-value access in __smsc75xx_read_reg
David Howells <[email protected]>
ipv4, ipv6: Fix handling of transhdrlen in __ip{,6}_append_data()
Mauricio Faria de Oliveira <[email protected]>
modpost: add missing else to the "of" check
Junxiao Bi <[email protected]>
scsi: target: core: Fix deadlock due to recursive locking
Richard Fitzgerald <[email protected]>
regmap: rbtree: Fix wrong register marked as in-cache when creating new node
Alexandra Diupina <[email protected]>
drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close()
Pin-yen Lin <[email protected]>
wifi: mwifiex: Fix oob check condition in mwifiex_process_rx_packet
Zhihao Cheng <[email protected]>
ubi: Refuse attaching if mtd's erasesize is 0
Qu Wenruo <[email protected]>
btrfs: reject unknown mount options early
Jordan Rife <[email protected]>
net: replace calls to sock->ops->connect() with kernel_connect()
Gustavo A. R. Silva <[email protected]>
wifi: mwifiex: Fix tlv_buf_left calculation
Gustavo A. R. Silva <[email protected]>
qed/red_ll2: Fix undefined behavior bug in struct qed_ll2_info
Dinghao Liu <[email protected]>
scsi: zfcp: Fix a double put in zfcp_port_enqueue()
Greg Kroah-Hartman <[email protected]>
Revert "PCI: qcom: Disable write access to read only registers for IP v2.3.3"
Greg Kroah-Hartman <[email protected]>
media: dvb: symbol fixup for dvb_attach() - again
Greg Kroah-Hartman <[email protected]>
Revert "drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions"
Niklas Cassel <[email protected]>
ata: libata: disallow dev-initiated LPM transitions to unsupported states
Shida Zhang <[email protected]>
ext4: fix rec_len verify error
Greg Ungerer <[email protected]>
fs: binfmt_elf_efpic: fix personality for ELF-FDPIC
Matthias Schiffer <[email protected]>
ata: libata-sata: increase PMP SRST timeout to 10s
Damien Le Moal <[email protected]>
ata: libata-core: Do not register PM operations for SAS ports
Damien Le Moal <[email protected]>
ata: libata-core: Fix port and device removal
Damien Le Moal <[email protected]>
ata: libata-core: Fix ata_port_request_pm() locking
Mika Westerberg <[email protected]>
net: thunderbolt: Fix TCPv6 GSO checksum calculation
Josef Bacik <[email protected]>
btrfs: properly report 0 avail for very full file systems
Heiner Kallweit <[email protected]>
i2c: i801: unregister tco_pdev in i801_probe() error path
Niklas Cassel <[email protected]>
ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES
Kailang Yang <[email protected]>
ALSA: hda: Disable power save for solving pop issue on Lenovo ThinkCentre M70q
Pan Bian <[email protected]>
nilfs2: fix potential use after free in nilfs_gccache_submit_read_data()
Andy Shevchenko <[email protected]>
serial: 8250_port: Check IRQ data before use
Roberto Sassu <[email protected]>
smack: Record transmuting in smk_transmuted
Roberto Sassu <[email protected]>
smack: Retrieve transmuting information in smack_inode_getsecurity()
Vishal Goel <[email protected]>
Smack:- Use overlay inode label in smack_inode_copy_up()
Shivasharan S <[email protected]>
scsi: megaraid_sas: Enable msix_load_balance for Invader and later controllers
Felix Riemann <[email protected]>
net: Fix unwanted sign extension in netdev_stats_to_stats64()
Mika Westerberg <[email protected]>
watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running
Mika Westerberg <[email protected]>
watchdog: iTCO_wdt: No need to stop the timer in probe
Pratyush Yadav <[email protected]>
nvme-pci: do not set the NUMA node of device if it has none
Thomas Zimmermann <[email protected]>
fbdev/sh7760fb: Depend on FB=y
Stanislav Fomichev <[email protected]>
bpf: Clarify error expectations from bpf_clone_redirect
Niklas Cassel <[email protected]>
ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
Zheng Yejian <[email protected]>
ring-buffer: Avoid softlockup in ring_buffer_resize()
Zheng Yejian <[email protected]>
selftests/ftrace: Correctly enable event in instance-event.tc
Helge Deller <[email protected]>
parisc: irq: Make irq_stack_union static to avoid sparse warning
Helge Deller <[email protected]>
parisc: drivers: Fix sparse warning
Helge Deller <[email protected]>
parisc: iosapic.c: Fix sparse warnings
Helge Deller <[email protected]>
parisc: sba: Fix compile warning wrt list of SBA devices
Wenhua Lin <[email protected]>
gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip
Tony Lindgren <[email protected]>
ARM: dts: ti: omap: motorola-mapphone: Fix abe_clkctrl warning on boot
Timo Alho <[email protected]>
clk: tegra: fix error return case for recalc_rate
Christoph Hellwig <[email protected]>
MIPS: Alchemy: only build mmc support helpers if au1xmmc is enabled
Jan Kara <[email protected]>
ext4: do not let fstrim block system suspend
Jan Kara <[email protected]>
ext4: move setting of trimmed bit into ext4_try_to_trim_range()
Kemeng Shi <[email protected]>
ext4: replace the traditional ternary conditional operator with with max()/min()
Dmitry Monakhov <[email protected]>
ext4: mark group as trimmed only if it was fully scanned
Lukas Czerner <[email protected]>
ext4: change s_last_trim_minblks type to unsigned long
Lukas Bulwahn <[email protected]>
ext4: scope ret locally in ext4_try_to_trim_range()
Wang Jianchao <[email protected]>
ext4: add new helper interface ext4_try_to_trim_range()
Wang Jianchao <[email protected]>
ext4: remove the 'group' parameter of ext4_trim_extent
Junxiao Bi <[email protected]>
scsi: megaraid_sas: Fix deadlock on firmware crashdump
Shivasharan S <[email protected]>
scsi: megaraid_sas: Load balance completions across all MSI-X
Manish Rangankar <[email protected]>
scsi: qla2xxx: Remove unsupported ql2xenabledif option
Martin K. Petersen <[email protected]>
scsi: qla2xxx: Add protection mask module parameters
Werner Sembach <[email protected]>
Input: i8042 - add quirk for TUXEDO Gemini 17 Gen1/Clevo PD70PN
Xiaoke Wang <[email protected]>
i2c: mux: demux-pinctrl: check the return value of devm_kstrdup()
Christophe JAILLET <[email protected]>
gpio: tb10x: Fix an error handling path in tb10x_gpio_probe()
Ziyang Xuan <[email protected]>
team: fix null-ptr-deref when team device type is changed
Eric Dumazet <[email protected]>
net: bridge: use DEV_STATS_INC()
Eric Dumazet <[email protected]>
net: add atomic_long_t to net_device_stats fields
Jie Wang <[email protected]>
net: hns3: add 5ms delay before clear firmware reset irq source
Kajol Jain <[email protected]>
powerpc/perf/hv-24x7: Update domain value check
Kyle Zeng <[email protected]>
ipv4: fix null-deref in ipv4_link_failure
Sabrina Dubroca <[email protected]>
selftests: tls: swap the TX and RX sockets in some tests
Kees Cook <[email protected]>
selftests/tls: Add {} to avoid static checker warning
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables: disallow element removal on anonymous sets
Szuying Chen <[email protected]>
ata: libahci: clear pending interrupt status
Hannes Reinecke <[email protected]>
ata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones
Trond Myklebust <[email protected]>
NFS/pNFS: Report EINVAL errors from connect() to the server
-------------
Diffstat:
Makefile | 4 +- arch/arm/boot/dts/omap4-droid4-xt894.dts | 4 +- arch/mips/alchemy/devboards/db1000.c | 4 + arch/mips/alchemy/devboards/db1200.c | 6 + arch/mips/alchemy/devboards/db1300.c | 4 + arch/parisc/include/asm/ldcw.h | 36 +++--- arch/parisc/include/asm/ropes.h | 3 + arch/parisc/include/asm/spinlock_types.h | 5 - arch/parisc/kernel/drivers.c | 2 +- arch/parisc/kernel/irq.c | 2 +- arch/powerpc/perf/hv-24x7.c | 2 +- drivers/ata/ahci.c | 13 +- drivers/ata/ahci_xgene.c | 4 - drivers/ata/libahci.c | 49 ++++---- drivers/ata/libata-core.c | 60 ++++++--- drivers/ata/libata-eh.c | 13 +- drivers/ata/libata-scsi.c | 2 +- drivers/ata/libata-transport.c | 9 +- drivers/ata/libata.h | 2 + drivers/base/arch_topology.c | 2 +- drivers/base/cacheinfo.c | 18 +-- drivers/base/core.c | 8 +- drivers/base/cpu.c | 34 ++--- drivers/base/firmware_loader/fallback.c | 2 +- drivers/base/memory.c | 24 ++-- drivers/base/node.c | 34 ++--- drivers/base/platform.c | 2 +- drivers/base/power/sysfs.c | 50 ++++---- drivers/base/regmap/regcache-rbtree.c | 3 +- drivers/base/soc.c | 8 +- drivers/char/agp/parisc-agp.c | 2 - drivers/clk/tegra/clk-bpmp.c | 2 +- drivers/gpio/gpio-aspeed.c | 2 +- drivers/gpio/gpio-pmic-eic-sprd.c | 1 + drivers/gpio/gpio-pxa.c | 1 + drivers/gpio/gpio-tb10x.c | 6 +- drivers/i2c/busses/i2c-i801.c | 1 + drivers/i2c/muxes/i2c-demux-pinctrl.c | 4 + drivers/infiniband/core/cma_configfs.c | 2 +- drivers/infiniband/hw/mlx4/sysfs.c | 2 +- drivers/infiniband/hw/mlx5/main.c | 2 +- drivers/input/serio/i8042-x86ia64io.h | 7 ++ drivers/media/dvb-frontends/sp8870.c | 2 +- drivers/media/tuners/tuner-xc2028.c | 2 +- drivers/mtd/ubi/build.c | 7 ++ .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 + drivers/net/ethernet/qlogic/qed/qed_ll2.h | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 7 +- drivers/net/team/team.c | 10 +- drivers/net/thunderbolt.c | 3 +- drivers/net/usb/smsc75xx.c | 4 +- drivers/net/wan/fsl_ucc_hdlc.c | 12 +- .../net/wireless/marvell/mwifiex/11n_rxreorder.c | 4 +- drivers/net/wireless/marvell/mwifiex/sta_rx.c | 16 +-- drivers/nvme/host/pci.c | 2 - drivers/parisc/iosapic.c | 4 +- drivers/parisc/iosapic_private.h | 4 +- drivers/pci/controller/dwc/pcie-qcom.c | 2 - drivers/s390/scsi/zfcp_aux.c | 9 +- drivers/scsi/megaraid/megaraid_sas.h | 5 +- drivers/scsi/megaraid/megaraid_sas_base.c | 44 ++++--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 18 ++- drivers/scsi/qla2xxx/qla_attr.c | 2 - drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 45 +++++-- drivers/target/target_core_device.c | 11 +- drivers/tty/serial/8250/8250_port.c | 5 +- drivers/video/fbdev/Kconfig | 2 +- drivers/watchdog/iTCO_wdt.c | 26 +++- fs/binfmt_elf_fdpic.c | 5 +- fs/btrfs/super.c | 6 +- fs/ext4/ext4.h | 2 +- fs/ext4/mballoc.c | 138 ++++++++++++--------- fs/ext4/namei.c | 26 ++-- fs/nfs/flexfilelayout/flexfilelayout.c | 1 + fs/nilfs2/gcinode.c | 6 +- include/linux/if_team.h | 2 + include/linux/libata.h | 6 +- include/linux/netdevice.h | 58 +++++---- include/net/dst.h | 5 +- include/net/tcp.h | 6 +- include/uapi/linux/bpf.h | 4 +- kernel/trace/ring_buffer.c | 2 + net/bridge/br_forward.c | 4 +- net/bridge/br_input.c | 4 +- net/core/dev.c | 14 +-- net/dccp/ipv4.c | 9 +- net/dccp/ipv6.c | 9 +- net/ipv4/route.c | 4 +- net/ipv4/tcp_input.c | 13 ++ net/ipv4/tcp_output.c | 7 +- net/l2tp/l2tp_ip6.c | 2 +- net/netfilter/ipvs/ip_vs_sync.c | 4 +- net/netfilter/nf_tables_api.c | 9 +- net/rds/tcp_connect.c | 2 +- net/sctp/associola.c | 3 +- net/sctp/socket.c | 1 + scripts/mod/file2alias.c | 2 +- security/smack/smack.h | 1 + security/smack/smack_lsm.c | 65 +++++++--- sound/pci/hda/hda_intel.c | 1 + tools/include/uapi/linux/bpf.h | 4 +- tools/power/cpupower/Makefile | 8 +- tools/power/cpupower/bench/Makefile | 2 +- .../ftrace/test.d/instances/instance-event.tc | 2 +- tools/testing/selftests/net/tls.c | 11 +- 106 files changed, 700 insertions(+), 444 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 6/91 selftests: tls: swap the TX and RX sockets in some tests
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sabrina Dubroca <[email protected]>
[ Upstream commit c326ca98446e0ae4fee43a40acf79412b74cfedb ]
tls.sendmsg_large and tls.sendmsg_multiple are trying to send through the self->cfd socket (only configured with TLS_RX) and to receive through the self->fd socket (only configured with TLS_TX), so they're not using kTLS at all. Swap the sockets.
--- tools/testing/selftests/net/tls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/net/tls.c +4 -4
@@ -199,11 +199,11 @@ TEST_F(tls, sendmsg_large) msg.msg_iov = &vec; msg.msg_iovlen =1 ; -EXPECT_EQ (sendmsg (self->cfd, &msg,0 ), send_len); +EXPECT_EQ (sendmsg (self->fd, &msg,0 ), send_len); }while (recvs++ < sends) { -EXPECT_NE (recv (self->fd, mem, send_len,0 ),-1 ); +EXPECT_NE (recv (self->cfd, mem, send_len,0 ),-1 ); }free (mem);
@@ -232,9 +232,9 @@ TEST_F(tls, sendmsg_multiple) msg.msg_iov = vec; msg.msg_iovlen = iov_len; -EXPECT_EQ (sendmsg (self->cfd, &msg,0 ), total_len); +EXPECT_EQ (sendmsg (self->fd, &msg,0 ), total_len); buf =malloc (total_len); -EXPECT_NE (recv (self->fd, buf, total_len,0 ),-1 ); +EXPECT_NE (recv (self->cfd, buf, total_len,0 ),-1 );for (i =0 ; i < iov_len; i++) { EXPECT_EQ(memcmp(test_strs[i], buf + len_cmp, strlen(test_strs[i])),
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 15/91 Input: i8042 - add quirk for TUXEDO Gemini 17 Gen1/Clevo PD70PN
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Werner Sembach <[email protected]>
[ Upstream commit eb09074bdb05ffd6bfe77f8b4a41b76ef78c997b ]
The touchpad of this device is both connected via PS/2 and i2c. This causes strange behavior when both driver fight for control. The easy fix is to prevent the PS/2 driver from accessing the mouse port as the full feature set of the touchpad is only supported in the i2c interface anyway.
The strange behavior in this case is, that when an external screen is connected and the notebook is closed, the pointer on the external screen is moving to the lower right corner. When the notebook is opened again, this movement stops, but the touchpad clicks are unresponsive afterwards until reboot.
--- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -1188,6 +1188,13 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) }, +/* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */ + { + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOAUX ) + }, { .matches = { DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 16/91 scsi: qla2xxx: Add protection mask module parameters
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin K. Petersen <[email protected]>
[ Upstream commit 7855d2ba1172d716d96a628af7c5bafa5725ac57 ]
Allow user to selectively enable/disable DIF/DIX protection capabilities mask.
Stable-dep-of: e9105c4b7a92 ("scsi: qla2xxx: Remove unsupported ql2xenabledif option")
--- drivers/scsi/qla2xxx/qla_os.c | 36 +++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-)
drivers/scsi/qla2xxx/qla_os.c +28 -8
@@ -277,6 +277,20 @@ MODULE_PARM_DESC(qla2xuseresexchforels,"Reserve 1/2 of emergency exchanges for ELS.\n" " 0 (default): disabled"); +int ql2xprotmask; +module_param (ql2xprotmask, int,0644 ); +MODULE_PARM_DESC (ql2xprotmask, +"Override DIF/DIX protection capabilities mask\n" +"Default is 0 which sets protection mask based on " +"capabilities reported by HBA firmware.\n" ); + +int ql2xprotguard; +module_param (ql2xprotguard, int,0644 ); +MODULE_PARM_DESC (ql2xprotguard,"Override choice of DIX checksum\n" +" 0 -- Let HBA firmware decide\n" +" 1 -- Force T10 CRC\n" +" 2 -- Force IP checksum\n" ); +/* * SCSI host template entry points */
@@ -3293,13 +3307,16 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) "Registering for DIF/DIX type 1 and 3 protection.\n");if (ql2xenabledif ==1 ) prot =SHOST_DIX_TYPE0_PROTECTION ; -scsi_host_set_prot (host, - prot |SHOST_DIF_TYPE1_PROTECTION - |SHOST_DIF_TYPE2_PROTECTION - |SHOST_DIF_TYPE3_PROTECTION - |SHOST_DIX_TYPE1_PROTECTION - |SHOST_DIX_TYPE2_PROTECTION - |SHOST_DIX_TYPE3_PROTECTION ); +if (ql2xprotmask) +scsi_host_set_prot (host, ql2xprotmask); +else +scsi_host_set_prot (host, + prot |SHOST_DIF_TYPE1_PROTECTION + |SHOST_DIF_TYPE2_PROTECTION + |SHOST_DIF_TYPE3_PROTECTION + |SHOST_DIX_TYPE1_PROTECTION + |SHOST_DIX_TYPE2_PROTECTION + |SHOST_DIX_TYPE3_PROTECTION ); guard =SHOST_DIX_GUARD_CRC ;
@@ -3307,7 +3324,10 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) (ql2xenabledif > 1 || IS_PI_DIFB_DIX0_CAPABLE(ha))) guard |=SHOST_DIX_GUARD_IP ; -scsi_host_set_guard (host, guard); +if (ql2xprotguard) +scsi_host_set_guard (host, ql2xprotguard); +else +scsi_host_set_guard (host, guard); }else base_vha->flags.difdix_supported =0 ; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 17/91 scsi: qla2xxx: Remove unsupported ql2xenabledif option
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manish Rangankar <[email protected]>
[ Upstream commit e9105c4b7a9208a21a9bda133707624f12ddabc2 ]
User accidently passed module parameter ql2xenabledif=1 which is unsupported. However, driver still initialized which lead to guard tag errors during device discovery.
Remove unsupported ql2xenabledif=1 option and validate the user input.
--- drivers/scsi/qla2xxx/qla_attr.c | 2 -- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_os.c | 9 +++++++-- 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -2
@@ -2088,8 +2088,6 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) vha->flags.difdix_supported =1 ;ql_dbg (ql_dbg_user, vha,0x7082 ,"Registered for DIF/DIX type 1 and 3 protection.\n" ); -if (ql2xenabledif ==1 ) - prot =SHOST_DIX_TYPE0_PROTECTION ;scsi_host_set_prot (vha->host, prot |SHOST_DIF_TYPE1_PROTECTION | SHOST_DIF_TYPE2_PROTECTION
drivers/scsi/qla2xxx/qla_dbg.c +1 -1
@@ -22,7 +22,7 @@* | Queue Command and IO tracing | 0x3074 | 0x300b | * | | | 0x3027-0x3028 | * | | | 0x303d-0x3041 | -* | | | 0x302d,0x3033 | +* | | | 0x302e,0x3033 | * | | | 0x3036,0x3038 | * | | | 0x303a | * | DPC Thread | 0x4023 | 0x4002,0x4013 |
drivers/scsi/qla2xxx/qla_os.c +7 -2
@@ -3069,6 +3069,13 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) host->max_id = ha->max_fibre_devices; host->cmd_per_lun =3 ; host->unique_id = host->host_no; + +if (ql2xenabledif && ql2xenabledif !=2 ) { +ql_log (ql_log_warn, base_vha,0x302d , +"Invalid value for ql2xenabledif, resetting it to default (2)\n" ); + ql2xenabledif =2 ; + } +if (IS_T10_PI_CAPABLE (ha) && ql2xenabledif) host->max_cmd_len =32 ;else
@@ -3305,8 +3312,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) base_vha->flags.difdix_supported =1 ;ql_dbg (ql_dbg_init, base_vha,0x00f1 ,"Registering for DIF/DIX type 1 and 3 protection.\n" ); -if (ql2xenabledif ==1 ) - prot =SHOST_DIX_TYPE0_PROTECTION ;if (ql2xprotmask)scsi_host_set_prot (host, ql2xprotmask);else
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 18/91 scsi: megaraid_sas: Load balance completions across all MSI-X
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivasharan S <[email protected]>
[ Upstream commit 1d15d9098ad12b0021ac5a6b851f26d1ab021e5a ]
Driver will use "reply descriptor post queues" in round robin fashion when the combined MSI-X mode is not enabled. With this IO completions are distributed and load balanced across all the available reply descriptor post queues equally.
This is enabled only if combined MSI-X mode is not enabled in firmware. This improves performance and also fixes soft lockups.
When load balancing is enabled, IRQ affinity from driver needs to be disabled.
Stable-dep-of: 0b0747d507bf ("scsi: megaraid_sas: Fix deadlock on firmware crashdump")
--- drivers/scsi/megaraid/megaraid_sas.h | 3 +++ drivers/scsi/megaraid/megaraid_sas_base.c | 22 +++++++++++++++++---- drivers/scsi/megaraid/megaraid_sas_fusion.c | 18 +++++++++++++---- 3 files changed, 35 insertions(+), 8 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +3 -0
@@ -2193,6 +2193,7 @@ struct megasas_instance {u32 secure_jbod_support;u32 support_morethan256jbod;/* FW support for more than 256 PD/JBOD */ bool use_seqnum_jbod_fp;/* Added for PD sequence */ +bool smp_affinity_enable;spinlock_t crashdump_lock;struct megasas_register_set __iomem *reg_set;
@@ -2210,6 +2211,7 @@ struct megasas_instance {u16 ldio_threshold;u16 cur_can_queue;u32 max_sectors_per_req; +bool msix_load_balance;struct megasas_aen_event *ev;struct megasas_cmd **cmd_list;
@@ -2246,6 +2248,7 @@ struct megasas_instance {atomic_t sge_holes_type1;atomic_t sge_holes_type2;atomic_t sge_holes_type3; +atomic64_t total_io_count;struct megasas_instance_template *instancet;struct tasklet_struct isr_tasklet;
drivers/scsi/megaraid/megaraid_sas_base.c +18 -4
@@ -5101,6 +5101,7 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) &instance->irq_context[j]);/* Retry irq register for IO_APIC*/ instance->msix_vectors =0 ; + instance->msix_load_balance = false;if (is_probe) {pci_free_irq_vectors (instance->pdev);return megasas_setup_irqs_ioapic (instance);
@@ -5109,6 +5110,7 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) } } } +return 0 ; }
@@ -5364,6 +5366,12 @@ static int megasas_init_fw(struct megasas_instance *instance)if (rdpq_enable) instance->is_rdpq = (scratch_pad_2 &MR_RDPQ_MODE_OFFSET ) ?1 :0 ; + +if (!instance->msix_combined) { + instance->msix_load_balance = true; + instance->smp_affinity_enable = false; + } + fw_msix_count = instance->msix_vectors;/* Save 1-15 reply post index address to local memory * Index 0 is already saved from reg offset
@@ -5382,17 +5390,20 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->msix_vectors); }else /* MFI adapters */ instance->msix_vectors =1 ; +/* Don't bother allocating more MSI-X vectors than cpus */ instance->msix_vectors =min (instance->msix_vectors, (unsigned int )num_online_cpus ()); -if (smp_affinity_enable) +if (instance->smp_affinity_enable) irq_flags |=PCI_IRQ_AFFINITY ; i =pci_alloc_irq_vectors (instance->pdev,1 , instance->msix_vectors, irq_flags); -if (i >0 ) +if (i >0 ) { instance->msix_vectors = i; -else + }else { instance->msix_vectors =0 ; + instance->msix_load_balance = false; + } }/* * MSI-X host index 0 is common for all adapter.
@@ -6447,6 +6458,7 @@ static inline void megasas_init_ctrl_params(struct megasas_instance *instance)INIT_LIST_HEAD (&instance->internal_reset_pending_q);atomic_set (&instance->fw_outstanding,0 ); +atomic64_set (&instance->total_io_count,0 );init_waitqueue_head (&instance->int_cmd_wait_q);init_waitqueue_head (&instance->abort_cmd_wait_q);
@@ -6469,6 +6481,8 @@ static inline void megasas_init_ctrl_params(struct megasas_instance *instance) instance->last_time =0 ; instance->disableOnlineCtrlReset =1 ; instance->UnevenSpanSupport =0 ; + instance->smp_affinity_enable = smp_affinity_enable ? true : false; + instance->msix_load_balance = false;if (instance->adapter_type !=MFI_SERIES ) {INIT_WORK (&instance->work_init, megasas_fusion_ocr_wq);
@@ -6818,7 +6832,7 @@ megasas_resume(struct pci_dev *pdev)/* Now re-enable MSI-X */ if (instance->msix_vectors) { irq_flags =PCI_IRQ_MSIX ; -if (smp_affinity_enable) +if (instance->smp_affinity_enable) irq_flags |=PCI_IRQ_AFFINITY ; } rval = pci_alloc_irq_vectors(instance->pdev, 1,
drivers/scsi/megaraid/megaraid_sas_fusion.c +14 -4
@@ -2641,8 +2641,13 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, fp_possible = (io_info.fpOkForIo >0 ) ? true : false; } - cmd->request_desc->SCSIIO.MSIxIndex = - instance->reply_map[raw_smp_processor_id ()]; +if (instance->msix_load_balance) + cmd->request_desc->SCSIIO.MSIxIndex = + (mega_mod64 (atomic64_add_return (1 , &instance->total_io_count), + instance->msix_vectors)); +else + cmd->request_desc->SCSIIO.MSIxIndex = + instance->reply_map[raw_smp_processor_id ()]; praid_context = &io_request->RaidContext;
@@ -2969,8 +2974,13 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, cmd->request_desc->SCSIIO.DevHandle = io_request->DevHandle; - cmd->request_desc->SCSIIO.MSIxIndex = - instance->reply_map[raw_smp_processor_id ()]; +if (instance->msix_load_balance) + cmd->request_desc->SCSIIO.MSIxIndex = + (mega_mod64 (atomic64_add_return (1 , &instance->total_io_count), + instance->msix_vectors)); +else + cmd->request_desc->SCSIIO.MSIxIndex = + instance->reply_map[raw_smp_processor_id ()];if (!fp_possible) {/* system pd firmware path */
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 19/91 scsi: megaraid_sas: Fix deadlock on firmware crashdump
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Bi <[email protected]>
[ Upstream commit 0b0747d507bffb827e40fc0f9fb5883fffc23477 ]
The following processes run into a deadlock. CPU 41 was waiting for CPU 29 to handle a CSD request while holding spinlock "crashdump_lock", but CPU 29 was hung by that spinlock with IRQs disabled.
PID: 17360 TASK: ffff95c1090c5c40 CPU: 41 COMMAND: "mrdiagd"
!# 0 [ffffb80edbf37b58] __read_once_size at ffffffff9b871a40 include/linux/compiler.h:185:0
!# 1 [ffffb80edbf37b58] atomic_read at ffffffff9b871a40 arch/x86/include/asm/atomic.h:27:0
!# 2 [ffffb80edbf37b58] dump_stack at ffffffff9b871a40 lib/dump_stack.c:54:0
# 3 [ffffb80edbf37b78] csd_lock_wait_toolong at ffffffff9b131ad5 kernel/smp.c:364:0
# 4 [ffffb80edbf37b78] __csd_lock_wait at ffffffff9b131ad5 kernel/smp.c:384:0
# 5 [ffffb80edbf37bf8] csd_lock_wait at ffffffff9b13267a kernel/smp.c:394:0
# 6 [ffffb80edbf37bf8] smp_call_function_many at ffffffff9b13267a kernel/smp.c:843:0
# 7 [ffffb80edbf37c50] smp_call_function at ffffffff9b13279d kernel/smp.c:867:0
# 8 [ffffb80edbf37c50] on_each_cpu at ffffffff9b13279d kernel/smp.c:976:0
# 9 [ffffb80edbf37c78] flush_tlb_kernel_range at ffffffff9b085c4b arch/x86/mm/tlb.c:742:0
#10 [ffffb80edbf37cb8] __purge_vmap_area_lazy at ffffffff9b23a1e0 mm/vmalloc.c:701:0
#11 [ffffb80edbf37ce0] try_purge_vmap_area_lazy at ffffffff9b23a2cc mm/vmalloc.c:722:0
#12 [ffffb80edbf37ce0] free_vmap_area_noflush at ffffffff9b23a2cc mm/vmalloc.c:754:0
#13 [ffffb80edbf37cf8] free_unmap_vmap_area at ffffffff9b23bb3b mm/vmalloc.c:764:0
#14 [ffffb80edbf37cf8] remove_vm_area at ffffffff9b23bb3b mm/vmalloc.c:1509:0
#15 [ffffb80edbf37d18] __vunmap at ffffffff9b23bb8a mm/vmalloc.c:1537:0
#16 [ffffb80edbf37d40] vfree at ffffffff9b23bc85 mm/vmalloc.c:1612:0
#17 [ffffb80edbf37d58] megasas_free_host_crash_buffer [megaraid_sas] at ffffffffc020b7f2 drivers/scsi/megaraid/megaraid_sas_fusion.c:3932:0 #18 [ffffb80edbf37d80] fw_crash_state_store [megaraid_sas] at ffffffffc01f804d drivers/scsi/megaraid/megaraid_sas_base.c:3291:0 #19 [ffffb80edbf37dc0] dev_attr_store at ffffffff9b56dd7b drivers/base/core.c:758:0
#20 [ffffb80edbf37dd0] sysfs_kf_write at ffffffff9b326acf fs/sysfs/file.c:144:0
#21 [ffffb80edbf37de0] kernfs_fop_write at ffffffff9b325fd4 fs/kernfs/file.c:316:0
#22 [ffffb80edbf37e20] __vfs_write at ffffffff9b29418a fs/read_write.c:480:0
#23 [ffffb80edbf37ea8] vfs_write at ffffffff9b294462 fs/read_write.c:544:0
#24 [ffffb80edbf37ee8] SYSC_write at ffffffff9b2946ec fs/read_write.c:590:0
#25 [ffffb80edbf37ee8] SyS_write at ffffffff9b2946ec fs/read_write.c:582:0
#26 [ffffb80edbf37f30] do_syscall_64 at ffffffff9b003ca9 arch/x86/entry/common.c:298:0
#27 [ffffb80edbf37f58] entry_SYSCALL_64 at ffffffff9ba001b1 arch/x86/entry/entry_64.S:238:0
PID: 17355 TASK: ffff95c1090c3d80 CPU: 29 COMMAND: "mrdiagd"
!# 0 [ffffb80f2d3c7d30] __read_once_size at ffffffff9b0f2ab0 include/linux/compiler.h:185:0
!# 1 [ffffb80f2d3c7d30] native_queued_spin_lock_slowpath at ffffffff9b0f2ab0 kernel/locking/qspinlock.c:368:0
# 2 [ffffb80f2d3c7d58] pv_queued_spin_lock_slowpath at ffffffff9b0f244b arch/x86/include/asm/paravirt.h:674:0 # 3 [ffffb80f2d3c7d58] queued_spin_lock_slowpath at ffffffff9b0f244b arch/x86/include/asm/qspinlock.h:53:0 # 4 [ffffb80f2d3c7d68] queued_spin_lock at ffffffff9b8961a6 include/asm-generic/qspinlock.h:90:0
# 5 [ffffb80f2d3c7d68] do_raw_spin_lock_flags at ffffffff9b8961a6 include/linux/spinlock.h:173:0
# 6 [ffffb80f2d3c7d68] __raw_spin_lock_irqsave at ffffffff9b8961a6 include/linux/spinlock_api_smp.h:122:0
# 7 [ffffb80f2d3c7d68] _raw_spin_lock_irqsave at ffffffff9b8961a6 kernel/locking/spinlock.c:160:0
# 8 [ffffb80f2d3c7d88] fw_crash_buffer_store [megaraid_sas] at ffffffffc01f8129 drivers/scsi/megaraid/megaraid_sas_base.c:3205:0 # 9 [ffffb80f2d3c7dc0] dev_attr_store at ffffffff9b56dd7b drivers/base/core.c:758:0
#10 [ffffb80f2d3c7dd0] sysfs_kf_write at ffffffff9b326acf fs/sysfs/file.c:144:0
#11 [ffffb80f2d3c7de0] kernfs_fop_write at ffffffff9b325fd4 fs/kernfs/file.c:316:0
#12 [ffffb80f2d3c7e20] __vfs_write at ffffffff9b29418a fs/read_write.c:480:0
#13 [ffffb80f2d3c7ea8] vfs_write at ffffffff9b294462 fs/read_write.c:544:0
#14 [ffffb80f2d3c7ee8] SYSC_write at ffffffff9b2946ec fs/read_write.c:590:0
#15 [ffffb80f2d3c7ee8] SyS_write at ffffffff9b2946ec fs/read_write.c:582:0
#16 [ffffb80f2d3c7f30] do_syscall_64 at ffffffff9b003ca9 arch/x86/entry/common.c:298:0
#17 [ffffb80f2d3c7f58] entry_SYSCALL_64 at ffffffff9ba001b1 arch/x86/entry/entry_64.S:238:0
The lock is used to synchronize different sysfs operations, it doesn't protect any resource that will be touched by an interrupt. Consequently it's not required to disable IRQs. Replace the spinlock with a mutex to fix the deadlock.
--- drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +1 -1
@@ -2194,7 +2194,7 @@ struct megasas_instance {u32 support_morethan256jbod;/* FW support for more than 256 PD/JBOD */ bool use_seqnum_jbod_fp;/* Added for PD sequence */ bool smp_affinity_enable; -spinlock_t crashdump_lock; +struct mutex crashdump_lock;struct megasas_register_set __iomem *reg_set;u32 __iomem *reply_post_host_index_addr[MR_MAX_MSIX_REG_ARRAY ];
drivers/scsi/megaraid/megaraid_sas_base.c +9 -12
@@ -3004,14 +3004,13 @@ megasas_fw_crash_buffer_store(struct device *cdev,struct megasas_instance *instance = (struct megasas_instance *) shost->hostdata;int val =0 ; -unsigned long flags;if (kstrtoint (buf,0 , &val) !=0 )return -EINVAL ; -spin_lock_irqsave (&instance->crashdump_lock, flags); +mutex_lock (&instance->crashdump_lock); instance->fw_crash_buffer_offset = val; -spin_unlock_irqrestore (&instance->crashdump_lock, flags); +mutex_unlock (&instance->crashdump_lock);return strlen (buf); }
@@ -3027,17 +3026,16 @@ megasas_fw_crash_buffer_show(struct device *cdev,unsigned long dmachunk =CRASH_DMA_BUF_SIZE ;unsigned long chunk_left_bytes;unsigned long src_addr; -unsigned long flags;u32 buff_offset; -spin_lock_irqsave (&instance->crashdump_lock, flags); +mutex_lock (&instance->crashdump_lock); buff_offset = instance->fw_crash_buffer_offset;if (!instance->crash_dump_buf || !((instance->fw_crash_state ==AVAILABLE ) || (instance->fw_crash_state ==COPYING ))) {dev_err (&instance->pdev->dev,"Firmware crash dump is not available\n" ); -spin_unlock_irqrestore (&instance->crashdump_lock, flags); +mutex_unlock (&instance->crashdump_lock);return -EINVAL ; }
@@ -3046,7 +3044,7 @@ megasas_fw_crash_buffer_show(struct device *cdev,if (buff_offset > (instance->fw_crash_buffer_size * dmachunk)) {dev_err (&instance->pdev->dev,"Firmware crash dump offset is out of range\n" ); -spin_unlock_irqrestore (&instance->crashdump_lock, flags); +mutex_unlock (&instance->crashdump_lock);return 0 ; }
@@ -3058,7 +3056,7 @@ megasas_fw_crash_buffer_show(struct device *cdev, src_addr = (unsigned long )instance->crash_buf[buff_offset / dmachunk] + (buff_offset % dmachunk);memcpy (buf, (void *)src_addr, size); -spin_unlock_irqrestore (&instance->crashdump_lock, flags); +mutex_unlock (&instance->crashdump_lock);return size; }
@@ -3083,7 +3081,6 @@ megasas_fw_crash_state_store(struct device *cdev,struct megasas_instance *instance = (struct megasas_instance *) shost->hostdata;int val =0 ; -unsigned long flags;if (kstrtoint (buf,0 , &val) !=0 )return -EINVAL ;
@@ -3097,9 +3094,9 @@ megasas_fw_crash_state_store(struct device *cdev, instance->fw_crash_state = val;if ((val ==COPIED ) || (val ==COPY_ERROR )) { -spin_lock_irqsave (&instance->crashdump_lock, flags); +mutex_lock (&instance->crashdump_lock);megasas_free_host_crash_buffer (instance); -spin_unlock_irqrestore (&instance->crashdump_lock, flags); +mutex_unlock (&instance->crashdump_lock);if (val ==COPY_ERROR )dev_info (&instance->pdev->dev,"application failed to " "copy Firmware crash dump\n" );
@@ -6463,7 +6460,7 @@ static inline void megasas_init_ctrl_params(struct megasas_instance *instance)init_waitqueue_head (&instance->int_cmd_wait_q);init_waitqueue_head (&instance->abort_cmd_wait_q); -spin_lock_init (&instance->crashdump_lock); +mutex_init (&instance->crashdump_lock);spin_lock_init (&instance->mfi_pool_lock);spin_lock_init (&instance->hba_lock);spin_lock_init (&instance->stream_lock);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 20/91 ext4: remove the group parameter of ext4_trim_extent
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Jianchao <[email protected]>
[ Upstream commit bd2eea8d0a6b6a9aca22f20bf74f73b71d8808af ]
Get rid of the 'group' parameter of ext4_trim_extent as we can get it from the 'e4b'.
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/mballoc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
fs/ext4/mballoc.c +4 -5
@@ -5149,19 +5149,19 @@ int ext4_group_add_blocks(handle_t *handle, struct super_block *sb,* @sb: super block for the file system * @start: starting block of the free extent in the alloc. group * @count: number of blocks to TRIM -* @group: alloc. group we are working with * @e4b: ext4 buddy for the group * * Trim "count" blocks starting at "start" in the "group". To assure that no * one will allocate those blocks, mark it as used in buddy bitmap. This must * be called with under the group lock. */ -static int ext4_trim_extent (struct super_block *sb,int start,int count, -ext4_group_t group,struct ext4_buddy *e4b) +static int ext4_trim_extent (struct super_block *sb, +int start,int count,struct ext4_buddy *e4b)__releases (bitlock)__acquires (bitlock) {struct ext4_free_extent ex; +ext4_group_t group = e4b->bd_group;int ret =0 ;trace_ext4_trim_extent (sb, group, start, count);
@@ -5237,8 +5237,7 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group, next =mb_find_next_bit (bitmap, max +1 , start);if ((next - start) >= minblocks) { - ret =ext4_trim_extent (sb, start, - next - start, group, &e4b); + ret =ext4_trim_extent (sb, start, next - start, &e4b);if (ret && ret != -EOPNOTSUPP )break ; ret =0 ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 21/91 ext4: add new helper interface ext4_try_to_trim_range()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Jianchao <[email protected]>
[ Upstream commit 6920b3913235f517728bb69abe9b39047a987113 ]
There is no functional change in this patch but just split the codes, which serachs free block and does trim, into a new function ext4_try_to_trim_range. This is preparing for the following async backgroup discard.
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/mballoc.c | 102 ++++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 45 deletions(-)
fs/ext4/mballoc.c +57 -45
@@ -5184,6 +5184,54 @@ __acquires(bitlock)return ret; } +static int ext4_try_to_trim_range (struct super_block *sb, +struct ext4_buddy *e4b,ext4_grpblk_t start, +ext4_grpblk_t max,ext4_grpblk_t minblocks) +{ +ext4_grpblk_t next, count, free_count; +void *bitmap; +int ret =0 ; + + bitmap = e4b->bd_bitmap; + start = (e4b->bd_info->bb_first_free > start) ? + e4b->bd_info->bb_first_free : start; + count =0 ; + free_count =0 ; + +while (start <= max) { + start =mb_find_next_zero_bit (bitmap, max +1 , start); +if (start > max) +break ; + next =mb_find_next_bit (bitmap, max +1 , start); + +if ((next - start) >= minblocks) { + ret =ext4_trim_extent (sb, start, next - start, e4b); +if (ret && ret != -EOPNOTSUPP ) +break ; + ret =0 ; + count += next - start; + } + free_count += next - start; + start = next +1 ; + +if (fatal_signal_pending (current)) { + count = -ERESTARTSYS ; +break ; + } + +if (need_resched ()) { +ext4_unlock_group (sb, e4b->bd_group); +cond_resched (); +ext4_lock_group (sb, e4b->bd_group); + } + +if ((e4b->bd_info->bb_free - free_count) < minblocks) +break ; + } + +return count; +} +/** * ext4_trim_all_free -- function to trim all free space in alloc. group * @sb: super block for file system
@@ -5207,10 +5255,8 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group, ext4_grpblk_t start, ext4_grpblk_t max, ext4_grpblk_t minblocks) { - void *bitmap; -ext4_grpblk_t next, count =0 , free_count =0 ; struct ext4_buddy e4b; -int ret =0 ; +int ret;trace_ext4_trim_all_free (sb, group, start, max);
@@ -5220,57 +5266,23 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group, ret, group);return ret; } - bitmap = e4b.bd_bitmap;ext4_lock_group (sb, group); -if (EXT4_MB_GRP_WAS_TRIMMED (e4b.bd_info) && - minblocks >=atomic_read (&EXT4_SB (sb)->s_last_trim_minblks)) - goto out; - - start = (e4b.bd_info->bb_first_free > start) ? - e4b.bd_info->bb_first_free : start; - -while (start <= max) { - start =mb_find_next_zero_bit (bitmap, max +1 , start); -if (start > max) -break ; - next =mb_find_next_bit (bitmap, max +1 , start); - -if ((next - start) >= minblocks) { - ret =ext4_trim_extent (sb, start, next - start, &e4b); -if (ret && ret != -EOPNOTSUPP ) -break ; - ret =0 ; - count += next - start; - } - free_count += next - start; - start = next +1 ; - -if (fatal_signal_pending (current)) { - count = -ERESTARTSYS ; -break ; - } - -if (need_resched ()) { -ext4_unlock_group (sb, group); -cond_resched (); -ext4_lock_group (sb, group); - } -if ((e4b.bd_info->bb_free - free_count) < minblocks) -break ; +if (!EXT4_MB_GRP_WAS_TRIMMED (e4b.bd_info) || + minblocks <atomic_read (&EXT4_SB (sb)->s_last_trim_minblks)) { + ret =ext4_try_to_trim_range (sb, &e4b, start, max, minblocks); +if (ret >=0 ) +EXT4_MB_GRP_SET_TRIMMED (e4b.bd_info); + }else { + ret =0 ; } -if (!ret) { - ret = count; -EXT4_MB_GRP_SET_TRIMMED (e4b.bd_info); - } -out:ext4_unlock_group (sb, group);ext4_mb_unload_buddy (&e4b);ext4_debug ("trimmed %d blocks in the group %d\n" , - count, group); + ret, group);return ret; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 22/91 ext4: scope ret locally in ext4_try_to_trim_range()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Bulwahn <[email protected]>
[ Upstream commit afcc4e32f606dbfb47aa7309172c89174b86e74c ]
As commit 6920b3913235 ("ext4: add new helper interface ext4_try_to_trim_range()") moves some code into the separate function ext4_try_to_trim_range(), the use of the variable ret within that function is more limited and can be adjusted as well.
Scope the use of the variable ret locally and drop dead assignments.
No functional change.
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/mballoc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/ext4/mballoc.c +2 -3
@@ -5190,7 +5190,6 @@ static int ext4_try_to_trim_range(struct super_block *sb, {ext4_grpblk_t next, count, free_count;void *bitmap; -int ret =0 ; bitmap = e4b->bd_bitmap; start = (e4b->bd_info->bb_first_free > start) ?
@@ -5205,10 +5204,10 @@ static int ext4_try_to_trim_range(struct super_block *sb, next =mb_find_next_bit (bitmap, max +1 , start);if ((next - start) >= minblocks) { - ret =ext4_trim_extent (sb, start, next - start, e4b); +int ret =ext4_trim_extent (sb, start, next - start, e4b); +if (ret && ret != -EOPNOTSUPP )break ; - ret =0 ; count += next - start; } free_count += next - start;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 23/91 ext4: change s_last_trim_minblks type to unsigned long
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <[email protected]>
[ Upstream commit 2327fb2e23416cfb2795ccca2f77d4d65925be99 ]
There is no good reason for the s_last_trim_minblks to be atomic. There is no data integrity needed and there is no real danger in setting and reading it in a racy manner. Change it to be unsigned long, the same type as s_clusters_per_group which is the maximum that's allowed.
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/ext4.h | 2 +- fs/ext4/mballoc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
fs/ext4/ext4.h +1 -1
@@ -1500,7 +1500,7 @@ struct ext4_sb_info {struct task_struct *s_mmp_tsk;/* record the last minlen when FITRIM is called. */ -atomic_t s_last_trim_minblks; +unsigned long s_last_trim_minblks;/* Reference to checksum algorithm driver via cryptoapi */ struct crypto_shash *s_chksum_driver;
fs/ext4/mballoc.c +2 -2
@@ -5269,7 +5269,7 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group,ext4_lock_group (sb, group);if (!EXT4_MB_GRP_WAS_TRIMMED (e4b.bd_info) || - minblocks <atomic_read (&EXT4_SB (sb)->s_last_trim_minblks)) { + minblocks <EXT4_SB (sb)->s_last_trim_minblks) { ret =ext4_try_to_trim_range (sb, &e4b, start, max, minblocks);if (ret >=0 )EXT4_MB_GRP_SET_TRIMMED (e4b.bd_info);
@@ -5378,7 +5378,7 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range) }if (!ret) -atomic_set (&EXT4_SB (sb)->s_last_trim_minblks, minlen); +EXT4_SB (sb)->s_last_trim_minblks = minlen; out: range->len =EXT4_C2B (EXT4_SB (sb), trimmed) << sb->s_blocksize_bits;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 24/91 ext4: mark group as trimmed only if it was fully scanned
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Monakhov <[email protected]>
[ Upstream commit d63c00ea435a5352f486c259665a4ced60399421 ]
Otherwise nonaligned fstrim calls will works inconveniently for iterative scanners, for example:
// trim [0,16MB] for group-1, but mark full group as trimmed
fstrim -o $((1024*1024*128)) -l $((1024*1024*16)) ./m
// handle [16MB,16MB] for group-1, do nothing because group already has the flag. fstrim -o $((1024*1024*144)) -l $((1024*1024*16)) ./m
[ Update function documentation for ext4_trim_all_free -- TYT ]
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/mballoc.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
fs/ext4/mballoc.c +12 -6
@@ -5238,6 +5238,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,* @start: first group block to examine * @max: last group block to examine * @minblocks: minimum extent block count +* @set_trimmed: set the trimmed flag if at least one block is trimmed * * ext4_trim_all_free walks through group's buddy bitmap searching for free * extents. When the free block is found, ext4_trim_extent is called to TRIM
@@ -5252,7 +5253,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,static ext4_grpblk_t ext4_trim_all_free (struct super_block *sb,ext4_group_t group,ext4_grpblk_t start,ext4_grpblk_t max, -ext4_grpblk_t minblocks) +ext4_grpblk_t minblocks,bool set_trimmed) {struct ext4_buddy e4b;int ret;
@@ -5271,7 +5272,7 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group,if (!EXT4_MB_GRP_WAS_TRIMMED (e4b.bd_info) || minblocks <EXT4_SB (sb)->s_last_trim_minblks) { ret =ext4_try_to_trim_range (sb, &e4b, start, max, minblocks); -if (ret >=0 ) +if (ret >=0 && set_trimmed)EXT4_MB_GRP_SET_TRIMMED (e4b.bd_info); }else { ret =0 ;
@@ -5308,6 +5309,7 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)ext4_fsblk_t first_data_blk =le32_to_cpu (EXT4_SB (sb)->s_es->s_first_data_block);ext4_fsblk_t max_blks =ext4_blocks_count (EXT4_SB (sb)->s_es); +bool whole_group, eof = false;int ret =0 ; start = range->start >> sb->s_blocksize_bits;
@@ -5326,8 +5328,10 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)if (minlen >EXT4_CLUSTERS_PER_GROUP (sb)) goto out; } -if (end >= max_blks) +if (end >= max_blks -1 ) { end = max_blks -1 ; + eof = true; + }if (end <= first_data_blk) goto out;if (start < first_data_blk)
@@ -5341,6 +5345,7 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)/* end now represents the last cluster to discard in this group */ end =EXT4_CLUSTERS_PER_GROUP (sb) -1 ; + whole_group = true;for (group = first_group; group <= last_group; group++) { grp =ext4_get_group_info (sb, group);
@@ -5357,12 +5362,13 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)* change it for the last group, note that last_cluster is * already computed earlier by ext4_get_group_no_and_offset() */ -if (group == last_group) +if (group == last_group) { end = last_cluster; - + whole_group = eof ? true : end ==EXT4_CLUSTERS_PER_GROUP (sb) -1 ; + }if (grp->bb_free >= minlen) { cnt =ext4_trim_all_free (sb, group, first_cluster, - end, minlen); + end, minlen, whole_group);if (cnt <0 ) { ret = cnt;break ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 7/91 ipv4: fix null-deref in ipv4_link_failure
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Zeng <[email protected]>
[ Upstream commit 0113d9c9d1ccc07f5a3710dac4aa24b6d711278c ]
Currently, we assume the skb is associated with a device before calling __ip_options_compile, which is not always the case if it is re-routed by ipvs.
When skb->dev is NULL, dev_net(skb->dev) will become null-dereference. This patch adds a check for the edge case and switch to use the net_device from the rtable when skb->dev is NULL.
--- net/ipv4/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/route.c +3 -1
@@ -1215,6 +1215,7 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)static void ipv4_send_dest_unreach (struct sk_buff *skb) { +struct net_device *dev;struct ip_options opt;int res;
@@ -1232,7 +1233,8 @@ static void ipv4_send_dest_unreach(struct sk_buff *skb) opt.optlen =ip_hdr (skb)->ihl *4 -sizeof (struct iphdr );rcu_read_lock (); - res =__ip_options_compile (dev_net (skb->dev), &opt, skb,NULL ); + dev = skb->dev ? skb->dev :skb_rtable (skb)->dst.dev; + res =__ip_options_compile (dev_net (dev), &opt, skb,NULL );rcu_read_unlock ();if (res)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 25/91 ext4: replace the traditional ternary conditional operator with with max()/min()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kemeng Shi <[email protected]>
[ Upstream commit de8bf0e5ee7482585450357c6d4eddec8efc5cb7 ]
Replace the traditional ternary conditional operator with with max()/min()
Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()")
--- fs/ext4/mballoc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
fs/ext4/mballoc.c +2 -4
@@ -5192,8 +5192,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,void *bitmap; bitmap = e4b->bd_bitmap; - start = (e4b->bd_info->bb_first_free > start) ? - e4b->bd_info->bb_first_free : start; + start =max (e4b->bd_info->bb_first_free, start); count =0 ; free_count =0 ;
@@ -5413,8 +5412,7 @@ ext4_mballoc_query_range(ext4_lock_group (sb, group); - start = (e4b.bd_info->bb_first_free > start) ? - e4b.bd_info->bb_first_free : start; + start =max (e4b.bd_info->bb_first_free, start);if (end >=EXT4_CLUSTERS_PER_GROUP (sb)) end =EXT4_CLUSTERS_PER_GROUP (sb) -1 ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 26/91 ext4: move setting of trimmed bit into ext4_try_to_trim_range()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit 45e4ab320c9b5fa67b1fc3b6a9b381cfcc0c8488 ]
Currently we set the group's trimmed bit in ext4_trim_all_free() based on return value of ext4_try_to_trim_range(). However when we will want to abort trimming because of suspend attempt, we want to return success from ext4_try_to_trim_range() but not set the trimmed bit. Instead implementing awkward propagation of this information, just move setting of trimmed bit into ext4_try_to_trim_range() when the whole group is trimmed.
--- fs/ext4/mballoc.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-)
fs/ext4/mballoc.c +25 -21
@@ -5184,14 +5184,27 @@ __acquires(bitlock)return ret; } +static ext4_grpblk_t ext4_last_grp_cluster (struct super_block *sb, +ext4_group_t grp) +{ +if (grp <ext4_get_groups_count (sb)) +return EXT4_CLUSTERS_PER_GROUP (sb) -1 ; +return (ext4_blocks_count (EXT4_SB (sb)->s_es) - +ext4_group_first_block_no (sb, grp) -1 ) >> +EXT4_CLUSTER_BITS (sb); +} +static int ext4_try_to_trim_range (struct super_block *sb,struct ext4_buddy *e4b,ext4_grpblk_t start,ext4_grpblk_t max,ext4_grpblk_t minblocks) {ext4_grpblk_t next, count, free_count; +bool set_trimmed = false;void *bitmap; bitmap = e4b->bd_bitmap; +if (start ==0 && max >=ext4_last_grp_cluster (sb, e4b->bd_group)) + set_trimmed = true; start =max (e4b->bd_info->bb_first_free, start); count =0 ; free_count =0 ;
@@ -5206,16 +5219,14 @@ static int ext4_try_to_trim_range(struct super_block *sb,int ret =ext4_trim_extent (sb, start, next - start, e4b);if (ret && ret != -EOPNOTSUPP ) -break ; +return count; count += next - start; } free_count += next - start; start = next +1 ; -if (fatal_signal_pending (current)) { - count = -ERESTARTSYS ; -break ; - } +if (fatal_signal_pending (current)) +return -ERESTARTSYS ;if (need_resched ()) {ext4_unlock_group (sb, e4b->bd_group);
@@ -5227,6 +5238,9 @@ static int ext4_try_to_trim_range(struct super_block *sb,break ; } +if (set_trimmed) +EXT4_MB_GRP_SET_TRIMMED (e4b->bd_info); +return count; }
@@ -5237,7 +5251,6 @@ static int ext4_try_to_trim_range(struct super_block *sb,* @start: first group block to examine * @max: last group block to examine * @minblocks: minimum extent block count -* @set_trimmed: set the trimmed flag if at least one block is trimmed * * ext4_trim_all_free walks through group's buddy bitmap searching for free * extents. When the free block is found, ext4_trim_extent is called to TRIM
@@ -5252,7 +5265,7 @@ static int ext4_try_to_trim_range(struct super_block *sb,static ext4_grpblk_t ext4_trim_all_free (struct super_block *sb,ext4_group_t group,ext4_grpblk_t start,ext4_grpblk_t max, -ext4_grpblk_t minblocks,bool set_trimmed) +ext4_grpblk_t minblocks) {struct ext4_buddy e4b;int ret;
@@ -5269,13 +5282,10 @@ ext4_trim_all_free(struct super_block *sb, ext4_group_t group,ext4_lock_group (sb, group);if (!EXT4_MB_GRP_WAS_TRIMMED (e4b.bd_info) || - minblocks <EXT4_SB (sb)->s_last_trim_minblks) { + minblocks <EXT4_SB (sb)->s_last_trim_minblks) ret =ext4_try_to_trim_range (sb, &e4b, start, max, minblocks); -if (ret >=0 && set_trimmed) -EXT4_MB_GRP_SET_TRIMMED (e4b.bd_info); - }else { +else ret =0 ; - }ext4_unlock_group (sb, group);ext4_mb_unload_buddy (&e4b);
@@ -5308,7 +5318,6 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)ext4_fsblk_t first_data_blk =le32_to_cpu (EXT4_SB (sb)->s_es->s_first_data_block);ext4_fsblk_t max_blks =ext4_blocks_count (EXT4_SB (sb)->s_es); -bool whole_group, eof = false;int ret =0 ; start = range->start >> sb->s_blocksize_bits;
@@ -5327,10 +5336,8 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)if (minlen >EXT4_CLUSTERS_PER_GROUP (sb)) goto out; } -if (end >= max_blks -1 ) { +if (end >= max_blks -1 ) end = max_blks -1 ; - eof = true; - }if (end <= first_data_blk) goto out;if (start < first_data_blk)
@@ -5344,7 +5351,6 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)/* end now represents the last cluster to discard in this group */ end =EXT4_CLUSTERS_PER_GROUP (sb) -1 ; - whole_group = true;for (group = first_group; group <= last_group; group++) { grp =ext4_get_group_info (sb, group);
@@ -5361,13 +5367,11 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range)* change it for the last group, note that last_cluster is * already computed earlier by ext4_get_group_no_and_offset() */ -if (group == last_group) { +if (group == last_group) end = last_cluster; - whole_group = eof ? true : end ==EXT4_CLUSTERS_PER_GROUP (sb) -1 ; - }if (grp->bb_free >= minlen) { cnt =ext4_trim_all_free (sb, group, first_cluster, - end, minlen, whole_group); + end, minlen);if (cnt <0 ) { ret = cnt;break ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 27/91 ext4: do not let fstrim block system suspend
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit 5229a658f6453362fbb9da6bf96872ef25a7097e ]
Len Brown has reported that system suspend sometimes fail due to inability to freeze a task working in ext4_trim_fs() for one minute. Trimming a large filesystem on a disk that slowly processes discard requests can indeed take a long time. Since discard is just an advisory call, it is perfectly fine to interrupt it at any time and the return number of discarded blocks until that moment. Do that when we detect the task is being frozen.
References: https://bugzilla.kernel.org/show_bug.cgi?id=216322
--- fs/ext4/mballoc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
fs/ext4/mballoc.c +10 -2
@@ -16,6 +16,7 @@#include <linux/slab.h> #include <linux/nospec.h> #include <linux/backing-dev.h> +#include <linux/freezer.h> #include <trace/events/ext4.h> #ifdef CONFIG_EXT4_DEBUG
@@ -5194,6 +5195,11 @@ static ext4_grpblk_t ext4_last_grp_cluster(struct super_block *sb,EXT4_CLUSTER_BITS (sb); } +static bool ext4_trim_interrupted (void ) +{ +return fatal_signal_pending (current) ||freezing (current); +} +static int ext4_try_to_trim_range (struct super_block *sb,struct ext4_buddy *e4b,ext4_grpblk_t start,ext4_grpblk_t max,ext4_grpblk_t minblocks)
@@ -5225,8 +5231,8 @@ static int ext4_try_to_trim_range(struct super_block *sb, free_count += next - start; start = next +1 ; -if (fatal_signal_pending (current)) -return -ERESTARTSYS ; +if (ext4_trim_interrupted ()) +return count;if (need_resched ()) {ext4_unlock_group (sb, e4b->bd_group);
@@ -5353,6 +5359,8 @@ int ext4_trim_fs(struct super_block *sb, struct fstrim_range *range) end =EXT4_CLUSTERS_PER_GROUP (sb) -1 ;for (group = first_group; group <= last_group; group++) { +if (ext4_trim_interrupted ()) +break ; grp =ext4_get_group_info (sb, group);/* We only do this if the grp has never been initialized */ if (unlikely (EXT4_MB_GRP_NEED_INIT (grp))) {
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 28/91 MIPS: Alchemy: only build mmc support helpers if au1xmmc is enabled
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
[ Upstream commit ef8f8f04a0b25e8f294b24350e8463a8d6a9ba0b ]
While commit d4a5c59a955b ("mmc: au1xmmc: force non-modular build and remove symbol_get usage") to be built in, it can still build a kernel without MMC support and thuse no mmc_detect_change symbol at all.
Add ifdefs to build the mmc support code in the alchemy arch code conditional on mmc support.
--- arch/mips/alchemy/devboards/db1000.c | 4 ++++ arch/mips/alchemy/devboards/db1200.c | 6 ++++++ arch/mips/alchemy/devboards/db1300.c | 4 ++++ 3 files changed, 14 insertions(+)
arch/mips/alchemy/devboards/db1000.c +4 -0
@@ -173,6 +173,7 @@ static struct platform_device db1x00_audio_dev = {/******************************************************************************/ +#ifdef CONFIG_MMC_AU1X static irqreturn_t db1100_mmc_cd (int irq,void *ptr) {mmc_detect_change (ptr,msecs_to_jiffies (500 ));
@@ -380,6 +381,7 @@ static struct platform_device db1100_mmc1_dev = { .num_resources = ARRAY_SIZE(au1100_mmc1_res), .resource = au1100_mmc1_res, }; +#endif /* CONFIG_MMC_AU1X */ /******************************************************************************/
@@ -497,9 +499,11 @@ static struct platform_device *db1000_devs[] = {static struct platform_device *db1100_devs[] = { &au1100_lcd_device, +#ifdef CONFIG_MMC_AU1X &db1100_mmc0_dev, &db1100_mmc1_dev, &db1000_irda_dev, +#endif };int __init db1000_dev_setup (void )
arch/mips/alchemy/devboards/db1200.c +6 -0
@@ -341,6 +341,7 @@ static struct platform_device db1200_ide_dev = {/**********************************************************************/ +#ifdef CONFIG_MMC_AU1X /* SD carddetects: they're supposed to be edge-triggered, but ack * doesn't seem to work (CPLD Rev 2). Instead, the screaming one * is disabled and its counterpart enabled. The 200ms timeout is
@@ -601,6 +602,7 @@ static struct platform_device pb1200_mmc1_dev = { .num_resources = ARRAY_SIZE(au1200_mmc1_res), .resource = au1200_mmc1_res, }; +#endif /* CONFIG_MMC_AU1X */ /**********************************************************************/
@@ -768,7 +770,9 @@ static struct platform_device db1200_audiodma_dev = {static struct platform_device *db1200_devs[]__initdata = {NULL ,/* PSC0, selected by S6.8 */ &db1200_ide_dev, +#ifdef CONFIG_MMC_AU1X &db1200_mmc0_dev, +#endif &au1200_lcd_dev, &db1200_eth_dev, &db1200_nand_dev,
@@ -779,7 +783,9 @@ static struct platform_device *db1200_devs[] __initdata = { };static struct platform_device *pb1200_devs[]__initdata = { +#ifdef CONFIG_MMC_AU1X &pb1200_mmc1_dev, +#endif };/* Some peripheral base addresses differ on the PB1200 */
arch/mips/alchemy/devboards/db1300.c +4 -0
@@ -448,6 +448,7 @@ static struct platform_device db1300_ide_dev = {/**********************************************************************/ +#ifdef CONFIG_MMC_AU1X static irqreturn_t db1300_mmc_cd (int irq,void *ptr) {disable_irq_nosync (irq);
@@ -626,6 +627,7 @@ static struct platform_device db1300_sd0_dev = { .resource = au1300_sd0_res, .num_resources = ARRAY_SIZE(au1300_sd0_res), }; +#endif /* CONFIG_MMC_AU1X */ /**********************************************************************/
@@ -756,8 +758,10 @@ static struct platform_device *db1300_dev[] __initdata = { &db1300_5waysw_dev, &db1300_nand_dev, &db1300_ide_dev, +#ifdef CONFIG_MMC_AU1X &db1300_sd0_dev, &db1300_sd1_dev, +#endif &db1300_lcd_dev, &db1300_ac97_dev, &db1300_i2s_dev,
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 29/91 clk: tegra: fix error return case for recalc_rate
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Timo Alho <[email protected]>
[ Upstream commit a47b44fbb13f5e7a981b4515dcddc93a321ae89c ]
tegra-bpmp clocks driver makes implicit conversion of signed error code to unsigned value in recalc_rate operation. The behavior for recalc_rate, according to it's specification, should be that "If the driver cannot figure out a rate for this clock, it must return 0."
--- drivers/clk/tegra/clk-bpmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/tegra/clk-bpmp.c +1 -1
@@ -162,7 +162,7 @@ static unsigned long tegra_bpmp_clk_recalc_rate(struct clk_hw *hw, err =tegra_bpmp_clk_transfer (clk->bpmp, &msg);if (err <0 ) -return err; +return 0 ;return response.rate; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 30/91 ARM: dts: ti: omap: motorola-mapphone: Fix abe_clkctrl warning on boot
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit ac08bda1569b06b7a62c7b4dd00d4c3b28ceaaec ]
Commit 0840242e8875 ("ARM: dts: Configure clock parent for pwm vibra") attempted to fix the PWM settings but ended up causin an additional clock reparenting error:
clk: failed to reparent abe-clkctrl:0060:24 to sys_clkin_ck: -22
Only timer9 is in the PER domain and can use the sys_clkin_ck clock source. For timer8, the there is no sys_clkin_ck available as it's in the ABE domain, instead it should use syc_clk_div_ck. However, for power management, we want to use the always on sys_32k_ck instead.
Depends-on: 61978617e905 ("ARM: dts: Add minimal support for Droid Bionic xt875")
--- arch/arm/boot/dts/omap4-droid4-xt894.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/omap4-droid4-xt894.dts +2 -2
@@ -647,12 +647,12 @@ /* Configure pwm clock source for timers 8 & 9 */ &timer8 { assigned-clocks = <&abe_clkctrl OMAP4_TIMER8_CLKCTRL 24>; - assigned-clock-parents = <&sys_clkin_ck>; + assigned-clock-parents = <&sys_32k_ck>; }; &timer9 { assigned-clocks = <&l4_per_clkctrl OMAP4_TIMER9_CLKCTRL 24>; - assigned-clock-parents = <&sys_clkin_ck>; + assigned-clock-parents = <&sys_32k_ck>; }; /*
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 31/91 gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenhua Lin <[email protected]>
[ Upstream commit 26d9e5640d2130ee16df7b1fb6a908f460ab004c ]
The drivers uses a mutex and I2C bus access in its PMIC EIC chip get implementation. This means these functions can sleep and the PMIC EIC chip should set the can_sleep property to true.
This will ensure that a warning is printed when trying to get the value from a context that potentially can't sleep.
--- drivers/gpio/gpio-pmic-eic-sprd.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-pmic-eic-sprd.c +1 -0
@@ -341,6 +341,7 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev) pmic_eic->chip.set_config = sprd_pmic_eic_set_config; pmic_eic->chip.set = sprd_pmic_eic_set; pmic_eic->chip.get = sprd_pmic_eic_get; + pmic_eic->chip.can_sleep = true; pmic_eic->intc.name =dev_name (&pdev->dev); pmic_eic->intc.irq_mask = sprd_pmic_eic_irq_mask;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 32/91 parisc: sba: Fix compile warning wrt list of SBA devices
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
[ Upstream commit eb3255ee8f6f4691471a28fbf22db5e8901116cd ]
Fix this makecheck warning:drivers/parisc/sba_iommu.c:98:19: warning: symbol 'sba_list'
was not declared. Should it be static?
--- arch/parisc/include/asm/ropes.h | 3 +++ drivers/char/agp/parisc-agp.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/parisc/include/asm/ropes.h +3 -0
@@ -86,6 +86,9 @@ struct sba_device {struct ioc ioc[MAX_IOC ]; }; +/* list of SBA's in system, see drivers/parisc/sba_iommu.c */ +extern struct sba_device *sba_list; +#define ASTRO_RUNWAY_PORT 0x582#define IKE_MERCED_PORT 0x803#define REO_MERCED_PORT 0x804
drivers/char/agp/parisc-agp.c +0 -2
@@ -385,8 +385,6 @@ find_quicksilver(struct device *dev, void *data)static int __init parisc_agp_init (void ) { -extern struct sba_device *sba_list; -int err =-1 ;struct parisc_device *sba =NULL , *lba =NULL ;struct lba_device *lbadev =NULL ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 33/91 parisc: iosapic.c: Fix sparse warnings
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
[ Upstream commit 927c6c8aa27c284a799b8c18784e37d3373af908 ]
--- drivers/parisc/iosapic.c | 4 ++-- drivers/parisc/iosapic_private.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/parisc/iosapic.c +2 -2
@@ -216,9 +216,9 @@ static inline void iosapic_write(void __iomem *iosapic, unsigned int reg, u32 vastatic DEFINE_SPINLOCK (iosapic_lock); -static inline void iosapic_eoi (void __iomem *addr,unsigned int data) +static inline void iosapic_eoi (__le32 __iomem *addr,__le32 data) { -__raw_writel (data, addr); +__raw_writel ((__force u32 )data, addr); }/*
drivers/parisc/iosapic_private.h +2 -2
@@ -132,8 +132,8 @@ struct iosapic_irt {struct vector_info {struct iosapic_info *iosapic;/* I/O SAPIC this vector is on */ struct irt_entry *irte;/* IRT entry */ -u32 __iomem *eoi_addr;/* precalculate EOI reg address */ -u32 eoi_data;/* IA64: ? PA: swapped txn_data */ +__le32 __iomem *eoi_addr;/* precalculate EOI reg address */ +__le32 eoi_data;/* IA64: ? PA: swapped txn_data */ int txn_irq;/* virtual IRQ number for processor */ ulong txn_addr;/* IA64: id_eid PA: partial HPA */ u32 txn_data;/* CPU interrupt bit */
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 34/91 parisc: drivers: Fix sparse warning
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
[ Upstream commit b137b9d60b8add5620a06c687a71ce18776730b0 ]
Fix "warning: directive in macro's argument list" warning.
--- arch/parisc/kernel/drivers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/drivers.c +1 -1
@@ -903,9 +903,9 @@ static __init void qemu_header(void)pr_info ("#define PARISC_MODEL \"%s\"\n\n" , boot_cpu_data.pdc.sys_model_name); +#define p ((unsigned long *)&boot_cpu_data.pdc.model)pr_info ("#define PARISC_PDC_MODEL 0x%lx, 0x%lx, 0x%lx, " "0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx\n\n" , - #define p ((unsigned long *)&boot_cpu_data.pdc.model) p[0 ], p[1 ], p[2 ], p[3 ], p[4 ], p[5 ], p[6 ], p[7 ], p[8 ]);#undef p
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 8/91 powerpc/perf/hv-24x7: Update domain value check
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kajol Jain <[email protected]>
[ Upstream commit 4ff3ba4db5943cac1045e3e4a3c0463ea10f6930 ]
Valid domain value is in range 1 to HV_PERF_DOMAIN_MAX. Current code has check for domain value greater than or equal to HV_PERF_DOMAIN_MAX. But the check for domain value 0 is missing.
Fix this issue by adding check for domain value 0.
Before:
# ./perf stat -v -e hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ sleep 1 Using CPUID 00800200 Control descriptor is not initialized Error: The sys_perf_event_open() syscall returned with 5 (Input/output error) for event (hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/). /bin/dmesg | grep -i perf may provide additional information.
Result from dmesg:
[ 37.819387] hv-24x7: hcall failed: [0 0x60040000 0x100 0] => ret 0xfffffffffffffffc (-4) detail=0x2000000 failing ix=0
After:
# ./perf stat -v -e hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ sleep 1 Using CPUID 00800200 Control descriptor is not initialized Warning: hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/ event is not supported by the kernel. failed to read counter hv_24x7/CPM_ADJUNCT_INST,domain=0,core=1/
--- arch/powerpc/perf/hv-24x7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/perf/hv-24x7.c +1 -1
@@ -1326,7 +1326,7 @@ static int h_24x7_event_init(struct perf_event *event) } domain =event_get_domain (event); -if (domain >=HV_PERF_DOMAIN_MAX ) { +if (domain ==0 || domain >=HV_PERF_DOMAIN_MAX ) {pr_devel ("invalid domain %d\n" , domain);return -EINVAL ; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 9/91 net: hns3: add 5ms delay before clear firmware reset irq source
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jie Wang <[email protected]>
[ Upstream commit 0770063096d5da4a8e467b6e73c1646a75589628 ]
Currently the reset process in hns3 and firmware watchdog init process is asynchronous. we think firmware watchdog initialization is completed before hns3 clear the firmware interrupt source. However, firmware initialization may not complete early.
so we add delay before hns3 clear firmware interrupt source and 5 ms delay is enough to avoid second firmware reset interrupt.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +5 -0
@@ -2517,8 +2517,13 @@ static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval)static void hclge_clear_event_cause (struct hclge_dev *hdev,u32 event_type,u32 regclr) { +#define HCLGE_IMP_RESET_DELAY 5 +switch (event_type) {case HCLGE_VECTOR0_EVENT_RST : +if (regclr ==BIT (HCLGE_VECTOR0_IMPRESET_INT_B )) +mdelay (HCLGE_IMP_RESET_DELAY ); +hclge_write_dev (&hdev->hw,HCLGE_MISC_RESET_STS_REG , regclr);break ;case HCLGE_VECTOR0_EVENT_MBX :
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 10/91 net: add atomic_long_t to net_device_stats fields
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 6c1c5097781f563b70a81683ea6fdac21637573b ]
Long standing KCSAN issues are caused by data-race around some dev->stats changes.
Most performance critical paths already use per-cpu variables, or per-queue ones.
It is reasonable (and more correct) to use atomic operations for the slow paths.
This patch adds an union for each field of net_device_stats, so that we can convert paths that are not yet protected by a spinlock or a mutex.
netdev_stats_to_stats64() no longer has an #if BITS_PER_LONG==64
Note that the memcpy() we were using on 64bit arches had no provision to avoid load-tearing,
while atomic_long_read() is providing the needed protection at no cost.
Stable-dep-of: 44bdb313da57 ("net: bridge: use DEV_STATS_INC()")
--- include/linux/netdevice.h | 58 +++++++++++++++++++++++---------------- include/net/dst.h | 5 ++-- net/core/dev.c | 14 ++-------- 3 files changed, 40 insertions(+), 37 deletions(-)
include/linux/netdevice.h +35 -23
@@ -162,31 +162,38 @@ static inline bool dev_xmit_complete(int rc)* (unsigned long) so they can be read and written atomically. */ +#define NET_DEV_STAT (FIELD ) \ + union { \ + unsigned long FIELD; \ + atomic_long_t __##FIELD; \ + } +struct net_device_stats { -unsigned long rx_packets; -unsigned long tx_packets; -unsigned long rx_bytes; -unsigned long tx_bytes; -unsigned long rx_errors; -unsigned long tx_errors; -unsigned long rx_dropped; -unsigned long tx_dropped; -unsigned long multicast; -unsigned long collisions; -unsigned long rx_length_errors; -unsigned long rx_over_errors; -unsigned long rx_crc_errors; -unsigned long rx_frame_errors; -unsigned long rx_fifo_errors; -unsigned long rx_missed_errors; -unsigned long tx_aborted_errors; -unsigned long tx_carrier_errors; -unsigned long tx_fifo_errors; -unsigned long tx_heartbeat_errors; -unsigned long tx_window_errors; -unsigned long rx_compressed; -unsigned long tx_compressed; +NET_DEV_STAT (rx_packets); +NET_DEV_STAT (tx_packets); +NET_DEV_STAT (rx_bytes); +NET_DEV_STAT (tx_bytes); +NET_DEV_STAT (rx_errors); +NET_DEV_STAT (tx_errors); +NET_DEV_STAT (rx_dropped); +NET_DEV_STAT (tx_dropped); +NET_DEV_STAT (multicast); +NET_DEV_STAT (collisions); +NET_DEV_STAT (rx_length_errors); +NET_DEV_STAT (rx_over_errors); +NET_DEV_STAT (rx_crc_errors); +NET_DEV_STAT (rx_frame_errors); +NET_DEV_STAT (rx_fifo_errors); +NET_DEV_STAT (rx_missed_errors); +NET_DEV_STAT (tx_aborted_errors); +NET_DEV_STAT (tx_carrier_errors); +NET_DEV_STAT (tx_fifo_errors); +NET_DEV_STAT (tx_heartbeat_errors); +NET_DEV_STAT (tx_window_errors); +NET_DEV_STAT (rx_compressed); +NET_DEV_STAT (tx_compressed); }; +#undef NET_DEV_STAT#include <linux/cache.h>
@@ -4842,4 +4849,9 @@ do { \#define PTYPE_HASH_SIZE (16)#define PTYPE_HASH_MASK (PTYPE_HASH_SIZE - 1) +/* Note: Avoid these macros in fast path, prefer per-cpu or per-queue counters. */ +#define DEV_STATS_INC (DEV ,FIELD ) atomic_long_inc(&(DEV)->stats.__##FIELD) +#define DEV_STATS_ADD (DEV ,FIELD ,VAL ) \ + atomic_long_add((VAL), &(DEV)->stats.__##FIELD) +#endif /* _LINUX_NETDEVICE_H */
include/net/dst.h +2 -3
@@ -362,9 +362,8 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,static inline void skb_tunnel_rx (struct sk_buff *skb,struct net_device *dev,struct net *net) { -/* TODO : stats should be SMP safe */ - dev->stats.rx_packets++; - dev->stats.rx_bytes += skb->len; +DEV_STATS_INC (dev, rx_packets); +DEV_STATS_ADD (dev, rx_bytes, skb->len);__skb_tunnel_rx (skb, dev, net); }
net/core/dev.c +3 -11
@@ -9035,24 +9035,16 @@ void netdev_run_todo(void)void netdev_stats_to_stats64 (struct rtnl_link_stats64 *stats64,const struct net_device_stats *netdev_stats) { -#if BITS_PER_LONG ==64 -BUILD_BUG_ON (sizeof (*stats64) <sizeof (*netdev_stats)); -memcpy (stats64, netdev_stats,sizeof (*netdev_stats)); -/* zero out counters that only exist in rtnl_link_stats64 */ -memset ((char *)stats64 +sizeof (*netdev_stats),0 , -sizeof (*stats64) -sizeof (*netdev_stats)); -#else -size_t i, n =sizeof (*netdev_stats) /sizeof (unsigned long ); -const unsigned long *src = (const unsigned long *)netdev_stats; +size_t i, n =sizeof (*netdev_stats) /sizeof (atomic_long_t); +const atomic_long_t *src = (atomic_long_t *)netdev_stats;u64 *dst = (u64 *)stats64;BUILD_BUG_ON (n >sizeof (*stats64) /sizeof (u64));for (i =0 ; i < n; i++) - dst[i] = src[i]; + dst[i] =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)); -#endif }EXPORT_SYMBOL (netdev_stats_to_stats64);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 12/91 team: fix null-ptr-deref when team device type is changed
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ziyang Xuan <[email protected]>
[ Upstream commit 492032760127251e5540a5716a70996bacf2a3fd ]
Get a null-ptr-deref bug as follows with reproducer [1].
BUG: kernel NULL pointer dereference, address: 0000000000000228 ... RIP: 0010:vlan_dev_hard_header+0x35/0x140 [8021q] ... Call Trace: <TASK> ? __die+0x24/0x70 ? page_fault_oops+0x82/0x150 ? exc_page_fault+0x69/0x150 ? asm_exc_page_fault+0x26/0x30 ? vlan_dev_hard_header+0x35/0x140 [8021q] ? vlan_dev_hard_header+0x8e/0x140 [8021q] neigh_connected_output+0xb2/0x100 ip6_finish_output2+0x1cb/0x520 ? nf_hook_slow+0x43/0xc0 ? ip6_mtu+0x46/0x80 ip6_finish_output+0x2a/0xb0 mld_sendpack+0x18f/0x250 mld_ifc_work+0x39/0x160 process_one_work+0x1e6/0x3f0 worker_thread+0x4d/0x2f0 ? __pfx_worker_thread+0x10/0x10 kthread+0xe5/0x120 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30
[1]
$ teamd -t team0 -d -c '{"runner": {"name": "loadbalance"}}'
$ ip link add name t-dummy type dummy
$ ip link add link t-dummy name t-dummy.100 type vlan id 100
$ ip link add name t-nlmon type nlmon
$ ip link set t-nlmon master team0
$ ip link set t-nlmon nomaster
$ ip link set t-dummy up
$ ip link set team0 up
$ ip link set t-dummy.100 down
$ ip link set t-dummy.100 master team0When enslave a vlan device to team device and team device type is changed from non-ether to ether, header_ops of team device is changed to vlan_header_ops. That is incorrect and will trigger null-ptr-deref for vlan->real_dev in vlan_dev_hard_header() because team device is not a vlan device.
Cache eth_header_ops in team_setup(), then assign cached header_ops to header_ops of team net device when its type is changed from non-ether to ether to fix the bug.
--- drivers/net/team/team.c | 10 +++++++++- include/linux/if_team.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-)
drivers/net/team/team.c +9 -1
@@ -2095,7 +2095,12 @@ static const struct ethtool_ops team_ethtool_ops = {static void team_setup_by_port (struct net_device *dev,struct net_device *port_dev) { - dev->header_ops = port_dev->header_ops; +struct team *team =netdev_priv (dev); + +if (port_dev->type ==ARPHRD_ETHER ) + dev->header_ops = team->header_ops_cache; +else + dev->header_ops = port_dev->header_ops; dev->type = port_dev->type; dev->hard_header_len = port_dev->hard_header_len; dev->needed_headroom = port_dev->needed_headroom;
@@ -2142,8 +2147,11 @@ static int team_dev_type_check_change(struct net_device *dev,static void team_setup (struct net_device *dev) { +struct team *team =netdev_priv (dev); +ether_setup (dev); dev->max_mtu =ETH_MAX_MTU ; + team->header_ops_cache = dev->header_ops; dev->netdev_ops = &team_netdev_ops; dev->ethtool_ops = &team_ethtool_ops;
include/linux/if_team.h +2 -0
@@ -196,6 +196,8 @@ struct team {struct net_device *dev;/* associated netdevice */ struct team_pcpu_stats __percpu *pcpu_stats; +const struct header_ops *header_ops_cache; +struct mutex lock;/* used for overall locking, e.g. port lists write */ /*
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 13/91 gpio: tb10x: Fix an error handling path in tb10x_gpio_probe()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit b547b5e52a0587e6b25ea520bf2f9e03d00cbcb6 ]
If an error occurs after a successful irq_domain_add_linear() call, it should be undone by a corresponding irq_domain_remove(), as already done in the remove function.
--- drivers/gpio/gpio-tb10x.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpio/gpio-tb10x.c +5 -1
@@ -246,7 +246,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev) handle_edge_irq,IRQ_NOREQUEST ,IRQ_NOPROBE , IRQ_GC_INIT_MASK_CACHE);if (ret) -return ret; + goto err_remove_domain; gc = tb10x_gpio->domain->gc->gc[0 ]; gc->reg_base = tb10x_gpio->base;
@@ -260,6 +260,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev) }return 0 ; + +err_remove_domain: +irq_domain_remove (tb10x_gpio->domain); +return ret; }static int tb10x_gpio_remove (struct platform_device *pdev)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 14/91 i2c: mux: demux-pinctrl: check the return value of devm_kstrdup()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiaoke Wang <[email protected]>
[ Upstream commit 7c0195fa9a9e263df204963f88a22b21688ffb66 ]
devm_kstrdup() returns pointer to allocated string on success, NULL on failure. So it is better to check the return value of it.
--- drivers/i2c/muxes/i2c-demux-pinctrl.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/i2c/muxes/i2c-demux-pinctrl.c +4 -0
@@ -244,6 +244,10 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev) props[i].name =devm_kstrdup (&pdev->dev,"status" ,GFP_KERNEL ); props[i].value =devm_kstrdup (&pdev->dev,"ok" ,GFP_KERNEL ); +if (!props[i].name || !props[i].value) { + err = -ENOMEM ; + goto err_rollback; + } props[i].length =3 ;of_changeset_init (&priv->chan[i].chgset);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 5/91 selftests/tls: Add {} to avoid static checker warning
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit f50688b47c5858d2ff315d020332bf4cb6710837 ]
This silences a static checker warning due to the unusual macro construction of EXPECT_*() by adding explicit {}s around the enclosing while loop.
Stable-dep-of: c326ca98446e ("selftests: tls: swap the TX and RX sockets in some tests")
--- tools/testing/selftests/net/tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/net/tls.c +2 -1
@@ -202,8 +202,9 @@ TEST_F(tls, sendmsg_large)EXPECT_EQ (sendmsg (self->cfd, &msg,0 ), send_len); } -while (recvs++ < sends) +while (recvs++ < sends) {EXPECT_NE (recv (self->fd, mem, send_len,0 ),-1 ); + }free (mem); }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 36/91 selftests/ftrace: Correctly enable event in instance-event.tc
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit f4e4ada586995b17f828c6d147d1800eb1471450 ]
Function instance_set() expects to enable event 'sched_switch', so we should set 1 to its 'enable' file.
Testcase passed after this patch:
# ./ftracetest test.d/instances/instance-event.tc === Ftrace unit tests === [1] Test creation and deletion of trace instances while setting an event [PASS]
# of passed: 1 # of failed: 0 # of unresolved: 0 # of untested: 0 # of unsupported: 0 # of xfailed: 0 # of undefined(test bug): 0
--- .../testing/selftests/ftrace/test.d/instances/instance-event.tc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/instances/instance-event.tc +1 -1
@@ -43,7 +43,7 @@ instance_read() { instance_set() { while :; do - echo 1 > foo/events/sched/sched_switch + echo 1 > foo/events/sched/sched_switch/enable done 2> /dev/null }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 45/91 scsi: megaraid_sas: Enable msix_load_balance for Invader and later controllers
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shivasharan S <[email protected]>
[ Upstream commit 1175b88452cad208894412b955ee698934968aed ]
Load balancing IO completions across all available MSI-X vectors should be enabled for Invader and later generation controllers only. This needs to be disabled for older controllers. Add an adapter type check before setting msix_load_balance flag.
--- drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_base.c +2 -1
@@ -5364,7 +5364,8 @@ static int megasas_init_fw(struct megasas_instance *instance) instance->is_rdpq = (scratch_pad_2 &MR_RDPQ_MODE_OFFSET ) ?1 :0 ; -if (!instance->msix_combined) { +if (instance->adapter_type >=INVADER_SERIES && + !instance->msix_combined) { instance->msix_load_balance = true; instance->smp_affinity_enable = false; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 46/91 Smack:- Use overlay inode label in smack_inode_copy_up()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vishal Goel <[email protected]>
commit 387ef964460f14fe1c1ea29aba70e22731ea7cf7 upstream.
Currently in "smack_inode_copy_up()" function, process label is changed with the label on parent inode. Due to which, process is assigned directory label and whatever file or directory created by the process are also getting directory label which is wrong label.
Changes has been done to use label of overlay inode instead of parent inode.
--- security/smack/smack_lsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/smack/smack_lsm.c +1 -1
@@ -4612,7 +4612,7 @@ static int smack_inode_copy_up(struct dentry *dentry, struct cred **new)/* * Get label from overlay inode and set it in create_sid */ - isp =d_inode (dentry->d_parent)->i_security; + isp =d_inode (dentry)->i_security; skp = isp->smk_inode; tsp->smk_task = skp; *new = new_creds;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 47/91 smack: Retrieve transmuting information in smack_inode_getsecurity()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roberto Sassu <[email protected]>
commit 3a3d8fce31a49363cc31880dce5e3b0617c9c38b upstream.
Enhance smack_inode_getsecurity() to retrieve the value for SMACK64TRANSMUTE from the inode security blob, similarly to SMACK64.
This helps to display accurate values in the situation where the security labels come from mount options and not from xattrs.
--- security/smack/smack_lsm.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
security/smack/smack_lsm.c +18 -4
@@ -1490,10 +1490,19 @@ static int smack_inode_getsecurity(struct inode *inode,struct super_block *sbp;struct inode *ip = (struct inode *)inode;struct smack_known *isp; +struct inode_smack *ispp; +size_t label_len; +char *label =NULL ; -if (strcmp (name,XATTR_SMACK_SUFFIX ) ==0 ) +if (strcmp (name,XATTR_SMACK_SUFFIX ) ==0 ) { isp =smk_of_inode (inode); -else { + }else if (strcmp (name,XATTR_SMACK_TRANSMUTE ) ==0 ) { + ispp = inode->i_security; +if (ispp->smk_flags &SMK_INODE_TRANSMUTE ) + label =TRANS_TRUE ; +else + label ="" ; + }else {/* * The rest of the Smack xattrs are only on sockets. */
@@ -1515,13 +1524,18 @@ static int smack_inode_getsecurity(struct inode *inode,return -EOPNOTSUPP ; } +if (!label) + label = isp->smk_known; + + label_len =strlen (label); +if (alloc) { - *buffer =kstrdup (isp->smk_known,GFP_KERNEL ); + *buffer =kstrdup (label,GFP_KERNEL );if (*buffer ==NULL )return -ENOMEM ; } -return strlen (isp->smk_known); +return label_len; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 48/91 smack: Record transmuting in smk_transmuted
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roberto Sassu <[email protected]>
commit 2c085f3a8f23c9b444e8b99d93c15d7ce870fc4e upstream.
smack_dentry_create_files_as() determines whether transmuting should occur based on the label of the parent directory the new inode will be added to, and not the label of the directory where it is created.
This helps for example to do transmuting on overlayfs, since the latter first creates the inode in the working directory, and then moves it to the correct destination.
However, despite smack_dentry_create_files_as() provides the correct label, smack_inode_init_security() does not know from passed information whether or not transmuting occurred. Without this information, smack_inode_init_security() cannot set SMK_INODE_CHANGED in smk_flags, which will result in the SMACK64TRANSMUTE xattr not being set in smack_d_instantiate().
Thus, add the smk_transmuted field to the task_smack structure, and set it in smack_dentry_create_files_as() to smk_task if transmuting occurred. If smk_task is equal to smk_transmuted in smack_inode_init_security(), act as if transmuting was successful but without taking the label from the parent directory (the inode label was already set correctly from the current credentials in smack_inode_alloc_security()).
--- security/smack/smack.h | 1 + security/smack/smack_lsm.c | 41 +++++++++++++++++++++++++++----------- 2 files changed, 30 insertions(+), 12 deletions(-)
security/smack/smack.h +1 -0
@@ -120,6 +120,7 @@ struct inode_smack {struct task_smack {struct smack_known *smk_task;/* label for access control */ struct smack_known *smk_forked;/* label when forked */ +struct smack_known *smk_transmuted;/* label when transmuted */ struct list_head smk_rules;/* per task access rules */ struct mutex smk_rules_lock;/* lock for the rules */ struct list_head smk_relabel;/* transit allowed labels */
security/smack/smack_lsm.c +29 -12
65 lines not on this page · raw message
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 49/91 serial: 8250_port: Check IRQ data before use
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
commit cce7fc8b29961b64fadb1ce398dc5ff32a79643b upstream.
In case the leaf driver wants to use IRQ polling (irq = 0) and IIR register shows that an interrupt happened in the 8250 hardware the IRQ data can be NULL. In such a case we need to skip the wake event as we came to this path from the timer interrupt and quite likely system is already awake.
Without this fix we have got an Oops:
serial8250: ttyS0 at I/O 0x3f8 (irq = 0, base_baud = 115200) is a 16550A
...
BUG: kernel NULL pointer dereference, address: 0000000000000010
RIP: 0010:serial8250_handle_irq+0x7c/0x240
Call Trace:
? serial8250_handle_irq+0x7c/0x240
? __pfx_serial8250_timeout+0x10/0x10--- drivers/tty/serial/8250/8250_port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +4 -1
@@ -1910,7 +1910,10 @@ int serial8250_handle_irq(struct uart_po skip_rx = true;if (status & (UART_LSR_DR |UART_LSR_BI ) && !skip_rx) { -if (irqd_is_wakeup_set (irq_get_irq_data (port->irq))) +struct irq_data *d; + + d =irq_get_irq_data (port->irq); +if (d &&irqd_is_wakeup_set (d))pm_wakeup_event (tport->tty->dev,0 );if (!up->dma ||handle_rx_dma (up, iir)) status =serial8250_rx_chars (up, status);
Greg Kroah-Hartman
maintainerPATCH 50/91 nilfs2: fix potential use after free in nilfs_gccache_submit_read_data()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pan Bian <[email protected]>
commit 7ee29facd8a9c5a26079148e36bcf07141b3a6bc upstream.
In nilfs_gccache_submit_read_data(), brelse(bh) is called to drop the reference count of bh when the call to nilfs_dat_translate() fails. If the reference count hits 0 and its owner page gets unlocked, bh may be freed. However, bh->b_page is dereferenced to put the page after that, which may result in a use-after-free bug. This patch moves the release operation after unlocking and putting the page.
NOTE: The function in question is only called in GC, and in combination with current userland tools, address translation using DAT does not occur in that function, so the code path that causes this issue will not be executed. However, it is possible to run that code path by intentionally modifying the userland GC library or by calling the GC ioctl directly.
--- fs/nilfs2/gcinode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/nilfs2/gcinode.c +3 -3
@@ -73,10 +73,8 @@ int nilfs_gccache_submit_read_data(strucstruct the_nilfs *nilfs = inode->i_sb->s_fs_info; err =nilfs_dat_translate (nilfs->ns_dat, vbn, &pbn); -if (unlikely (err)) {/* -EIO, -ENOMEM, -ENOENT */ -brelse (bh); +if (unlikely (err))/* -EIO, -ENOMEM, -ENOENT */ goto failed; - } }lock_buffer (bh);
@@ -102,6 +100,8 @@ int nilfs_gccache_submit_read_data(struc failed:unlock_page (bh->b_page);put_page (bh->b_page); +if (unlikely (err)) +brelse (bh);return err; }
Greg Kroah-Hartman
maintainerPATCH 51/91 ALSA: hda: Disable power save for solving pop issue on Lenovo ThinkCentre M70q
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kailang Yang <[email protected]>
commit 057a28ef93bdbe84326d34cdb5543afdaab49fe1 upstream.
Lenovo ThinkCentre M70q had boot up pop noise.
Disable power save will solve pop issue.
--- sound/pci/hda/hda_intel.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/hda_intel.c +1 -0
@@ -2364,6 +2364,7 @@ static struct snd_pci_quirk power_save_bSND_PCI_QUIRK (0x8086 ,0x2068 ,"Intel NUC7i3BNB" ,0 ),/* https://bugzilla.kernel.org/show_bug.cgi?id=198611 */ SND_PCI_QUIRK (0x17aa ,0x2227 ,"Lenovo X1 Carbon 3rd Gen" ,0 ), +SND_PCI_QUIRK (0x17aa ,0x316e ,"Lenovo ThinkCentre M70q" ,0 ),/* https://bugzilla.redhat.com/show_bug.cgi?id=1689623 */ SND_PCI_QUIRK(0x17aa, 0x367b, "Lenovo IdeaCentre B550", 0),/* https://bugzilla.redhat.com/show_bug.cgi?id=1572975 */
Greg Kroah-Hartman
maintainerPATCH 52/91 ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
commit 3ef600923521616ebe192c893468ad0424de2afb upstream.
For REPORT SUPPORTED OPERATION CODES command, the service action field is defined as bits 0-4 in the second byte in the CDB. Bits 5-7 in the second byte are reserved.
Only look at the service action field in the second byte when determining if the MAINTENANCE IN opcode is a REPORT SUPPORTED OPERATION CODES command.
This matches how we only look at the service action field in the second byte when determining if the SERVICE ACTION IN(16) opcode is a READ CAPACITY(16) command (reserved bits 5-7 in the second byte are ignored).
--- drivers/ata/libata-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-scsi.c +1 -1
@@ -4561,7 +4561,7 @@ void ata_scsi_simulate(struct ata_devicebreak ;case MAINTENANCE_IN : -if (scsicmd[1 ] ==MI_REPORT_SUPPORTED_OPERATION_CODES ) +if ((scsicmd[1 ] &0x1f ) ==MI_REPORT_SUPPORTED_OPERATION_CODES )ata_scsi_rbuf_fill (&args, ata_scsiop_maint_in);else ata_scsi_set_invalid_field (dev, cmd,1 ,0xff );
Greg Kroah-Hartman
maintainerPATCH 53/91 i2c: i801: unregister tco_pdev in i801_probe() error path
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Heiner Kallweit <[email protected]>
commit 3914784553f68c931fc666dbe7e86fe881aada38 upstream.
We have to unregister tco_pdev also if i2c_add_adapter() fails.
--- drivers/i2c/busses/i2c-i801.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +1 -0
@@ -1679,6 +1679,7 @@ static int i801_probe(struct pci_dev *de "SMBus I801 adapter at %04lx", priv->smba); err =i2c_add_adapter (&priv->adapter);if (err) { +platform_device_unregister (priv->tco_pdev);i801_acpi_remove (priv);return err; }
Greg Kroah-Hartman
maintainerPATCH 54/91 btrfs: properly report 0 avail for very full file systems
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josef Bacik <[email protected]>
commit 58bfe2ccec5f9f137b41dd38f335290dcc13cd5c upstream.
A user reported some issues with smaller file systems that get very full. While investigating this issue I noticed that df wasn't showing 100% full, despite having 0 chunk space and having < 1MiB of available metadata space.
This turns out to be an overflow issue, we're doing:
total_available_metadata_space - SZ_4M < global_block_rsv_size
to determine if there's not enough space to make metadata allocations, which overflows if total_available_metadata_space is < 4M. Fix this by checking to see if our available space is greater than the 4M threshold. This makes df properly report 100% usage on the file system.
--- fs/btrfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/super.c +1 -1
@@ -2196,7 +2196,7 @@ static int btrfs_statfs(struct dentry *d* calculated f_bavail. */ if (!mixed && block_rsv->space_info->full && - total_free_meta - thresh < block_rsv->size) + (total_free_meta < thresh || total_free_meta - thresh < block_rsv->size)) buf->f_bavail =0 ; buf->f_type =BTRFS_SUPER_MAGIC ;
Greg Kroah-Hartman
maintainerPATCH 37/91 ring-buffer: Avoid softlockup in ring_buffer_resize()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zheng Yejian <[email protected]>
[ Upstream commit f6bd2c92488c30ef53b5bd80c52f0a7eee9d545a ]
When user resize all trace ring buffer through file 'buffer_size_kb', then in ring_buffer_resize(), kernel allocates buffer pages for each cpu in a loop.
If the kernel preemption model is PREEMPT_NONE and there are many cpus and there are many buffer pages to be allocated, it may not give up cpu for a long time and finally cause a softlockup.
To avoid it, call cond_resched() after each cpu buffer allocation.
--- kernel/trace/ring_buffer.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/ring_buffer.c +2 -0
@@ -1753,6 +1753,8 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, err = -ENOMEM ; goto out_err; } + +cond_resched (); }get_online_cpus ();
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 55/91 net: thunderbolt: Fix TCPv6 GSO checksum calculation
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
commit e0b65f9b81fef180cf5f103adecbe5505c961153 upstream.
Alex reported that running ssh over IPv6 does not work with Thunderbolt/USB4 networking driver. The reason for that is that driver should call skb_is_gso() before calling skb_is_gso_v6(), and it should not return false after calculates the checksum successfully. This probably was a copy paste error from the original driver where it was done properly.
--- drivers/net/thunderbolt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/thunderbolt.c +1 -2
@@ -961,12 +961,11 @@ static bool tbnet_xmit_csum_and_map(stru *tucso = ~csum_tcpudp_magic (ip_hdr (skb)->saddr,ip_hdr (skb)->daddr,0 ,ip_hdr (skb)->protocol,0 ); - }else if (skb_is_gso_v6 (skb)) { + }else if (skb_is_gso (skb) &&skb_is_gso_v6 (skb)) { tucso = dest + ((void *)&(tcp_hdr (skb)->check) - data); *tucso = ~csum_ipv6_magic (&ipv6_hdr (skb)->saddr, &ipv6_hdr (skb)->daddr,0 ,IPPROTO_TCP ,0 ); -return false; }else if (protocol ==htons (ETH_P_IPV6 )) { tucso = dest +skb_checksum_start_offset (skb) + skb->csum_offset; *tucso = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
Greg Kroah-Hartman
maintainerPATCH 56/91 ata: libata-core: Fix ata_port_request_pm() locking
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 3b8e0af4a7a331d1510e963b8fd77e2fca0a77f1 upstream.
The function ata_port_request_pm() checks the port flag ATA_PFLAG_PM_PENDING and calls ata_port_wait_eh() if this flag is set to ensure that power management operations for a port are not scheduled simultaneously. However, this flag check is done without holding the port lock.
Fix this by taking the port lock on entry to the function and checking the flag under this lock. The lock is released and re-taken if ata_port_wait_eh() needs to be called. The two WARN_ON() macros checking that the ATA_PFLAG_PM_PENDING flag was cleared are removed as the first call is racy and the second one done without holding the port lock.
--- drivers/ata/libata-core.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/ata/libata-core.c +9 -9
@@ -5756,17 +5756,19 @@ static void ata_port_request_pm(struct astruct ata_link *link;unsigned long flags; -/* Previous resume operation might still be in -* progress. Wait for PM_PENDING to clear. +spin_lock_irqsave (ap->lock, flags); + +/* +* A previous PM operation might still be in progress. Wait for +* ATA_PFLAG_PM_PENDING to clear. */ if (ap->pflags &ATA_PFLAG_PM_PENDING ) { +spin_unlock_irqrestore (ap->lock, flags);ata_port_wait_eh (ap); -WARN_ON (ap->pflags &ATA_PFLAG_PM_PENDING ); +spin_lock_irqsave (ap->lock, flags); } -/* request PM ops to EH */ -spin_lock_irqsave (ap->lock, flags); - +/* Request PM operation to EH */ ap->pm_mesg = mesg; ap->pflags |=ATA_PFLAG_PM_PENDING ;ata_for_each_link (link, ap,HOST_FIRST ) {
@@ -5778,10 +5780,8 @@ static void ata_port_request_pm(struct aspin_unlock_irqrestore (ap->lock, flags); -if (!async) { +if (!async)ata_port_wait_eh (ap); -WARN_ON (ap->pflags &ATA_PFLAG_PM_PENDING ); - } }/*
Greg Kroah-Hartman
maintainerPATCH 57/91 ata: libata-core: Fix port and device removal
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 84d76529c650f887f1e18caee72d6f0589e1baf9 upstream.
Whenever an ATA adapter driver is removed (e.g. rmmod), ata_port_detach() is called repeatedly for all the adapter ports to remove (unload) the devices attached to the port and delete the port device itself. Removing of devices is done using libata EH with the ATA_PFLAG_UNLOADING port flag set. This causes libata EH to execute ata_eh_unload() which disables all devices attached to the port.
ata_port_detach() finishes by calling scsi_remove_host() to remove the scsi host associated with the port. This function will trigger the removal of all scsi devices attached to the host and in the case of disks, calls to sd_shutdown() which will flush the device write cache and stop the device. However, given that the devices were already disabled by ata_eh_unload(), the synchronize write cache command and start stop unit commands fail. E.g. running "rmmod ahci" with first removing sd_mod results in error messages like:
ata13.00: disable device
sd 0:0:0:0: [sda] Synchronizing SCSI cache
sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK sd 0:0:0:0: [sda] Stopping disk
sd 0:0:0:0: [sda] Start/Stop Unit failed: Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Fix this by removing all scsi devices of the ata devices connected to the port before scheduling libata EH to disable the ATA devices.
--- drivers/ata/libata-core.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/ata/libata-core.c +20 -1
@@ -6750,11 +6750,30 @@ static void ata_port_detach(struct ata_pif (!ap->ops->error_handler) goto skip_eh; -/* tell EH we're leaving & flush EH */ +/* Wait for any ongoing EH */ +ata_port_wait_eh (ap); + +mutex_lock (&ap->scsi_scan_mutex);spin_lock_irqsave (ap->lock, flags); + +/* Remove scsi devices */ +ata_for_each_link (link, ap,HOST_FIRST ) { +ata_for_each_dev (dev, link,ALL ) { +if (dev->sdev) { +spin_unlock_irqrestore (ap->lock, flags); +scsi_remove_device (dev->sdev); +spin_lock_irqsave (ap->lock, flags); + dev->sdev =NULL ; + } + } + } + +/* Tell EH to disable all devices */ ap->pflags |=ATA_PFLAG_UNLOADING ;ata_port_schedule_eh (ap); +spin_unlock_irqrestore (ap->lock, flags); +mutex_unlock (&ap->scsi_scan_mutex);/* wait till EH commits suicide */ ata_port_wait_eh (ap);
Greg Kroah-Hartman
maintainerPATCH 58/91 ata: libata-core: Do not register PM operations for SAS ports
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 75e2bd5f1ede42a2bc88aa34b431e1ace8e0bea0 upstream.
libsas does its own domain based power management of ports. For such ports, libata should not use a device type defining power management operations as executing these operations for suspend/resume in addition to libsas calls to ata_sas_port_suspend() and ata_sas_port_resume() is not necessary (and likely dangerous to do, even though problems are not seen currently).
Introduce the new ata_port_sas_type device_type for ports managed by libsas. This new device type is used in ata_tport_add() and is defined without power management operations.
--- drivers/ata/libata-core.c | 2 +- drivers/ata/libata-transport.c | 9 ++++++++- drivers/ata/libata.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)
drivers/ata/libata-core.c +1 -1
@@ -5947,7 +5947,7 @@ void ata_host_resume(struct ata_host *ho#endif const struct device_type ata_port_type = { - .name ="ata_port" , + .name =ATA_PORT_TYPE_NAME , #ifdef CONFIG_PM .pm = &ata_port_pm_ops, #endif
drivers/ata/libata-transport.c +8 -1
@@ -266,6 +266,10 @@ void ata_tport_delete(struct ata_port *aput_device (dev); } +static const struct device_type ata_port_sas_type = { + .name =ATA_PORT_TYPE_NAME , +}; +/** ata_tport_add - initialize a transport ATA port structure * * @parent: parent device
@@ -283,7 +287,10 @@ int ata_tport_add(struct device *parent,struct device *dev = &ap->tdev;device_initialize (dev); - dev->type = &ata_port_type; +if (ap->flags &ATA_FLAG_SAS_HOST ) + dev->type = &ata_port_sas_type; +else + dev->type = &ata_port_type; dev->parent = parent;ata_host_get (ap->host);
drivers/ata/libata.h +2 -0
@@ -46,6 +46,8 @@ enum { ATA_DNXFER_QUIET = (1 << 31), }; +#define ATA_PORT_TYPE_NAME "ata_port" +extern atomic_t ata_print_id;extern int atapi_passthru16;extern int libata_fua;
Greg Kroah-Hartman
maintainerPATCH 59/91 ata: libata-sata: increase PMP SRST timeout to 10s
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Schiffer <[email protected]>
commit 753a4d531bc518633ea88ac0ed02b25a16823d51 upstream.
On certain SATA controllers, softreset fails after wakeup from S2RAM with the message "softreset failed (1st FIS failed)", sometimes resulting in drives not being detected again. With the increased timeout, this issue is avoided. Instead, "softreset failed (device not ready)" is now logged 1-2 times; this later failure seems to cause fewer problems however, and the drives are detected reliably once they've spun up and the probe is retried.
The issue was observed with the primary SATA controller of the QNAP TS-453B, which is an "Intel Corporation Celeron/Pentium Silver Processor SATA Controller [8086:31e3] (rev 06)" integrated in the Celeron J4125 CPU, and the following drives:
- Seagate IronWolf ST12000VN0008
- Seagate IronWolf ST8000NE0004
The SATA controller seems to be more relevant to this issue than the drives, as the same drives are always detected reliably on the secondary SATA controller on the same board (an ASMedia 106x) without any "softreset failed" errors even without the increased timeout.
--- include/linux/libata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/libata.h +1 -1
@@ -311,7 +311,7 @@ enum {* advised to wait only for the following duration before * doing SRST. */ - ATA_TMOUT_PMP_SRST_WAIT = 5000, + ATA_TMOUT_PMP_SRST_WAIT = 10000,/* When the LPM policy is set to ATA_LPM_MAX_POWER, there might * be a spurious PHY event, so ignore the first PHY event that
Greg Kroah-Hartman
maintainerPATCH 60/91 fs: binfmt_elf_efpic: fix personality for ELF-FDPIC
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Ungerer <[email protected]>
commit 7c3151585730b7095287be8162b846d31e6eee61 upstream.
The elf-fdpic loader hard sets the process personality to either PER_LINUX_FDPIC for true elf-fdpic binaries or to PER_LINUX for normal ELF binaries (in this case they would be constant displacement compiled with -pie for example). The problem with that is that it will lose any other bits that may be in the ELF header personality (such as the "bug emulation" bits).
On the ARM architecture the ADDR_LIMIT_32BIT flag is used to signify a normal 32bit binary - as opposed to a legacy 26bit address binary. This matters since start_thread() will set the ARM CPSR register as required based on this flag. If the elf-fdpic loader loses this bit the process will be mis-configured and crash out pretty quickly.
Modify elf-fdpic loader personality setting so that it preserves the upper three bytes by using the SET_PERSONALITY macro to set it. This macro in the generic case sets PER_LINUX and preserves the upper bytes. Architectures can override this for their specific use case, and ARM does exactly this.
The problem shows up quite easily running under qemu using the ARM architecture, but not necessarily on all types of real ARM hardware. If the underlying ARM processor does not support the legacy 26-bit addressing mode then everything will work as expected.
--- fs/binfmt_elf_fdpic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/binfmt_elf_fdpic.c +2 -3
@@ -349,10 +349,9 @@ static int load_elf_fdpic_binary(struct/* there's now no turning back... the old userspace image is dead, * defunct, deceased, etc. */ +SET_PERSONALITY (exec_params.hdr);if (elf_check_fdpic (&exec_params.hdr)) -set_personality (PER_LINUX_FDPIC ); -else -set_personality (PER_LINUX ); + current->personality |=PER_LINUX_FDPIC ;if (elf_read_implies_exec (&exec_params.hdr, executable_stack)) current->personality |=READ_IMPLIES_EXEC ;
Greg Kroah-Hartman
maintainerPATCH 61/91 ext4: fix rec_len verify error
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shida Zhang <[email protected]>
commit 7fda67e8c3ab6069f75888f67958a6d30454a9f6 upstream.
With the configuration PAGE_SIZE 64k and filesystem blocksize 64k, a problem occurred when more than 13 million files were directly created under a directory:
EXT4-fs error (device xx): ext4_dx_csum_set:492: inode #xxxx: comm xxxxx: dir seems corrupt? Run e2fsck -D. EXT4-fs error (device xx): ext4_dx_csum_verify:463: inode #xxxx: comm xxxxx: dir seems corrupt? Run e2fsck -D. EXT4-fs error (device xx): dx_probe:856: inode #xxxx: block 8188: comm xxxxx: Directory index failed checksum
When enough files are created, the fake_dirent->reclen will be 0xffff. it doesn't equal to the blocksize 65536, i.e. 0x10000.
But it is not the same condition when blocksize equals to 4k. when enough files are created, the fake_dirent->reclen will be 0x1000. it equals to the blocksize 4k, i.e. 0x1000.
The problem seems to be related to the limitation of the 16-bit field when the blocksize is set to 64k.
To address this, helpers like ext4_rec_len_{from,to}_disk has already been introduced to complete the conversion between the encoded and the plain form of rec_len.
So fix this one by using the helper, and all the other in this file too.
--- fs/ext4/namei.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
fs/ext4/namei.c +15 -11
@@ -322,17 +322,17 @@ static struct ext4_dir_entry_tail *get_d struct ext4_dir_entry *de) {struct ext4_dir_entry_tail *t; +int blocksize =EXT4_BLOCK_SIZE (inode->i_sb);#ifdef PARANOID struct ext4_dir_entry *d, *top; d = de; top = (struct ext4_dir_entry *)(((void *)de) + - (EXT4_BLOCK_SIZE (inode->i_sb) - -sizeof (struct ext4_dir_entry_tail ))); -while (d < top && d->rec_len) + (blocksize -sizeof (struct ext4_dir_entry_tail ))); +while (d < top &&ext4_rec_len_from_disk (d->rec_len, blocksize)) d = (struct ext4_dir_entry *)(((void *)d) + -le16_to_cpu (d->rec_len)); +ext4_rec_len_from_disk (d->rec_len, blocksize));if (d != top)return NULL ;
@@ -343,7 +343,8 @@ static struct ext4_dir_entry_tail *get_d#endif if (t->det_reserved_zero1 || -le16_to_cpu (t->det_rec_len) !=sizeof (struct ext4_dir_entry_tail ) || + (ext4_rec_len_from_disk (t->det_rec_len, blocksize) != +sizeof (struct ext4_dir_entry_tail )) || t->det_reserved_zero2 || t->det_reserved_ft !=EXT4_FT_DIR_CSUM )return NULL ;
@@ -425,13 +426,14 @@ static struct dx_countlimit *get_dx_counstruct ext4_dir_entry *dp;struct dx_root_info *root;int count_offset; +int blocksize =EXT4_BLOCK_SIZE (inode->i_sb); +unsigned int rlen =ext4_rec_len_from_disk (dirent->rec_len, blocksize); -if (le16_to_cpu (dirent->rec_len) ==EXT4_BLOCK_SIZE (inode->i_sb)) +if (rlen == blocksize) count_offset =8 ; -else if (le16_to_cpu (dirent->rec_len) ==12 ) { +else if (rlen ==12 ) { dp = (struct ext4_dir_entry *)(((void *)dirent) +12 ); -if (le16_to_cpu (dp->rec_len) != -EXT4_BLOCK_SIZE (inode->i_sb) -12 ) +if (ext4_rec_len_from_disk (dp->rec_len, blocksize) != blocksize -12 )return NULL ; root = (struct dx_root_info *)(((void *)dp +12 )); if (root->reserved_zero ||
@@ -1244,6 +1246,7 @@ static int dx_make_map(struct inode *dirunsigned int buflen = bh->b_size;char *base = bh->b_data;struct dx_hash_info h = *hinfo; +int blocksize =EXT4_BLOCK_SIZE (dir->i_sb);if (ext4_has_metadata_csum (dir->i_sb)) buflen -=sizeof (struct ext4_dir_entry_tail );
@@ -1257,11 +1260,12 @@ static int dx_make_map(struct inode *dir map_tail--; map_tail->hash = h.hash; map_tail->offs = ((char *) de - base)>>2 ; - map_tail->size =le16_to_cpu (de->rec_len); + map_tail->size =ext4_rec_len_from_disk (de->rec_len, + blocksize); count++;cond_resched (); } - de =ext4_next_entry (de, dir->i_sb->s_blocksize); + de =ext4_next_entry (de, blocksize); }return count; }
Greg Kroah-Hartman
maintainerPATCH 62/91 ata: libata: disallow dev-initiated LPM transitions to unsupported states
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
commit 24e0e61db3cb86a66824531989f1df80e0939f26 upstream.
In AHCI 1.3.1, the register description for CAP.SSC:
"When cleared to ‘0’, software must not allow the HBA to initiate transitions to the Slumber state via agressive link power management nor the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port must be programmed to disallow device initiated Slumber requests."
In AHCI 1.3.1, the register description for CAP.PSC:
"When cleared to ‘0’, software must not allow the HBA to initiate transitions to the Partial state via agressive link power management nor the PxCMD.ICC field in each port, and the PxSCTL.IPM field in each port must be programmed to disallow device initiated Partial requests."
Ensure that we always set the corresponding bits in PxSCTL.IPM, such that a device is not allowed to initiate transitions to power states which are unsupported by the HBA.
DevSleep is always initiated by the HBA, however, for completeness, set the corresponding bit in PxSCTL.IPM such that agressive link power management cannot transition to DevSleep if DevSleep is not supported.
sata_link_scr_lpm() is used by libahci, ata_piix and libata-pmp. However, only libahci has the ability to read the CAP/CAP2 register to see if these features are supported. Therefore, in order to not introduce any regressions on ata_piix or libata-pmp, create flags that indicate that the respective feature is NOT supported. This way, the behavior for ata_piix and libata-pmp should remain unchanged.
This change is based on a patch originally submitted by Runa Guo-oc.
--- drivers/ata/ahci.c | 9 +++++++++ drivers/ata/libata-core.c | 19 ++++++++++++++++--- include/linux/libata.h | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-)
drivers/ata/ahci.c +9 -0
@@ -1864,6 +1864,15 @@ static int ahci_init_one(struct pci_develse dev_info (&pdev->dev,"SSS flag set, parallel bus scan disabled\n" ); +if (!(hpriv->cap &HOST_CAP_PART )) + host->flags |=ATA_HOST_NO_PART ; + +if (!(hpriv->cap &HOST_CAP_SSC )) + host->flags |=ATA_HOST_NO_SSC ; + +if (!(hpriv->cap2 &HOST_CAP2_SDS )) + host->flags |=ATA_HOST_NO_DEVSLP ; +if (pi.flags &ATA_FLAG_EM )ahci_reset_em (host);
drivers/ata/libata-core.c +16 -3
@@ -3997,10 +3997,23 @@ int sata_link_scr_lpm(struct ata_link *lcase ATA_LPM_MED_POWER_WITH_DIPM :case ATA_LPM_MIN_POWER_WITH_PARTIAL :case ATA_LPM_MIN_POWER : -if (ata_link_nr_enabled (link) >0 ) -/* no restrictions on LPM transitions */ +if (ata_link_nr_enabled (link) >0 ) { +/* assume no restrictions on LPM transitions */ scontrol &= ~(0x7 <<8 ); -else { + +/* +* If the controller does not support partial, slumber, +* or devsleep, then disallow these transitions. +*/ +if (link->ap->host->flags &ATA_HOST_NO_PART ) + scontrol |= (0x1 <<8 ); + +if (link->ap->host->flags &ATA_HOST_NO_SSC ) + scontrol |= (0x2 <<8 ); + +if (link->ap->host->flags &ATA_HOST_NO_DEVSLP ) + scontrol |= (0x4 <<8 ); + }else {/* empty port, power off */ scontrol &= ~0xf ; scontrol |= (0x1 <<2 );
include/linux/libata.h +4 -0
@@ -278,6 +278,10 @@ enum {ATA_HOST_PARALLEL_SCAN = (1 <<2 ),/* Ports on this host can be scanned in parallel */ ATA_HOST_IGNORE_ATA = (1 <<3 ),/* Ignore ATA devices on this host. */ +ATA_HOST_NO_PART = (1 <<4 ),/* Host does not support partial */ +ATA_HOST_NO_SSC = (1 <<5 ),/* Host does not support slumber */ +ATA_HOST_NO_DEVSLP = (1 <<6 ),/* Host does not support devslp */ +/* bits 24:31 of host->flags are reserved for LLD specific flags */ /* various lengths of time */
Greg Kroah-Hartman
maintainerPATCH 63/91 Revert "drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions"
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
This reverts commit 3ce2cd63e8ee037644db0cbea65e6c40ab6cc178 which is commit aa838896d87af561a33ecefea1caa4c15a68bc47 upstream.
Ben writes:
When I looked into the referenced security issue, it seemed to only be exploitable through wakelock names, and in the upstream kernel only after commit c8377adfa781 "PM / wakeup: Show wakeup sources stats in sysfs" (first included in 5.4). So I would be interested to know if and why a fix was needed for 4.19.
More importantly, this backported version uniformly converts to sysfs_emit(), but there are 3 places sysfs_emit_at() must be used instead:
--- drivers/base/arch_topology.c | 2 - drivers/base/cacheinfo.c | 18 +++++------ drivers/base/core.c | 8 ++--- drivers/base/cpu.c | 34 ++++++++++----------- drivers/base/firmware_loader/fallback.c | 2 - drivers/base/memory.c | 24 +++++++-------- drivers/base/node.c | 34 ++++++++++----------- drivers/base/platform.c | 2 - drivers/base/power/sysfs.c | 50 ++++++++++++++++---------------- drivers/base/soc.c | 8 ++--- 10 files changed, 91 insertions(+), 91 deletions(-)
drivers/base/arch_topology.c +1 -1
@@ -44,7 +44,7 @@ static ssize_t cpu_capacity_show(struct { struct cpu *cpu = container_of(dev, struct cpu, dev); -return sysfs_emit (buf,"%lu\n" ,topology_get_cpu_scale (NULL , cpu->dev.id)); +return sprintf (buf,"%lu\n" ,topology_get_cpu_scale (NULL , cpu->dev.id)); } static ssize_t cpu_capacity_store(struct device *dev,
drivers/base/cacheinfo.c +9 -9
@@ -372,7 +372,7 @@ static ssize_t size_show(struct device * {struct cacheinfo *this_leaf =dev_get_drvdata (dev); -return sysfs_emit (buf,"%uK\n" , this_leaf->size >>10 ); +return sprintf (buf,"%uK\n" , this_leaf->size >>10 ); }static ssize_t shared_cpumap_show_func (struct device *dev,bool list,char *buf)
@@ -402,11 +402,11 @@ static ssize_t type_show(struct device *switch (this_leaf->type) {case CACHE_TYPE_DATA : -return sysfs_emit (buf,"Data\n" ); +return sprintf (buf,"Data\n" );case CACHE_TYPE_INST : -return sysfs_emit (buf,"Instruction\n" ); +return sprintf (buf,"Instruction\n" );case CACHE_TYPE_UNIFIED : -return sysfs_emit (buf,"Unified\n" ); +return sprintf (buf,"Unified\n" );default :return -EINVAL ; }
@@ -420,11 +420,11 @@ static ssize_t allocation_policy_show(stint n =0 ;if ((ci_attr &CACHE_READ_ALLOCATE ) && (ci_attr &CACHE_WRITE_ALLOCATE )) - n =sysfs_emit (buf,"ReadWriteAllocate\n" ); + n =sprintf (buf,"ReadWriteAllocate\n" );else if (ci_attr &CACHE_READ_ALLOCATE ) - n =sysfs_emit (buf,"ReadAllocate\n" ); + n =sprintf (buf,"ReadAllocate\n" );else if (ci_attr &CACHE_WRITE_ALLOCATE ) - n =sysfs_emit (buf,"WriteAllocate\n" ); + n =sprintf (buf,"WriteAllocate\n" );return n; }
@@ -436,9 +436,9 @@ static ssize_t write_policy_show(structint n =0 ;if (ci_attr &CACHE_WRITE_THROUGH ) - n =sysfs_emit (buf,"WriteThrough\n" ); + n =sprintf (buf,"WriteThrough\n" );else if (ci_attr &CACHE_WRITE_BACK ) - n =sysfs_emit (buf,"WriteBack\n" ); + n =sprintf (buf,"WriteBack\n" );return n; }
drivers/base/core.c +4 -4
@@ -994,7 +994,7 @@ ssize_t device_show_ulong(struct device char *buf) {struct dev_ext_attribute *ea =to_ext_attr (attr); -return sysfs_emit (buf,"%lx\n" , *(unsigned long *)(ea->var)); +return snprintf (buf,PAGE_SIZE ,"%lx\n" , *(unsigned long *)(ea->var)); }EXPORT_SYMBOL_GPL (device_show_ulong);
@@ -1019,7 +1019,7 @@ ssize_t device_show_int(struct device *d {struct dev_ext_attribute *ea =to_ext_attr (attr); -return sysfs_emit (buf,"%d\n" , *(int *)(ea->var)); +return snprintf (buf,PAGE_SIZE ,"%d\n" , *(int *)(ea->var)); }EXPORT_SYMBOL_GPL (device_show_int);
@@ -1040,7 +1040,7 @@ ssize_t device_show_bool(struct device * {struct dev_ext_attribute *ea =to_ext_attr (attr); -return sysfs_emit (buf,"%d\n" , *(bool *)(ea->var)); +return snprintf (buf,PAGE_SIZE ,"%d\n" , *(bool *)(ea->var)); }EXPORT_SYMBOL_GPL (device_show_bool);
@@ -1273,7 +1273,7 @@ static ssize_t online_show(struct devicedevice_lock (dev); val = !dev->offline;device_unlock (dev); -return sysfs_emit (buf,"%u\n" , val); +return sprintf (buf,"%u\n" , val); } static ssize_t online_store(struct device *dev, struct device_attribute *attr,
drivers/base/cpu.c +17 -17
@@ -156,7 +156,7 @@ static ssize_t show_crash_notes(struct d* operation should be safe. No locking required. */ addr =per_cpu_ptr_to_phys (per_cpu_ptr (crash_notes, cpunum)); - rc =sysfs_emit (buf,"%Lx\n" , addr); + rc =sprintf (buf,"%Lx\n" , addr);return rc; } static DEVICE_ATTR(crash_notes, 0400, show_crash_notes, NULL);
@@ -167,7 +167,7 @@ static ssize_t show_crash_notes_size(str {ssize_t rc; - rc =sysfs_emit (buf,"%zu\n" ,sizeof (note_buf_t)); + rc =sprintf (buf,"%zu\n" ,sizeof (note_buf_t));return rc; } static DEVICE_ATTR(crash_notes_size, 0400, show_crash_notes_size, NULL);
@@ -264,7 +264,7 @@ static ssize_t print_cpus_offline(struct nr_cpu_ids, total_cpus-1); } - n +=sysfs_emit (&buf[n],"\n" ); + n +=snprintf (&buf[n], len - n,"\n" );return n; } static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL);
@@ -272,7 +272,7 @@ static DEVICE_ATTR(offline, 0444, print_static ssize_t print_cpus_isolated (struct device *dev,struct device_attribute *attr,char *buf) { -int n =0 ; +int n =0 , len =PAGE_SIZE -2 ;cpumask_var_t isolated;if (!alloc_cpumask_var (&isolated,GFP_KERNEL ))
@@ -280,7 +280,7 @@ static ssize_t print_cpus_isolated(struccpumask_andnot (isolated, cpu_possible_mask,housekeeping_cpumask (HK_FLAG_DOMAIN )); - n =sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (isolated)); + n =scnprintf (buf, len,"%*pbl\n" ,cpumask_pr_args (isolated));free_cpumask_var (isolated);
@@ -292,9 +292,9 @@ static DEVICE_ATTR(isolated, 0444, printstatic ssize_t print_cpus_nohz_full (struct device *dev,struct device_attribute *attr,char *buf) { -int n =0 ; +int n =0 , len =PAGE_SIZE -2 ; - n =sysfs_emit (buf,"%*pbl\n" ,cpumask_pr_args (tick_nohz_full_mask)); + n =scnprintf (buf, len,"%*pbl\n" ,cpumask_pr_args (tick_nohz_full_mask));return n; }
@@ -328,7 +328,7 @@ static ssize_t print_cpu_modalias(structssize_t n;u32 i; - n =sysfs_emit (buf,"cpu:type:" CPU_FEATURE_TYPEFMT ":feature:" , + n =sprintf (buf,"cpu:type:" CPU_FEATURE_TYPEFMT ":feature:" ,CPU_FEATURE_TYPEVAL );for (i =0 ; i <MAX_CPU_FEATURES ; i++)
@@ -520,56 +520,56 @@ static void __init cpu_dev_register_genessize_t __weak cpu_show_meltdown (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_spectre_v1 (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_spectre_v2 (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_spec_store_bypass (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_l1tf (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_mds (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_tsx_async_abort (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_itlb_multihit (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); }ssize_t __weak cpu_show_srbds (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf,"Not affected\n" ); +return sprintf (buf,"Not affected\n" ); } ssize_t __weak cpu_show_mmio_stale_data(struct device *dev,
drivers/base/firmware_loader/fallback.c +1 -1
@@ -215,7 +215,7 @@ static ssize_t firmware_loading_show(str loading =fw_sysfs_loading (fw_sysfs->fw_priv);mutex_unlock (&fw_lock); -return sysfs_emit (buf,"%d\n" , loading); +return sprintf (buf,"%d\n" , loading); }/* one pages buffer should be mapped/unmapped only once */
drivers/base/memory.c +12 -12
@@ -121,7 +121,7 @@ static ssize_t show_mem_start_phys_indexunsigned long phys_index; phys_index = mem->start_section_nr / sections_per_block; -return sysfs_emit (buf,"%08lx\n" , phys_index); +return sprintf (buf,"%08lx\n" , phys_index); }/*
@@ -145,7 +145,7 @@ static ssize_t show_mem_removable(struct } out: -return sysfs_emit (buf,"%d\n" , ret); +return sprintf (buf,"%d\n" , ret); }/*
@@ -163,17 +163,17 @@ static ssize_t show_mem_state(struct dev*/ switch (mem->state) {case MEM_ONLINE : - len =sysfs_emit (buf,"online\n" ); + len =sprintf (buf,"online\n" );break ;case MEM_OFFLINE : - len =sysfs_emit (buf,"offline\n" ); + len =sprintf (buf,"offline\n" );break ;case MEM_GOING_OFFLINE : - len =sysfs_emit (buf,"going-offline\n" ); + len =sprintf (buf,"going-offline\n" );break ;default : - len =sysfs_emit (buf,"ERROR-UNKNOWN-%ld\n" , - mem->state); + len =sprintf (buf,"ERROR-UNKNOWN-%ld\n" , + mem->state);WARN_ON (1 );break ; }
@@ -384,7 +384,7 @@ static ssize_t show_phys_device(struct d struct device_attribute *attr, char *buf) { struct memory_block *mem = to_memory_block(dev); -return sysfs_emit (buf,"%d\n" , mem->phys_device); +return sprintf (buf,"%d\n" , mem->phys_device); }#ifdef CONFIG_MEMORY_HOTREMOVE
@@ -422,7 +422,7 @@ static ssize_t show_valid_zones(struct d*/ if (!test_pages_in_a_zone (start_pfn, start_pfn + nr_pages, &valid_start_pfn, &valid_end_pfn)) -return sysfs_emit (buf,"none\n" ); +return sprintf (buf,"none\n" ); start_pfn = valid_start_pfn;strcat (buf,page_zone (pfn_to_page (start_pfn))->name); goto out;
@@ -456,7 +456,7 @@ static ssize_t print_block_size(struct device *dev, struct device_attribute *attr, char *buf) { - return sysfs_emit(buf, "%lx\n", get_memory_block_size()); + return sprintf(buf, "%lx\n", get_memory_block_size()); } static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL);
@@ -470,9 +470,9 @@ show_auto_online_blocks(struct device *d char *buf) {if (memhp_auto_online) -return sysfs_emit (buf,"online\n" ); +return sprintf (buf,"online\n" );else -return sysfs_emit (buf,"offline\n" ); +return sprintf (buf,"offline\n" ); } static ssize_t
drivers/base/node.c +17 -17
@@ -69,7 +69,7 @@ static ssize_t node_read_meminfo(structstruct sysinfo i;si_meminfo_node (&i, nid); - n =sysfs_emit (buf, + n =sprintf (buf,"Node %d MemTotal: %8lu kB\n" "Node %d MemFree: %8lu kB\n" "Node %d MemUsed: %8lu kB\n"
@@ -96,7 +96,7 @@ static ssize_t node_read_meminfo(struct nid, K(sum_zone_node_page_state(nid, NR_MLOCK)));#ifdef CONFIG_HIGHMEM - n +=sysfs_emit (buf + n, + n +=sprintf (buf + n,"Node %d HighTotal: %8lu kB\n" "Node %d HighFree: %8lu kB\n" "Node %d LowTotal: %8lu kB\n"
@@ -106,7 +106,7 @@ static ssize_t node_read_meminfo(struct nid,K (i.totalram - i.totalhigh), nid, K(i.freeram - i.freehigh));#endif - n +=sysfs_emit (buf + n, + n +=sprintf (buf + n,"Node %d Dirty: %8lu kB\n" "Node %d Writeback: %8lu kB\n" "Node %d FilePages: %8lu kB\n"
@@ -162,19 +162,19 @@ static DEVICE_ATTR(meminfo, S_IRUGO, nodstatic ssize_t node_read_numastat (struct device *dev,struct device_attribute *attr,char *buf) { -return sysfs_emit (buf, -"numa_hit %lu\n" -"numa_miss %lu\n" -"numa_foreign %lu\n" -"interleave_hit %lu\n" -"local_node %lu\n" -"other_node %lu\n" , -sum_zone_numa_state (dev->id,NUMA_HIT ), -sum_zone_numa_state (dev->id,NUMA_MISS ), -sum_zone_numa_state (dev->id,NUMA_FOREIGN ), -sum_zone_numa_state (dev->id,NUMA_INTERLEAVE_HIT ), -sum_zone_numa_state (dev->id,NUMA_LOCAL ), -sum_zone_numa_state (dev->id,NUMA_OTHER )); +return sprintf (buf, +"numa_hit %lu\n" +"numa_miss %lu\n" +"numa_foreign %lu\n" +"interleave_hit %lu\n" +"local_node %lu\n" +"other_node %lu\n" , +sum_zone_numa_state (dev->id,NUMA_HIT ), +sum_zone_numa_state (dev->id,NUMA_MISS ), +sum_zone_numa_state (dev->id,NUMA_FOREIGN ), +sum_zone_numa_state (dev->id,NUMA_INTERLEAVE_HIT ), +sum_zone_numa_state (dev->id,NUMA_LOCAL ), +sum_zone_numa_state (dev->id,NUMA_OTHER )); } static DEVICE_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
@@ -612,7 +612,7 @@ static ssize_t print_nodes_state(enum no {int n; - n =sysfs_emit (buf,"%*pbl" , + n =scnprintf (buf,PAGE_SIZE -1 ,"%*pbl" ,nodemask_pr_args (&node_states[state])); buf[n++] ='\n' ; buf[n] ='\0' ;
drivers/base/platform.c +1 -1
@@ -927,7 +927,7 @@ static ssize_t driver_override_show(strussize_t len;device_lock (dev); - len =sysfs_emit (buf,"%s\n" , pdev->driver_override); + len =sprintf (buf,"%s\n" , pdev->driver_override);device_unlock (dev);return len; }
drivers/base/power/sysfs.c +25 -25
135 lines not on this page · raw message
drivers/base/soc.c +4 -4
@@ -72,13 +72,13 @@ static ssize_t soc_info_get(struct devic struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);if (attr == &dev_attr_machine) -return sysfs_emit (buf,"%s\n" , soc_dev->attr->machine); +return sprintf (buf,"%s\n" , soc_dev->attr->machine);if (attr == &dev_attr_family) -return sysfs_emit (buf,"%s\n" , soc_dev->attr->family); +return sprintf (buf,"%s\n" , soc_dev->attr->family);if (attr == &dev_attr_revision) -return sysfs_emit (buf,"%s\n" , soc_dev->attr->revision); +return sprintf (buf,"%s\n" , soc_dev->attr->revision);if (attr == &dev_attr_soc_id) -return sysfs_emit (buf,"%s\n" , soc_dev->attr->soc_id); +return sprintf (buf,"%s\n" , soc_dev->attr->soc_id);return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 38/91 ata: libata-eh: do not clear ATA_PFLAG_EH_PENDING in ata_eh_reset()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit 80cc944eca4f0baa9c381d0706f3160e491437f2 ]
ata_scsi_port_error_handler() starts off by clearing ATA_PFLAG_EH_PENDING, before calling ap->ops->error_handler() (without holding the ap->lock).
If an error IRQ is received while ap->ops->error_handler() is running, the irq handler will set ATA_PFLAG_EH_PENDING.
Once ap->ops->error_handler() returns, ata_scsi_port_error_handler() checks if ATA_PFLAG_EH_PENDING is set, and if it is, another iteration of ATA EH is performed.
The problem is that ATA_PFLAG_EH_PENDING is not only cleared by ata_scsi_port_error_handler(), it is also cleared by ata_eh_reset().
ata_eh_reset() is called by ap->ops->error_handler(). This additional clearing done by ata_eh_reset() breaks the whole retry logic in ata_scsi_port_error_handler(). Thus, if an error IRQ is received while ap->ops->error_handler() is running, the port will currently remain frozen and will never get re-enabled.
The additional clearing in ata_eh_reset() was introduced in commit 1e641060c4b5 ("libata: clear eh_info on reset completion").
Looking at the original error report:
https://marc.info/?l=linux-ide&m=124765325828495&w=2
We can see the following happening:
[ 1.074659] ata3: XXX port freeze [ 1.074700] ata3: XXX hardresetting link, stopping engine [ 1.074746] ata3: XXX flipping SControl
[ 1.411471] ata3: XXX irq_stat=400040 CONN|PHY [ 1.411475] ata3: XXX port freeze
[ 1.420049] ata3: XXX starting engine [ 1.420096] ata3: XXX rc=0, class=1 [ 1.420142] ata3: XXX clearing IRQs for thawing [ 1.420188] ata3: XXX port thawed [ 1.420234] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
We are not supposed to be able to receive an error IRQ while the port is frozen (PxIE is set to 0, i.e. all IRQs for the port are disabled).
AHCI 1.3.1 section 10.7.1.1 First Tier (IS Register) states:
"Each bit location can be thought of as reporting a '1' if the virtual "interrupt line" for that port is indicating it wishes to generate an interrupt. That is, if a port has one or more interrupt status bit set, and the enables for those status bits are set, then this bit shall be set."
Additionally, AHCI state P:ComInit clearly shows that the state machine will only jump to P:ComInitSetIS (which sets IS.IPS(x) to '1'), if PxIE.PCE is set to '1'. In our case, PxIE is set to 0, so IS.IPS(x) won't get set.
So IS.IPS(x) only gets set if PxIS and PxIE is set.
AHCI 1.3.1 section 10.7.1.1 First Tier (IS Register) also states:
"The bits in this register are read/write clear. It is set by the level of the virtual interrupt line being a set, and cleared by a write of '1' from the software."
So if IS.IPS(x) is set, you need to explicitly clear it by writing a 1 to IS.IPS(x) for that port.
Since PxIE is cleared, the only way to get an interrupt while the port is frozen, is if IS.IPS(x) is set, and the only way IS.IPS(x) can be set when the port is frozen, is if it was set before the port was frozen.
However, since commit 737dd811a3db ("ata: libahci: clear pending interrupt status"), we clear both PxIS and IS.IPS(x) after freezing the port, but before the COMRESET, so the problem that commit 1e641060c4b5 ("libata:
clear eh_info on reset completion") fixed can no longer happen.
Thus, revert commit 1e641060c4b5 ("libata: clear eh_info on reset completion"), so that the retry logic in ata_scsi_port_error_handler() works once again. (The retry logic is still needed, since we can still get an error IRQ _after_ the port has been thawed, but before ata_scsi_port_error_handler() takes the ap->lock in order to check if ATA_PFLAG_EH_PENDING is set.)
--- drivers/ata/libata-eh.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
drivers/ata/libata-eh.c +3 -10
@@ -2922,18 +2922,11 @@ int ata_eh_reset(struct ata_link *link, int classify,postreset (slave, classes); } -/* -* Some controllers can't be frozen very well and may set spurious -* error conditions during reset. Clear accumulated error -* information and re-thaw the port if frozen. As reset is the -* final recovery action and we cross check link onlineness against -* device classification later, no hotplug event is lost by this. -*/ +/* clear cached SError */ spin_lock_irqsave (link->ap->lock, flags); -memset (&link->eh_info,0 ,sizeof (link->eh_info)); + link->eh_info.serror =0 ;if (slave) -memset (&slave->eh_info,0 ,sizeof (link->eh_info)); - ap->pflags &= ~ATA_PFLAG_EH_PENDING ; + slave->eh_info.serror =0 ;spin_unlock_irqrestore (link->ap->lock, flags);if (ap->pflags &ATA_PFLAG_FROZEN )
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 39/91 bpf: Clarify error expectations from bpf_clone_redirect
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stanislav Fomichev <[email protected]>
[ Upstream commit 7cb779a6867fea00b4209bcf6de2f178a743247d ]
Commit 151e887d8ff9 ("veth: Fixing transmit return status for dropped packets") exposed the fact that bpf_clone_redirect is capable of returning raw NET_XMIT_XXX return codes.
This is in the conflict with its UAPI doc which says the following:
"0 on success, or a negative error in case of failure."
Update the UAPI to reflect the fact that bpf_clone_redirect can return positive error numbers, but don't explicitly define their meaning.
--- include/uapi/linux/bpf.h | 4 +++- tools/include/uapi/linux/bpf.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
include/uapi/linux/bpf.h +3 -1
@@ -693,7 +693,9 @@ union bpf_attr {* performed again, if the helper is used in combination with * direct packet access. * Return -* 0 on success, or a negative error in case of failure. +* 0 on success, or a negative error in case of failure. Positive +* error indicates a potential drop or congestion in the target +* device. The particular positive error codes are not defined. * * u64 bpf_get_current_pid_tgid(void) * Return
tools/include/uapi/linux/bpf.h +3 -1
@@ -691,7 +691,9 @@ union bpf_attr {* performed again, if the helper is used in combination with * direct packet access. * Return -* 0 on success, or a negative error in case of failure. +* 0 on success, or a negative error in case of failure. Positive +* error indicates a potential drop or congestion in the target +* device. The particular positive error codes are not defined. * * u64 bpf_get_current_pid_tgid(void) * Return
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 40/91 fbdev/sh7760fb: Depend on FB=y
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit f75f71b2c418a27a7c05139bb27a0c83adf88d19 ]
Fix linker error if FB=m about missing fb_io_read and fb_io_write. The linker's error message suggests that this config setting has already been broken for other symbols.
All errors (new ones prefixed by >>):
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o: in function `sh7760fb_probe':
sh7760fb.c:(.text+0x374): undefined reference to `framebuffer_alloc'
sh4-linux-ld: sh7760fb.c:(.text+0x394): undefined reference to `fb_videomode_to_var'
sh4-linux-ld: sh7760fb.c:(.text+0x39c): undefined reference to `fb_alloc_cmap'
sh4-linux-ld: sh7760fb.c:(.text+0x3a4): undefined reference to `register_framebuffer'
sh4-linux-ld: sh7760fb.c:(.text+0x3ac): undefined reference to `fb_dealloc_cmap'
sh4-linux-ld: sh7760fb.c:(.text+0x434): undefined reference to `framebuffer_release'
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o: in function `sh7760fb_remove':
sh7760fb.c:(.text+0x800): undefined reference to `unregister_framebuffer'
sh4-linux-ld: sh7760fb.c:(.text+0x804): undefined reference to `fb_dealloc_cmap'
sh4-linux-ld: sh7760fb.c:(.text+0x814): undefined reference to `framebuffer_release'Quoted 2 lines
Quoted 2 lines
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o:(.rodata+0xc): undefined reference to `fb_io_read'
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o:(.rodata+0x10): undefined reference to `fb_io_write'
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o:(.rodata+0x2c): undefined reference to `cfb_fillrect'
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o:(.rodata+0x30): undefined reference to `cfb_copyarea'
sh4-linux-ld: drivers/video/fbdev/sh7760fb.o:(.rodata+0x34): undefined reference to `cfb_imageblit'--- drivers/video/fbdev/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/Kconfig +1 -1
@@ -2085,7 +2085,7 @@ config FB_COBALT config FB_SH7760 bool "SH7760/SH7763/SH7720/SH7721 LCDC support" - depends on FB && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ + depends on FB=y && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ || CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721) select FB_CFB_FILLRECT select FB_CFB_COPYAREA
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 41/91 nvme-pci: do not set the NUMA node of device if it has none
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pratyush Yadav <[email protected]>
[ Upstream commit dad651b2a44eb6b201738f810254279dca29d30d ]
If a device has no NUMA node information associated with it, the driver puts the device in node first_memory_node (say node 0). Not having a NUMA node and being associated with node 0 are completely different things and it makes little sense to mix the two.
--- drivers/nvme/host/pci.c | 2 -- 1 file changed, 2 deletions(-)
drivers/nvme/host/pci.c +0 -2
@@ -2501,8 +2501,6 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)size_t alloc_size; node =dev_to_node (&pdev->dev); -if (node ==NUMA_NO_NODE ) -set_dev_node (&pdev->dev, first_memory_node); dev =kzalloc_node (sizeof (*dev),GFP_KERNEL , node);if (!dev)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 42/91 watchdog: iTCO_wdt: No need to stop the timer in probe
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
commit 1ae3e78c08209ac657c59f6f7ea21bbbd7f6a1d4 upstream.
The watchdog core can handle pinging of the watchdog before userspace opens the device. For this reason instead of stopping the timer, just mark it as running and let the watchdog core take care of it.
--- drivers/watchdog/iTCO_wdt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/watchdog/iTCO_wdt.c +11 -2
@@ -401,6 +401,16 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)return time_left; } +static void iTCO_wdt_set_running (struct iTCO_wdt_private *p) +{ +u16 val; + +/* Bit 11: TCO Timer Halt -> 0 = The TCO timer is * enabled */ + val =inw (TCO1_CNT (p)); +if (!(val &BIT (11 ))) +set_bit (WDOG_HW_RUNNING , &p->wddev.status); +} +/* * Kernel Interfaces */
@@ -537,8 +547,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)watchdog_set_drvdata (&p->wddev, p);platform_set_drvdata (pdev, p); -/* Make sure the watchdog is not running */ -iTCO_wdt_stop (&p->wddev); +iTCO_wdt_set_running (p);/* Check that the heartbeat value is within it's range; if not reset to the default */
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 43/91 watchdog: iTCO_wdt: Set NO_REBOOT if the watchdog is not already running
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
commit ef9b7bf52c2f47f0a9bf988543c577b92c92d15e upstream.
Daniel reported that the commit 1ae3e78c0820 ("watchdog: iTCO_wdt: No need to stop the timer in probe") makes QEMU implementation of the iTCO watchdog not to trigger reboot anymore when NO_REBOOT flag is initially cleared using this option (in QEMU command line):
-global ICH9-LPC.noreboot=false
The problem with the commit is that it left the unconditional setting of NO_REBOOT that is not cleared anymore when the kernel keeps pinging the watchdog (as opposed to the previous code that called iTCO_wdt_stop() that cleared it).
Fix this so that we only set NO_REBOOT if the watchdog was not initially running.
--- drivers/watchdog/iTCO_wdt.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/watchdog/iTCO_wdt.c +14 -7
@@ -401,14 +401,18 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)return time_left; } -static void iTCO_wdt_set_running (struct iTCO_wdt_private *p) +/* Returns true if the watchdog was running */ +static bool iTCO_wdt_set_running (struct iTCO_wdt_private *p) {u16 val; -/* Bit 11: TCO Timer Halt -> 0 = The TCO timer is * enabled */ +/* Bit 11: TCO Timer Halt -> 0 = The TCO timer is enabled */ val =inw (TCO1_CNT (p)); -if (!(val &BIT (11 ))) +if (!(val &BIT (11 ))) {set_bit (WDOG_HW_RUNNING , &p->wddev.status); +return true; + } +return false; }/*
@@ -486,9 +490,6 @@ static int iTCO_wdt_probe(struct platform_device *pdev)return -ENODEV ;/* Cannot reset NO_REBOOT bit */ } -/* Set the NO_REBOOT bit to prevent later reboots, just for sure */ - p->update_no_reboot_bit (p->no_reboot_priv, true); -/* The TCO logic uses the TCO_EN bit in the SMI_EN register */ if (!devm_request_region(dev, p->smi_res->start, resource_size(p->smi_res),
@@ -547,7 +548,13 @@ static int iTCO_wdt_probe(struct platform_device *pdev)watchdog_set_drvdata (&p->wddev, p);platform_set_drvdata (pdev, p); -iTCO_wdt_set_running (p); +if (!iTCO_wdt_set_running (p)) { +/* +* If the watchdog was not running set NO_REBOOT now to +* prevent later reboots. +*/ + p->update_no_reboot_bit (p->no_reboot_priv, true); + }/* Check that the heartbeat value is within it's range; if not reset to the default */
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 44/91 net: Fix unwanted sign extension in netdev_stats_to_stats64()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Riemann <[email protected]>
[ Upstream commit 9b55d3f0a69af649c62cbc2633e6d695bb3cc583 ]
When converting net_device_stats to rtnl_link_stats64 sign extension is triggered on ILP32 machines as 6c1c509778 changed the previous "ulong -> u64" conversion to "long -> u64" by accessing the net_device_stats fields through a (signed) atomic_long_t.
This causes for example the received bytes counter to jump to 16EiB after having received 2^31 bytes. Casting the atomic value to "unsigned long" beforehand converting it into u64 avoids this.
--- net/core/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
@@ -9041,7 +9041,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));
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 35/91 parisc: irq: Make irq_stack_union static to avoid sparse warning
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
[ Upstream commit b1bef1388c427cdad7331a9c8eb4ebbbe5b954b0 ]
--- arch/parisc/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/parisc/kernel/irq.c +1 -1
@@ -392,7 +392,7 @@ union irq_stack_union {volatile unsigned int lock[1 ]; }; -DEFINE_PER_CPU(union irq_stack_union, irq_stack_union) = { +static DEFINE_PER_CPU(union irq_stack_union, irq_stack_union) = { .slock = {1 ,1 ,1 ,1 }, };#endif
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 65/91 Revert "PCI: qcom: Disable write access to read only registers for IP v2.3.3"
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
This reverts commit 3a4ecf4c9d793d0ecd07fc49cd76a2e24652d3b7 which is commit a33d700e8eea76c62120cb3dbf5e01328f18319a upstream.
It was applied to the incorrect function as the original function the commit changed is not in this kernel branch.
--- drivers/pci/controller/dwc/pcie-qcom.c | 2 -- 1 file changed, 2 deletions(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -2
@@ -758,8 +758,6 @@ static int qcom_pcie_get_resources_2_4_0if (IS_ERR (res->phy_ahb_reset))return PTR_ERR (res->phy_ahb_reset); -dw_pcie_dbi_ro_wr_dis (pci); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 74/91 regmap: rbtree: Fix wrong register marked as in-cache when creating new node
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Fitzgerald <[email protected]>
[ Upstream commit 7a795ac8d49e2433e1b97caf5e99129daf8e1b08 ]
When regcache_rbtree_write() creates a new rbtree_node it was passing the wrong bit number to regcache_rbtree_set_register(). The bit number is the offset __in number of registers__, but in the case of creating a new block regcache_rbtree_write() was not dividing by the address stride to get the number of registers.
Fix this by dividing by map->reg_stride.
Compare with regcache_rbtree_read() where the bit is checked.
This bug meant that the wrong register was marked as present. The register that was written to the cache could not be read from the cache because it was not marked as cached. But a nearby register could be marked as having a cached value even if it was never written to the cache.
--- drivers/base/regmap/regcache-rbtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/base/regmap/regcache-rbtree.c +2 -1
@@ -467,7 +467,8 @@ static int regcache_rbtree_write(struct regmap *map, unsigned int reg,if (!rbnode)return -ENOMEM ;regcache_rbtree_set_register (map, rbnode, - reg - rbnode->base_reg, value); + (reg - rbnode->base_reg) / map->reg_stride, + value);regcache_rbtree_insert (map, &rbtree_ctx->root, rbnode); rbtree_ctx->cached_rbnode = rbnode; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 75/91 scsi: target: core: Fix deadlock due to recursive locking
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Junxiao Bi <[email protected]>
[ Upstream commit a154f5f643c6ecddd44847217a7a3845b4350003 ]
The following call trace shows a deadlock issue due to recursive locking of mutex "device_mutex". First lock acquire is in target_for_each_device() and second in target_free_device().
PID: 148266 TASK: ffff8be21ffb5d00 CPU: 10 COMMAND: "iscsi_ttx"
#0 [ffffa2bfc9ec3b18] __schedule at ffffffffa8060e7f
#1 [ffffa2bfc9ec3ba0] schedule at ffffffffa8061224
#2 [ffffa2bfc9ec3bb8] schedule_preempt_disabled at ffffffffa80615ee
#3 [ffffa2bfc9ec3bc8] __mutex_lock at ffffffffa8062fd7
#4 [ffffa2bfc9ec3c40] __mutex_lock_slowpath at ffffffffa80631d3
#5 [ffffa2bfc9ec3c50] mutex_lock at ffffffffa806320c
#6 [ffffa2bfc9ec3c68] target_free_device at ffffffffc0935998 [target_core_mod]
#7 [ffffa2bfc9ec3c90] target_core_dev_release at ffffffffc092f975 [target_core_mod] #8 [ffffa2bfc9ec3ca0] config_item_put at ffffffffa79d250f
#9 [ffffa2bfc9ec3cd0] config_item_put at ffffffffa79d2583
#10 [ffffa2bfc9ec3ce0] target_devices_idr_iter at ffffffffc0933f3a [target_core_mod] #11 [ffffa2bfc9ec3d00] idr_for_each at ffffffffa803f6fc
#12 [ffffa2bfc9ec3d60] target_for_each_device at ffffffffc0935670 [target_core_mod] #13 [ffffa2bfc9ec3d98] transport_deregister_session at ffffffffc0946408 [target_core_mod] #14 [ffffa2bfc9ec3dc8] iscsit_close_session at ffffffffc09a44a6 [iscsi_target_mod] #15 [ffffa2bfc9ec3df0] iscsit_close_connection at ffffffffc09a4a88 [iscsi_target_mod] #16 [ffffa2bfc9ec3df8] finish_task_switch at ffffffffa76e5d07
#17 [ffffa2bfc9ec3e78] iscsit_take_action_for_connection_exit at ffffffffc0991c23 [iscsi_target_mod] #18 [ffffa2bfc9ec3ea0] iscsi_target_tx_thread at ffffffffc09a403b [iscsi_target_mod] #19 [ffffa2bfc9ec3f08] kthread at ffffffffa76d8080
#20 [ffffa2bfc9ec3f50] ret_from_fork at ffffffffa8200364
--- drivers/target/target_core_device.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/target/target_core_device.c +4 -7
@@ -881,7 +881,6 @@ sector_t target_to_linux_sector(struct se_device *dev, sector_t lb)EXPORT_SYMBOL (target_to_linux_sector);struct devices_idr_iter { -struct config_item *prev_item;int (*fn)(struct se_device *dev,void *data);void *data; };
@@ -891,11 +890,9 @@ static int target_devices_idr_iter(int id, void *p, void *data) {struct devices_idr_iter *iter = data;struct se_device *dev = p; +struct config_item *item;int ret; -config_item_put (iter->prev_item); - iter->prev_item =NULL ; -/* * We add the device early to the idr, so it can be used * by backend modules during configuration. We do not want
@@ -905,12 +902,13 @@ static int target_devices_idr_iter(int id, void *p, void *data)if (!target_dev_configured (dev))return 0 ; - iter->prev_item =config_item_get_unless_zero (&dev->dev_group.cg_item); -if (!iter->prev_item) + item =config_item_get_unless_zero (&dev->dev_group.cg_item); +if (!item)return 0 ;mutex_unlock (&device_mutex); ret = iter->fn (dev, iter->data); +config_item_put (item);mutex_lock (&device_mutex);return ret;
@@ -933,7 +931,6 @@ int target_for_each_device(int (*fn)(struct se_device *dev, void *data),mutex_lock (&device_mutex); ret =idr_for_each (&devices_idr, target_devices_idr_iter, &iter);mutex_unlock (&device_mutex); -config_item_put (iter.prev_item);return ret; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 76/91 modpost: add missing else to the "of" check
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mauricio Faria de Oliveira <[email protected]>
[ Upstream commit cbc3d00cf88fda95dbcafee3b38655b7a8f2650a ]
Without this 'else' statement, an "usb" name goes into two handlers:
the first/previous 'if' statement _AND_ the for-loop over 'devtable', but the latter is useless as it has no 'usb' device_id entry anyway.
Tested with allmodconfig before/after patch; no changes to *.mod.c:
git checkout v6.6-rc3
make -j$(nproc) allmodconfig
make -j$(nproc) olddefconfig
make -j$(nproc)
find . -name '*.mod.c' | cpio -pd /tmp/before
# apply patch
make -j$(nproc)
find . -name '*.mod.c' | cpio -pd /tmp/after
diff -r /tmp/before/ /tmp/after/
# no difference
--- scripts/mod/file2alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mod/file2alias.c +1 -1
@@ -1395,7 +1395,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,/* First handle the "special" cases */ if (sym_is (name, namelen,"usb" ))do_usb_table (symval, sym->st_size, mod); -if (sym_is (name, namelen,"of" )) +else if (sym_is (name, namelen,"of" ))do_of_table (symval, sym->st_size, mod);else if (sym_is (name, namelen,"pnp" ))do_pnp_device_entry (symval, sym->st_size, mod);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 77/91 ipv4, ipv6: Fix handling of transhdrlen in __ip{,6}_append_data()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 9d4c75800f61e5d75c1659ba201b6c0c7ead3070 ]
Including the transhdrlen in length is a problem when the packet is partially filled (e.g. something like send(MSG_MORE) happened previously) when appending to an IPv4 or IPv6 packet as we don't want to repeat the transport header or account for it twice. This can happen under some circumstances, such as splicing into an L2TP socket.
The symptom observed is a warning in __ip6_append_data():
WARNING: CPU: 1 PID: 5042 at net/ipv6/ip6_output.c:1800 __ip6_append_data.isra.0+0x1be8/0x47f0 net/ipv6/ip6_output.c:1800
that occurs when MSG_SPLICE_PAGES is used to append more data to an already partially occupied skbuff. The warning occurs when 'copy' is larger than the amount of data in the message iterator. This is because the requested length includes the transport header length when it shouldn't. This can be triggered by, for example:
sfd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_L2TP);
bind(sfd, ...); // ::1
connect(sfd, ...); // ::1 port 7
send(sfd, buffer, 4100, MSG_MORE);
sendfile(sfd, dfd, NULL, 1024);Fix this by only adding transhdrlen into the length if the write queue is empty in l2tp_ip6_sendmsg(), analogously to how UDP does things.
l2tp_ip_sendmsg() looks like it won't suffer from this problem as it builds the UDP packet itself.
--- net/l2tp/l2tp_ip6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_ip6.c +1 -1
@@ -525,7 +525,6 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)*/ if (len >INT_MAX - transhdrlen)return -EMSGSIZE ; - ulen = len + transhdrlen;/* Mirror BSD error message compatibility */ if (msg->msg_flags &MSG_OOB )
@@ -649,6 +648,7 @@ static int l2tp_ip6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) back_from_confirm:lock_sock (sk); + ulen = len +skb_queue_empty (&sk->sk_write_queue) ? transhdrlen :0 ; err = ip6_append_data(sk, ip_generic_getfrag, msg, ulen, transhdrlen, &ipc6, &fl6, (struct rt6_info *)dst,
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 78/91 net: usb: smsc75xx: Fix uninit-value access in __smsc75xx_read_reg
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shigeru Yoshida <[email protected]>
[ Upstream commit e9c65989920f7c28775ec4e0c11b483910fb67b8 ]
syzbot reported the following uninit-value access issue:
=====================================================
BUG: KMSAN: uninit-value in smsc75xx_wait_ready drivers/net/usb/smsc75xx.c:975 [inline] BUG: KMSAN: uninit-value in smsc75xx_bind+0x5c9/0x11e0 drivers/net/usb/smsc75xx.c:1482 CPU: 0 PID: 8696 Comm: kworker/0:3 Not tainted 5.8.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x21c/0x280 lib/dump_stack.c:118 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215 smsc75xx_wait_ready drivers/net/usb/smsc75xx.c:975 [inline] smsc75xx_bind+0x5c9/0x11e0 drivers/net/usb/smsc75xx.c:1482 usbnet_probe+0x1152/0x3f90 drivers/net/usb/usbnet.c:1737 usb_probe_interface+0xece/0x1550 drivers/usb/core/driver.c:374 really_probe+0xf20/0x20b0 drivers/base/dd.c:529 driver_probe_device+0x293/0x390 drivers/base/dd.c:701 __device_attach_driver+0x63f/0x830 drivers/base/dd.c:807 bus_for_each_drv+0x2ca/0x3f0 drivers/base/bus.c:431 __device_attach+0x4e2/0x7f0 drivers/base/dd.c:873 device_initial_probe+0x4a/0x60 drivers/base/dd.c:920 bus_probe_device+0x177/0x3d0 drivers/base/bus.c:491 device_add+0x3b0e/0x40d0 drivers/base/core.c:2680 usb_set_configuration+0x380f/0x3f10 drivers/usb/core/message.c:2032 usb_generic_driver_probe+0x138/0x300 drivers/usb/core/generic.c:241 usb_probe_device+0x311/0x490 drivers/usb/core/driver.c:272 really_probe+0xf20/0x20b0 drivers/base/dd.c:529 driver_probe_device+0x293/0x390 drivers/base/dd.c:701 __device_attach_driver+0x63f/0x830 drivers/base/dd.c:807 bus_for_each_drv+0x2ca/0x3f0 drivers/base/bus.c:431 __device_attach+0x4e2/0x7f0 drivers/base/dd.c:873 device_initial_probe+0x4a/0x60 drivers/base/dd.c:920 bus_probe_device+0x177/0x3d0 drivers/base/bus.c:491 device_add+0x3b0e/0x40d0 drivers/base/core.c:2680 usb_new_device+0x1bd4/0x2a30 drivers/usb/core/hub.c:2554 hub_port_connect drivers/usb/core/hub.c:5208 [inline] hub_port_connect_change drivers/usb/core/hub.c:5348 [inline] port_event drivers/usb/core/hub.c:5494 [inline] hub_event+0x5e7b/0x8a70 drivers/usb/core/hub.c:5576 process_one_work+0x1688/0x2140 kernel/workqueue.c:2269 worker_thread+0x10bc/0x2730 kernel/workqueue.c:2415 kthread+0x551/0x590 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:293
Local variable ----buf.i87@smsc75xx_bind created at:
__smsc75xx_read_reg drivers/net/usb/smsc75xx.c:83 [inline] smsc75xx_wait_ready drivers/net/usb/smsc75xx.c:968 [inline] smsc75xx_bind+0x485/0x11e0 drivers/net/usb/smsc75xx.c:1482 __smsc75xx_read_reg drivers/net/usb/smsc75xx.c:83 [inline] smsc75xx_wait_ready drivers/net/usb/smsc75xx.c:968 [inline] smsc75xx_bind+0x485/0x11e0 drivers/net/usb/smsc75xx.c:1482
This issue is caused because usbnet_read_cmd() reads less bytes than requested (zero byte in the reproducer). In this case, 'buf' is not properly filled.
This patch fixes the issue by returning -ENODATA if usbnet_read_cmd() reads less bytes than requested.
--- drivers/net/usb/smsc75xx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/usb/smsc75xx.c +3 -1
@@ -102,7 +102,9 @@ static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index, ret =fn (dev,USB_VENDOR_REQUEST_READ_REGISTER ,USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE ,0 , index, &buf,4 ); -if (unlikely (ret <0 )) { +if (unlikely (ret <4 )) { + ret = ret <0 ? ret : -ENODATA ; +netdev_warn (dev->net,"Failed to read reg index 0x%08x: %d\n" , index, ret);return ret;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 79/91 net: stmmac: dwmac-stm32: fix resume on STM32 MCU
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Wolsieffer <[email protected]>
[ Upstream commit 6f195d6b0da3b689922ba9e302af2f49592fa9fc ]
The STM32MP1 keeps clk_rx enabled during suspend, and therefore the driver does not enable the clock in stm32_dwmac_init() if the device was suspended. The problem is that this same code runs on STM32 MCUs, which do disable clk_rx during suspend, causing the clock to never be re-enabled on resume.
This patch adds a variant flag to indicate that clk_rx remains enabled during suspend, and uses this to decide whether to enable the clock in stm32_dwmac_init() if the device was suspended.
This approach fixes this specific bug with limited opportunity for unintended side-effects, but I have a follow up patch that will refactor the clock configuration and hopefully make it less error prone.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c +5 -2
@@ -57,6 +57,7 @@ struct stm32_ops {int (*parse_data)(struct stm32_dwmac *dwmac,struct device *dev);u32 syscfg_eth_mask; +bool clk_rx_enable_in_suspend; };static int stm32_dwmac_init (struct plat_stmmacenet_data *plat_dat)
@@ -74,7 +75,8 @@ static int stm32_dwmac_init(struct plat_stmmacenet_data *plat_dat)if (ret)return ret; -if (!dwmac->dev->power.is_suspended) { +if (!dwmac->ops->clk_rx_enable_in_suspend || + !dwmac->dev->power.is_suspended) { ret =clk_prepare_enable (dwmac->clk_rx);if (ret) {clk_disable_unprepare (dwmac->clk_tx);
@@ -413,7 +415,8 @@ static struct stm32_ops stm32mp1_dwmac_data = { .suspend = stm32mp1_suspend, .resume = stm32mp1_resume, .parse_data = stm32mp1_parse_data, - .syscfg_eth_mask = SYSCFG_MP1_ETH_MASK + .syscfg_eth_mask = SYSCFG_MP1_ETH_MASK, + .clk_rx_enable_in_suspend = true };static const struct of_device_id stm32_dwmac_match[] = {
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 80/91 tcp: fix quick-ack counting to count actual ACKs of new data
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neal Cardwell <[email protected]>
[ Upstream commit 059217c18be6757b95bfd77ba53fb50b48b8a816 ]
This commit fixes quick-ack counting so that it only considers that a quick-ack has been provided if we are sending an ACK that newly acknowledges data.
The code was erroneously using the number of data segments in outgoing skbs when deciding how many quick-ack credits to remove. This logic does not make sense, and could cause poor performance in request-response workloads, like RPC traffic, where requests or responses can be multi-segment skbs.
When a TCP connection decides to send N quick-acks, that is to accelerate the cwnd growth of the congestion control module controlling the remote endpoint of the TCP connection. That quick-ack decision is purely about the incoming data and outgoing ACKs. It has nothing to do with the outgoing data or the size of outgoing data.
And in particular, an ACK only serves the intended purpose of allowing the remote congestion control to grow the congestion window quickly if the ACK is ACKing or SACKing new data.
The fix is simple: only count packets as serving the goal of the quickack mechanism if they are ACKing/SACKing new data. We can tell whether this is the case by checking inet_csk_ack_scheduled(), since we schedule an ACK exactly when we are ACKing/SACKing new data.
--- include/net/tcp.h | 6 ++++-- net/ipv4/tcp_output.c | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-)
include/net/tcp.h +4 -2
@@ -346,12 +346,14 @@ ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags); -static inline void tcp_dec_quickack_mode (struct sock *sk, -const unsigned int pkts) +static inline void tcp_dec_quickack_mode (struct sock *sk) {struct inet_connection_sock *icsk =inet_csk (sk);if (icsk->icsk_ack.quick) { +/* How many ACKs S/ACKing new data have we sent? */ +const unsigned int pkts =inet_csk_ack_scheduled (sk) ?1 :0 ; +if (pkts >= icsk->icsk_ack.quick) { icsk->icsk_ack.quick =0 ;/* Leaving quickack mode we deflate ATO. */
net/ipv4/tcp_output.c +3 -4
@@ -164,8 +164,7 @@ static void tcp_event_data_sent(struct tcp_sock *tp, }/* Account for an ACK we sent. */ -static inline void tcp_event_ack_sent (struct sock *sk,unsigned int pkts, -u32 rcv_nxt) +static inline void tcp_event_ack_sent (struct sock *sk,u32 rcv_nxt) {struct tcp_sock *tp =tcp_sk (sk);
@@ -179,7 +178,7 @@ static inline void tcp_event_ack_sent(struct sock *sk, unsigned int pkts,if (unlikely (rcv_nxt != tp->rcv_nxt))return ;/* Special ACK sent by DCTCP to reflect ECN */ -tcp_dec_quickack_mode (sk, pkts); +tcp_dec_quickack_mode (sk);inet_csk_clear_xmit_timer (sk,ICSK_TIME_DACK ); }
@@ -1139,7 +1138,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, icsk->icsk_af_ops->send_check (sk, skb);if (likely (tcb->tcp_flags &TCPHDR_ACK )) -tcp_event_ack_sent (sk,tcp_skb_pcount (skb), rcv_nxt); +tcp_event_ack_sent (sk, rcv_nxt);if (skb->len != tcp_header_size) {tcp_event_data_sent (tp, sk);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 81/91 tcp: fix delayed ACKs for MSS boundary condition
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neal Cardwell <[email protected]>
[ Upstream commit 4720852ed9afb1c5ab84e96135cb5b73d5afde6f ]
This commit fixes poor delayed ACK behavior that can cause poor TCP latency in a particular boundary condition: when an application makes a TCP socket write that is an exact multiple of the MSS size.
The problem is that there is painful boundary discontinuity in the current delayed ACK behavior. With the current delayed ACK behavior, we have:
(1) If an app reads data when > 1*MSS is unacknowledged, then tcp_cleanup_rbuf() ACKs immediately because of:
tp->rcv_nxt - tp->rcv_wup > icsk->icsk_ack.rcv_mss ||
(2) If an app reads all received data, and the packets were < 1*MSS,
and either (a) the app is not ping-pong or (b) we received two
packets < 1*MSS, then tcp_cleanup_rbuf() ACKs immediately beecause
of:
((icsk->icsk_ack.pending & ICSK_ACK_PUSHED2) ||
((icsk->icsk_ack.pending & ICSK_ACK_PUSHED) &&
!inet_csk_in_pingpong_mode(sk))) &&(3) *However*: if an app reads exactly 1*MSS of data, tcp_cleanup_rbuf() does not send an immediate ACK. This is true even if the app is not ping-pong and the 1*MSS of data had the PSH bit set, suggesting the sending application completed an application write.
Thus if the app is not ping-pong, we have this painful case where
Quoted 1 line
1*MSS gets an immediate ACK, and <1*MSS gets an immediate ACK, but a
write whose last skb is an exact multiple of 1*MSS can get a 40ms delayed ACK. This means that any app that transfers data in one direction and takes care to align write size or packet size with MSS can suffer this problem. With receive zero copy making 4KB MSS values more common, it is becoming more common to have application writes naturally align with MSS, and more applications are likely to encounter this delayed ACK problem.
The fix in this commit is to refine the delayed ACK heuristics with a simple check: immediately ACK a received 1*MSS skb with PSH bit set if the app reads all data. Why? If an skb has a len of exactly 1*MSS and has the PSH bit set then it is likely the end of an application write. So more data may not be arriving soon, and yet the data sender may be waiting for an ACK if cwnd-bound or using TX zero copy. Thus we set ICSK_ACK_PUSHED in this case so that tcp_cleanup_rbuf() will send an ACK immediately if the app reads all of the data and is not ping-pong. Note that this logic is also executed for the case where len > MSS, but in that case this logic does not matter (and does not hurt) because tcp_cleanup_rbuf() will always ACK immediately if the app reads data and there is more than an MSS of unACKed data.
--- net/ipv4/tcp_input.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
net/ipv4/tcp_input.c +13 -0
@@ -172,6 +172,19 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)if (unlikely (len > icsk->icsk_ack.rcv_mss +MAX_TCP_OPTION_SPACE ))tcp_gro_dev_warn (sk, skb, len); +/* If the skb has a len of exactly 1*MSS and has the PSH bit +* set then it is likely the end of an application write. So +* more data may not be arriving soon, and yet the data sender +* may be waiting for an ACK if cwnd-bound or using TX zero +* copy. So we set ICSK_ACK_PUSHED here so that +* tcp_cleanup_rbuf() will send an ACK immediately if the app +* reads all of the data and is not ping-pong. If len > MSS +* then this logic does not matter (and does not hurt) because +* tcp_cleanup_rbuf() will always ACK immediately if the app +* reads data and there is more than an MSS of unACKed data. +*/ +if (TCP_SKB_CB (skb)->tcp_flags &TCPHDR_PSH ) + icsk->icsk_ack.pending |=ICSK_ACK_PUSHED ; }else {/* Otherwise, we make more careful check taking into account, * that SACKs block is variable.
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 82/91 sctp: update transport state when processing a dupcook packet
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Long <[email protected]>
[ Upstream commit 2222a78075f0c19ca18db53fd6623afb4aff602d ]
During the 4-way handshake, the transport's state is set to ACTIVE in sctp_process_init() when processing INIT_ACK chunk on client or COOKIE_ECHO chunk on server.
In the collision scenario below:
192.168.1.2 > 192.168.1.1: sctp (1) [INIT] [init tag: 3922216408]
192.168.1.1 > 192.168.1.2: sctp (1) [INIT] [init tag: 144230885]
192.168.1.2 > 192.168.1.1: sctp (1) [INIT ACK] [init tag: 3922216408]
192.168.1.1 > 192.168.1.2: sctp (1) [COOKIE ECHO]
192.168.1.2 > 192.168.1.1: sctp (1) [COOKIE ACK]192.168.1.1 > 192.168.1.2: sctp (1) [INIT ACK] [init tag: 3914796021]
when processing COOKIE_ECHO on 192.168.1.2, as it's in COOKIE_WAIT state, sctp_sf_do_dupcook_b() is called by sctp_sf_do_5_2_4_dupcook() where it creates a new association and sets its transport to ACTIVE then updates to the old association in sctp_assoc_update().
However, in sctp_assoc_update(), it will skip the transport update if it finds a transport with the same ipaddr already existing in the old asoc, and this causes the old asoc's transport state not to move to ACTIVE after the handshake.
This means if DATA retransmission happens at this moment, it won't be able to enter PF state because of the check 'transport->state == SCTP_ACTIVE' in sctp_do_8_2_transport_strike().
This patch fixes it by updating the transport in sctp_assoc_update() with sctp_assoc_add_peer() where it updates the transport state if there is already a transport with the same ipaddr exists in the old asoc.
--- net/sctp/associola.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/sctp/associola.c +1 -2
@@ -1181,8 +1181,7 @@ int sctp_assoc_update(struct sctp_association *asoc,/* Add any peer addresses from the new association. */ list_for_each_entry (trans, &new->peer.transport_addr_list, transports) -if (!sctp_assoc_lookup_paddr (asoc, &trans->ipaddr) && - !sctp_assoc_add_peer (asoc, &trans->ipaddr, +if (!sctp_assoc_add_peer (asoc, &trans->ipaddr,GFP_ATOMIC , trans->state))return -ENOMEM ;
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 83/91 sctp: update hb timer immediately after users change hb_interval
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Long <[email protected]>
[ Upstream commit 1f4e803cd9c9166eb8b6c8b0b8e4124f7499fc07 ]
Currently, when hb_interval is changed by users, it won't take effect until the next expiry of hb timer. As the default value is 30s, users have to wait up to 30s to wait its hb_interval update to work.
This becomes pretty bad in containers where a much smaller value is usually set on hb_interval. This patch improves it by resetting the hb timer immediately once the value of hb_interval is updated by users.
Note that we don't address the already existing 'problem' when sending a heartbeat 'on demand' if one hb has just been sent(from the timer) mentioned in:
https://www.mail-archive.com/[email protected]/msg590224.html
--- net/sctp/socket.c | 1 + 1 file changed, 1 insertion(+)
net/sctp/socket.c +1 -0
@@ -2578,6 +2578,7 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,if (trans) { trans->hbinterval =msecs_to_jiffies (params->spp_hbinterval); +sctp_transport_reset_hb_timer (trans); }else if (asoc) { asoc->hbinterval =msecs_to_jiffies (params->spp_hbinterval);
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 66/91 scsi: zfcp: Fix a double put in zfcp_port_enqueue()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dinghao Liu <[email protected]>
commit b481f644d9174670b385c3a699617052cd2a79d3 upstream.
When device_register() fails, zfcp_port_release() will be called after put_device(). As a result, zfcp_ccw_adapter_put() will be called twice: one in zfcp_port_release() and one in the error path after device_register(). So the reference on the adapter object is doubly put, which may lead to a premature free. Fix this by adjusting the error tag after device_register().
--- drivers/s390/scsi/zfcp_aux.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/s390/scsi/zfcp_aux.c +5 -4
@@ -493,12 +493,12 @@ struct zfcp_port *zfcp_port_enqueue(struif (port) {put_device (&port->dev); retval = -EEXIST ; - goto err_out; + goto err_put; } port =kzalloc (sizeof (struct zfcp_port ),GFP_KERNEL );if (!port) - goto err_out; + goto err_put;rwlock_init (&port->unit_list_lock);INIT_LIST_HEAD (&port->unit_list);
@@ -521,7 +521,7 @@ struct zfcp_port *zfcp_port_enqueue(struif (dev_set_name (&port->dev,"0x%016llx" , (unsigned long long )wwpn)) {kfree (port); - goto err_out; + goto err_put; } retval = -EINVAL ;
@@ -538,8 +538,9 @@ struct zfcp_port *zfcp_port_enqueue(strureturn port; -err_out: +err_put:zfcp_ccw_adapter_put (adapter); +err_out:return ERR_PTR (retval); }
Greg Kroah-Hartman
maintainerPATCH 84/91 cpupower: add Makefile dependencies for install targets
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Babrou <[email protected]>
commit fb7791e213a64495ec2336869b868fcd8af14346 upstream.
This allows building cpupower in parallel rather than serially.
--- tools/power/cpupower/Makefile | 8 ++++---- tools/power/cpupower/bench/Makefile | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
tools/power/cpupower/Makefile +4 -4
@@ -278,14 +278,14 @@ clean: $(MAKE) -C bench O=$(OUTPUT) clean -install-lib: +install-lib: libcpupower $(INSTALL) -d $(DESTDIR)${libdir} $(CP) $(OUTPUT)libcpupower.so* $(DESTDIR)${libdir}/ $(INSTALL) -d $(DESTDIR)${includedir} $(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h $(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h -install-tools: +install-tools: $(OUTPUT)cpupower $(INSTALL) -d $(DESTDIR)${bindir} $(INSTALL_PROGRAM) $(OUTPUT)cpupower $(DESTDIR)${bindir}
@@ -299,14 +299,14 @@ install-man: $(INSTALL_DATA) -D man/cpupower-info.1 $(DESTDIR)${mandir}/man1/cpupower-info.1 $(INSTALL_DATA) -D man/cpupower-monitor.1 $(DESTDIR)${mandir}/man1/cpupower-monitor.1 -install-gmo: +install-gmo: create-gmo $(INSTALL) -d $(DESTDIR)${localedir} for HLANG in $(LANGUAGES); do \ echo '$(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo'; \ $(INSTALL_DATA) -D $(OUTPUT)po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; -install-bench: +install-bench: compile-bench @#DESTDIR must be set from outside to survive @sbindir=$(sbindir) bindir=$(bindir) docdir=$(docdir) confdir=$(confdir) $(MAKE) -C bench O=$(OUTPUT) install
tools/power/cpupower/bench/Makefile +1 -1
@@ -27,7 +27,7 @@ $(OUTPUT)cpufreq-bench: $(OBJS) all: $(OUTPUT)cpufreq-bench -install: +install: $(OUTPUT)cpufreq-bench mkdir -p $(DESTDIR)/$(sbindir) mkdir -p $(DESTDIR)/$(bindir) mkdir -p $(DESTDIR)/$(docdir)
Greg Kroah-Hartman
maintainerPATCH 85/91 IB/mlx4: Fix the size of a buffer in add_port_entries()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
commit d7f393430a17c2bfcdf805462a5aa80be4285b27 upstream.
In order to be sure that 'buff' is never truncated, its size should be 12, not 11.
When building with W=1, this fixes the following warnings:
drivers/infiniband/hw/mlx4/sysfs.c: In function ‘add_port_entries’:
drivers/infiniband/hw/mlx4/sysfs.c:268:34: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
268 | sprintf(buff, "%d", i);
| ^
drivers/infiniband/hw/mlx4/sysfs.c:268:17: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 11
268 | sprintf(buff, "%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/mlx4/sysfs.c:286:34: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=]
286 | sprintf(buff, "%d", i);
| ^
drivers/infiniband/hw/mlx4/sysfs.c:286:17: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 11
286 | sprintf(buff, "%d", i);
| ^~~~~~~~~~~~~~~~~~~~~~--- drivers/infiniband/hw/mlx4/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx4/sysfs.c +1 -1
@@ -221,7 +221,7 @@ void del_sysfs_port_mcg_attr(struct mlx4static int add_port_entries (struct mlx4_ib_dev *device,int port_num) {int i; -char buff[11 ]; +char buff[12 ];struct mlx4_ib_iov_port *port =NULL ;int ret =0 ;struct ib_port_attr attr;
Greg Kroah-Hartman
maintainerPATCH 86/91 gpio: aspeed: fix the GPIO number passed to pinctrl_gpio_set_config()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bartosz Golaszewski <[email protected]>
commit f9315f17bf778cb8079a29639419fcc8a41a3c84 upstream.
pinctrl_gpio_set_config() expects the GPIO number from the global GPIO numberspace, not the controller-relative offset, which needs to be added to the chip base.
--- drivers/gpio/gpio-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-aspeed.c +1 -1
@@ -999,7 +999,7 @@ static int aspeed_gpio_set_config(structelse if (param ==PIN_CONFIG_BIAS_DISABLE || param ==PIN_CONFIG_BIAS_PULL_DOWN || param ==PIN_CONFIG_DRIVE_STRENGTH ) -return pinctrl_gpio_set_config (offset, config); +return pinctrl_gpio_set_config (chip->base + offset, config);else if (param ==PIN_CONFIG_DRIVE_OPEN_DRAIN || param ==PIN_CONFIG_DRIVE_OPEN_SOURCE )/* Return -ENOTSUPP to trigger emulation, as per datasheet */
Greg Kroah-Hartman
maintainerPATCH 87/91 gpio: pxa: disable pinctrl calls for MMP_GPIO
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duje Mihanović <[email protected]>
commit f0575116507b981e6a810e78ce3c9040395b958b upstream.
Similarly to PXA3xx and MMP2, pinctrl-single isn't capable of setting pin direction on MMP either.
--- drivers/gpio/gpio-pxa.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-pxa.c +1 -0
@@ -246,6 +246,7 @@ static bool pxa_gpio_has_pinctrl(void)switch (gpio_type) {case PXA3XX_GPIO :case MMP2_GPIO : +case MMP_GPIO :return false;default :
Greg Kroah-Hartman
maintainerPATCH 88/91 RDMA/cma: Fix truncation compilation warning in make_cma_ports
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
commit 18126c767658ae8a831257c6cb7776c5ba5e7249 upstream.
The following compilation error is false alarm as RDMA devices don't have such large amount of ports to actually cause to format truncation.
drivers/infiniband/core/cma_configfs.c: In function ‘make_cma_ports’:drivers/infiniband/core/cma_configfs.c:223:57: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
223 | snprintf(port_str, sizeof(port_str), "%u", i + 1);
| ^drivers/infiniband/core/cma_configfs.c:223:17: note: ‘snprintf’ output between 2 and 11 bytes into a destination of size 10
223 | snprintf(port_str, sizeof(port_str), "%u", i + 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:243: drivers/infiniband/core/cma_configfs.o] Error 1
--- drivers/infiniband/core/cma_configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/cma_configfs.c +1 -1
@@ -215,7 +215,7 @@ static int make_cma_ports(struct cma_dev }for (i =0 ; i < ports_num; i++) { -char port_str[10 ]; +char port_str[11 ]; ports[i].port_num = i +1 ;snprintf (port_str,sizeof (port_str),"%u" , i +1 );
Greg Kroah-Hartman
maintainerPATCH 89/91 RDMA/mlx5: Fix NULL string error
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shay Drory <[email protected]>
commit dab994bcc609a172bfdab15a0d4cb7e50e8b5458 upstream.
checkpath is complaining about NULL string, change it to 'Unknown'.
--- drivers/infiniband/hw/mlx5/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/main.c +1 -1
@@ -2005,7 +2005,7 @@ static inline char *mmap_cmd2str(enum mlcase MLX5_IB_MMAP_DEVICE_MEM :return "Device Memory" ;default : -return NULL ; +return "Unknown" ; } }
Greg Kroah-Hartman
maintainerPATCH 90/91 parisc: Restore __ldcw_align for PA-RISC 2.0 processors
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: John David Anglin <[email protected]>
commit 914988e099fc658436fbd7b8f240160c352b6552 upstream.
Back in 2005, Kyle McMartin removed the 16-byte alignment for ldcw semaphores on PA 2.0 machines (CONFIG_PA20). This broke spinlocks on pre PA8800 processors. The main symptom was random faults in mmap'd memory (e.g., gcc compilations, etc).
Unfortunately, the errata for this ldcw change is lost.
The issue is the 16-byte alignment required for ldcw semaphore instructions can only be reduced to natural alignment when the ldcw operation can be handled coherently in cache. Only PA8800 and PA8900 processors actually support doing the operation in cache.
Aligning the spinlock dynamically adds two integer instructions to each spinlock.
Tested on rp3440, c8000 and a500.
--- arch/parisc/include/asm/ldcw.h | 36 +++++++++++++++++-------------- arch/parisc/include/asm/spinlock_types.h | 5 ---- 2 files changed, 20 insertions(+), 21 deletions(-)
arch/parisc/include/asm/ldcw.h +20 -16
@@ -2,14 +2,28 @@#ifndef __PARISC_LDCW_H#define __PARISC_LDCW_H -#ifndef CONFIG_PA20 /* Because kmalloc only guarantees 8-byte alignment for kmalloc'd data, and GCC only guarantees 8-byte alignment for stack locals, we can't be assured of 16-byte alignment for atomic lock data even if we specify "__attribute ((aligned(16)))" in the type declaration. So, we use a struct containing an array of four ints for the atomic lock type and dynamically select the 16-byte aligned int from the array -for the semaphore. */ +for the semaphore. */ + +/* From: "Jim Hull" <jim.hull of hp.com> +I've attached a summary of the change, but basically, for PA 2.0, as +long as the ",CO" (coherent operation) completer is implemented, then the +16-byte alignment requirement for ldcw and ldcd is relaxed, and instead +they only require "natural" alignment (4-byte for ldcw, 8-byte for +ldcd). + +Although the cache control hint is accepted by all PA 2.0 processors, +it is only implemented on PA8800/PA8900 CPUs. Prior PA8X00 CPUs still +require 16-byte alignment. If the address is unaligned, the operation +of the instruction is undefined. The ldcw instruction does not generate +unaligned data reference traps so misaligned accesses are not detected. +This hid the problem for years. So, restore the 16-byte alignment dropped +by Kyle McMartin in "Remove __ldcw_align for PA-RISC 2.0 processors". */ #define __PA_LDCW_ALIGNMENT 16#define __PA_LDCW_ALIGN_ORDER 4
@@ -19,22 +33,12 @@ & ~(__PA_LDCW_ALIGNMENT -1 ); \ (volatile unsigned int *) __ret; \ }) -#define __LDCW "ldcw" -#else /*CONFIG_PA20*/ -/* From: "Jim Hull" <jim.hull of hp.com> -I've attached a summary of the change, but basically, for PA 2.0, as -long as the ",CO" (coherent operation) completer is specified, then the -16-byte alignment requirement for ldcw and ldcd is relaxed, and instead -they only require "natural" alignment (4-byte for ldcw, 8-byte for -ldcd). */ - -#define __PA_LDCW_ALIGNMENT 4 -#define __PA_LDCW_ALIGN_ORDER 2 -#define __ldcw_align (a) (&(a)->slock) +#ifdef CONFIG_PA20 #define __LDCW "ldcw,co" - -#endif /*!CONFIG_PA20*/ +#else +#define __LDCW "ldcw" +#endif /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. We don't explicitly expose that "*a" may be written as reload
arch/parisc/include/asm/spinlock_types.h +0 -5
@@ -3,13 +3,8 @@#define __ASM_SPINLOCK_TYPES_Htypedef struct { -#ifdef CONFIG_PA20 -volatile unsigned int slock; -# define __ARCH_SPIN_LOCK_UNLOCKED { 1 } -#else volatile unsigned int lock[4 ];# define __ARCH_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } -#endif }arch_spinlock_t ; typedef struct {
Greg Kroah-Hartman
maintainerPATCH 91/91 dccp: fix dccp_v4_err()/dccp_v6_err() again
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 6af289746a636f71f4c0535a9801774118486c7a upstream.
dh->dccph_x is the 9th byte (offset 8) in "struct dccp_hdr", not in the "byte 7" as Jann claimed.
We need to make sure the ICMP messages are big enough, using more standard ways (no more assumptions).
syzbot reported:
BUG: KMSAN: uninit-value in pskb_may_pull_reason include/linux/skbuff.h:2667 [inline] BUG: KMSAN: uninit-value in pskb_may_pull include/linux/skbuff.h:2681 [inline] BUG: KMSAN: uninit-value in dccp_v6_err+0x426/0x1aa0 net/dccp/ipv6.c:94 pskb_may_pull_reason include/linux/skbuff.h:2667 [inline] pskb_may_pull include/linux/skbuff.h:2681 [inline] dccp_v6_err+0x426/0x1aa0 net/dccp/ipv6.c:94 icmpv6_notify+0x4c7/0x880 net/ipv6/icmp.c:867 icmpv6_rcv+0x19d5/0x30d0 ip6_protocol_deliver_rcu+0xda6/0x2a60 net/ipv6/ip6_input.c:438 ip6_input_finish net/ipv6/ip6_input.c:483 [inline] NF_HOOK include/linux/netfilter.h:304 [inline] ip6_input+0x15d/0x430 net/ipv6/ip6_input.c:492 ip6_mc_input+0xa7e/0xc80 net/ipv6/ip6_input.c:586 dst_input include/net/dst.h:468 [inline] ip6_rcv_finish+0x5db/0x870 net/ipv6/ip6_input.c:79 NF_HOOK include/linux/netfilter.h:304 [inline] ipv6_rcv+0xda/0x390 net/ipv6/ip6_input.c:310 __netif_receive_skb_one_core net/core/dev.c:5523 [inline] __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5637 netif_receive_skb_internal net/core/dev.c:5723 [inline] netif_receive_skb+0x58/0x660 net/core/dev.c:5782 tun_rx_batched+0x83b/0x920 tun_get_user+0x564c/0x6940 drivers/net/tun.c:2002 tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x8ef/0x15c0 fs/read_write.c:584 ksys_write+0x20f/0x4c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x93/0xd0 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was created at:
slab_post_alloc_hook+0x12f/0xb70 mm/slab.h:767 slab_alloc_node mm/slub.c:3478 [inline] kmem_cache_alloc_node+0x577/0xa80 mm/slub.c:3523 kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:559 __alloc_skb+0x318/0x740 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] alloc_skb_with_frags+0xc8/0xbd0 net/core/skbuff.c:6313 sock_alloc_send_pskb+0xa80/0xbf0 net/core/sock.c:2795 tun_alloc_skb drivers/net/tun.c:1531 [inline] tun_get_user+0x23cf/0x6940 drivers/net/tun.c:1846 tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048 call_write_iter include/linux/fs.h:1985 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x8ef/0x15c0 fs/read_write.c:584 ksys_write+0x20f/0x4c0 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x93/0xd0 fs/read_write.c:646 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd CPU: 0 PID: 4995 Comm: syz-executor153 Not tainted 6.6.0-rc1-syzkaller-00014-ga747acc0b752 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
--- net/dccp/ipv4.c | 9 ++------- net/dccp/ipv6.c | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-)
net/dccp/ipv4.c +2 -7
@@ -247,13 +247,8 @@ static void dccp_v4_err(struct sk_buff *int err;struct net *net =dev_net (skb->dev); -/* For the first __dccp_basic_hdr_len() check, we only need dh->dccph_x, -* which is in byte 7 of the dccp header. -* Our caller (icmp_socket_deliver()) already pulled 8 bytes for us. -* -* Later on, we want to access the sequence number fields, which are -* beyond 8 bytes, so we have to pskb_may_pull() ourselves. -*/ +if (!pskb_may_pull (skb, offset +sizeof (*dh))) +return ; dh = (struct dccp_hdr *)(skb->data + offset);if (!pskb_may_pull (skb, offset +__dccp_basic_hdr_len (dh)))return ;
net/dccp/ipv6.c +2 -7
@@ -80,13 +80,8 @@ static void dccp_v6_err(struct sk_buff *__u64 seq;struct net *net =dev_net (skb->dev); -/* For the first __dccp_basic_hdr_len() check, we only need dh->dccph_x, -* which is in byte 7 of the dccp header. -* Our caller (icmpv6_notify()) already pulled 8 bytes for us. -* -* Later on, we want to access the sequence number fields, which are -* beyond 8 bytes, so we have to pskb_may_pull() ourselves. -*/ +if (!pskb_may_pull (skb, offset +sizeof (*dh))) +return ; dh = (struct dccp_hdr *)(skb->data + offset);if (!pskb_may_pull (skb, offset +__dccp_basic_hdr_len (dh)))return ;
Greg Kroah-Hartman
maintainerPATCH 67/91 qed/red_ll2: Fix undefined behavior bug in struct qed_ll2_info
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit eea03d18af9c44235865a4bc9bec4d780ef6cf21 upstream.
The flexible structure (a structure that contains a flexible-array member at the end) qed_ll2_tx_packet is nested within the second layer of struct qed_ll2_info:
struct qed_ll2_tx_packet {
...
/* Flexible Array of bds_set determined by max_bds_per_packet */
struct {
struct core_tx_bd *txq_bd;
dma_addr_t tx_frag;
u16 frag_len;
} bds_set[];
};struct qed_ll2_tx_queue {
...
struct qed_ll2_tx_packet cur_completing_packet;
};struct qed_ll2_info {
...
struct qed_ll2_tx_queue tx_queue;
struct qed_ll2_cbs cbs;
};The problem is that member cbs in struct qed_ll2_info is placed just after an object of type struct qed_ll2_tx_queue, which is in itself an implicit flexible structure, which by definition ends in a flexible array member, in this case bds_set. This causes an undefined behavior bug at run-time when dynamic memory is allocated for bds_set, which could lead to a serious issue if cbs in struct qed_ll2_info is overwritten by the contents of bds_set. Notice that the type of cbs is a structure full of function pointers (and a cookie :) ):
include/linux/qed/qed_ll2_if.h:
107 typedef
108 void (*qed_ll2_complete_rx_packet_cb)(void *cxt,
109 struct qed_ll2_comp_rx_data *data);
110
111 typedef
112 void (*qed_ll2_release_rx_packet_cb)(void *cxt,
113 u8 connection_handle, 114 void *cookie, 115 dma_addr_t rx_buf_addr, 116 bool b_last_packet); 117 118 typedef 119 void (*qed_ll2_complete_tx_packet_cb)(void *cxt, 120 u8 connection_handle, 121 void *cookie, 122 dma_addr_t first_frag_addr, 123 bool b_last_fragment, 124 bool b_last_packet); 125 126 typedef 127 void (*qed_ll2_release_tx_packet_cb)(void *cxt, 128 u8 connection_handle, 129 void *cookie, 130 dma_addr_t first_frag_addr, 131 bool b_last_fragment, bool b_last_packet);
132
133 typedef
134 void (*qed_ll2_slowpath_cb)(void *cxt, u8 connection_handle,
135 u32 opaque_data_0, u32 opaque_data_1);
136
137 struct qed_ll2_cbs {
138 qed_ll2_complete_rx_packet_cb rx_comp_cb; 139 qed_ll2_release_rx_packet_cb rx_release_cb; 140 qed_ll2_complete_tx_packet_cb tx_comp_cb; 141 qed_ll2_release_tx_packet_cb tx_release_cb; 142 qed_ll2_slowpath_cb slowpath_cb; 143 void *cookie;
144 };
Fix this by moving the declaration of cbs to the middle of its containing structure qed_ll2_info, preventing it from being overwritten by the contents of bds_set at run-time.
This bug was introduced in 2017, when bds_set was converted to a one-element array, and started to be used as a Variable Length Object (VLO) at run-time.
--- drivers/net/ethernet/qlogic/qed/qed_ll2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/qlogic/qed/qed_ll2.h +1 -1
@@ -122,9 +122,9 @@ struct qed_ll2_info {enum core_tx_dest tx_dest;u8 tx_stats_en;bool main_func_queue; +struct qed_ll2_cbs cbs;struct qed_ll2_rx_queue rx_queue;struct qed_ll2_tx_queue tx_queue; -struct qed_ll2_cbs cbs; };/**
Greg Kroah-Hartman
maintainerPATCH 68/91 wifi: mwifiex: Fix tlv_buf_left calculation
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo A. R. Silva <[email protected]>
commit eec679e4ac5f47507774956fb3479c206e761af7 upstream.
In a TLV encoding scheme, the Length part represents the length after the header containing the values for type and length. In this case, tlv_len should be:
tlv_len == (sizeof(*tlv_rxba) - 1) - sizeof(tlv_rxba->header) + tlv_bitmap_len
Notice that the - 1 accounts for the one-element array bitmap, which 1-byte size is already included in sizeof(*tlv_rxba).
So, if the above is correct, there is a double-counting of some members in struct mwifiex_ie_types_rxba_sync, when tlv_buf_left and tmp are calculated:
968 tlv_buf_left -= (sizeof(*tlv_rxba) + tlv_len);
969 tmp = (u8 *)tlv_rxba + tlv_len + sizeof(*tlv_rxba);
in specific, members:
drivers/net/wireless/marvell/mwifiex/fw.h:777
777 u8 mac[ETH_ALEN]; 778 u8 tid; 779 u8 reserved; 780 __le16 seq_num; 781 __le16 bitmap_len;
This is clearly wrong, and affects the subsequent decoding of data in event_buf through tlv_rxba:
970 tlv_rxba = (struct mwifiex_ie_types_rxba_sync *)tmp;
Fix this by using sizeof(tlv_rxba->header) instead of sizeof(*tlv_rxba) in the calculation of tlv_buf_left and tmp.
This results in the following binary differences before/after changes:
| drivers/net/wireless/marvell/mwifiex/11n_rxreorder.o | @@ -4698,11 +4698,11 @@ | drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c:968 | tlv_buf_left -= (sizeof(tlv_rxba->header) + tlv_len); | - 1da7: lea -0x11(%rbx),%edx | + 1da7: lea -0x4(%rbx),%edx | 1daa: movzwl %bp,%eax | drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c:969 | tmp = (u8 *)tlv_rxba + sizeof(tlv_rxba->header) + tlv_len; | - 1dad: lea 0x11(%r15,%rbp,1),%r15 | + 1dad: lea 0x4(%r15,%rbp,1),%r15
The above reflects the desired change: avoid counting 13 too many bytes; which is the total size of the double-counted members in struct mwifiex_ie_types_rxba_sync:
$ pahole -C mwifiex_ie_types_rxba_sync drivers/net/wireless/marvell/mwifiex/11n_rxreorder.o
struct mwifiex_ie_types_rxba_sync {
struct mwifiex_ie_types_header header; /* 0 4 */ |-----------------------------------------------------------------------
| u8 mac[6]; /* 4 6 */ |
| u8 tid; /* 10 1 */ |
| u8 reserved; /* 11 1 */ |
| __le16 seq_num; /* 12 2 */ |
| __le16 bitmap_len; /* 14 2 */ |
| u8 bitmap[1]; /* 16 1 */ |
|----------------------------------------------------------------------|
| 13 bytes|
-----------
/* size: 17, cachelines: 1, members: 7 */
/* last cacheline: 17 bytes */
} __attribute__((__packed__));--- drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c +2 -2
@@ -986,8 +986,8 @@ void mwifiex_11n_rxba_sync_event(struct } } - tlv_buf_left -= (sizeof (*tlv_rxba) + tlv_len); - tmp = (u8 *)tlv_rxba + tlv_len +sizeof (*tlv_rxba); + tlv_buf_left -= (sizeof (tlv_rxba->header) + tlv_len); + tmp = (u8 *)tlv_rxba +sizeof (tlv_rxba->header) + tlv_len; tlv_rxba = (struct mwifiex_ie_types_rxba_sync *)tmp; } }
Greg Kroah-Hartman
maintainerPATCH 69/91 net: replace calls to sock->ops->connect() with kernel_connect()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jordan Rife <[email protected]>
commit 26297b4ce1ce4ea40bc9a48ec99f45da3f64d2e2 upstream.
commit 0bdf399342c5 ("net: Avoid address overwrite in kernel_connect") ensured that kernel_connect() will not overwrite the address parameter in cases where BPF connect hooks perform an address rewrite. This change replaces direct calls to sock->ops->connect() in net with kernel_connect() to make these call safe.
--- net/netfilter/ipvs/ip_vs_sync.c | 4 ++-- net/rds/tcp_connect.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
net/netfilter/ipvs/ip_vs_sync.c +2 -2
@@ -1510,8 +1510,8 @@ static int make_send_sock(struct netns_i }get_mcast_sockaddr (&mcast_addr, &salen, &ipvs->mcfg, id); - result = sock->ops->connect (sock, (struct sockaddr *) &mcast_addr, - salen,0 ); + result =kernel_connect (sock, (struct sockaddr *)&mcast_addr, + salen,0 );if (result <0 ) {pr_err ("Error connecting to the multicast addr\n" ); goto error;
net/rds/tcp_connect.c +1 -1
@@ -169,7 +169,7 @@ int rds_tcp_conn_path_connect(struct rds* own the socket */ rds_tcp_set_callbacks (sock, cp); - ret = sock->ops->connect (sock, addr, addrlen,O_NONBLOCK ); + ret =kernel_connect (sock, addr, addrlen,O_NONBLOCK );rdsdebug ("connect to address %pI6c returned %d\n" , &conn->c_faddr, ret);if (ret == -EINPROGRESS )
Greg Kroah-Hartman
maintainerPATCH 70/91 btrfs: reject unknown mount options early
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qu Wenruo <[email protected]>
commit 5f521494cc73520ffac18ede0758883b9aedd018 upstream.
[BUG]
The following script would allow invalid mount options to be specified (although such invalid options would just be ignored):
# mkfs.btrfs -f $dev # mount $dev $mnt1 <<< Successful mount expected # mount $dev $mnt2 -o junk <<< Failed mount expected # echo $? 0
[CAUSE]
For the 2nd mount, since the fs is already mounted, we won't go through open_ctree() thus no btrfs_parse_options(), but only through btrfs_parse_subvol_options().
However we do not treat unrecognized options from valid but irrelevant options, thus those invalid options would just be ignored by btrfs_parse_subvol_options().
[FIX]
Add the handling for Opt_err to handle invalid options and error out, while still ignore other valid options inside btrfs_parse_subvol_options().
--- fs/btrfs/super.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/btrfs/super.c +4 -0
@@ -991,6 +991,10 @@ static int btrfs_parse_subvol_options(cocase Opt_subvolrootid:pr_warn ("BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n" );break ; +case Opt_err: +btrfs_err (NULL ,"unrecognized mount option '%s'" , p); + error = -EINVAL ; + goto out;default :break ; }
Greg Kroah-Hartman
maintainerPATCH 71/91 ubi: Refuse attaching if mtds erasesize is 0
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhihao Cheng <[email protected]>
[ Upstream commit 017c73a34a661a861712f7cc1393a123e5b2208c ]
There exists mtd devices with zero erasesize, which will trigger a divide-by-zero exception while attaching ubi device. Fix it by refusing attaching if mtd's erasesize is 0.
--- drivers/mtd/ubi/build.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mtd/ubi/build.c +7 -0
@@ -878,6 +878,13 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,return -EINVAL ; } +/* UBI cannot work on flashes with zero erasesize. */ +if (!mtd->erasesize) { +pr_err ("ubi: refuse attaching mtd%d - zero erasesize flash is not supported\n" , + mtd->index); +return -EINVAL ; + } +if (ubi_num ==UBI_DEV_NUM_AUTO ) {/* Search for an empty slot in the @ubi_devices array */ for (ubi_num =0 ; ubi_num <UBI_MAX_DEVICES ; ubi_num++)
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 72/91 wifi: mwifiex: Fix oob check condition in mwifiex_process_rx_packet
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pin-yen Lin <[email protected]>
[ Upstream commit aef7a0300047e7b4707ea0411dc9597cba108fc8 ]
Only skip the code path trying to access the rfc1042 headers when the buffer is too small, so the driver can still process packets without rfc1042 headers.
--- drivers/net/wireless/marvell/mwifiex/sta_rx.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/net/wireless/marvell/mwifiex/sta_rx.c +9 -7
@@ -98,7 +98,8 @@ int mwifiex_process_rx_packet(struct mwifiex_private *priv, rx_pkt_len =le16_to_cpu (local_rx_pd->rx_pkt_length); rx_pkt_hdr = (void *)local_rx_pd + rx_pkt_off; -if (sizeof (*rx_pkt_hdr) + rx_pkt_off > skb->len) { +if (sizeof (rx_pkt_hdr->eth803_hdr) +sizeof (rfc1042_header) + + rx_pkt_off > skb->len) {mwifiex_dbg (priv->adapter,ERROR ,"wrong rx packet offset: len=%d, rx_pkt_off=%d\n" , skb->len, rx_pkt_off);
@@ -107,12 +108,13 @@ int mwifiex_process_rx_packet(struct mwifiex_private *priv,return -1 ; } -if ((!memcmp (&rx_pkt_hdr->rfc1042_hdr, bridge_tunnel_header, -sizeof (bridge_tunnel_header))) || - (!memcmp (&rx_pkt_hdr->rfc1042_hdr, rfc1042_header, -sizeof (rfc1042_header)) && -ntohs (rx_pkt_hdr->rfc1042_hdr.snap_type) !=ETH_P_AARP && -ntohs (rx_pkt_hdr->rfc1042_hdr.snap_type) !=ETH_P_IPX )) { +if (sizeof (*rx_pkt_hdr) + rx_pkt_off <= skb->len && + ((!memcmp (&rx_pkt_hdr->rfc1042_hdr, bridge_tunnel_header, +sizeof (bridge_tunnel_header))) || + (!memcmp (&rx_pkt_hdr->rfc1042_hdr, rfc1042_header, +sizeof (rfc1042_header)) && +ntohs (rx_pkt_hdr->rfc1042_hdr.snap_type) !=ETH_P_AARP && +ntohs (rx_pkt_hdr->rfc1042_hdr.snap_type) !=ETH_P_IPX ))) {/* * Replace the 803 header and rfc1042 header (llc/snap) with an * EthernetII header, keep the src/dst and snap_type
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 73/91 drivers/net: process the result of hdlc_open() and add call of hdlc_close() in uhdlc_close()
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandra Diupina <[email protected]>
[ Upstream commit a59addacf899b1b21a7b7449a1c52c98704c2472 ]
Process the result of hdlc_open() and call uhdlc_close() in case of an error. It is necessary to pass the error code up the control flow, similar to a possible error in request_irq().
Also add a hdlc_close() call to the uhdlc_close() because the comment to hdlc_close() says it must be called by the hardware driver when the HDLC device is being closed
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/net/wan/fsl_ucc_hdlc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/wan/fsl_ucc_hdlc.c +10 -2
@@ -37,6 +37,8 @@#define TDM_PPPOHT_SLIC_MAXIN +static int uhdlc_close (struct net_device *dev); +static struct ucc_tdm_info utdm_primary_info = { .uf_info = { .tsa =0 ,
@@ -661,6 +663,7 @@ static int uhdlc_open(struct net_device *dev)hdlc_device *hdlc =dev_to_hdlc (dev);struct ucc_hdlc_private *priv = hdlc->priv;struct ucc_tdm *utdm = priv->utdm; +int rc =0 ;if (priv->hdlc_busy !=1 ) { if (request_irq(priv->ut_info->uf_info.irq,
@@ -683,10 +686,13 @@ static int uhdlc_open(struct net_device *dev)netif_device_attach (priv->ndev);napi_enable (&priv->napi);netif_start_queue (dev); -hdlc_open (dev); + + rc =hdlc_open (dev); +if (rc) +uhdlc_close (dev); } -return 0 ; +return rc; }static void uhdlc_memclean (struct ucc_hdlc_private *priv)
@@ -775,6 +781,8 @@ static int uhdlc_close(struct net_device *dev)netif_stop_queue (dev); priv->hdlc_busy =0 ; +hdlc_close (dev); +return 0 ; }
Signature · 1 line
2.40.1
Greg Kroah-Hartman
maintainerPATCH 64/91 media: dvb: symbol fixup for dvb_attach() - again
In reply to Greg Kroah-Hartman4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
In commit f296b374b9c1 ("media: dvb: symbol fixup for dvb_attach()") in the 4.19.y tree, a few symbols were missed due to files being renamed in newer kernel versions. Fix this up by properly marking up the sp8870_attach and xc2028_attach symbols.
--- drivers/media/dvb-frontends/sp8870.c | 2 +- drivers/media/tuners/tuner-xc2028.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/dvb-frontends/sp8870.c +1 -1
@@ -619,4 +619,4 @@ MODULE_DESCRIPTION("Spase SP8870 DVB-T DMODULE_AUTHOR ("Juergen Peitz" );MODULE_LICENSE ("GPL" ); -EXPORT_SYMBOL (sp8870_attach); +EXPORT_SYMBOL_GPL (sp8870_attach);
drivers/media/tuners/tuner-xc2028.c +1 -1
@@ -1513,7 +1513,7 @@ fail:return NULL ; } -EXPORT_SYMBOL (xc2028_attach); +EXPORT_SYMBOL_GPL (xc2028_attach);MODULE_DESCRIPTION ("Xceive xc2028/xc3028 tuner driver" );MODULE_AUTHOR ("Michel Ludwig <[email protected]>" );
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.296-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Re: [PATCH 4.19 70/91] btrfs: reject unknown mount options early
In reply to Greg Kroah-HartmanQuoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Please reject the patch from all stable branches (if that's not yet too late).
The rejection is too strict, especially the check is before the security mount options, thus it would reject all security mount options.
Sorry for the trouble,
Qu
Quoted 55 lines
------------------
From: Qu Wenruo <[email protected]>
commit
5f521494cc73520ffac18ede0758883b9aedd018upstream.[BUG]
The following script would allow invalid mount options to be specified (although such invalid options would just be ignored):# mkfs.btrfs -f $dev # mount $dev $mnt1 <<< Successful mount expected # mount $dev $mnt2 -o junk <<< Failed mount expected # echo $? 0[CAUSE]
For the 2nd mount, since the fs is already mounted, we won't go throughopen_ctree()thus nobtrfs_parse_options(), but only throughbtrfs_parse_subvol_options().However we do not treat unrecognized options from valid but irrelevant options, thus those invalid options would just be ignored by
btrfs_parse_subvol_options().[FIX]
Add the handling forOpt_errto handle invalid options and error out, while still ignore other valid options insidebtrfs_parse_subvol_options().Reported-by Anand Jain <[email protected]>CC [email protected] # 4.14+Signed-off-by Qu Wenruo <[email protected]>Reviewed-by David Sterba <[email protected]>Signed-off-by David Sterba <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- fs/btrfs/super.c | 4 ++++ 1 file changed, 4 insertions(+)fs/btrfs/super.c +4
-0@@ -991,6 +991,10 @@ static int btrfs_parse_subvol_options(cocase Opt_subvolrootid:pr_warn ("BTRFS: 'subvolrootid' mount option is deprecated and has no effect\n" );break ; +case Opt_err: +btrfs_err (NULL ,"unrecognized mount option '%s'" , p); + error = -EINVAL ; + goto out;default :break ; }
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.296-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v4.19:
10 builds: 10 pass, 0 fail
20 boots: 20 pass, 0 fail
37 tests: 37 pass, 0 failLinux version: 4.19.296-rc1-g1d560dafb2e3
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Jon
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.296-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v4.19:
10 builds: 10 pass, 0 fail
20 boots: 20 pass, 0 fail
37 tests: 37 pass, 0 failLinux version: 4.19.296-rc1-g1d560dafb2e3
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04Jon
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 70/91] btrfs: reject unknown mount options early
In reply to Qu WenruoQuoted 10 lines · Qu Wenruo
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Please reject the patch from all stable branches (if that's not yet too late).
The rejection is too strict, especially the check is before the security mount options, thus it would reject all security mount options.
This is queued up in all stable -rc releases right now, is there a fix in Linus's tree for this as well or is it broken there too?
thanks,
greg k-h
Re: [PATCH 4.19 70/91] btrfs: reject unknown mount options early
Quoted 6 lines · Greg Kroah-Hartman
Quoted 5 lines · Qu Wenruo
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
Quoted 5 lines
Please reject the patch from all stable branches (if that's not yet too late).
The rejection is too strict, especially the check is before the security mount options, thus it would reject all security mount options.
This is queued up in all stable -rc releases right now, is there a fix in Linus's tree for this as well or is it broken there too?
Yes it's broken there too, I'll send a revert.
Greg Kroah-Hartman
maintainerRe: [PATCH 4.19 70/91] btrfs: reject unknown mount options early
Quoted 10 lines · David Sterba
Quoted 9 lines · Greg Kroah-Hartman
Quoted 8 lines · Qu Wenruo
Quoted 1 line · Greg Kroah-Hartman
4.19-stable review patch. If anyone has any objections, please let me know.
Please reject the patch from all stable branches (if that's not yet too late).
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
The rejection is too strict, especially the check is before the security mount options, thus it would reject all security mount options.
This is queued up in all stable -rc releases right now, is there a fix in Linus's tree for this as well or is it broken there too?
Yes it's broken there too, I'll send a revert.
Ok, thanks, I'll go drop this from all stable queues right now.
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
Build results:
total: 149 pass: 149 fail: 0 Qemu test results: total: 441 pass: 441 fail: 0
Guenter
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.19.296 release. There are 91 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 11 Oct 2023 13:00:55 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.296-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.19.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 4.19.296-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-4.19.y
* git commit: 1d560dafb2e3608cc252a10c4558f86edc39b34c
* git describe: v4.19.295-92-g1d560dafb2e3
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.19.y/build/v4.19.295-92-g1d560dafb2e3
## Test Regressions (compared to v4.19.295)
## Metric Regressions (compared to v4.19.295)
## Test Fixes (compared to v4.19.295)
## Metric Fixes (compared to v4.19.295)
## Test result summary
total: 52204, pass: 44074, fail: 1739, skip: 6358, xfail: 33
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 111 total, 105 passed, 6 failed
* arm64: 37 total, 32 passed, 5 failed
* i386: 21 total, 18 passed, 3 failed
* mips: 22 total, 22 passed, 0 failed
* parisc: 3 total, 0 passed, 3 failed
* powerpc: 24 total, 24 passed, 0 failed
* s390: 6 total, 6 passed, 0 failed
* sh: 12 total, 12 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 30 total, 26 passed, 4 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-vm
* kselftest-watchdog
* kselftest-zram
* kunit
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-crypto
* ltp-cve
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org