From: Johannes Berg <johannes.berg(a)intel.com>
[ Upstream commit 67dfa589aa8806c7959cbca2f4613b8d41c75a06 ]
When probing a client, first check if we have it, and then
check for the channel context, otherwise you can trigger
the warning there easily by probing when the AP isn't even
started yet. Since a client existing means the AP is also
operating, we can then keep the warning.
Also simplify the moved code a bit.
Reported-by: syzbot+999fac712d84878a7379(a)syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg(a)intel.com>
Signed-off-by: Alexander Ofitserov <oficerovas(a)altlinux.org>
Cc: stable(a)vger.kernel.org
---
net/mac80211/cfg.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 45bb6f27559877..8aef97b92c5213 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3642,19 +3642,20 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
mutex_lock(&local->mtx);
rcu_read_lock();
+ sta = sta_info_get_bss(sdata, peer);
+ if (!sta) {
+ ret = -ENOLINK;
+ goto unlock;
+ }
+
+ qos = sta->sta.wme;
+
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
if (WARN_ON(!chanctx_conf)) {
ret = -EINVAL;
goto unlock;
}
band = chanctx_conf->def.chan->band;
- sta = sta_info_get_bss(sdata, peer);
- if (sta) {
- qos = sta->sta.wme;
- } else {
- ret = -ENOLINK;
- goto unlock;
- }
if (qos) {
fc = cpu_to_le16(IEEE80211_FTYPE_DATA |
--
2.42.1
There is an issue in clang's ThinLTO caching (enabled for the kernel via
'--thinlto-cache-dir') with .incbin, which the kernel occasionally uses
to include data within the kernel, such as the .config file for
/proc/config.gz. For example, when changing the .config and rebuilding
vmlinux, the copy of .config in vmlinux does not match the copy of
.config in the build folder:
$ echo 'CONFIG_LTO_NONE=n
CONFIG_LTO_CLANG_THIN=y
CONFIG_IKCONFIG=y
CONFIG_HEADERS_INSTALL=y' >kernel/configs/repro.config
$ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 clean defconfig repro.config vmlinux
...
$ grep CONFIG_HEADERS_INSTALL .config
CONFIG_HEADERS_INSTALL=y
$ scripts/extract-ikconfig vmlinux | grep CONFIG_HEADERS_INSTALL
CONFIG_HEADERS_INSTALL=y
$ scripts/config -d HEADERS_INSTALL
$ make -kj"$(nproc)" ARCH=x86_64 LLVM=1 vmlinux
...
UPD kernel/config_data
GZIP kernel/config_data.gz
CC kernel/configs.o
...
LD vmlinux
...
$ grep CONFIG_HEADERS_INSTALL .config
# CONFIG_HEADERS_INSTALL is not set
$ scripts/extract-ikconfig vmlinux | grep CONFIG_HEADERS_INSTALL
CONFIG_HEADERS_INSTALL=y
Without '--thinlto-cache-dir' or when using full LTO, this issue does
not occur.
Benchmarking incremental builds on a few different machines with and
without the cache shows a 20% increase in incremental build time without
the cache when measured by touching init/main.c and running 'make all'.
ARCH=arm64 defconfig + CONFIG_LTO_CLANG_THIN=y on an arm64 host:
Benchmark 1: With ThinLTO cache
Time (mean ± σ): 56.347 s ± 0.163 s [User: 83.768 s, System: 24.661 s]
Range (min … max): 56.109 s … 56.594 s 10 runs
Benchmark 2: Without ThinLTO cache
Time (mean ± σ): 67.740 s ± 0.479 s [User: 718.458 s, System: 31.797 s]
Range (min … max): 67.059 s … 68.556 s 10 runs
Summary
With ThinLTO cache ran
1.20 ± 0.01 times faster than Without ThinLTO cache
ARCH=x86_64 defconfig + CONFIG_LTO_CLANG_THIN=y on an x86_64 host:
Benchmark 1: With ThinLTO cache
Time (mean ± σ): 85.772 s ± 0.252 s [User: 91.505 s, System: 8.408 s]
Range (min … max): 85.447 s … 86.244 s 10 runs
Benchmark 2: Without ThinLTO cache
Time (mean ± σ): 103.833 s ± 0.288 s [User: 232.058 s, System: 8.569 s]
Range (min … max): 103.286 s … 104.124 s 10 runs
Summary
With ThinLTO cache ran
1.21 ± 0.00 times faster than Without ThinLTO cache
While it is unfortunate to take this performance improvement off the
table, correctness is more important. If/when this is fixed in LLVM, it
can potentially be brought back in a conditional manner. Alternatively,
a developer can just disable LTO if doing incremental compiles quickly
is important, as a full compile cycle can still take over a minute even
with the cache and it is unlikely that LTO will result in functional
differences for a kernel change.
Cc: stable(a)vger.kernel.org
Fixes: dc5723b02e52 ("kbuild: add support for Clang LTO")
Reported-by: Yifan Hong <elsk(a)google.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/2021
Reported-by: Masami Hiramatsu <mhiramat(a)kernel.org>
Closes: https://lore.kernel.org/r/20220327115526.cc4b0ff55fc53c97683c3e4d@kernel.or…
Signed-off-by: Nathan Chancellor <nathan(a)kernel.org>
---
This is an alternative (and arguably more robust) fix to Yifan's patch
at https://lore.kernel.org/20240429220756.979347-2-elsk@google.com/.
---
Makefile | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 40fb2ca6fe4c..6b6a4a757062 100644
--- a/Makefile
+++ b/Makefile
@@ -942,7 +942,6 @@ endif
ifdef CONFIG_LTO_CLANG
ifdef CONFIG_LTO_CLANG_THIN
CC_FLAGS_LTO := -flto=thin -fsplit-lto-unit
-KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod_prefix).thinlto-cache
else
CC_FLAGS_LTO := -flto
endif
@@ -1477,7 +1476,7 @@ endif # CONFIG_MODULES
# Directories & files removed with 'make clean'
CLEAN_FILES += vmlinux.symvers modules-only.symvers \
modules.builtin modules.builtin.modinfo modules.nsdeps \
- compile_commands.json .thinlto-cache rust/test \
+ compile_commands.json rust/test \
rust-project.json .vmlinux.objs .vmlinux.export.c
# Directories & files removed with 'make mrproper'
@@ -1783,7 +1782,7 @@ PHONY += compile_commands.json
clean-dirs := $(KBUILD_EXTMOD)
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers $(KBUILD_EXTMOD)/modules.nsdeps \
- $(KBUILD_EXTMOD)/compile_commands.json $(KBUILD_EXTMOD)/.thinlto-cache
+ $(KBUILD_EXTMOD)/compile_commands.json
PHONY += prepare
# now expand this into a simple variable to reduce the cost of shell evaluations
---
base-commit: e67572cd2204894179d89bd7b984072f19313b03
change-id: 20240501-kbuild-llvm-drop-thinlto-cache-f497770692f8
Best regards,
--
Nathan Chancellor <nathan(a)kernel.org>
This reverts commit ad6bcdad2b6724e113f191a12f859a9e8456b26d. I had
nak'd it, and Greg said on the thread that it links that he wasn't going
to take it either, especially since it's not his code or his tree, but
then, seemingly accidentally, it got pushed up some months later, in
what looks like a mistake, with no further discussion in the linked
thread. So revert it, since it's clearly not intended.
Fixes: ad6bcdad2b67 ("vmgenid: emit uevent when VMGENID updates")
Cc: stable(a)vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Link: https://lore.kernel.org/r/20230531095119.11202-2-bchalios@amazon.es
Signed-off-by: Jason A. Donenfeld <Jason(a)zx2c4.com>
---
drivers/virt/vmgenid.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/virt/vmgenid.c b/drivers/virt/vmgenid.c
index b67a28da4702..a1c467a0e9f7 100644
--- a/drivers/virt/vmgenid.c
+++ b/drivers/virt/vmgenid.c
@@ -68,7 +68,6 @@ static int vmgenid_add(struct acpi_device *device)
static void vmgenid_notify(struct acpi_device *device, u32 event)
{
struct vmgenid_state *state = acpi_driver_data(device);
- char *envp[] = { "NEW_VMGENID=1", NULL };
u8 old_id[VMGENID_SIZE];
memcpy(old_id, state->this_id, sizeof(old_id));
@@ -76,7 +75,6 @@ static void vmgenid_notify(struct acpi_device *device, u32 event)
if (!memcmp(old_id, state->this_id, sizeof(old_id)))
return;
add_vmfork_randomness(state->this_id, sizeof(state->this_id));
- kobject_uevent_env(&device->dev.kobj, KOBJ_CHANGE, envp);
}
static const struct acpi_device_id vmgenid_ids[] = {
--
2.44.0
6.6.30-rc1 has a large set of fs/smb (cifs.ko and ksmbd.ko) patches
backported but was missing more than 30 fixes so I put together a safe
backport of the remaining, leaving out patches that had dependencies
on things outside of fs/smb
The following changes since commit 488f7008e62890fae8c7a2d3583913c8074f1fc6:
smb3: fix lock ordering potential deadlock in cifs_sync_mid_result
(2024-04-30 12:30:53 -0500)
are available in the Git repository at:
git://git.samba.org/ksmbd.git tags/6.6.30-rc1-full-fs-smb-backport
for you to fetch changes up to 411b6f385ac2427ee9d70fae277a4ed6b9d3983f:
smb: smb2pdu.h: Avoid -Wflex-array-member-not-at-end warnings
(2024-05-01 02:18:25 -0500)
----------------------------------------------------------------
full backport for 6.6.30, includes all 80 (of the relevant) missing
fs/smb changesets
Test results look good (and better than without the patches). Here
are the functional test results (they passed exhaustive set of tests
to various server types):
http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/3/…http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/5/…http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/9/…http://smb311-linux-testing.southcentralus.cloudapp.azure.com/#/builders/10…
Note that 22 patches had dependencies and were not appropriate to
backport and are not included, but here is the list of the additional
80 fs/smb patches included, many of which fix bugs (the others reduce
risk of backport, and help avoid merge conflicts):
411b6f385ac2 (HEAD -> fs-smb-backport-linux-6.6.30-rc1, tag:
6.6.30-rc1-full-fs-smb-backport,
origin/fs-smb-backport-linux-6.6.30-rc1) smb: smb2pdu.h: Avoid
-Wflex-array-member-not-at-end warnings
e97b85914501 ksmbd: add continuous availability share parameter
c52ce70edb58 cifs: Add tracing for the cifs_tcon struct refcounting
6fa6d5ed6a06 smb3: fix broken reconnect when password changing on the
server by allowing password rotation
d8833245b0f3 smb: client: instantiate when creating SFU files
4c8cf606bdb9 smb: client: fix NULL ptr deref in
cifs_mark_open_handles_for_deleted_file()
e0727528f3be smb3: add trace event for mknod
b71e6511fa98 smb311: additional compression flag defined in updated
protocol spec
0725c800685e smb311: correct incorrect offset field in compression header
e25e2f027599 cifs: Move some extern decls from .c files to .h
0d422616d36e ksmbd: fix potencial out-of-bounds when buffer offset is invalid
3967f3e18d66 ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16()
aec926736509 ksmbd: Fix spelling mistake "connction" -> "connection"
43f609cc80a5 ksmbd: fix possible null-deref in smb_lazy_parent_lease_break_close
3f1a838bc984 cifs: remove redundant variable assignment
05415df6229c cifs: fixes for get_inode_info
025b6f60cccc cifs: defer close file handles having RH lease
f1907205b6d3 ksmbd: add support for durable handles v1/v2
38b6f9391d64 ksmbd: mark SMB2_SESSION_EXPIRED to session when
destroying previous session
5ab62e6d22d1 cifs: update internal module version number for cifs.ko
4dcd0fe0c185 smb: common: simplify compression headers
0409ad4bad2b smb: common: fix fields sizes in compression_pattern_payload_v1
25fc3d85adc6 smb: client: negotiate compression algorithms
f3351838c269 smb3: add dynamic trace point for ioctls
7716c6db1c3b smb: client: return reparse type in /proc/mounts
1c3fbd8f92e9 smb: client: set correct d_type for reparse DFS/DFSR and
mount point
555e4ef34991 smb: client: parse uid, gid, mode and dev from WSL reparse points
5232c56b469f smb: client: introduce SMB2_OP_QUERY_WSL_EA
2bcfc0b089f7 smb: client: Fix a NULL vs IS_ERR() check in wsl_set_xattrs()
7ef14e642141 smb: client: add support for WSL reparse points
324c9dc5ab0b smb: client: reduce number of parameters in smb2_compound_op()
8b52dc432b0a smb: client: fix potential broken compound request
8f22fd9f0396 smb: client: move most of reparse point handling code to
common file
0ddb5bfd6f20 smb: client: introduce reparse mount option
370c2c605121 smb: client: retry compound request without reusing lease
6051d1b018ea smb: client: do not defer close open handles to deleted files
6a9d47b768c4 smb: client: reuse file lease key in compound operations
87eec3c54337 smb: client: get rid of smb311_posix_query_path_info()
32fab0e3e9b9 smb: client: parse owner/group when creating reparse points
df9a4c3f5db4 smb3: update allocation size more accurately on write completion
4d7263b3bf67 smb: client: handle path separator of created SMB symlinks
bd15b21c46c1 cifs: update the same create_guid on replay
6feda182ccf0 ksmbd: Add kernel-doc for ksmbd_extract_sharename() function
a12c76c3f311 cifs: set replay flag for retries of write command
e0a86c86ec5f cifs: commands that are retried should have replay flag set
207e9813ad88 smb: client: delete "true", "false" defines
6eb8a67757c6 smb: Fix some kernel-doc comments
3c21bffee62f cifs: new mount option called retrans
005892f2a944 smb: client: don't clobber ->i_rdev from cached reparse points
222edc9359a6 cifs: new nt status codes from MS-SMB2
80e719af52b9 cifs: pick channel for tcon and tdis
56c978ef1555 cifs: minor comment cleanup
6008da8e76ac cifs: remove redundant variable tcon_exist
95d9120fd9b0 cifs: update internal module version number for cifs.ko
2bbd03ad1d98 ksmbd: vfs: fix all kernel-doc warnings
0988e25500d0 ksmbd: auth: fix most kernel-doc warnings
9198cebadcef cifs: remove unneeded return statement
2b8222b46d92 cifs: get rid of dup length check in parse_reparse_point()
a1975468bc0d cifs: Pass unbyteswapped eof value into SMB2_set_eof()
b312f2d94a42 smb3: Improve exception handling in allocate_mr_list()
b6a02523d103 cifs: fix in logging in cifs_chan_update_iface
f7e60be64713 smb: client: handle special files and symlinks in SMB3 POSIX
2f68be9f5e9d smb: client: cleanup smb2_query_reparse_point()
eed182ebb134 smb: client: allow creating symlinks via reparse points
95c6eac76fa5 smb: client: optimise reparse point querying
8dbc76e94b4b smb: client: allow creating special files via reparse points
a5a4a5bc172b smb: client: extend smb2_compound_op() to accept more commands
778c2e03cbf4 smb: client: Fix minor whitespace errors and warnings
757f636f8fb0 smb: client: introduce cifs_sfu_make_node()
52740954fa81 cifs: fix use after free for iface while disabling
secondary channels
789f47984ddf cifs: update internal module version number for cifs.ko
120608af2863 Missing field not being returned in ioctl CIFS_IOC_GET_MNT_INFO
d1e9469bb4de smb3: minor cleanup of session handling code
09f7cf2bba1b smb3: more minor cleanups for session handling routines
6e19e4e86f02 smb3: minor RDMA cleanup
d73d7f8d1faa cifs: print server capabilities in DebugData
a88a5c2bf942 smb: use crypto_shash_digest() in symlink_hash()
56ad4435b30b Add definition for new smb3.1.1 command type
5900e9b37aa2 SMB3: clarify some of the unused CreateOption flags
fdf07b15f7d7 cifs: Add client version details to NTLM authenticate message
--
Thanks,
Steve
From: Vitor Soares <vitor.soares(a)toradex.com>
When the mcp251xfd_start_xmit() function fails, the driver stops
processing messages, and the interrupt routine does not return,
running indefinitely even after killing the running application.
Error messages:
[ 441.298819] mcp251xfd spi2.0 can0: ERROR in mcp251xfd_start_xmit: -16
[ 441.306498] mcp251xfd spi2.0 can0: Transmit Event FIFO buffer not empty. (seq=0x000017c7, tef_tail=0x000017cf, tef_head=0x000017d0, tx_head=0x000017d3).
... and repeat forever.
The issue can be triggered when multiple devices share the same
SPI interface. And there is concurrent access to the bus.
The problem occurs because tx_ring->head increments even if
mcp251xfd_start_xmit() fails. Consequently, the driver skips one
TX package while still expecting a response in
mcp251xfd_handle_tefif_one().
This patch resolves the issue by decreasing tx_ring->head if
mcp251xfd_start_xmit() fails. With the fix, if we trigger the issue and
the err = -EBUSY, the driver returns NETDEV_TX_BUSY. The network stack
retries to transmit the message.
Otherwise, it prints an error and discards the message.
Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
Cc: stable(a)vger.kernel.org
Signed-off-by: Vitor Soares <vitor.soares(a)toradex.com>
---
V2->V3:
- Add tx_dropped stats.
- netdev_sent_queue() only if can_put_echo_skb() succeed.
V1->V2:
- Return NETDEV_TX_BUSY if mcp251xfd_tx_obj_write() == -EBUSY.
- Rework the commit message to address the change above.
- Change can_put_echo_skb() to be called after mcp251xfd_tx_obj_write() succeed.
Otherwise, we get Kernel NULL pointer dereference error.
drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c | 34 ++++++++++++--------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c
index 160528d3cc26..146c44e47c60 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-tx.c
@@ -166,6 +166,7 @@ netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
struct net_device *ndev)
{
struct mcp251xfd_priv *priv = netdev_priv(ndev);
+ struct net_device_stats *stats = &ndev->stats;
struct mcp251xfd_tx_ring *tx_ring = priv->tx;
struct mcp251xfd_tx_obj *tx_obj;
unsigned int frame_len;
@@ -181,25 +182,32 @@ netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
tx_obj = mcp251xfd_get_tx_obj_next(tx_ring);
mcp251xfd_tx_obj_from_skb(priv, tx_obj, skb, tx_ring->head);
- /* Stop queue if we occupy the complete TX FIFO */
tx_head = mcp251xfd_get_tx_head(tx_ring);
- tx_ring->head++;
- if (mcp251xfd_get_tx_free(tx_ring) == 0)
- netif_stop_queue(ndev);
-
frame_len = can_skb_get_frame_len(skb);
- err = can_put_echo_skb(skb, ndev, tx_head, frame_len);
- if (!err)
- netdev_sent_queue(priv->ndev, frame_len);
+
+ tx_ring->head++;
err = mcp251xfd_tx_obj_write(priv, tx_obj);
- if (err)
- goto out_err;
+ if (err) {
+ tx_ring->head--;
- return NETDEV_TX_OK;
+ if (err == -EBUSY)
+ return NETDEV_TX_BUSY;
- out_err:
- netdev_err(priv->ndev, "ERROR in %s: %d\n", __func__, err);
+ stats->tx_dropped++;
+
+ if (net_ratelimit())
+ netdev_err(priv->ndev,
+ "ERROR in %s: %d\n", __func__, err);
+ } else {
+ err = can_put_echo_skb(skb, ndev, tx_head, frame_len);
+ if (!err)
+ netdev_sent_queue(priv->ndev, frame_len);
+
+ /* Stop queue if we occupy the complete TX FIFO */
+ if (mcp251xfd_get_tx_free(tx_ring) == 0)
+ netif_stop_queue(ndev);
+ }
return NETDEV_TX_OK;
}
--
2.34.1
This reverts commit 484fd6c1de13b336806a967908a927cc0356e312. The
commit caused a regression because now the umask was applied to
symlinks and the fix is unnecessary because the umask/O_TMPFILE bug
has been fixed somewhere else already.
Fixes: https://lore.kernel.org/lkml/28DSITL9912E1.2LSZUVTGTO52Q@mforney.org/
Signed-off-by: Max Kellermann <max.kellermann(a)ionos.com>
---
fs/ext4/acl.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/fs/ext4/acl.h b/fs/ext4/acl.h
index ef4c19e5f570..0c5a79c3b5d4 100644
--- a/fs/ext4/acl.h
+++ b/fs/ext4/acl.h
@@ -68,11 +68,6 @@ extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
static inline int
ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
{
- /* usually, the umask is applied by posix_acl_create(), but if
- ext4 ACL support is disabled at compile time, we need to do
- it here, because posix_acl_create() will never be called */
- inode->i_mode &= ~current_umask();
-
return 0;
}
#endif /* CONFIG_EXT4_FS_POSIX_ACL */
--
2.39.2