I've attached mailboxes with backports to 4.9, 4.14, and 4.19 of fixes
for:
- TCP source port randomisation
- xprtdma header length calculation
- [4.9 only] swiotlb information leak
- [4.9 only] FUSE pipe buffer information leak
Ben.
--
Ben Hutchings
Man invented language to satisfy his deep need to complain.
- Lily Tomlin
commit b337af3a4d6147000b7ca6b3438bf5c820849b37 upstream.
In systemd systems setting a fixed MAC address through
the "dev_addr" module argument fails systematically.
When checking the MAC address after the interface is created
it always has the same but different MAC address to the one
supplied as argument.
This is partially caused by systemd which by default will
set an internally generated permanent MAC address for interfaces
that are marked as having a randomly generated address.
Commit 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in
setting MAC address in setup phase") didn't take into account
the fact that the interface must be marked as having a set
MAC address when it's set as module argument.
Fixed by marking the interface with NET_ADDR_SET when
the "dev_addr" module argument is supplied.
Reported-by: Maximilian Senftleben <kernel(a)mail.msdigital.de>
Cc: stable(a)vger.kernel.org
Fixes: 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in setting MAC address in setup phase")
Signed-off-by: Marian Postevca <posteuca(a)mutex.one>
---
drivers/usb/gadget/function/u_ether.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index d15a54f6c24b9..ef253599dcf96 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -774,9 +774,13 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g,
dev->qmult = qmult;
snprintf(net->name, sizeof(net->name), "%s%%d", netname);
- if (get_ether_addr(dev_addr, net->dev_addr))
+ if (get_ether_addr(dev_addr, net->dev_addr)) {
+ net->addr_assign_type = NET_ADDR_RANDOM;
dev_warn(&g->dev,
"using random %s ethernet address\n", "self");
+ } else {
+ net->addr_assign_type = NET_ADDR_SET;
+ }
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
"using random %s ethernet address\n", "host");
@@ -833,6 +837,9 @@ struct net_device *gether_setup_name_default(const char *netname)
INIT_LIST_HEAD(&dev->tx_reqs);
INIT_LIST_HEAD(&dev->rx_reqs);
+ /* by default we always have a random MAC address */
+ net->addr_assign_type = NET_ADDR_RANDOM;
+
skb_queue_head_init(&dev->rx_frames);
/* network device setup */
@@ -869,7 +876,6 @@ int gether_register_netdev(struct net_device *net)
dev = netdev_priv(net);
g = dev->gadget;
- net->addr_assign_type = NET_ADDR_RANDOM;
eth_hw_addr_set(net, dev->dev_mac);
status = register_netdev(net);
@@ -910,6 +916,7 @@ int gether_set_dev_addr(struct net_device *net, const char *dev_addr)
if (get_ether_addr(dev_addr, new_addr))
return -EINVAL;
memcpy(dev->dev_mac, new_addr, ETH_ALEN);
+ net->addr_assign_type = NET_ADDR_SET;
return 0;
}
EXPORT_SYMBOL_GPL(gether_set_dev_addr);
--
2.35.1
This is the start of the stable review cycle for the 5.4.197 release.
There are 34 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 Sun, 05 Jun 2022 17:38:05 +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/v5.x/stable-review/patch-5.4.197-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 5.4.197-rc1
Liu Jian <liujian56(a)huawei.com>
bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes
Chuck Lever <chuck.lever(a)oracle.com>
NFSD: Fix possible sleep during nfsd4_release_lockowner()
Trond Myklebust <trond.myklebust(a)hammerspace.com>
NFS: Memory allocation failures are not server fatal errors
Akira Yokosawa <akiyks(a)gmail.com>
docs: submitting-patches: Fix crossref to 'The canonical patch format'
Xiu Jianfeng <xiujianfeng(a)huawei.com>
tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()
Stefan Mahnke-Hartmann <stefan.mahnke-hartmann(a)infineon.com>
tpm: Fix buffer access in tpm2_get_tpm_pt()
Marek Maślanka <mm(a)semihalf.com>
HID: multitouch: Add support for Google Whiskers Touchpad
Mariusz Tkaczyk <mariusz.tkaczyk(a)linux.intel.com>
raid5: introduce MD_BROKEN
Sarthak Kukreti <sarthakkukreti(a)google.com>
dm verity: set DM_TARGET_IMMUTABLE feature flag
Mikulas Patocka <mpatocka(a)redhat.com>
dm stats: add cond_resched when looping over entries
Mikulas Patocka <mpatocka(a)redhat.com>
dm crypt: make printing of the key constant-time
Dan Carpenter <dan.carpenter(a)oracle.com>
dm integrity: fix error code in dm_integrity_ctr()
Sultan Alsawaf <sultan(a)kerneltoast.com>
zsmalloc: fix races between asynchronous zspage free and page migration
Vitaly Chikunov <vt(a)altlinux.org>
crypto: ecrdsa - Fix incorrect use of vli_cmp
Florian Westphal <fw(a)strlen.de>
netfilter: conntrack: re-fetch conntrack after insertion
Kees Cook <keescook(a)chromium.org>
exec: Force single empty string when argv is empty
Gustavo A. R. Silva <gustavoars(a)kernel.org>
drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
Miri Korenblit <miriam.rachel.korenblit(a)intel.com>
cfg80211: set custom regdomain after wiphy registration
Stephen Brennan <stephen.s.brennan(a)oracle.com>
assoc_array: Fix BUG_ON during garbage collect
Piyush Malgujar <pmalgujar(a)marvell.com>
drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
Mika Westerberg <mika.westerberg(a)linux.intel.com>
i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
Joel Stanley <joel(a)jms.id.au>
net: ftgmac100: Disable hardware checksum on AST2600
Thomas Bartschies <thomas.bartschies(a)cvk.de>
net: af_key: check encryption module availability consistency
IotaHydrae <writeforever(a)foxmail.com>
pinctrl: sunxi: fix f1c100s uart2 function
Lorenzo Pieralisi <lorenzo.pieralisi(a)arm.com>
ACPI: sysfs: Fix BERT error region memory mapping
Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
ACPI: sysfs: Make sparse happy about address space in use
Hans Verkuil <hverkuil-cisco(a)xs4all.nl>
media: vim2m: initialize the media device earlier
Sakari Ailus <sakari.ailus(a)linux.intel.com>
media: vim2m: Register video device after setting up internals
Willy Tarreau <w(a)1wt.eu>
secure_seq: use the 64 bits of the siphash for port offset calculation
Eric Dumazet <edumazet(a)google.com>
tcp: change source port randomizarion at connect() time
Dmitry Mastykin <dmastykin(a)astralinux.ru>
Input: goodix - fix spurious key release events
Denis Efremov (Oracle) <efremov(a)linux.com>
staging: rtl8723bs: prevent ->Ssid overflow in rtw_wx_set_scan()
Thomas Gleixner <tglx(a)linutronix.de>
x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests
Daniel Thompson <daniel.thompson(a)linaro.org>
lockdown: also lock down previous kgdb use
-------------
Diffstat:
Documentation/process/submitting-patches.rst | 2 +-
Makefile | 4 +-
arch/x86/pci/xen.c | 5 +++
crypto/ecrdsa.c | 8 ++--
drivers/acpi/sysfs.c | 23 +++++++---
drivers/char/tpm/tpm2-cmd.c | 11 ++++-
drivers/char/tpm/tpm_ibmvtpm.c | 1 +
drivers/gpu/drm/i915/intel_pm.c | 2 +-
drivers/hid/hid-multitouch.c | 3 ++
drivers/i2c/busses/i2c-ismt.c | 14 ++++++
drivers/i2c/busses/i2c-thunderx-pcidrv.c | 1 +
drivers/input/touchscreen/goodix.c | 2 +-
drivers/md/dm-crypt.c | 14 ++++--
drivers/md/dm-integrity.c | 2 -
drivers/md/dm-stats.c | 8 ++++
drivers/md/dm-verity-target.c | 1 +
drivers/md/raid5.c | 47 +++++++++----------
drivers/media/platform/vim2m.c | 22 +++++----
drivers/net/ethernet/faraday/ftgmac100.c | 5 +++
drivers/pinctrl/sunxi/pinctrl-suniv-f1c100s.c | 2 +-
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 ++-
fs/exec.c | 25 ++++++++++-
fs/nfs/internal.h | 1 +
fs/nfsd/nfs4state.c | 12 ++---
include/linux/security.h | 2 +
include/net/inet_hashtables.h | 2 +-
include/net/netfilter/nf_conntrack_core.h | 7 ++-
include/net/secure_seq.h | 4 +-
kernel/debug/debug_core.c | 24 ++++++++++
kernel/debug/kdb/kdb_main.c | 62 ++++++++++++++++++++++++--
lib/assoc_array.c | 8 ++++
mm/zsmalloc.c | 37 +++++++++++++--
net/core/filter.c | 4 +-
net/core/secure_seq.c | 4 +-
net/ipv4/inet_hashtables.c | 28 +++++++++---
net/ipv6/inet6_hashtables.c | 4 +-
net/key/af_key.c | 6 +--
net/wireless/core.c | 8 ++--
net/wireless/reg.c | 1 +
security/lockdown/lockdown.c | 2 +
40 files changed, 327 insertions(+), 97 deletions(-)
To stable tree maintainers:
Patch: net: mana: Add handling of CQE_RX_TRUNCATED
commit e4b7621982d29f26ff4d39af389e5e675a4ffed4 upstream
Why you think it should be applied:
This patch fixes the handling of CQE_RX_TRUNCATED case, otherwise someone can easily attack it by sending a jumbo packet and cause the driver misbehave.
What kernel version you wish it to be applied to:
5.15.x
Thanks,
- Haiyang
[Public]
Hi,
Can you please backport this commit to 5.15.y?
commit 79d6b9351f086e0f914a26915d96ab52286ec46c ("drm/amd/display: Don't reinitialize DMCUB on s0ix resume")
It fixes display corruption that was found during s0ix resume on Ryzen 6000.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1978244
Thanks,
stable team, please consider
commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
It will noticeable reduce system overhead when this happens on multiple CPUs.
----snip----
commit 3ae11dbcfac906a8c3a480e98660a823130dc16a
s390/mm: use non-quiescing sske for KVM switch to keyed guest
The switch to a keyed guest does not require a classic sske as the other
guest CPUs are not accessing the key before the switch is complete.
By using the NQ SSKE things are faster especially with multiple guests.
Signed-off-by: Christian Borntraeger <borntraeger(a)linux.ibm.com>
Suggested-by: Janis Schoetterl-Glausch <scgl(a)linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda(a)linux.ibm.com>
Link: https://lore.kernel.org/r/20220530092706.11637-3-borntraeger@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger(a)linux.ibm.com>
Signed-off-by: Heiko Carstens <hca(a)linux.ibm.com>
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 697df02362af..4909dcd762e8 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -748,7 +748,7 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
pgste_val(pgste) |= PGSTE_GR_BIT | PGSTE_GC_BIT;
ptev = pte_val(*ptep);
if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE))
- page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1);
+ page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 0);
pgste_set_unlock(ptep, pgste);
preempt_enable();
}
From: Will Deacon <will(a)kernel.org>
commit c50f11c6196f45c92ca48b16a5071615d4ae0572 upstream.
Invalidating the buffer memory in arch_sync_dma_for_device() for
FROM_DEVICE transfers
When using the streaming DMA API to map a buffer prior to inbound
non-coherent DMA (i.e. DMA_FROM_DEVICE), we invalidate any dirty CPU
cachelines so that they will not be written back during the transfer and
corrupt the buffer contents written by the DMA. This, however, poses two
potential problems:
(1) If the DMA transfer does not write to every byte in the buffer,
then the unwritten bytes will contain stale data once the transfer
has completed.
(2) If the buffer has a virtual alias in userspace, then stale data
may be visible via this alias during the period between performing
the cache invalidation and the DMA writes landing in memory.
Address both of these issues by cleaning (aka writing-back) the dirty
lines in arch_sync_dma_for_device(DMA_FROM_DEVICE) instead of discarding
them using invalidation.
Cc: Ard Biesheuvel <ardb(a)kernel.org>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Robin Murphy <robin.murphy(a)arm.com>
Cc: Russell King <linux(a)armlinux.org.uk>
Cc: <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/20220606152150.GA31568@willie-the-truck
Signed-off-by: Will Deacon <will(a)kernel.org>
Reviewed-by: Ard Biesheuvel <ardb(a)kernel.org>
Link: https://lore.kernel.org/r/20220610151228.4562-2-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas(a)arm.com>
---
arch/arm64/mm/cache.S | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
index 2d881f34dd9d..7b8158ae36ec 100644
--- a/arch/arm64/mm/cache.S
+++ b/arch/arm64/mm/cache.S
@@ -228,8 +228,6 @@ SYM_FUNC_END_PI(__dma_flush_area)
* - dir - DMA direction
*/
SYM_FUNC_START_PI(__dma_map_area)
- cmp w2, #DMA_FROM_DEVICE
- b.eq __dma_inv_area
b __dma_clean_area
SYM_FUNC_END_PI(__dma_map_area)
From: Will Deacon <will(a)kernel.org>
commit c50f11c6196f45c92ca48b16a5071615d4ae0572 upstream.
Invalidating the buffer memory in arch_sync_dma_for_device() for
FROM_DEVICE transfers
When using the streaming DMA API to map a buffer prior to inbound
non-coherent DMA (i.e. DMA_FROM_DEVICE), we invalidate any dirty CPU
cachelines so that they will not be written back during the transfer and
corrupt the buffer contents written by the DMA. This, however, poses two
potential problems:
(1) If the DMA transfer does not write to every byte in the buffer,
then the unwritten bytes will contain stale data once the transfer
has completed.
(2) If the buffer has a virtual alias in userspace, then stale data
may be visible via this alias during the period between performing
the cache invalidation and the DMA writes landing in memory.
Address both of these issues by cleaning (aka writing-back) the dirty
lines in arch_sync_dma_for_device(DMA_FROM_DEVICE) instead of discarding
them using invalidation.
Cc: Ard Biesheuvel <ardb(a)kernel.org>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Robin Murphy <robin.murphy(a)arm.com>
Cc: Russell King <linux(a)armlinux.org.uk>
Cc: <stable(a)vger.kernel.org>
Link: https://lore.kernel.org/r/20220606152150.GA31568@willie-the-truck
Signed-off-by: Will Deacon <will(a)kernel.org>
Reviewed-by: Ard Biesheuvel <ardb(a)kernel.org>
Link: https://lore.kernel.org/r/20220610151228.4562-2-will@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas(a)arm.com>
---
arch/arm64/mm/cache.S | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
index db767b072601..7b054c67acd8 100644
--- a/arch/arm64/mm/cache.S
+++ b/arch/arm64/mm/cache.S
@@ -228,8 +228,6 @@ ENDPIPROC(__dma_flush_area)
* - dir - DMA direction
*/
ENTRY(__dma_map_area)
- cmp w2, #DMA_FROM_DEVICE
- b.eq __dma_inv_area
b __dma_clean_area
ENDPIPROC(__dma_map_area)
The soc/fsl/dpio driver will perform a soc_device_match()
to determine the optimal cache settings for a given CPU core.
If FSL_GUTS is not enabled, this search will fail and
the driver will not configure cache stashing for the given
DPIO, and a string of "unknown SoC" messages will appear:
fsl_mc_dpio dpio.7: unknown SoC version
fsl_mc_dpio dpio.6: unknown SoC version
fsl_mc_dpio dpio.5: unknown SoC version
Signed-off-by: Mathew McBride <matt(a)traverse.com.au>
Fixes: 51da14e96e9b ("soc: fsl: dpio: configure cache stashing destination")
Cc: stable(a)vger.kernel.org
---
drivers/soc/fsl/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
index 07d52cafbb31..fcec6ed83d5e 100644
--- a/drivers/soc/fsl/Kconfig
+++ b/drivers/soc/fsl/Kconfig
@@ -24,6 +24,7 @@ config FSL_MC_DPIO
tristate "QorIQ DPAA2 DPIO driver"
depends on FSL_MC_BUS
select SOC_BUS
+ select FSL_GUTS
select DIMLIB
help
Driver for the DPAA2 DPIO object. A DPIO provides queue and
--
2.30.1