4.9.324-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 4.9.324-rc1 review
This is the start of the stable review cycle for the 4.9.324 release. There are 28 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 Thu, 21 Jul 2022 11:43:40 +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.9.324-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.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.9.324-rc1
Marc Kleine-Budde <[email protected]>
can: m_can: m_can_tx_handler(): fix use after free of skb
Rik van Riel <[email protected]>
mm: invalidate hwpoison page cache page in fault path
Yi Yang <[email protected]>
serial: 8250: fix return error code in serial8250_request_std_resource()
Chanho Park <[email protected]>
tty: serial: samsung_tty: set dma burst_size to 1
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Fix event pending check
Lucien Buchmann <[email protected]>
USB: serial: ftdi_sio: add Belimo device ids
Linus Torvalds <[email protected]>
signal handling: don't use BUG_ON() for debugging
Juergen Gross <[email protected]>
x86: Clear .brk area at early boot
Charles Keepax <[email protected]>
ASoC: wm5110: Fix DRE control
Mark Brown <[email protected]>
ASoC: ops: Fix off by one in range control validation
Michael Walle <[email protected]>
NFC: nxp-nci: don't print header length mismatch on i2c error
Hangyu Hua <[email protected]>
net: tipc: fix possible refcount leak in tipc_sk_create()
Liang He <[email protected]>
cpufreq: pmac32-cpufreq: Fix refcount leak bug
Stephan Gerhold <[email protected]>
virtio_mmio: Restore guest page size on resume
Stephan Gerhold <[email protected]>
virtio_mmio: Add missing PM calls to freeze/restore
Íñigo Huguet <[email protected]>
sfc: fix kernel panic when creating VF
Íñigo Huguet <[email protected]>
sfc: fix use after free when disabling sriov
Kuniyuki Iwashima <[email protected]>
ipv4: Fix data-races around sysctl_ip_dynaddr.
Kuniyuki Iwashima <[email protected]>
icmp: Fix data-races around sysctl.
Kuniyuki Iwashima <[email protected]>
cipso: Fix data-races around sysctl.
Ard Biesheuvel <[email protected]>
ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle
Doug Berger <[email protected]>
net: dsa: bcm_sf2: force pause link settings
Ryusuke Konishi <[email protected]>
nilfs2: fix incorrect masking of permission flags for symlinks
Dmitry Osipenko <[email protected]>
ARM: 9213/1: Print message about disabled Spectre workarounds only once
Steven Rostedt (Google) <[email protected]>
net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer
Juergen Gross <[email protected]>
xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue
Meng Tang <[email protected]>
ALSA: hda - Add fixup for Dell Latitidue E5430
James Morse <[email protected]>
arm64: entry: Restore tramp_map_kernel ISB
-------------
Diffstat:
Documentation/networking/ip-sysctl.txt | 4 ++-- Makefile | 4 ++-- arch/arm/mm/proc-v7-bugs.c | 9 ++++----- arch/arm64/kernel/entry.S | 1 + arch/x86/kernel/head64.c | 2 ++ drivers/cpufreq/pmac32-cpufreq.c | 4 ++++ drivers/net/can/m_can/m_can.c | 5 +++-- drivers/net/dsa/bcm_sf2.c | 19 +++++++++++++++++++ drivers/net/ethernet/sfc/ef10.c | 3 +++ drivers/net/ethernet/sfc/ef10_sriov.c | 10 +++++++--- drivers/net/xen-netback/rx.c | 1 + drivers/nfc/nxp-nci/i2c.c | 8 ++++++-- drivers/tty/serial/8250/8250_port.c | 4 +++- drivers/tty/serial/samsung.c | 5 ++--- drivers/usb/dwc3/gadget.c | 4 +++- drivers/usb/serial/ftdi_sio.c | 3 +++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ drivers/virtio/virtio_mmio.c | 26 ++++++++++++++++++++++++++ fs/nilfs2/nilfs.h | 3 +++ include/trace/events/sock.h | 6 ++++-- kernel/signal.c | 8 ++++---- mm/memory.c | 9 +++++++-- net/ipv4/af_inet.c | 4 ++-- net/ipv4/cipso_ipv4.c | 12 +++++++----- net/ipv4/icmp.c | 5 +++-- net/tipc/socket.c | 1 + sound/pci/hda/patch_realtek.c | 1 + sound/soc/codecs/wm5110.c | 8 ++++++-- sound/soc/soc-ops.c | 4 ++-- 29 files changed, 137 insertions(+), 42 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/28 arm64: entry: Restore tramp_map_kernel ISB
From: James Morse <[email protected]>
Summit reports that the BHB backports for v4.9 prevent vulnerable platforms from booting when CONFIG_RANDOMIZE_BASE is enabled.
This is because the trampoline code takes a translation fault when accessing the data page, because the TTBR write hasn't been completed by an ISB before the access is made.
Upstream has a complex erratum workaround for QCOM_FALKOR_E1003 in this area, which removes the ISB when the workaround has been applied. v4.9 lacks this workaround, but should still have the ISB.
Restore the barrier.
--- arch/arm64/kernel/entry.S | 1 + 1 file changed, 1 insertion(+)
arch/arm64/kernel/entry.S +1 -0
@@ -964,6 +964,7 @@ __ni_sys_trace: b . 2: tramp_map_kernel x30 + isb tramp_data_read_var x30, vectors prfm plil1strm, [x30, #(1b - \vector_start)] msr vbar_el1, x30
Greg Kroah-Hartman
maintainerPATCH 2/28 ALSA: hda - Add fixup for Dell Latitidue E5430
In reply to Greg Kroah-HartmanFrom: Meng Tang <[email protected]>
commit 841bdf85c226803a78a9319af9b2caa9bf3e2eda upstream.
Another Dell model, another fixup entry: Latitude E5430 needs the same fixup as other Latitude E series as workaround for noise problems.
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -5709,6 +5709,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x1025 ,0x079b ,"Acer Aspire V5-573G" ,ALC282_FIXUP_ASPIRE_V5_PINS ),SND_PCI_QUIRK (0x1025 ,0x106d ,"Acer Cloudbook 14" ,ALC283_FIXUP_CHROME_BOOK ),SND_PCI_QUIRK (0x1028 ,0x0470 ,"Dell M101z" ,ALC269_FIXUP_DELL_M101Z ), +SND_PCI_QUIRK (0x1028 ,0x053c ,"Dell Latitude E5430" ,ALC292_FIXUP_DELL_E7X ),SND_PCI_QUIRK (0x1028 ,0x054b ,"Dell XPS one 2710" ,ALC275_FIXUP_DELL_XPS ),SND_PCI_QUIRK (0x1028 ,0x05bd ,"Dell Latitude E6440" ,ALC292_FIXUP_DELL_E7X ), SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X),
Greg Kroah-Hartman
maintainerPATCH 3/28 xen/netback: avoid entering xenvif_rx_next_skb() with an empty rx queue
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
commit 94e8100678889ab428e68acadf042de723f094b9 upstream.
xenvif_rx_next_skb() is expecting the rx queue not being empty, but in case the loop in xenvif_rx_action() is doing multiple iterations, the availability of another skb in the rx queue is not being checked.
This can lead to crashes:
[40072.537261] BUG: unable to handle kernel NULL pointer dereference at 0000000000000080 [40072.537407] IP: xenvif_rx_skb+0x23/0x590 [xen_netback] [40072.537534] PGD 0 P4D 0 [40072.537644] Oops: 0000 [#1] SMP NOPTI [40072.537749] CPU: 0 PID: 12505 Comm: v1-c40247-q2-gu Not tainted 4.12.14-122.121-default #1 SLE12-SP5 [40072.537867] Hardware name: HP ProLiant DL580 Gen9/ProLiant DL580 Gen9, BIOS U17 11/23/2021 [40072.537999] task: ffff880433b38100 task.stack: ffffc90043d40000 [40072.538112] RIP: e030:xenvif_rx_skb+0x23/0x590 [xen_netback] [40072.538217] RSP: e02b:ffffc90043d43de0 EFLAGS: 00010246 [40072.538319] RAX: 0000000000000000 RBX: ffffc90043cd7cd0 RCX: 00000000000000f7 [40072.538430] RDX: 0000000000000000 RSI: 0000000000000006 RDI: ffffc90043d43df8 [40072.538531] RBP: 000000000000003f R08: 000077ff80000000 R09: 0000000000000008 [40072.538644] R10: 0000000000007ff0 R11: 00000000000008f6 R12: ffffc90043ce2708 [40072.538745] R13: 0000000000000000 R14: ffffc90043d43ed0 R15: ffff88043ea748c0 [40072.538861] FS: 0000000000000000(0000) GS:ffff880484600000(0000) knlGS:0000000000000000 [40072.538988] CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033 [40072.539088] CR2: 0000000000000080 CR3: 0000000407ac8000 CR4: 0000000000040660 [40072.539211] Call Trace: [40072.539319] xenvif_rx_action+0x71/0x90 [xen_netback] [40072.539429] xenvif_kthread_guest_rx+0x14a/0x29c [xen_netback]
Fix that by stopping the loop in case the rx queue becomes empty.
--- drivers/net/xen-netback/rx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/xen-netback/rx.c +1 -0
@@ -482,6 +482,7 @@ void xenvif_rx_action(struct xenvif_queu queue->rx_copy.completed = &completed_skbs;while (xenvif_rx_ring_slots_available (queue) && + !skb_queue_empty (&queue->rx_queue) && work_done <RX_BATCH_SIZE ) {xenvif_rx_skb (queue); work_done++;
Greg Kroah-Hartman
maintainerPATCH 4/28 net: sock: tracing: Fix sock_exceed_buf_limit not to dereference stale pointer
In reply to Greg Kroah-HartmanFrom: Steven Rostedt (Google) <[email protected]>
commit 820b8963adaea34a87abbecb906d1f54c0aabfb7 upstream.
The trace event sock_exceed_buf_limit saves the prot->sysctl_mem pointer and then dereferences it in the TP_printk() portion. This is unsafe as the TP_printk() portion is executed at the time the buffer is read. That is, it can be seconds, minutes, days, months, even years later. If the proto is freed, then this dereference will can also lead to a kernel crash.
Instead, save the sysctl_mem array into the ring buffer and have the TP_printk() reference that instead. This is the proper and safe way to read pointers in trace events.
--- include/trace/events/sock.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
include/trace/events/sock.h +4 -2
@@ -37,7 +37,7 @@ TRACE_EVENT(sock_exceed_buf_limit,TP_STRUCT__entry ( __array(char, name, 32) - __field(long *, sysctl_mem) + __array(long, sysctl_mem, 3) __field(long, allocated) __field(int, sysctl_rmem) __field(int, rmem_alloc)
@@ -45,7 +45,9 @@ TRACE_EVENT(sock_exceed_buf_limit,TP_fast_assign ( strncpy(__entry->name, prot->name, 32); - __entry->sysctl_mem = prot->sysctl_mem; + __entry->sysctl_mem[0 ] =READ_ONCE (prot->sysctl_mem[0 ]); + __entry->sysctl_mem[1 ] =READ_ONCE (prot->sysctl_mem[1 ]); + __entry->sysctl_mem[2 ] =READ_ONCE (prot->sysctl_mem[2 ]); __entry->allocated = allocated; __entry->sysctl_rmem = prot->sysctl_rmem[0 ]; __entry->rmem_alloc =atomic_read (&sk->sk_rmem_alloc);
Greg Kroah-Hartman
maintainerPATCH 5/28 ARM: 9213/1: Print message about disabled Spectre workarounds only once
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
commit e4ced82deb5fb17222fb82e092c3f8311955b585 upstream.
Print the message about disabled Spectre workarounds only once. The message is printed each time CPU goes out from idling state on NVIDIA Tegra boards, causing storm in KMSG that makes system unusable.
--- arch/arm/mm/proc-v7-bugs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm/mm/proc-v7-bugs.c +1 -2
@@ -110,8 +110,7 @@ static unsigned int spectre_v2_install_w#else static unsigned int spectre_v2_install_workaround (unsigned int method) { -pr_info ("CPU%u: Spectre V2: workarounds disabled by configuration\n" , -smp_processor_id ()); +pr_info_once ("Spectre V2: workarounds disabled by configuration\n" );return SPECTRE_VULNERABLE ; }
Greg Kroah-Hartman
maintainerPATCH 6/28 nilfs2: fix incorrect masking of permission flags for symlinks
In reply to Greg Kroah-HartmanFrom: Ryusuke Konishi <[email protected]>
commit 5924e6ec1585445f251ea92713eb15beb732622a upstream.
The permission flags of newly created symlinks are wrongly dropped on nilfs2 with the current umask value even though symlinks should have 777 (rwxrwxrwx) permissions:
$ umask 0022 $ touch file && ln -s file symlink; ls -l file symlink -rw-r--r--. 1 root root 0 Jun 23 16:29 file lrwxr-xr-x. 1 root root 4 Jun 23 16:29 symlink -> file
This fixes the bug by inserting a missing check that excludes symlinks.
--- fs/nilfs2/nilfs.h | 3 +++ 1 file changed, 3 insertions(+)
fs/nilfs2/nilfs.h +3 -0
@@ -212,6 +212,9 @@ static inline int nilfs_acl_chmod(structstatic inline int nilfs_init_acl (struct inode *inode,struct inode *dir) { +if (S_ISLNK (inode->i_mode)) +return 0 ; + inode->i_mode &= ~current_umask ();return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 7/28 net: dsa: bcm_sf2: force pause link settings
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
commit 7c97bc0128b2eecc703106112679a69d446d1a12 upstream.
The pause settings reported by the PHY should also be applied to the GMII port status override otherwise the switch will not generate pause frames towards the link partner despite the advertisement saying otherwise.
--- drivers/net/dsa/bcm_sf2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/net/dsa/bcm_sf2.c +19 -0
@@ -600,7 +600,9 @@ static void bcm_sf2_sw_adjust_link(strucstruct bcm_sf2_priv *priv =bcm_sf2_to_priv (ds);struct ethtool_eee *p = &priv->port_sts[port].eee;u32 id_mode_dis =0 , port_mode; +u16 lcl_adv =0 , rmt_adv =0 ;const char *str =NULL ; +u8 flowctrl =0 ;u32 reg;switch (phydev->interface) {
@@ -667,10 +669,27 @@ force_link:break ; } +if (phydev->duplex ==DUPLEX_FULL && + phydev->autoneg ==AUTONEG_ENABLE ) { +if (phydev->pause) + rmt_adv =LPA_PAUSE_CAP ; +if (phydev->asym_pause) + rmt_adv |=LPA_PAUSE_ASYM ; +if (phydev->advertising & ADVERTISED_Pause) + lcl_adv =ADVERTISE_PAUSE_CAP ; +if (phydev->advertising & ADVERTISED_Asym_Pause) + lcl_adv |=ADVERTISE_PAUSE_ASYM ; + flowctrl =mii_resolve_flowctrl_fdx (lcl_adv, rmt_adv); + } +if (phydev->link) reg |=LINK_STS ;if (phydev->duplex ==DUPLEX_FULL ) reg |=DUPLX_MODE ; +if (flowctrl &FLOW_CTRL_TX ) + reg |=TXFLOW_CNTL ; +if (flowctrl &FLOW_CTRL_RX ) + reg |=RXFLOW_CNTL ;core_writel (priv, reg,CORE_STS_OVERRIDE_GMIIP_PORT (port));
Greg Kroah-Hartman
maintainerPATCH 8/28 ARM: 9209/1: Spectre-BHB: avoid pr_info() every time a CPU comes out of idle
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 0609e200246bfd3b7516091c491bec4308349055 ]
Jon reports that the Spectre-BHB init code is filling up the kernel log with spurious notifications about which mitigation has been enabled, every time any CPU comes out of a low power state.
Given that Spectre-BHB mitigations are system wide, only a single mitigation can be enabled, and we already print an error if two types of CPUs coexist in a single system that require different Spectre-BHB mitigations.
This means that the pr_info() that describes the selected mitigation does not need to be emitted for each CPU anyway, and so we can simply emit it only once.
In order to clarify the above in the log message, update it to describe that the selected mitigation will be enabled on all CPUs, including ones that are unaffected. If another CPU comes up later that is affected and requires a different mitigation, we report an error as before.
--- arch/arm/mm/proc-v7-bugs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mm/proc-v7-bugs.c +3 -3
@@ -217,10 +217,10 @@ static int spectre_bhb_install_workaround(int method)return SPECTRE_VULNERABLE ; spectre_bhb_method = method; - } -pr_info ("CPU%u: Spectre BHB: using %s workaround\n" , -smp_processor_id (),spectre_bhb_method_name (method)); +pr_info ("CPU%u: Spectre BHB: enabling %s workaround for all CPUs\n" , +smp_processor_id (),spectre_bhb_method_name (method)); + }return SPECTRE_MITIGATED ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 9/28 cipso: Fix data-races around sysctl.
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit dd44f04b9214adb68ef5684ae87a81ba03632250 ]
While reading cipso sysctl variables, they can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races.
--- Documentation/networking/ip-sysctl.txt | 2 +- net/ipv4/cipso_ipv4.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-)
Documentation/networking/ip-sysctl.txt +1 -1
@@ -781,7 +781,7 @@ cipso_cache_enable - BOOLEAN cipso_cache_bucket_size - INTEGER The CIPSO label cache consists of a fixed size hash table with each hash bucket containing a number of cache entries. This variable limits - the number of entries in each hash bucket; the larger the value the + the number of entries in each hash bucket; the larger the value is, the more CIPSO label mappings that can be cached. When the number of entries in a given hash bucket reaches this limit adding new entries causes the oldest entry in the bucket to be removed to make room.
net/ipv4/cipso_ipv4.c +7 -5
@@ -254,7 +254,7 @@ static int cipso_v4_cache_check(const unsigned char *key,struct cipso_v4_map_cache_entry *prev_entry =NULL ;u32 hash; -if (!cipso_v4_cache_enabled) +if (!READ_ONCE (cipso_v4_cache_enabled))return -ENOENT ; hash =cipso_v4_map_cache_hash (key, key_len);
@@ -311,13 +311,14 @@ static int cipso_v4_cache_check(const unsigned char *key,int cipso_v4_cache_add (const unsigned char *cipso_ptr,const struct netlbl_lsm_secattr *secattr) { +int bkt_size =READ_ONCE (cipso_v4_cache_bucketsize);int ret_val = -EPERM ;u32 bkt;struct cipso_v4_map_cache_entry *entry =NULL ;struct cipso_v4_map_cache_entry *old_entry =NULL ;u32 cipso_ptr_len; -if (!cipso_v4_cache_enabled || cipso_v4_cache_bucketsize <=0 ) +if (!READ_ONCE (cipso_v4_cache_enabled) || bkt_size <=0 )return 0 ; cipso_ptr_len = cipso_ptr[1 ];
@@ -337,7 +338,7 @@ int cipso_v4_cache_add(const unsigned char *cipso_ptr, bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS -1 );spin_lock_bh (&cipso_v4_cache[bkt].lock); -if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) { +if (cipso_v4_cache[bkt].size < bkt_size) {list_add (&entry->list, &cipso_v4_cache[bkt].list); cipso_v4_cache[bkt].size +=1 ; }else {
@@ -1214,7 +1215,8 @@ static int cipso_v4_gentag_rbm(const struct cipso_v4_doi *doi_def,/* This will send packets using the "optimized" format when * possible as specified in section 3.4.2.6 of the * CIPSO draft. */ -if (cipso_v4_rbm_optfmt && ret_val >0 && ret_val <=10 ) +if (READ_ONCE (cipso_v4_rbm_optfmt) && ret_val >0 && + ret_val <=10 ) tag_len =14 ;else tag_len =4 + ret_val;
@@ -1617,7 +1619,7 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)* all the CIPSO validations here but it doesn't * really specify _exactly_ what we need to validate * ... so, just make it a sysctl tunable. */ -if (cipso_v4_rbm_strictvalid) { +if (READ_ONCE (cipso_v4_rbm_strictvalid)) {if (cipso_v4_map_lvl_valid (doi_def, tag[3 ]) <0 ) { err_offset = opt_iter +3 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 10/28 icmp: Fix data-races around sysctl.
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 48d7ee321ea5182c6a70782aa186422a70e67e22 ]
While reading icmp sysctl variables, they can be changed concurrently. So, we need to add READ_ONCE() to avoid data-races.
--- net/ipv4/icmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/icmp.c +3 -2
@@ -268,11 +268,12 @@ bool icmp_global_allow(void)spin_lock (&icmp_global.lock); delta =min_t (u32, now - icmp_global.stamp,HZ );if (delta >=HZ /50 ) { - incr = sysctl_icmp_msgs_per_sec * delta /HZ ; + incr =READ_ONCE (sysctl_icmp_msgs_per_sec) * delta /HZ ;if (incr)WRITE_ONCE (icmp_global.stamp, now); } - credit =min_t (u32, icmp_global.credit + incr, sysctl_icmp_msgs_burst); + credit =min_t (u32, icmp_global.credit + incr, +READ_ONCE (sysctl_icmp_msgs_burst));if (credit) {/* We want to use a credit of one in average, but need to randomize * it for security reasons.
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 11/28 ipv4: Fix data-races around sysctl_ip_dynaddr.
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit e49e4aff7ec19b2d0d0957ee30e93dade57dab9e ]
While reading sysctl_ip_dynaddr, it can be changed concurrently. Thus, we need to add READ_ONCE() to its readers.
--- Documentation/networking/ip-sysctl.txt | 2 +- net/ipv4/af_inet.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Documentation/networking/ip-sysctl.txt +1 -1
@@ -849,7 +849,7 @@ ip_nonlocal_bind - BOOLEAN which can be quite useful - but may break some applications. Default: 0 -ip_dynaddr - BOOLEAN +ip_dynaddr - INTEGER If set non-zero, enables support for dynamic addresses. If set to a non-zero value larger than 1, a kernel log message will be printed when dynamic address rewriting
net/ipv4/af_inet.c +2 -2
@@ -1122,7 +1122,7 @@ static int inet_sk_reselect_saddr(struct sock *sk)if (new_saddr == old_saddr)return 0 ; -if (sock_net (sk)->ipv4.sysctl_ip_dynaddr >1 ) { +if (READ_ONCE (sock_net (sk)->ipv4.sysctl_ip_dynaddr) >1 ) {pr_info ("%s(): shifting inet->saddr from %pI4 to %pI4\n" , __func__, &old_saddr, &new_saddr); }
@@ -1177,7 +1177,7 @@ int inet_sk_rebuild_header(struct sock *sk)* Other protocols have to map its equivalent state to TCP_SYN_SENT. * DCCP maps its DCCP_REQUESTING state to TCP_SYN_SENT. -acme */ -if (!sock_net (sk)->ipv4.sysctl_ip_dynaddr || +if (!READ_ONCE (sock_net (sk)->ipv4.sysctl_ip_dynaddr) || sk->sk_state !=TCP_SYN_SENT || (sk->sk_userlocks &SOCK_BINDADDR_LOCK ) || (err =inet_sk_reselect_saddr (sk)) !=0 )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 12/28 sfc: fix use after free when disabling sriov
In reply to Greg Kroah-HartmanFrom: Íñigo Huguet <[email protected]>
[ Upstream commit ebe41da5d47ac0fff877e57bd14c54dccf168827 ]
Use after free is detected by kfence when disabling sriov. What was read after being freed was vf->pci_dev: it was freed from pci_disable_sriov and later read in efx_ef10_sriov_free_vf_vports, called from efx_ef10_sriov_free_vf_vswitching.
Set the pointer to NULL at release time to not trying to read it later.
Reproducer and dmesg log (note that kfence doesn't detect it every time):
$ echo 1 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs $ echo 0 > /sys/class/net/enp65s0f0np0/device/sriov_numvfs
BUG: KFENCE: use-after-free read in efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc]
Use-after-free read at 0x00000000ff3c1ba5 (in kfence-#224):
efx_ef10_sriov_free_vf_vswitching+0x82/0x170 [sfc] efx_ef10_pci_sriov_disable+0x38/0x70 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xfe/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae
kfence-#224: 0x00000000edb8ef95-0x00000000671f5ce1, size=2792, cache=kmalloc-4k
allocated by task 6771 on cpu 10 at 3137.860196s:
pci_alloc_dev+0x21/0x60 pci_iov_add_virtfn+0x2a2/0x320 sriov_enable+0x212/0x3e0 efx_ef10_sriov_configure+0x67/0x80 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xba/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae
freed by task 6771 on cpu 12 at 3170.991309s:
device_release+0x34/0x90 kobject_cleanup+0x3a/0x130 pci_iov_remove_virtfn+0xd9/0x120 sriov_disable+0x30/0xe0 efx_ef10_pci_sriov_disable+0x57/0x70 [sfc] efx_pci_sriov_configure+0x24/0x40 [sfc] sriov_numvfs_store+0xfe/0x140 kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x11f/0x1b0 vfs_write+0x1eb/0x280 ksys_write+0x5f/0xe0 do_syscall_64+0x5c/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae
--- drivers/net/ethernet/sfc/ef10_sriov.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/ethernet/sfc/ef10_sriov.c +7 -3
@@ -414,8 +414,9 @@ static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs)static int efx_ef10_pci_sriov_disable (struct efx_nic *efx,bool force) {struct pci_dev *dev = efx->pci_dev; +struct efx_ef10_nic_data *nic_data = efx->nic_data;unsigned int vfs_assigned =pci_vfs_assigned (dev); -int rc =0 ; +int i, rc =0 ;if (vfs_assigned && !force) { netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; "
@@ -423,10 +424,13 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force)return -EBUSY ; } -if (!vfs_assigned) +if (!vfs_assigned) { +for (i =0 ; i < efx->vf_count; i++) + nic_data->vf[i].pci_dev =NULL ;pci_disable_sriov (dev); -else + }else { rc = -EBUSY ; + }efx_ef10_sriov_free_vf_vswitching (efx); efx->vf_count =0 ;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 13/28 sfc: fix kernel panic when creating VF
In reply to Greg Kroah-HartmanFrom: Íñigo Huguet <[email protected]>
[ Upstream commit ada74c5539eba06cf8b47d068f92e0b3963a9a6e ]
When creating VFs a kernel panic can happen when calling to efx_ef10_try_update_nic_stats_vf.
When releasing a DMA coherent buffer, sometimes, I don't know in what specific circumstances, it has to unmap memory with vunmap. It is disallowed to do that in IRQ context or with BH disabled. Otherwise, we hit this line in vunmap, causing the crash:
BUG_ON(in_interrupt());
This patch reenables BH to release the buffer.
Log messages when the bug is hit:
kernel BUG at mm/vmalloc.c:2727!
invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
CPU: 6 PID: 1462 Comm: NetworkManager Kdump: loaded Tainted: G I --------- --- 5.14.0-119.el9.x86_64 #1 Hardware name: Dell Inc. PowerEdge R740/06WXJT, BIOS 2.8.2 08/27/2020 RIP: 0010:vunmap+0x2e/0x30 ...skip... Call Trace: __iommu_dma_free+0x96/0x100 efx_nic_free_buffer+0x2b/0x40 [sfc] efx_ef10_try_update_nic_stats_vf+0x14a/0x1c0 [sfc] efx_ef10_update_stats_vf+0x18/0x40 [sfc] efx_start_all+0x15e/0x1d0 [sfc] efx_net_open+0x5a/0xe0 [sfc] __dev_open+0xe7/0x1a0 __dev_change_flags+0x1d7/0x240 dev_change_flags+0x21/0x60 ...skip...
--- drivers/net/ethernet/sfc/ef10.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/sfc/ef10.c +3 -0
@@ -1830,7 +1830,10 @@ static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)efx_update_sw_stats (efx, stats); out: +/* releasing a DMA coherent buffer with BH disabled can panic */ +spin_unlock_bh (&efx->stats_lock);efx_nic_free_buffer (efx, &stats_buf); +spin_lock_bh (&efx->stats_lock);return rc; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 14/28 virtio_mmio: Add missing PM calls to freeze/restore
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit ed7ac37fde33ccd84e4bd2b9363c191f925364c7 ]
Most virtio drivers provide freeze/restore callbacks to finish up device usage before suspend and to reinitialize the virtio device after resume. However, these callbacks are currently only called when using virtio_pci. virtio_mmio does not have any PM ops defined.
This causes problems for example after suspend to disk (hibernation), since the virtio devices might lose their state after the VMM is restarted. Calling virtio_device_freeze()/restore() ensures that the virtio devices are re-initialized correctly.
Fix this by implementing the dev_pm_ops for virtio_mmio, similar to virtio_pci_common.
Message-Id: <[email protected]>
--- drivers/virtio/virtio_mmio.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/virtio/virtio_mmio.c +23 -0
@@ -66,6 +66,7 @@#include <linux/list.h> #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/pm.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/virtio.h>
@@ -489,6 +490,25 @@ static const struct virtio_config_ops virtio_mmio_config_ops = { .bus_name = vm_bus_name, }; +#ifdef CONFIG_PM_SLEEP +static int virtio_mmio_freeze (struct device *dev) +{ +struct virtio_mmio_device *vm_dev =dev_get_drvdata (dev); + +return virtio_device_freeze (&vm_dev->vdev); +} + +static int virtio_mmio_restore (struct device *dev) +{ +struct virtio_mmio_device *vm_dev =dev_get_drvdata (dev); + +return virtio_device_restore (&vm_dev->vdev); +} + +static const struct dev_pm_ops virtio_mmio_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (virtio_mmio_freeze, virtio_mmio_restore) +}; +#endif /* Platform device */
@@ -730,6 +750,9 @@ static struct platform_driver virtio_mmio_driver = { .name = "virtio-mmio", .of_match_table = virtio_mmio_match, .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match), +#ifdef CONFIG_PM_SLEEP + .pm = &virtio_mmio_pm_ops, +#endif }, };
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 15/28 virtio_mmio: Restore guest page size on resume
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit e0c2ce8217955537dd5434baeba061f209797119 ]
Virtio devices might lose their state when the VMM is restarted after a suspend to disk (hibernation) cycle. This means that the guest page size register must be restored for the virtio_mmio legacy interface, since otherwise the virtio queues are not functional.
This is particularly problematic for QEMU that currently still defaults to using the legacy interface for virtio_mmio. Write the guest page size register again in virtio_mmio_restore() to make legacy virtio_mmio devices work correctly after hibernation.
Message-Id: <[email protected]>
--- drivers/virtio/virtio_mmio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/virtio/virtio_mmio.c +3 -0
@@ -502,6 +502,9 @@ static int virtio_mmio_restore(struct device *dev) {struct virtio_mmio_device *vm_dev =dev_get_drvdata (dev); +if (vm_dev->version ==1 ) +writel (PAGE_SIZE , vm_dev->base +VIRTIO_MMIO_GUEST_PAGE_SIZE ); +return virtio_device_restore (&vm_dev->vdev); }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 16/28 cpufreq: pmac32-cpufreq: Fix refcount leak bug
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit ccd7567d4b6cf187fdfa55f003a9e461ee629e36 ]
In pmac_cpufreq_init_MacRISC3(), we need to add corresponding of_node_put() for the three node pointers whose refcount have been incremented by of_find_node_by_name().
--- drivers/cpufreq/pmac32-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/cpufreq/pmac32-cpufreq.c +4 -0
@@ -473,6 +473,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)if (slew_done_gpio_np) slew_done_gpio =read_gpio (slew_done_gpio_np); +of_node_put (volt_gpio_np); +of_node_put (freq_gpio_np); +of_node_put (slew_done_gpio_np); +/* If we use the frequency GPIOs, calculate the min/max speeds based * on the bus frequencies */
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 17/28 net: tipc: fix possible refcount leak in tipc_sk_create()
In reply to Greg Kroah-HartmanFrom: Hangyu Hua <[email protected]>
[ Upstream commit 00aff3590fc0a73bddd3b743863c14e76fd35c0c ]
Free sk in case tipc_sk_insert() fails.
--- net/tipc/socket.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/socket.c +1 -0
@@ -341,6 +341,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock, sock->state = state;sock_init_data (sock, sk);if (tipc_sk_insert (tsk)) { +sk_free (sk);pr_warn ("Socket create failed; port number exhausted\n" );return -EINVAL ; }
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 18/28 NFC: nxp-nci: dont print header length mismatch on i2c error
In reply to Greg Kroah-HartmanFrom: Michael Walle <[email protected]>
[ Upstream commit 9577fc5fdc8b07b891709af6453545db405e24ad ]
Don't print a misleading header length mismatch error if the i2c call returns an error. Instead just return the error code without any error message.
--- drivers/nfc/nxp-nci/i2c.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +6 -2
@@ -139,7 +139,9 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy,memcpy (skb_put (*skb,NXP_NCI_FW_HDR_LEN ), &header,NXP_NCI_FW_HDR_LEN ); r =i2c_master_recv (client,skb_put (*skb, frame_len), frame_len); -if (r != frame_len) { +if (r <0 ) { + goto fw_read_exit_free_skb; + }else if (r != frame_len) {nfc_err (&client->dev,"Invalid frame length: %u (expected %zu)\n" , r, frame_len);
@@ -184,7 +186,9 @@ static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy,return 0 ; r =i2c_master_recv (client,skb_put (*skb, header.plen), header.plen); -if (r != header.plen) { +if (r <0 ) { + goto nci_read_exit_free_skb; + }else if (r != header.plen) {nfc_err (&client->dev,"Invalid frame payload length: %u (expected %u)\n" , r, header.plen);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 19/28 ASoC: ops: Fix off by one in range control validation
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ]
We currently report that range controls accept a range of 0..(max-min) but accept writes in the range 0..(max-min+1). Remove that extra +1.
--- sound/soc/soc-ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-ops.c +2 -2
@@ -535,7 +535,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,return -EINVAL ;if (mc->platform_max && tmp > mc->platform_max)return -EINVAL ; -if (tmp > mc->max - mc->min +1 ) +if (tmp > mc->max - mc->min)return -EINVAL ;if (invert)
@@ -556,7 +556,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,return -EINVAL ;if (mc->platform_max && tmp > mc->platform_max)return -EINVAL ; -if (tmp > mc->max - mc->min +1 ) +if (tmp > mc->max - mc->min)return -EINVAL ;if (invert)
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 20/28 ASoC: wm5110: Fix DRE control
In reply to Greg Kroah-HartmanFrom: Charles Keepax <[email protected]>
[ Upstream commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ]
The DRE controls on wm5110 should return a value of 1 if the DRE state is actually changed, update to fix this.
--- sound/soc/codecs/wm5110.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/codecs/wm5110.c +6 -2
@@ -404,6 +404,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,unsigned int rnew = (!!ucontrol->value.integer.value[1 ]) << mc->rshift;unsigned int lold, rold;unsigned int lena, rena; +bool change = false;int ret;snd_soc_dapm_mutex_lock (dapm);
@@ -431,8 +432,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, goto err; } - ret =regmap_update_bits (arizona->regmap,ARIZONA_DRE_ENABLE , - mask, lnew | rnew); + ret =regmap_update_bits_check (arizona->regmap,ARIZONA_DRE_ENABLE , + mask, lnew | rnew, &change);if (ret) {dev_err (arizona->dev,"Failed to set DRE: %d\n" , ret); goto err;
@@ -445,6 +446,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,if (!rnew && rold)wm5110_clear_pga_volume (arizona, mc->rshift); +if (change) + ret =1 ; + err:snd_soc_dapm_mutex_unlock (dapm);
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 21/28 x86: Clear .brk area at early boot
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
[ Upstream commit 38fa5479b41376dc9d7f57e71c83514285a25ca0 ]
The .brk section has the same properties as .bss: it is an alloc-only section and should be cleared before being used.
Not doing so is especially a problem for Xen PV guests, as the hypervisor will validate page tables (check for writable page tables and hypervisor private bits) before accepting them to be used.
Make sure .brk is initially zero by letting clear_bss() clear the brk area, too.
--- arch/x86/kernel/head64.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/head64.c +2 -0
@@ -106,6 +106,8 @@ static void __init clear_bss(void) {memset (__bss_start,0 , (unsigned long ) __bss_stop - (unsigned long ) __bss_start); +memset (__brk_base,0 , + (unsigned long ) __brk_limit - (unsigned long ) __brk_base); }static unsigned long get_cmd_line_ptr (void )
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 22/28 signal handling: dont use BUG_ON() for debugging
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
[ Upstream commit a382f8fee42ca10c9bfce0d2352d4153f931f5dc ]
These are indeed "should not happen" situations, but it turns out recent changes made the 'task_is_stopped_or_trace()' case trigger (fix for that exists, is pending more testing), and the BUG_ON() makes it unnecessarily hard to actually debug for no good reason.
It's been that way for a long time, but let's make it clear: BUG_ON() is not good for debugging, and should never be used in situations where you could just say "this shouldn't happen, but we can continue".
Use WARN_ON_ONCE() instead to make sure it gets logged, and then just continue running. Instead of making the system basically unusuable because you crashed the machine while potentially holding some very core locks (eg this function is commonly called while holding 'tasklist_lock' for writing).
--- kernel/signal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/signal.c +4 -4
@@ -1647,12 +1647,12 @@ bool do_notify_parent(struct task_struct *tsk, int sig)bool autoreap = false;cputime_t utime, stime; -BUG_ON (sig ==-1 ); +WARN_ON_ONCE (sig ==-1 ); -/* do_notify_parent_cldstop should have been called instead. */ -BUG_ON (task_is_stopped_or_traced (tsk)); +/* do_notify_parent_cldstop should have been called instead. */ +WARN_ON_ONCE (task_is_stopped_or_traced (tsk)); -BUG_ON (!tsk->ptrace && +WARN_ON_ONCE (!tsk->ptrace && (tsk->group_leader != tsk || !thread_group_empty (tsk)));if (sig !=SIGCHLD ) {
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerPATCH 23/28 USB: serial: ftdi_sio: add Belimo device ids
In reply to Greg Kroah-HartmanFrom: Lucien Buchmann <[email protected]>
commit 7c239a071d1f04b7137789810807b4108d475c72 upstream.
Those two product ids are known.
--- drivers/usb/serial/ftdi_sio.c | 3 +++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 9 insertions(+)
drivers/usb/serial/ftdi_sio.c +3 -0
@@ -1018,6 +1018,9 @@ static const struct usb_device_id id_tab { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, +/* Belimo Automation devices */ + { USB_DEVICE(FTDI_VID, BELIMO_ZTH_PID) }, + { USB_DEVICE(FTDI_VID, BELIMO_ZIP_PID) },/* ICP DAS I-756xU devices */ { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1568,6 +1568,12 @@#define CHETCO_SEASMART_ANALOG_PID 0xA5AF/* SeaSmart Analog Adapter */ /* +* Belimo Automation +*/ +#define BELIMO_ZTH_PID 0x8050 +#define BELIMO_ZIP_PID 0xC811 + +/* * Unjo AB */ #define UNJO_VID 0x22B7
Greg Kroah-Hartman
maintainerPATCH 24/28 usb: dwc3: gadget: Fix event pending check
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
commit 7441b273388b9a59d8387a03ffbbca9d5af6348c upstream.
The DWC3_EVENT_PENDING flag is used to protect against invalid call to top-half interrupt handler, which can occur when there's a delay in software detection of the interrupt line deassertion.
However, the clearing of this flag was done prior to unmasking the interrupt line, creating opportunity where the top-half handler can come. This breaks the serialization and creates a race between the top-half and bottom-half handler, resulting in losing synchronization between the controller and the driver when processing events.
To fix this, make sure the clearing of the DWC3_EVENT_PENDING is done at the end of the bottom-half handler.
--- drivers/usb/dwc3/gadget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/dwc3/gadget.c +3 -1
@@ -2886,7 +2886,6 @@ static irqreturn_t dwc3_process_event_bu } evt->count =0 ; - evt->flags &= ~DWC3_EVENT_PENDING ; ret =IRQ_HANDLED ;/* Unmask interrupt */
@@ -2894,6 +2893,9 @@ static irqreturn_t dwc3_process_event_bu reg &= ~DWC3_GEVNTSIZ_INTMASK ;dwc3_writel (dwc->regs,DWC3_GEVNTSIZ (0 ), reg); +/* Keep the clearing of DWC3_EVENT_PENDING at the end */ + evt->flags &= ~DWC3_EVENT_PENDING ; +return ret; }
Greg Kroah-Hartman
maintainerPATCH 25/28 tty: serial: samsung_tty: set dma burst_size to 1
In reply to Greg Kroah-HartmanFrom: Chanho Park <[email protected]>
commit f7e35e4bf1e8dc2c8cbd5e0955dc1bd58558dae0 upstream.
The src_maxburst and dst_maxburst have been changed to 1 but the settings of the UCON register aren't changed yet. They should be changed as well according to the dmaengine slave config.
--- drivers/tty/serial/samsung.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/tty/serial/samsung.c +2 -3
@@ -241,8 +241,7 @@ static void enable_tx_dma(struct s3c24xx/* Enable tx dma mode */ ucon =rd_regl (port,S3C2410_UCON ); ucon &= ~(S3C64XX_UCON_TXBURST_MASK |S3C64XX_UCON_TXMODE_MASK ); - ucon |= (dma_get_cache_alignment () >=16 ) ? -S3C64XX_UCON_TXBURST_16 :S3C64XX_UCON_TXBURST_1 ; + ucon |=S3C64XX_UCON_TXBURST_1 ; ucon |=S3C64XX_UCON_TXMODE_DMA ;wr_regl (port,S3C2410_UCON , ucon);
@@ -515,7 +514,7 @@ static void enable_rx_dma(struct s3c24xxS3C64XX_UCON_DMASUS_EN |S3C64XX_UCON_TIMEOUT_EN | S3C64XX_UCON_RXMODE_MASK); - ucon |=S3C64XX_UCON_RXBURST_16 | + ucon |=S3C64XX_UCON_RXBURST_1 |0xf <<S3C64XX_UCON_TIMEOUT_SHIFT |S3C64XX_UCON_EMPTYINT_EN | S3C64XX_UCON_TIMEOUT_EN |
Greg Kroah-Hartman
maintainerPATCH 26/28 serial: 8250: fix return error code in serial8250_request_std_resource()
In reply to Greg Kroah-HartmanFrom: Yi Yang <[email protected]>
commit 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 upstream.
If port->mapbase = NULL in serial8250_request_std_resource() , it need return a error code instead of 0. If uart_set_info() fail to request new regions by serial8250_request_std_resource() but the return value of serial8250_request_std_resource() is 0, The system incorrectly considers that the resource application is successful and does not attempt to restore the old setting. A null pointer reference is triggered when the port resource is later invoked.
--- drivers/tty/serial/8250/8250_port.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/8250/8250_port.c +3 -1
@@ -2789,8 +2789,10 @@ static int serial8250_request_std_resourcase UPIO_MEM32BE :case UPIO_MEM16 :case UPIO_MEM : -if (!port->mapbase) +if (!port->mapbase) { + ret = -EINVAL ;break ; + }if (!request_mem_region (port->mapbase, size,"serial" )) { ret = -EBUSY ;
Greg Kroah-Hartman
maintainerPATCH 27/28 mm: invalidate hwpoison page cache page in fault path
In reply to Greg Kroah-HartmanFrom: Rik van Riel <[email protected]>
commit e53ac7374e64dede04d745ff0e70ff5048378d1f upstream.
Sometimes the page offlining code can leave behind a hwpoisoned clean page cache page. This can lead to programs being killed over and over and over again as they fault in the hwpoisoned page, get killed, and then get re-spawned by whatever wanted to run them.
This is particularly embarrassing when the page was offlined due to having too many corrected memory errors. Now we are killing tasks due to them trying to access memory that probably isn't even corrupted.
This problem can be avoided by invalidating the page from the page fault handler, which already has a branch for dealing with these kinds of pages. With this patch we simply pretend the page fault was successful if the page was invalidated, return to userspace, incur another page fault, read in the file from disk (to a new memory page), and then everything works again.
--- mm/memory.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
mm/memory.c +7 -2
@@ -2891,10 +2891,15 @@ static int __do_fault(struct fault_env * }if (unlikely (PageHWPoison (vmf.page))) { -if (ret &VM_FAULT_LOCKED ) +int poisonret =VM_FAULT_HWPOISON ; +if (ret &VM_FAULT_LOCKED ) { +/* Retry if a clean page was removed from the cache. */ +if (invalidate_inode_page (vmf.page)) + poisonret =0 ;unlock_page (vmf.page); + }put_page (vmf.page); -return VM_FAULT_HWPOISON ; +return poisonret; }if (unlikely (!(ret &VM_FAULT_LOCKED )))
Greg Kroah-Hartman
maintainerPATCH 28/28 can: m_can: m_can_tx_handler(): fix use after free of skb
In reply to Greg Kroah-HartmanFrom: Marc Kleine-Budde <[email protected]>
commit 2e8e79c416aae1de224c0f1860f2e3350fa171f8 upstream.
can_put_echo_skb() will clone skb then free the skb. Move the can_put_echo_skb() for the m_can version 3.0.x directly before the start of the xmit in hardware, similar to the 3.1.x branch.
--- drivers/net/can/m_can/m_can.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/can/m_can/m_can.c +3 -2
@@ -1068,8 +1068,6 @@ static netdev_tx_t m_can_start_xmit(strum_can_fifo_write (priv,0 ,M_CAN_FIFO_DATA (i /4 ), *(u32 *)(cf->data + i)); -can_put_echo_skb (skb, dev,0 ); -if (priv->can.ctrlmode &CAN_CTRLMODE_FD ) { cccr =m_can_read (priv,M_CAN_CCCR ); cccr &= ~(CCCR_CMR_MASK <<CCCR_CMR_SHIFT );
@@ -1086,6 +1084,9 @@ static netdev_tx_t m_can_start_xmit(stru/* enable first TX buffer to start transfer */ m_can_write (priv,M_CAN_TXBTIE ,0x1 ); + +can_put_echo_skb (skb, dev,0 ); +m_can_write (priv,M_CAN_TXBAR ,0x1 );return NETDEV_TX_OK ;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.324 release. There are 28 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 Thu, 21 Jul 2022 11:43:40 +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.9.324-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels and built tested with BMIPS_GENERIC (bmips_stb_defconfig):
Signature · 1 line
Florian
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.324 release. There are 28 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 Thu, 21 Jul 2022 11:43:40 +0000. Anything received after that time might be too late.
Build results:
total: 164 pass: 164 fail: 0 Qemu test results: total: 397 pass: 397 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.324 release. There are 28 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 Thu, 21 Jul 2022 11:43:40 +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.9.324-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v4.9:
8 builds: 8 pass, 0 fail
16 boots: 16 pass, 0 fail
32 tests: 32 pass, 0 failLinux version: 4.9.324-rc1-gfc1589ab2391
Boards tested: tegra124-jetson-tk1, tegra20-ventana,
tegra210-p2371-2180, tegra30-cardhu-a04
Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.9.324 release. There are 28 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 Thu, 21 Jul 2022 11:43:40 +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.9.324-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.9.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.9.324-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-4.9.y
* git commit: fc1589ab23915836383ec0460240b055fa41d304
* git describe: v4.9.323-29-gfc1589ab2391
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-4.9.y/build/v4.9.323-29-gfc1589ab2391
## Test Regressions (compared to v4.9.323)
No test regressions found.
## Metric Regressions (compared to v4.9.323)
No metric regressions found.
## Test Fixes (compared to v4.9.323)
No test fixes found.
## Metric Fixes (compared to v4.9.323)
No metric fixes found.
## Test result summary
total: 99983, pass: 88018, fail: 339, skip: 10469, xfail: 1157
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 254 total, 249 passed, 5 failed
* arm64: 50 total, 43 passed, 7 failed
* i386: 26 total, 25 passed, 1 failed
* mips: 30 total, 30 passed, 0 failed
* parisc: 12 total, 0 passed, 12 failed
* powerpc: 36 total, 16 passed, 20 failed
* s390: 12 total, 9 passed, 3 failed
* sh: 24 total, 24 passed, 0 failed
* sparc: 12 total, 12 passed, 0 failed
* x86_64: 45 total, 44 passed, 1 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kunit
* kvm-unit-tests
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* 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-open-posix-tests
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* packetdrill
* rcutorture
* ssuite
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org