id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
7b42f95813dc9ceb6bda35afcf914630909a19f9
Analyze and fix the following issue in the Linux kernel code: apparmor: fix potential UAF in aa_replace_profiles
Problem Details: The function aa_replace_profiles was accessing udata->size after calling aa_put_loaddata(udata), causing a potential UAF. Fixed this by saving the size to a local variable before dropping the reference. Fixes: 5ac8c355ae001 ("apparmor: allow introspecting the loaded policy pre internal transform") Re...
```diff diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 1739a9de9893..08620984d950 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -1378,13 +1378,15 @@ ssize_t aa_replace_profiles(struct aa_ns *policy_ns, struct aa_label *label, mutex_unlock(&ns->lock); out: +...
32e92764d6f8d251c1bca62be33793287b453a81
Analyze and fix the following issue in the Linux kernel code: apparmor: grab ns lock and refresh when looking up changehat child profiles
Problem Details: There was a race condition involving change_hat and profile replacement in which replacement of the parent profile during a changehat operation could result in the list of children becoming empty and the changehat operation failing. To prevent this: - grab the namespace lock until we've built the hat ...
```diff diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 6748ac74b060..c2652165a588 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -12,6 +12,7 @@ #include <linux/fs.h> #include <linux/file.h> #include <linux/mount.h> +#include <linux/mutex.h> #include <linux/sy...
ad213bbbc0e3e270ce7df2d9d80d4ce3826993d7
Analyze and fix the following issue in the Linux kernel code: apparmor: fix rawdata_f_data implicit flex array
Problem Details: rawdata_f_data has a blob of data that is allocated at its end but not explicitly declared. Makes sure it is correctly declared as a flex_rray. Fixes: 63c16c3a76085 ("apparmor: Initial implementation of raw policy blob compression") Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 252a7ca98a9e..03fc18cf5fa7 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -71,10 +71,10 @@ struct rawdata_f_data { struct aa_loaddata *loaddata; + DECLARE_FLEX_ARRAY(char, data); }; #...
654fe7505dc6889724d4094fa64f89991afabfc3
Analyze and fix the following issue in the Linux kernel code: apparmor: aa_label_alloc use aa_label_free on alloc failure
Problem Details: aa_label_alloc() allocates a secid before allocating or taking the label proxy. If the later proxy step fails, the error path only freed the label memory, leaking any resources initialized by aa_label_init(). Use aa_label_free() on the failure path so partially initialized labels release their secid a...
```diff diff --git a/security/apparmor/label.c b/security/apparmor/label.c index a8850d118c9c..c60244ed96db 100644 --- a/security/apparmor/label.c +++ b/security/apparmor/label.c @@ -458,7 +458,7 @@ struct aa_label *aa_label_alloc(int size, struct aa_proxy *proxy, gfp_t gfp) return new; fail: - kfree(new); + aa_la...
a58cafd38b46fb1a2220e2fbbcfe291ea75fa147
Analyze and fix the following issue in the Linux kernel code: apparmor: check label build before no_new_privs test
Problem Details: aa_change_profile() builds a replacement label with fn_label_build_in_scope() before the no_new_privs subset check. The build helper can fail and return NULL or an ERR_PTR, but the result was passed to aa_label_is_unconfined_subset() before the existing IS_ERR_OR_NULL() check. Reuse the existing targe...
```diff diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index f02bf770f638..6748ac74b060 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -1527,6 +1527,8 @@ check: new = fn_label_build_in_scope(label, profile, GFP_KERNEL, aa_get_label(target), aa_get_...
d62d9bfe050f44f772d05a32079dba3e3523ab2a
Analyze and fix the following issue in the Linux kernel code: security/apparmor/apparmorfs.c: conditionally compile get_loaddata_common_ref()
Problem Details: Some config did this: security/apparmor/apparmorfs.c:177:28: warning: 'get_loaddata_common_ref' defined but not used [-Wunused-function] 177 | static struct aa_loaddata *get_loaddata_common_ref(struct aa_common_ref *ref) get_loaddata_common_ref() is only used if CONFIG_SECURITY_APPARMOR_EXPORT_BINA...
```diff diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index ededaf46f3ca..aeff3d2d863b 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -174,6 +174,7 @@ static struct aa_proxy *get_proxy_common_ref(struct aa_common_ref *ref) return NULL; } +#ifdef C...
6d25e7b47616cb2db43351210929c8f19dc305a3
Analyze and fix the following issue in the Linux kernel code: apparmor: fix refcount leak when updating the sk_ctx
Problem Details: Currently update_sk_ctx() transfers the plabel reference, unfortunately it is also unconditionally put in the caller. Ideally we would make the caller conditionally put the reference based on whether it was transferred but for now just fix the bug by getting a reference. Fixes: 88fec3526e841 ("apparmo...
```diff diff --git a/security/apparmor/af_unix.c b/security/apparmor/af_unix.c index 23753cb2096e..834a3b1c2f0a 100644 --- a/security/apparmor/af_unix.c +++ b/security/apparmor/af_unix.c @@ -674,9 +674,11 @@ static void update_sk_ctx(struct sock *sk, struct aa_label *label, old = rcu_dereference_protected(ctx->peer,...
b1aea2c1960771a276d7e68c7424168eccd0c3da
Analyze and fix the following issue in the Linux kernel code: apparmor: fix race in unix socket mediation when peer_path is used
Problem Details: The holding a reference to the peer_sk is not enough to ensure access to the peer sk path. Accessing the path outside of the state lock allows for a race with unix_release_sock(). Fix this by taking the state lock and getting a reference to the path under lock. Ideally for connected sockets we would c...
```diff diff --git a/security/apparmor/af_unix.c b/security/apparmor/af_unix.c index 09ce3f6da20c..23753cb2096e 100644 --- a/security/apparmor/af_unix.c +++ b/security/apparmor/af_unix.c @@ -748,41 +748,47 @@ int aa_unix_file_perm(const struct cred *subj_cred, struct aa_label *label, if (!peer_sk) goto out; - pe...
4483efe4f21510b30c24bc97d9fd0e8feab94125
Analyze and fix the following issue in the Linux kernel code: apparmor: fix shadowing of plabel that prevents cache from being updated
Problem Details: Unfortunately the plabel was being shadowed by an unused local var. This didn't affect the mediation check but did cauase the cache to not correctly be updated resulting in extra mediation checks. Fixes: 88fec3526e841 ("apparmor: make sure unix socket labeling is correctly updated.") Signed-off-by: Jo...
```diff diff --git a/security/apparmor/af_unix.c b/security/apparmor/af_unix.c index fdb4a9f212c3..09ce3f6da20c 100644 --- a/security/apparmor/af_unix.c +++ b/security/apparmor/af_unix.c @@ -758,11 +758,10 @@ int aa_unix_file_perm(const struct cred *subj_cred, struct aa_label *label, unix_fs_perm(op, request, su...
9406f6012b7343661efb516a11c62d4db2b62f75
Analyze and fix the following issue in the Linux kernel code: net: ife: require ETH_HLEN to be pullable in ife_decode()
Problem Details: ife decode may return after making only the outer IFE header and metadata pullable. The caller then passes the decapsulated packet to eth_type_trans(), which expects the inner Ethernet header to be accessible from the linear data area. With a malformed IFE frame, the inner Ethernet header may still be...
```diff diff --git a/net/ife/ife.c b/net/ife/ife.c index be05b690b9ef..7a75947a31e3 100644 --- a/net/ife/ife.c +++ b/net/ife/ife.c @@ -79,7 +79,7 @@ void *ife_decode(struct sk_buff *skb, u16 *metalen) if (unlikely(ifehdrln < 2)) return NULL; - if (unlikely(!pskb_may_pull(skb, total_pull))) + if (unlikely(!pskb_m...
f846d68992142034b1d34a83200a10cdc713eeda
Analyze and fix the following issue in the Linux kernel code: spi: Fix mismatched DT property access types
Problem Details: The SPI drivers read properties whose bindings use normal uint32 cells. Using boolean or u16 helpers makes the access look like a different DT encoding and causes the property checker to flag the call sites. Use presence checks for unsupported properties and read numeric cell properties through u32 he...
```diff diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index f560bd537f7d..1341bdd7db75 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -756,7 +756,7 @@ static int of_fsl_espi_probe(struct platform_device *ofdev) unsigned int irq, num_cs; int ret; - if (of_propert...
4346d91cfa47b0d9303533edde8acd33e4b9ca40
Analyze and fix the following issue in the Linux kernel code: ASoC: dt-bindings: Fix RT5677 "realtek,gpio-config" type
Problem Details: "realtek,gpio-config" is described as six 8-bit GPIO configuration values, and the RT5677 driver stores and reads those values as bytes. The binding incorrectly documented the property as a uint32 array. Document "realtek,gpio-config" as a uint8-array so the generated schema matches the hardware defin...
```diff diff --git a/Documentation/devicetree/bindings/sound/realtek,rt5677.yaml b/Documentation/devicetree/bindings/sound/realtek,rt5677.yaml index 9ce23e58e5ea..ae27ae78b1b2 100644 --- a/Documentation/devicetree/bindings/sound/realtek,rt5677.yaml +++ b/Documentation/devicetree/bindings/sound/realtek,rt5677.yaml @@ -5...
d4e035b3a517d26a38374e5780f904cd9b3d7c50
Analyze and fix the following issue in the Linux kernel code: igc: fix typos in comments
Problem Details: Fix spelling errors in code comments: - igc_diag.c: 'autonegotioation' -> 'autonegotiation' - igc_main.c: 'revisons' -> 'revisions' (two occurrences) Signed-off-by: Maximilian Pezzullo <maximilianpezzullo@gmail.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: Joe Da...
```diff diff --git a/drivers/net/ethernet/intel/igc/igc_diag.c b/drivers/net/ethernet/intel/igc/igc_diag.c index a43d7244ee70..031561fdce49 100644 --- a/drivers/net/ethernet/intel/igc/igc_diag.c +++ b/drivers/net/ethernet/intel/igc/igc_diag.c @@ -172,7 +172,7 @@ bool igc_link_test(struct igc_adapter *adapter, u64 *data...
2904b67ba2f10ee2b490d787fdced6f8fac9ed58
Analyze and fix the following issue in the Linux kernel code: igb: fix typos in comments
Problem Details: Fix spelling errors in code comments: - e1000_nvm.c: 'likley' -> 'likely' - e1000_mac.c: 'auto-negotitation' -> 'auto-negotiation' - e1000_mbx.h: 'exra' -> 'extra' - e1000_defines.h: 'Aserted' -> 'Asserted' Signed-off-by: Maximilian Pezzullo <maximilianpezzullo@gmail.com> Reviewed-by: Aleksandr Lo...
```diff diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h index fa028928482f..7e6f9aa2d57b 100644 --- a/drivers/net/ethernet/intel/igb/e1000_defines.h +++ b/drivers/net/ethernet/intel/igb/e1000_defines.h @@ -442,7 +442,7 @@ /* Interrupt Cause Set */ #define E...
a5ecafcfb27baf2dba766c4fd99dbb947f4e85d8
Analyze and fix the following issue in the Linux kernel code: e1000e: limit endianness conversion to boundary words
Problem Details: [Why] In e1000_set_eeprom(), the eeprom_buff is allocated to hold a range of words. However, only the boundary words (the first and the last) are populated from the EEPROM if the write request is not word-aligned. The words in the middle of the buffer remain uninitialized because they are intended to b...
```diff diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index dbed30943ef4..a8b35ae41141 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c @@ -583,20 +583,25 @@ static int e1000_set_eeprom(struct net_device *...
4cc8566ae0d1609d888d90bf4e49b4f6ee62c1cd
Analyze and fix the following issue in the Linux kernel code: e1000: limit endianness conversion to boundary words
Problem Details: [Why] In e1000_set_eeprom(), the eeprom_buff is allocated to hold a range of words. However, only the boundary words (the first and the last) are populated from the EEPROM if the write request is not word-aligned. The words in the middle of the buffer remain uninitialized because they are intended to b...
```diff diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c index 4dcbeabb3ad2..c15ad95c63c1 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c @@ -499,6 +499,9 @@ static int e1000_set_eeprom(s...
8538aaea10e141457bcb13d51b0d278c697c422a
Analyze and fix the following issue in the Linux kernel code: iavf: iavf_virtchnl_completion: drop duplicate ether_addr_equal() test
Problem Details: This is just a simple cleanup fix. Commit 35a2443d0910f ("iavf: Add waiting for response from PF in set mac") introduced a duplicate ether_addr_equal() check, so the current code tests the new MAC twice against the former MAC. Remove the outer ether_addr_equal() test, remnant of commit c5c922b3e09b (...
```diff diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c index 4f2defd2331b..ec234cc8bd9d 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -2550,13 +2550,11 @@ void iavf_virtchnl_completion...
8a7bca6de6debded7d591a352db7b7715f1f3d11
Analyze and fix the following issue in the Linux kernel code: net/stmmac: Apply MTL_MAX queue limit if config missing
Problem Details: When "snps,rx-queues-to-use" or "tx-queues-to-use" config in DTS is provided current code will apply U8_MAX value for queues_to_use if there is input of higher value. But actual maximum number of supported queues is set via macro MTL_MAX_RX_QUEUES and MTL_MAX_TX_QUEUES, which currently have value of 8....
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 5cae2aa72906..dc5f951a311d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -156,8 +156,8 @@ static in...
1c3a77471afbb3981af28f7f7c8b2487558e4b00
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix debugfs new-tuple display for IPv4 ROUTE entries
Problem Details: In airoha_ppe_debugfs_foe_show(), the second switch statement falls through from PPE_PKT_TYPE_IPV4_HNAPT/DSLITE to PPE_PKT_TYPE_IPV4_ROUTE, accessing hwe->ipv4.new_tuple for all three types. However, IPv4 ROUTE (3-tuple) entries do not contain a valid new_tuple — this field is only meaningful for NATte...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_ppe_debugfs.c b/drivers/net/ethernet/airoha/airoha_ppe_debugfs.c index 0112c41150bb..e46a98514486 100644 --- a/drivers/net/ethernet/airoha/airoha_ppe_debugfs.c +++ b/drivers/net/ethernet/airoha/airoha_ppe_debugfs.c @@ -121,8 +121,6 @@ static int airoha_ppe_debugfs...
1402ecccf5630a0b7fa4749d7d2e72abc3f3d73d
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix register index for Tx-fwd counter configuration
Problem Details: In airoha_qdma_init_qos_stats(), the Tx-fwd counter configuration register uses the same index (i << 1) as the Tx-cpu counter, which overwrites the Tx-cpu configuration. The Tx-fwd counter value register correctly uses (i << 1) + 1, so the configuration register should use the same index. Fix the REG_...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c index 31cdb11cd78d..329988a8400c 100644 --- a/drivers/net/ethernet/airoha/airoha_eth.c +++ b/drivers/net/ethernet/airoha/airoha_eth.c @@ -1256,7 +1256,7 @@ static void airoha_qdma_init_qos_stats(struct airoha_qdma *...
acd7df8d955480a6f6e5bb809da67b1500cc3cf4
Analyze and fix the following issue in the Linux kernel code: tipc: restrict socket queue dumps in enqueue tracepoints
Problem Details: tipc_sk_enqueue() runs with sk->sk_lock.slock held while the socket is owned by user context. The spinlock protects the backlog queue in this path, but it does not serialize against the socket owner consuming or purging sk_receive_queue. KASAN reported: CPU: 14 UID: 0 PID: 1050 Comm: tipc3 Not tain...
```diff diff --git a/net/tipc/socket.c b/net/tipc/socket.c index f64f7a35b5c9..490f30899b5a 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2455,17 +2455,17 @@ static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk, atomic_set(dcnt, 0); lim = rcvbuf_limit(sk, skb) + atomic_read(dcnt)...
925551c944a1de3058dc3fb55a517eea7749835d
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: fix NPC mailbox codes in mbox.h
Problem Details: Several NPC mailbox command IDs in the 0x601x range were assigned out of order. Renumber and reorder the M() definitions so each opcode matches the stable contract expected by userspace tools and applications. Fixes: 4e527f1e5c15 ("octeontx2-af: npc: cn20k: Add new mailboxes for CN20K silicon") Cc: Su...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h index dc42c81c0942..44fdd6ba7307 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h +++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h @@ -283,31 +283,30 @@ M(NPC_GET_FIELD_HASH_INFO, ...
b693b51e0829b96a5c43f45c3fba3d11f6f09d2f
Analyze and fix the following issue in the Linux kernel code: dt-bindings: net: dsa: Convert lan9303.txt to yaml format
Problem Details: Convert lan9303.txt to yaml format to fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx53-kp-hsc.dtb: /soc/bus@50000000/i2c@53fec000/switch@a: failed to match any schema with compatible: ['smsc,lan9303-i2c'] Additional changes: - rename switch-phy to switch in example. Reviewed-by: Rob H...
```diff diff --git a/Documentation/devicetree/bindings/net/dsa/lan9303.txt b/Documentation/devicetree/bindings/net/dsa/lan9303.txt deleted file mode 100644 index 0337c2ccfa9a..000000000000 --- a/Documentation/devicetree/bindings/net/dsa/lan9303.txt +++ /dev/null @@ -1,100 +0,0 @@ -SMSC/MicroChip LAN9303 three port ethe...
fd615abd53110f0f815984e99e7cc51ca6b7d979
Analyze and fix the following issue in the Linux kernel code: net: bcmgenet: Use weighted round-robin TX DMA arbitration
Problem Details: Under heavy network traffic, we observed sporadic TX queue timeouts on the Raspberry Pi 4. The timeouts can be reproduced by stress testing the TX path with multiple concurrent iperf UDP streams: iperf3 -c <ip> -u -b0 -P16 -t60 NETDEV WATCHDOG: CPU: 0: transmit queue 0 timed out 2044 ms NE...
```diff diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 7c11cf916762..ad08c67269be 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -40,9 +40,8 @@ #include "bcmgenet.h" -/* Default ...
cf393de90f93bcc962436062e0a6d3afc0285d03
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Add tests for UDP send
Problem Details: Add tests specific to UDP sendmsg() in the protocol_* variants to ensure behaviour is consistent across AF_INET, AF_INET6 and AF_UNIX. Signed-off-by: Matthieu Buffet <matthieu@buffet.re> Link: https://patch.msgid.link/20260611162107.49278-5-matthieu@buffet.re [mic: Fix comment formatting, rebase] Sign...
```diff diff --git a/tools/testing/selftests/landlock/net_test.c b/tools/testing/selftests/landlock/net_test.c index 72e6fbdc2ea2..fb244aaef86f 100644 --- a/tools/testing/selftests/landlock/net_test.c +++ b/tools/testing/selftests/landlock/net_test.c @@ -289,9 +289,163 @@ static int connect_variant(const int sock_fd, ...
e61247a2e694d17236149135b2d22f0f7d19578c
Analyze and fix the following issue in the Linux kernel code: landlock: Add UDP send+connect access control
Problem Details: Add support for a second fine-grained UDP access right. LANDLOCK_ACCESS_NET_CONNECT_SEND_UDP controls the ability to set the remote port of a socket (via connect()) and to specify an explicit destination when sending a datagram, to override any remote peer set on a UDP socket (e.g. in sendto() or sendm...
```diff diff --git a/include/uapi/linux/landlock.h b/include/uapi/linux/landlock.h index f2927681e92d..811ec77f9105 100644 --- a/include/uapi/linux/landlock.h +++ b/include/uapi/linux/landlock.h @@ -378,11 +378,34 @@ struct landlock_net_port_attr { * * - %LANDLOCK_ACCESS_NET_BIND_UDP: Bind UDP sockets to the given ...
9a8ed15ce22472fe0363e33738b4317d06b13c3a
Analyze and fix the following issue in the Linux kernel code: landlock: Add UDP bind() access control
Problem Details: Add support for a first fine-grained UDP access right. LANDLOCK_ACCESS_NET_BIND_UDP controls the ability to set the local port of a UDP socket (via bind()). It will be useful for servers (to start receiving datagrams), and for some clients that need to use a specific source port (e.g. mDNS requires to ...
```diff diff --git a/include/uapi/linux/landlock.h b/include/uapi/linux/landlock.h index 10a346e55e95..f2927681e92d 100644 --- a/include/uapi/linux/landlock.h +++ b/include/uapi/linux/landlock.h @@ -200,10 +200,10 @@ struct landlock_net_port_attr { * (also used for IPv6), and within that range, on a per-socket basis...
0ce4243509d1580349dd0d50624036d6b097e958
Analyze and fix the following issue in the Linux kernel code: landlock: Fix unmarked concurrent access to socket family
Problem Details: Socket family is read (twice) in a context where the socket is not locked, so another thread can setsockopt(IPV6_ADDRFORM) to write it concurrently. Add needed READ_ONCE() annotation. Use the proper macro to access __sk_common.skc_family like everywhere else. Fixes: fff69fb03dde ("landlock: Support n...
```diff diff --git a/security/landlock/net.c b/security/landlock/net.c index a38bdfcffc22..4ee4002a8f56 100644 --- a/security/landlock/net.c +++ b/security/landlock/net.c @@ -46,6 +46,7 @@ static int current_check_access_socket(struct socket *const sock, const int addrlen, access_mask_t access_r...
0302cd72fe196aee933e3fb76f6d175d1ab0e843
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Explicitly disable audit in teardowns
Problem Details: I'm seeing sporadic selftest failures, such as # RUN scoped_audit.connect_to_child ... # scoped_abstract_unix_test.c:314:connect_to_child:Expected 0 (0) == records.access (8) # connect_to_child: Test failed # FAIL scoped_audit.connect_to_child not ok 19 scoped_audit.conn...
```diff diff --git a/tools/testing/selftests/landlock/audit.h b/tools/testing/selftests/landlock/audit.h index 936fe20f020e..f45fdef35681 100644 --- a/tools/testing/selftests/landlock/audit.h +++ b/tools/testing/selftests/landlock/audit.h @@ -553,10 +553,9 @@ static int audit_init_filter_exe(struct audit_filter *filter...
76579d09beedaffe7fe76e9c05644f73983e1ceb
Analyze and fix the following issue in the Linux kernel code: selftests/landlock: Test SCOPE_SIGNAL on the SIGIO/fowner pgid path
Problem Details: Add regression tests for the LANDLOCK_SCOPE_SIGNAL handling of the asynchronous SIGIO delivery path (fcntl(F_SETOWN)) with a process-group owner. sigio_to_pgid_members covers the bypass: a sandboxed process at the head of its process group's PGID hlist (the default after fork()) arms F_SETOWN(-pgrp) +...
```diff diff --git a/tools/testing/selftests/landlock/scoped_signal_test.c b/tools/testing/selftests/landlock/scoped_signal_test.c index d8bf33417619..f24f2c28f62e 100644 --- a/tools/testing/selftests/landlock/scoped_signal_test.c +++ b/tools/testing/selftests/landlock/scoped_signal_test.c @@ -559,4 +559,186 @@ TEST_F(...
4b80320ca7ed03d6e683f95b6066565dc97b9f92
Analyze and fix the following issue in the Linux kernel code: landlock: Fix LANDLOCK_SCOPE_SIGNAL bypass on the SIGIO path
Problem Details: LANDLOCK_SCOPE_SIGNAL must prevent a sandboxed process from signaling processes outside its Landlock domain. It can be bypassed through the asynchronous SIGIO delivery path. A sandboxed process that owns any file or socket can arm it with fcntl(fd, F_SETOWN, -pgid), fcntl(fd, F_SETSIG, SIGKILL) and O...
```diff diff --git a/security/landlock/fs.c b/security/landlock/fs.c index c1ecfe239032..664962a416d7 100644 --- a/security/landlock/fs.c +++ b/security/landlock/fs.c @@ -1900,6 +1900,14 @@ static bool control_current_fowner(struct fown_struct *const fown) */ lockdep_assert_held(&fown->lock); + /* + * A process...
b232bd12789fa57405b5092f28788be97aae9999
Analyze and fix the following issue in the Linux kernel code: landlock: Account all audit data allocations to user space
Problem Details: Mark the kzalloc_flex() of struct landlock_details with GFP_KERNEL_ACCOUNT so the allocation is charged to the calling task, like the other Landlock per-domain allocations which have used GFP_KERNEL_ACCOUNT forever. Every property of landlock_details is caller-attributable: allocated by landlock_restr...
```diff diff --git a/security/landlock/domain.c b/security/landlock/domain.c index 06b6bd845060..04b69b43fbf5 100644 --- a/security/landlock/domain.c +++ b/security/landlock/domain.c @@ -90,11 +90,12 @@ static struct landlock_details *get_current_details(void) return ERR_CAST(buffer); /* - * Create the new deta...
d936e1a9170f9cadaa5f37586b1dfe6f20f98799
Analyze and fix the following issue in the Linux kernel code: landlock: Set audit_net.sk for socket access checks
Problem Details: Set audit_net.sk in current_check_access_socket() to provide the socket object to audit_log_lsm_data(). This makes Landlock consistent with AppArmor, which always sets .sk for socket operations, and with SELinux's generic socket permission checks. The socket's local and foreign address information (l...
```diff diff --git a/security/landlock/net.c b/security/landlock/net.c index c368649985c5..a38bdfcffc22 100644 --- a/security/landlock/net.c +++ b/security/landlock/net.c @@ -198,6 +198,7 @@ static int current_check_access_socket(struct socket *const sock, return 0; audit_net.family = address->sa_family; + audit...
5db36ee62849eb084e345e5559c8fd5fe98159a3
Analyze and fix the following issue in the Linux kernel code: ice: introduce TXC DPLL device and TX ref clock pin framework for E825
Problem Details: E825 devices provide a dedicated TX clock (TXC) domain which may be driven by multiple reference clock sources, including external board references and port-derived SyncE. To support future TX clock control and observability through the Linux DPLL subsystem, introduce a separate TXC DPLL device (of DPL...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_dpll.c b/drivers/net/ethernet/intel/ice/ice_dpll.c index 9ffa7da7eb7f..a5127a844e28 100644 --- a/drivers/net/ethernet/intel/ice/ice_dpll.c +++ b/drivers/net/ethernet/intel/ice/ice_dpll.c @@ -19,6 +19,11 @@ #define ICE_DPLL_SW_PIN_INPUT_BASE_QSFP 6 #define ICE_D...
1a2292101c0dc422466c673031de03d2e871adbe
Analyze and fix the following issue in the Linux kernel code: dpll: balance create/delete notifications in __dpll_pin_(un)register
Problem Details: __dpll_pin_register() emits dpll_pin_create_ntf() internally, but __dpll_pin_unregister() left the matching delete to its callers. The counts then diverge on dpll_pin_on_pin_register() rollback and on dpll_pin_on_pin_unregister(), leaking stale notifications. Emit dpll_pin_delete_ntf() inside __dpll_p...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index ea45bb41376c..1aaf62775408 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -926,6 +926,7 @@ __dpll_pin_unregister(struct dpll_device *dpll, struct dpll_pin *pin, const struct dpll_pin_ops *ops, void *priv, vo...
0a5c720a7d57d2287d5566c4ad93ee26b7c06845
Analyze and fix the following issue in the Linux kernel code: dpll: guard sync-pair removal on full pin unregister
Problem Details: __dpll_pin_unregister() wiped the global sync-pair state on every (dpll, ops, priv, cookie) tuple removed from a pin. When a pin is registered multiple times and only one registration is being torn down, this dropped sync-pair pairings still in use by the surviving registrations. Move dpll_pin_ref_syn...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 58034be07080..ea45bb41376c 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -926,11 +926,12 @@ __dpll_pin_unregister(struct dpll_device *dpll, struct dpll_pin *pin, const struct dpll_pin_ops *ops, void *priv, ...
df0ba51ccf873e533669578104981109217d8201
Analyze and fix the following issue in the Linux kernel code: dpll: emit per-dpll delete notifications in dpll_pin_on_pin_unregister()
Problem Details: dpll_pin_on_pin_register() emits a creation notification for every parent->dpll_refs entry, but dpll_pin_on_pin_unregister() emitted only one deletion notification outside the loop. When a pin is registered against multiple parent dplls, userspace sees N creates but a single delete and leaks per-dpll s...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 80195f3a84f3..58034be07080 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -1036,14 +1036,14 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin, unsigned long i; mutex_lock(&dpll_lo...
e83b403eb142be18d223fc599c0ac45519053671
Analyze and fix the following issue in the Linux kernel code: dpll: send delete notification before unregister in on-pin rollback
Problem Details: The rollback path in dpll_pin_on_pin_register() called __dpll_pin_unregister() before dpll_pin_delete_ntf(). When the unregister dropped the pin's last DPLL reference it cleared the DPLL_REGISTERED mark in dpll_pin_xa, so the subsequent dpll_pin_event_send() failed dpll_pin_available() and aborted with...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index cea7e2be2cbc..80195f3a84f3 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -1007,9 +1007,9 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin, dpll_unregister: xa_for_each(&parent->dpll_r...
32239d600236a986c8e6d16aa814d3d91066b244
Analyze and fix the following issue in the Linux kernel code: dpll: fix stale iteration in dpll_pin_on_pin_unregister()
Problem Details: Neither parent->dpll_refs nor pin->dpll_refs on its own is a correct iteration target at unregister time: - pin->dpll_refs includes DPLLs the child was registered against via a different parent or directly; blind unregister WARNs on the cookie miss in dpll_xa_ref_pin_del(). - parent->dpll_...
```diff diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index 6dc7e93ece75..cea7e2be2cbc 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -1031,14 +1031,19 @@ EXPORT_SYMBOL_GPL(dpll_pin_on_pin_register); void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *p...
f64e03da0d83cb173743888bff4a7e61476a8fc2
Analyze and fix the following issue in the Linux kernel code: Revert "PCI/MSI: Unmap MSI-X region on error"
Problem Details: This reverts commit 1a8d4c6ecb4c81261bcdf13556abd4a958eca202. Commit 1a8d4c6ecb4c ("PCI/MSI: Unmap MSI-X region on error") added an iounmap(dev->msix_base) on the error path of msix_capability_init() to release the MSI-X region when msix_setup_interrupts() fails. When msix_setup_interrupts() fails, t...
```diff diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c index 81d24a270a79..a3e0daff0988 100644 --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -749,7 +749,7 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries, ret = msix_setup_interrupts(dev, entries, nvec, affd...
05f789fa90d95d5771230e78453cedff2486039d
Analyze and fix the following issue in the Linux kernel code: net: wwan: t7xx: check skb_clone in control TX
Problem Details: t7xx_port_ctrl_tx() clones each skb fragment before passing it to the port transmit path. The clone is used immediately to set cloned->len, so an skb_clone() failure results in a NULL pointer dereference. Check the clone before using it. If previous fragments were already queued, preserve the driver's...
```diff diff --git a/drivers/net/wwan/t7xx/t7xx_port_wwan.c b/drivers/net/wwan/t7xx/t7xx_port_wwan.c index 7fc569565ff9..d2529df7592a 100644 --- a/drivers/net/wwan/t7xx/t7xx_port_wwan.c +++ b/drivers/net/wwan/t7xx/t7xx_port_wwan.c @@ -106,6 +106,8 @@ static int t7xx_port_ctrl_tx(struct t7xx_port *port, struct sk_buff *...
14a8bc41ce9edae42d56466063a7f2c84a16c45c
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_wed: debugfs: correct index in wed_amsdu_show()
Problem Details: WED_MON_AMSDU_ENG_CNT point to different entry by 'base+n*offset' mode, correct the wed amsdu entry number in wed_amsdu_show(). Fixes: 3f3de094e8342 ("net: ethernet: mtk_wed: debugfs: add WED 3.0 debugfs entries") Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Link: https://patch.msgid.link/202...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c index 781c691473e1..519c364e87d1 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_debugfs.c @@ -310,9 +310,9 @@ wed_amsdu_show(struct seq_file *s...
d7d81b00301398fcd38cf5b5869f0fdb674472ef
Analyze and fix the following issue in the Linux kernel code: net: airoha: Fix error handling in airoha_ppe_flush_sram_entries()
Problem Details: In airoha_ppe_flush_sram_entries(), the outer "err" variable was never updated when the inner loop variable shadowed it, causing the function to always return 0 even when airoha_ppe_foe_commit_sram_entry() fails. Drop the outer "err" variable and return directly on error, propagating the error code fr...
```diff diff --git a/drivers/net/ethernet/airoha/airoha_ppe.c b/drivers/net/ethernet/airoha/airoha_ppe.c index 5c9dff6bccd1..a124f15345a9 100644 --- a/drivers/net/ethernet/airoha/airoha_ppe.c +++ b/drivers/net/ethernet/airoha/airoha_ppe.c @@ -1330,7 +1330,7 @@ static int airoha_ppe_flush_sram_entries(struct airoha_ppe ...
87bd2ad568e15b90d5f7d4bcd70342d05dad649c
Analyze and fix the following issue in the Linux kernel code: posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
Problem Details: In do_cpu_nanosleep(), posix_cpu_timer_create() takes a pid reference via get_pid() and stores it in timer.it.cpu.pid. If the subsequent posix_cpu_timer_set() call fails, the function returns immediately without calling posix_cpu_timer_del() to release the pid reference, causing a leak. Fix it by call...
```diff diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c index 395e297093f8..74775b94d11b 100644 --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -1506,6 +1506,7 @@ static int do_cpu_nanosleep(const clockid_t which_clock, int flags, spin_lock_irq(&timer.it_lock...
8f727615134abc6382f0ea07b90270d7bdde578f
Analyze and fix the following issue in the Linux kernel code: x86/irq: Add missing 's' back to thermal event printout
Problem Details: The /proc/interrupt handling rework dropped a 's' in the thermal event printout, which breaks the thermal test in the Intel LKVS suite. Bring the important letter back. Fixes: 2b57c69917ee ("x86/irq: Make irqstats array based") Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Tho...
```diff diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 9d98c81fcd24..30122f0b3af9 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -92,7 +92,7 @@ static const struct irq_stat_info irq_stat_info[IRQ_COUNT_MAX] = { #endif ISS(TLB, "TLB", " TLB shootdowns\n"), #ifdef CONFIG_X86_TH...
f24df84cbe05e4471c04ac4b921fc0340bbc7752
Analyze and fix the following issue in the Linux kernel code: time/jiffies: Register jiffies clocksource before usage
Problem Details: Teddy reported that a XEN HVM has a long boot delay, which was bisected to the recent enhancements to the negative motion detection. It turned out that the jiffies clocksource is used in early boot before it is registered, which leaves the max_delta_raw field at zero. That causes the read out to be cla...
```diff diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c index 1c954f330dfe..d51428867a33 100644 --- a/kernel/time/jiffies.c +++ b/kernel/time/jiffies.c @@ -60,15 +60,14 @@ EXPORT_SYMBOL(get_jiffies_64); EXPORT_SYMBOL(jiffies); -static int __init init_jiffies_clocksource(void) -{ - return __clocksource_r...
9b0c3673c88588d613d8f09f5931b2b466c6a83d
Analyze and fix the following issue in the Linux kernel code: block: check bio split for unaligned bvec
Problem Details: Offsets and lengths need to be validated against the dma alignment. This check was skipped for sufficiently a small bio with a single bvec, which may allow an invalid request dispatched to the driver. Force the validation for an unaligned bvec by forcing the bio split path that handles this condition. ...
```diff diff --git a/block/blk.h b/block/blk.h index 507ab34a6e90..25af8ac5ef0f 100644 --- a/block/blk.h +++ b/block/blk.h @@ -408,6 +408,8 @@ static inline bool bio_may_need_split(struct bio *bio, bv = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); if (bio->bi_iter.bi_size > bv->bv_len - bio->bi_iter.bi_bvec_done...
d532cddb6c6049ced414d64d83c6ce7149a6421a
Analyze and fix the following issue in the Linux kernel code: nbd: Reclassify sockets to avoid lockdep circular dependency
Problem Details: syzbot reported a possible circular locking dependency in udp_sendmsg() where fs_reclaim can be triggered while holding sk_lock, and fs_reclaim can eventually depend on another sk_lock (e.g., if NBD is used for swap or writeback and NBD uses TLS/TCP which acquires sk_lock). Since the UDP socket and th...
```diff diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index e2fe9e3308fc..3a585a0c882a 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1238,6 +1238,42 @@ static struct socket *nbd_get_socket(struct nbd_device *nbd, unsigned long fd, return sock; } +#ifdef CONFIG_DEBUG_LOCK_ALLOC +static str...
f9cd6fabe0e7c7f6fc30c6c192c7ed72aba37232
Analyze and fix the following issue in the Linux kernel code: octeontx2-af: npc: Fix size of entry2cntr_map
Problem Details: KASAN prints below splat. This is caused by allocating counter for reserved mcam entry for cpt 2nd pass entry. But mcam->entry2cntr_map is not allocated for reserved entries. BUG: KASAN: slab-out-of-bounds in npc_map_mcam_entry_and_cntr+0xb0/0x1a0 Write of size 2 at addr ffff0001033e7ffe by task kwork...
```diff diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index d301a3f0f87a..4994385a822b 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -2181,7 +2181,7 @@ int npc_mcam_rs...
cbde75c38b21f022891525078622587ad557b7c1
Analyze and fix the following issue in the Linux kernel code: batman-adv: tp_meter: handle overlapping packets
Problem Details: If the size of the packets would change during the transmission, it could happen that some retries of packets are overlapping. In this case, precise comparisons of sequence numbers by the receiver would be wrong. It is then necessary to check if the start sequence number to the end sequence number ("se...
```diff diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 055aa1ee6ac5..c2eea7dbc488 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1392,7 +1392,8 @@ out: /** * batadv_tp_handle_out_of_order() - store an out of order packet * @tp_vars: the private data of the curr...
6dde0cfcb36e4d5b3de35b75696937478441eed4
Analyze and fix the following issue in the Linux kernel code: batman-adv: tp_meter: prevent parallel modifications of last_recv
Problem Details: When last_recv is updated to store the last receive sequence number, it is assuming that nothing is modifying in parallel while: * check for outdated packets is done * out of order check is performed (and packets are stored in out-of-order queue) * the out-of-order queue was searched for closed gaps...
```diff diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index fb87fa141e32..055aa1ee6ac5 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1402,6 +1402,7 @@ out: */ static bool batadv_tp_handle_out_of_order(struct batadv_tp_receiver *tp_vars, const struct sk_buff *...
d67c728f07fca2ee6ffdc6dd4421cf2e8691f4d1
Analyze and fix the following issue in the Linux kernel code: batman-adv: tp_meter: annotate last_recv_time access with READ/WRITE_ONCE
Problem Details: The last_recv_time field for batadv_tp_receiver tracks the jiffies value of the most recent activity and is used to detect timeouts. These accesses are not consistently protected by a lock, so READ_ONCE/WRITE_ONCE must be used to prevent data races caused by compiler optimizations. Cc: stable@kernel.o...
```diff diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 259ac8c30735..fb87fa141e32 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -1290,7 +1290,7 @@ static void batadv_tp_receiver_shutdown(struct timer_list *t) bat_priv = tp_vars->common.bat_priv; /* if there is...
e7c775110e1858e5a7471a23a9c9658c0af9df89
Analyze and fix the following issue in the Linux kernel code: batman-adv: tp_meter: restrict number of unacked list entries
Problem Details: When the unacked_list is unbound, an attacker could send messages with small lengths and appropriated seqno + gaps to force the receiver to allocate more and more unacked_list entries. And the end either causing an out-of-memory situation or increase the management overhead for the (large) list that si...
```diff diff --git a/net/batman-adv/tp_meter.c b/net/batman-adv/tp_meter.c index 7e98cbfbbb70..259ac8c30735 100644 --- a/net/batman-adv/tp_meter.c +++ b/net/batman-adv/tp_meter.c @@ -87,6 +87,11 @@ #define BATADV_TP_PLEN (BATADV_TP_PACKET_LEN - ETH_HLEN - \ sizeof(struct batadv_unicast_packet)) +/** + * BATADV_T...
d11c00b95b2a3b3934007fc003dccc6fdcc061ad
Analyze and fix the following issue in the Linux kernel code: batman-adv: v: prevent OGM aggregation on disabled hardif
Problem Details: When an interface gets disabled, the worker is correctly disabled by batadv_hardif_disable_interface() -> ... -> batadv_v_ogm_iface_disable(). In this process, the skb aggr_list is also freed. But batadv_v_ogm_send_meshif() can still queue new skbs (via batadv_v_ogm_queue_on_if()) to the aggr_list. Th...
```diff diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c index fe7c0113d0df..db6f5bdcaa98 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -817,6 +817,7 @@ void batadv_v_hardif_init(struct batadv_hard_iface *hard_iface) hard_iface->bat_v.aggr_len = 0; skb_queue_head_init(&hard_iface...
493d9d2528e1a09b090e4b37f0f553def7bd5ce9
Analyze and fix the following issue in the Linux kernel code: batman-adv: frag: avoid underflow of TTL
Problem Details: Packets with a TTL are using it to limit the amount of time this packet can be forwarded. But for batadv_frag_packet, the TTL was always only reduced but it was never evaluated. It could even underflow without any effect. Check the TTL in batadv_frag_skb_fwd() before attempting to prepare it for forwa...
```diff diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index f311a42203d2..8a006a0473a8 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -417,6 +417,13 @@ bool batadv_frag_skb_fwd(struct sk_buff *skb, */ total_size = ntohs(packet->total_size); if (...
b7293c6e8c15b2db77809b25cf8389e35331b27a
Analyze and fix the following issue in the Linux kernel code: batman-adv: frag: ensure fragment is writable before modifying TTL
Problem Details: Before batman-adv is allowed to write to an skb, it either has to have its own copy of the skb or use skb_cow() to ensure that the data part is not shared. But batadv_frag_skb_fwd() modifies the TTL even when it is shared. Adding a skb_cow() right before this operation avoids this and can at the same ...
```diff diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c index 1e42cf99f8b3..f311a42203d2 100644 --- a/net/batman-adv/fragmentation.c +++ b/net/batman-adv/fragmentation.c @@ -386,6 +386,8 @@ out_err: * @skb: skb to forward * @recv_if: interface that the skb is received on * @orig_node_...
e728bbdf32660c8f32b8f5e8d09427a2c131ad60
Analyze and fix the following issue in the Linux kernel code: batman-adv: fix (m|b)cast csum after decrementing TTL
Problem Details: The broadcast and multicast packets can be received at the same time by the local system and forwarded to other nodes. Both are simply decrementing the TTL at the beginning of the receive path - independent of chosen paths (receive/forward). But such a modification of the data conflicts with the hw csu...
```diff diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 7b4acd1ad991..8786b66c8a92 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -8,6 +8,7 @@ #include "main.h" #include <linux/atomic.h> +#include <linux/build_bug.h> #include <linux/byteorder/generic.h> #include <li...
4cd6d3a4b96a8576f1fed8f9f9f17c2dc2978e0c
Analyze and fix the following issue in the Linux kernel code: batman-adv: ensure bcast is writable before modifying TTL
Problem Details: Before batman-adv is allowed to write to an skb, it either has to have its own copy of the skb or used skb_cow() to ensure that the data part is not shared. The old implementation used a shared queue and created copies before attempting to write to it. But with the new implementation, the broadcast pa...
```diff diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index cd4368b846ad..7b4acd1ad991 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -1191,6 +1191,12 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, if (batadv_is_my_mac(bat_priv, bcast_packet->orig)) goto free_skb; ...
df97a7107b16375a10a36d7a63e9b4291a8ac680
Analyze and fix the following issue in the Linux kernel code: batman-adv: gw: don't deselect gateway with active hardif
Problem Details: The batadv_hardif_cnt() was previously checking if there is an batadv_hard_iface->mesh_iface which is has the same mesh_iface. And since batadv_hardif_disable_interface() was resetting the batadv_hard_iface->mesh_iface after this check, it had to verify whether *1* interface was still part of the mesh_...
```diff diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 60cee2c2f2f4..03d01c20a954 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -814,30 +814,6 @@ err_dev: return ret; } -/** - * batadv_hardif_cnt() - get number of interfaces enslaved to ...
7bfb93e3475be9de894f1cecd3a727d3e1649b03
Analyze and fix the following issue in the Linux kernel code: selftests/bpf: Add arena direct-value one-past-end reject test
Problem Details: BPF_MAP_TYPE_ARENA supports direct-value pseudo loads, but unlike array maps its map value_size is zero and the valid direct-value range is the arena mmap size, max_entries * PAGE_SIZE. Commit 3ac1a467e376 ("bpf: Fix off-by-one boundary validation in arena direct-value access") fixed arena_map_direct_...
```diff diff --git a/tools/testing/selftests/bpf/prog_tests/arena_direct_value.c b/tools/testing/selftests/bpf/prog_tests/arena_direct_value.c new file mode 100644 index 000000000000..4b4adb3f4b71 --- /dev/null +++ b/tools/testing/selftests/bpf/prog_tests/arena_direct_value.c @@ -0,0 +1,73 @@ +// SPDX-License-Identifie...
b48bd16eb9fc57a463a337ca148516cdf3212d61
Analyze and fix the following issue in the Linux kernel code: rqspinlock: Fix order in raw_res_spin_(un)lock_irq to allow schedule
Problem Details: raw_res_spin_unlock_irqrestore() calls raw_res_spin_unlock() and then restores interrupts, this means preemption is enabled when interrupts are still disabled (as part of raw_res_spin_unlock()) so this cannot trigger an actual preemption. This is inconsistent with other spinlock implementations (raw_sp...
```diff diff --git a/include/asm-generic/rqspinlock.h b/include/asm-generic/rqspinlock.h index 151d267a496b..4d46643f46cb 100644 --- a/include/asm-generic/rqspinlock.h +++ b/include/asm-generic/rqspinlock.h @@ -243,12 +243,20 @@ static __always_inline void res_spin_unlock(rqspinlock_t *lock) ({ ...
4c71303c837449158815c521fcee4ec3b8721dbd
Analyze and fix the following issue in the Linux kernel code: bpf: Fix setting retval to -EPERM for cgroup hooks not returning errno
Problem Details: When a cgroup BPF program exits with 0, bpf_prog_run_array_cg() sets the hook return value to -EPERM if it is not a valid errno. This is correct for errno-based hooks, which return 0 on success and negative errno on failure, but wrong for boolean and void LSM hooks. Boolean LSM hooks should only return...
```diff diff --git a/include/linux/bpf_lsm.h b/include/linux/bpf_lsm.h index 643809cc78c3..143775a27a2a 100644 --- a/include/linux/bpf_lsm.h +++ b/include/linux/bpf_lsm.h @@ -52,6 +52,7 @@ int bpf_set_dentry_xattr_locked(struct dentry *dentry, const char *name__str, const struct bpf_dynptr *value_p, int flags); i...
20054869770c7df060c5ecee3e8bbf9029c47191
Analyze and fix the following issue in the Linux kernel code: net: qrtr: fix 32-bit integer overflow in qrtr_endpoint_post()
Problem Details: qrtr_endpoint_post() validates an incoming packet with if (!size || len != ALIGN(size, 4) + hdrlen) goto err; where size comes from the wire. On 32-bit, size_t is 32 bits and ALIGN(size, 4) wraps to 0 for size >= 0xfffffffd, so the check passes and skb_put_data(skb, data + hdrlen, size) writes pas...
```diff diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c index db823177e636..2288159f5b1b 100644 --- a/net/qrtr/af_qrtr.c +++ b/net/qrtr/af_qrtr.c @@ -496,7 +496,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len) if (cb->dst_port == QRTR_PORT_CTRL_LEGACY) cb->dst_port = QRTR_PO...
d7b0413b35715d7b32cb12d4d424613eff85ed2b
Analyze and fix the following issue in the Linux kernel code: net/mlx5: Check max_macs devlink param value against max capability
Problem Details: The max_macs devlink param is checked against the FW max value only at param register time (driver load) and inside the validate callback (devlink param set). The stored DRIVERINIT value persists across FW resets and devlink reloads without any further checks against the max. If the FW link type chang...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 74827e8ca125..37af619e5e04 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -527,7 +527,6 @@ static int handle_hca_cap(struct mlx5...
6001896f00984d317fb75160ba05c4a885fbe2a0
Analyze and fix the following issue in the Linux kernel code: bpf: Run generic devmap egress prog on private skb
Problem Details: Generic XDP devmap multi redirect uses skb_clone() for intermediate destinations and sends the last destination with the original skb. This can leave multiple destinations sharing the same packet data. This becomes visible after generic devmap egress-program support was added: a devmap egress program ...
```diff diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c index 5b9eac5342a9..dc7b859e8bbf 100644 --- a/kernel/bpf/devmap.c +++ b/kernel/bpf/devmap.c @@ -710,6 +710,18 @@ int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb, if (unlikely(err)) return err; + if (dst->xdp_prog && skb_...
ee1ba0add3fbd5a28fa5423be373acd147f1e344
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_dualpi2: Add missing module alias
Problem Details: When a qdisc is added by name, the kernel tries to autoload its module via request_qdisc_module(), which calls: request_module(NET_SCH_ALIAS_PREFIX "%s", name); i.e. it asks modprobe to resolve the "net-sch-<kind>" alias (e.g. "net-sch-dualpi2") rather than the module's file name. Since dualpi2 was s...
```diff diff --git a/net/sched/sch_dualpi2.c b/net/sched/sch_dualpi2.c index 05285775b454..dfec3c99eb45 100644 --- a/net/sched/sch_dualpi2.c +++ b/net/sched/sch_dualpi2.c @@ -1211,6 +1211,7 @@ static struct Qdisc_ops dualpi2_qdisc_ops __read_mostly = { .dump_stats = dualpi2_dump_stats, .owner = THIS_MODULE, }; +M...
9192a18f6de2f5e3eb3813ecd2895ac0f5c008a9
Analyze and fix the following issue in the Linux kernel code: net: ethernet: mtk_wed: fix loading WO firmware for MT7986
Problem Details: MT7986 requires a different mask for second WO firmware. Without this, WO would timeout after loading FW. The correct mask was removed when adding WED for MT7988. Add it back and add a WED version check to fix it. This can be reproduced with a MT7986 + MT7916 board. Fixes: e2f64db13aa1 ("net: ethern...
```diff diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c index fa6b21603416..0d38183c6ba7 100644 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c @@ -367,8 +367,12 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)...
8eed5519e496b7a07f441a0f579cb228a33189f7
Analyze and fix the following issue in the Linux kernel code: net: watchdog: fix refcount tracking races
Problem Details: Blamed commit converted the untracked dev_hold()/dev_put() calls in the watchdog code to use the tracked dev_hold_track()/dev_put_track() (which were later renamed/interfaced to netdev_hold() and netdev_put()). By introducing dev->watchdog_dev_tracker to store the reference tracking information withou...
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0e1e581efc5a..4a0e83709f29 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1980,6 +1980,8 @@ enum netdev_reg_state { * @qdisc_hash: qdisc hash table * @watchdog_timeo: Represents the timeout that is used by ...
f8fd56977eeea3d6939b1a9cd8bd36f1779b3ad0
Analyze and fix the following issue in the Linux kernel code: net: mana: guard TX wq object destroy with INVALID_MANA_HANDLE check
Problem Details: mana_create_txq() has several error paths (after mana_alloc_queues() or mana_create_wq_obj() failure) where tx_qp[i].tx_object stays as the INVALID_MANA_HANDLE sentinel set at allocation. mana_destroy_txq() then unconditionally calls mana_destroy_wq_obj() with (u64)-1, which firmware rejects and logs a...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index c9b1df1ed109..d7de4c4d25bb 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -2334,7 +2334,8 @@ static void mana_destroy_txq(struct man...
5985474e1cb4034680fac2145497a94b0860be50
Analyze and fix the following issue in the Linux kernel code: net: mana: initialize gdma queue id to INVALID_QUEUE_ID
Problem Details: mana_gd_create_mana_wq_cq() leaves queue->id as 0 (from kzalloc_obj()) until mana_create_wq_obj() assigns the firmware-returned id. If creation fails before that, cleanup calls mana_gd_destroy_cq() with id 0, NULLing gc->cq_table[0] and silently breaking whichever real CQ owns that slot. Initialize qu...
```diff diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index d8e816882f02..ac71ca8450bf 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -1192,6 +1192,8 @@ int mana_gd_create_mana_wq_cq(s...
29a540b56e51541b77d323ed4ce1b13dbf7b7872
Analyze and fix the following issue in the Linux kernel code: net: mdio: realtek-rtl9300: Add prefix to register field defines
Problem Details: The current Realtek Otto MDIO driver has some define leftovers without a SoC prefix. When adding new devices there will be an overlap for some of them. Sort this out as follows: - PHY_CTRL_CMD/PHY_CTRL_MMD_DEVAD/PHY_CTRL_MMD_REG are common for all series. Leave them as is but move them into a separa...
```diff diff --git a/drivers/net/mdio/mdio-realtek-rtl9300.c b/drivers/net/mdio/mdio-realtek-rtl9300.c index 92c8f2512476..007a07136fa1 100644 --- a/drivers/net/mdio/mdio-realtek-rtl9300.c +++ b/drivers/net/mdio/mdio-realtek-rtl9300.c @@ -59,23 +59,24 @@ #define RTL9300_SMI_PORT0_15_POLLING_SEL 0xca08 #define RTL9300...
15cd0c93bf4f892d66bc7a93667e2357b5673365
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_dualpi2: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen
Problem Details: Whenever dualpi2 drops packets during peek, it calls qdisc_tree_reduce_backlog. An issue arises because it calls qdisc_tree_reduce_backlog before it reincrements the qlen. If qlen drops to zero, but peek returns an skb, the parent's qlen_notify callback will be executed even though dualpi2 still has 1 ...
```diff diff --git a/net/sched/sch_dualpi2.c b/net/sched/sch_dualpi2.c index a22489c14458..05285775b454 100644 --- a/net/sched/sch_dualpi2.c +++ b/net/sched/sch_dualpi2.c @@ -579,7 +579,7 @@ static void drop_and_retry(struct dualpi2_sched_data *q, struct sk_buff *skb, qdisc_qstats_drop(sch); } -static struct sk_bu...
52f1da34c9f4d5bdc1e8b44242da5c7ba8db85f3
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen
Problem Details: Whenever codel drops packets during peek, it calls qdisc_tree_reduce_backlog. An issue arises because it calls qdisc_tree_reduce_backlog before it reincrements the qlen. If qlen drops to zero, but peek returns an skb, the parent's qlen_notify callback will be executed even though codel still has 1 pack...
```diff diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c index 317aae0ec7bd..7d5076196aff 100644 --- a/net/sched/sch_codel.c +++ b/net/sched/sch_codel.c @@ -56,7 +56,7 @@ static void drop_func(struct sk_buff *skb, void *ctx) qdisc_qstats_drop(sch); } -static struct sk_buff *codel_qdisc_dequeue(struct Qdi...
097f6fc7b1ae362dd7a9444b2572162fda73b284
Analyze and fix the following issue in the Linux kernel code: net/sched: sch_fq_codel: Do not call qdisc_tree_reduce_backlog during peek before restoring qlen
Problem Details: Whenever fq_codel drops packets during peek, it calls qdisc_tree_reduce_backlog. An issue arises because it calls qdisc_tree_reduce_backlog before it reincrements the qlen. If qlen drops to zero, but peek returns an skb, the parent's qlen_notify callback will be executed even though fq_codel still has ...
```diff diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 24db54684e8a..9aebf25ddc79 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c @@ -280,7 +280,7 @@ static void drop_func(struct sk_buff *skb, void *ctx) qdisc_qstats_drop(sch); } -static struct sk_buff *fq_codel_dequeue...
dc175389b18c29a5303ee83169ec653adfae3e17
Analyze and fix the following issue in the Linux kernel code: rxrpc: serialize kernel accept preallocation with socket teardown
Problem Details: rxrpc_kernel_charge_accept() reads rx->backlog without any socket/backlog synchronization and passes that raw pointer into rxrpc_service_prealloc_one(). A concurrent rxrpc_discard_prealloc() sets rx->backlog = NULL and frees the backlog rings, so a kernel preallocation worker can keep using a freed str...
```diff diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c index ee2d1319e69a..47824120f1da 100644 --- a/net/rxrpc/call_accept.c +++ b/net/rxrpc/call_accept.c @@ -471,13 +471,26 @@ int rxrpc_kernel_charge_accept(struct socket *sock, rxrpc_notify_rx_t notify_rx, unsigned long user_call_ID, gfp_t g...
47694fbc9d24ab6bf210f91e8efe06a10a478064
Analyze and fix the following issue in the Linux kernel code: afs: Fix netns teardown to cancel the preallocation charger
Problem Details: Fix the teardown of an afs network namespace to make sure it cancels the work item that keeps the preallocated rxrpc call/conn/peer queue charged before incoming calls are disabled (i.e. listen 0). Also, if net->live is false because the afs netns is being deleted, make afs_charge_preallocation() skip...
```diff diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index 588f8de51167..d5cfd24e815b 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -127,6 +127,7 @@ void afs_close_socket(struct afs_net *net) { _enter(""); + cancel_work_sync(&net->charge_preallocation_work); kernel_listen(net->socket, 0); flush_workqueue...
107a4cb0d47e735830f852d83970d5c81f8e1e08
Analyze and fix the following issue in the Linux kernel code: rxrpc: Fix UAF in rxgk_issue_challenge()
Problem Details: Fix rxgk_issue_challenge() to free the page containing the challenge content after invoking the tracepoint as the whdr passed to the tracepoint points into the page just freed. Fixes: 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)") Reported-by: Marc Dionne <marc.dionne@aur...
```diff diff --git a/net/rxrpc/rxgk.c b/net/rxrpc/rxgk.c index a1ee102abae1..77a67ace1d24 100644 --- a/net/rxrpc/rxgk.c +++ b/net/rxrpc/rxgk.c @@ -687,16 +687,17 @@ static int rxgk_issue_challenge(struct rxrpc_connection *conn) ret = do_udp_sendmsg(conn->local->socket, &msg, len); if (ret > 0) rxrpc_peer_mark_tx...
5801cff7d5d7b4e9d877dfb627b23eb63167f02c
Analyze and fix the following issue in the Linux kernel code: rxrpc: Don't move a peeked OOB message onto the pending queue
Problem Details: rxrpc_recvmsg_oob() takes a received oob message off recvmsg_oobq and, if a response is needed, moves it onto the pending_oobq tree. However, only the unlink from recvmsg_oobq is guarded by MSG_PEEK; the move onto pending_oobq always runs. As a result, reading a challenge with MSG_PEEK leaves the skb ...
```diff diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c index a3cf5358f16e..82614cbdb60f 100644 --- a/net/rxrpc/recvmsg.c +++ b/net/rxrpc/recvmsg.c @@ -262,12 +262,13 @@ static int rxrpc_recvmsg_oob(struct socket *sock, struct msghdr *msg, break; } - if (!(flags & MSG_PEEK)) + if (!(flags & MSG_PEEK)) { ...
16c8ae9735c5bd7e54dd7478d6348e0fc860842d
Analyze and fix the following issue in the Linux kernel code: rxrpc: rxrpc_verify_data ensure rx_dec_buffer alloc
Problem Details: rxrpc_recvmsg_data() calls rxrpc_verify_data() whenever the rxrpc_call.rx_dec_buffer is unallocated and assumes that upon successful return that rx_dec_buffer must be allocated. However, rxrpc_verify_data() does not request an allocation if the rxrpc_skb_priv.len is zero. In addition, failure to alloc...
```diff diff --git a/net/rxrpc/recvmsg.c b/net/rxrpc/recvmsg.c index c940600117a4..a3cf5358f16e 100644 --- a/net/rxrpc/recvmsg.c +++ b/net/rxrpc/recvmsg.c @@ -161,7 +161,7 @@ static int rxrpc_verify_data(struct rxrpc_call *call, struct sk_buff *skb) struct rxrpc_skb_priv *sp = rxrpc_skb(skb); int ret; - if (sp->l...
f48cd5b47bfe9ad6c3fdf9a1d631e3fd7ca90db0
Analyze and fix the following issue in the Linux kernel code: ethtool: tsconfig: always take rtnl_lock
Problem Details: mlx5 throws ASSERT_RTNL() warnings on timestamp config, because it tries to update features. mlx5e_hwtstamp_set() calls netdev_update_features(). I missed this while grepping the drivers because tsconfig goes through ndo_hwtstamp_set/get, not ethtool ops, even tho the new uAPI is in ethtool Netlink. W...
```diff diff --git a/net/ethtool/common.h b/net/ethtool/common.h index e3052972f953..2b3847f00801 100644 --- a/net/ethtool/common.h +++ b/net/ethtool/common.h @@ -113,6 +113,13 @@ ethtool_nl_msg_needs_rtnl(const struct net_device *dev, u8 cmd) return ops->op_needs_rtnl & ETHTOOL_OP_NEEDS_RTNL_SPAUSEPARAM; case ETH...
86c51f0f23136ea5ef5541f607287e07150cd23f
Analyze and fix the following issue in the Linux kernel code: virtio_net: do not allow tunnel csum offload for non GSO packets
Problem Details: Fiona reports broken connectivity for virtio net setup using UDP tunnel inside the guest and NIC with not UDP tunnel TSO support in the host. Currently the virtio_net driver exposes csum offload for UDP-tunneled, TCP non GSO packets. Such packet reach the host as CSUM_PARTIAL ones with the 'encapsulat...
```diff diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index f4adcfee7a80..7d2eeb9b1226 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -6222,6 +6222,19 @@ static void virtnet_free_irq_moder(struct virtnet_info *vi) rtnl_unlock(); } +static netdev_features_t virtnet_featur...
cdf19f380e46192e7084be559638aab1f6ed86a2
Analyze and fix the following issue in the Linux kernel code: net: atm: reject out-of-range traffic classes in QoS validation
Problem Details: Reject ATM traffic classes above ATM_ANYCLASS in check_tp(). SO_ATMQOS stores the supplied QoS after check_qos() succeeds, so accepting larger values leaves invalid traffic_class values in vcc->qos. That bad state later reaches pvc_info(), which indexes class_name[] with vcc->qos.{rx,tp}.traffic_class...
```diff diff --git a/net/atm/common.c b/net/atm/common.c index fe77f51f6ce1..6eb78c34c284 100644 --- a/net/atm/common.c +++ b/net/atm/common.c @@ -720,6 +720,8 @@ static int atm_change_qos(struct atm_vcc *vcc, struct atm_qos *qos) static int check_tp(const struct atm_trafprm *tp) { /* @@@ Should be merged with adju...
990348e5bb457697c2f1f7f7b65154a3334d9d2b
Analyze and fix the following issue in the Linux kernel code: tcp: clear sock_ops cb flags before force-closing a child socket
Problem Details: A child socket inherits the listener's bpf_sock_ops_cb_flags via sk_clone_lock(). If its setup fails in tcp_v4_syn_recv_sock() / tcp_v6_syn_recv_sock(), the child is freed through put_and_exit, where inet_csk_prepare_forced_close() drops the socket lock and tcp_done() runs without it. If BPF_SOCK_OPS_...
```diff diff --git a/include/net/tcp.h b/include/net/tcp.h index 98848db62894..607298501e12 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2942,6 +2942,11 @@ static inline int tcp_call_bpf_3arg(struct sock *sk, int op, u32 arg1, u32 arg2, return tcp_call_bpf(sk, op, 3, args); } +static inline void tcp_...
6213cf54adad2ea1c5d20a10754f941ca42584bd
Analyze and fix the following issue in the Linux kernel code: docs: net: fix minor issues with XDP metadata docs
Problem Details: Minor updates to the XDP metadata documentation: - s/union/struct/ for xsk_tx_metadata - document nested request and completion metadata fields - point capability queries at the xsk-features attribute - fix grammar in the XDP RX metadata guide - typos Acked-by: Stanislav Fomichev <sdf@fomichev.me> Ack...
```diff diff --git a/Documentation/networking/xdp-rx-metadata.rst b/Documentation/networking/xdp-rx-metadata.rst index ce96f4c99505..efdf5eeb49e7 100644 --- a/Documentation/networking/xdp-rx-metadata.rst +++ b/Documentation/networking/xdp-rx-metadata.rst @@ -36,7 +36,7 @@ metadata available in which case the driver ret...
e26657fe3b85c068b01f42bb0c602f242d643ba9
Analyze and fix the following issue in the Linux kernel code: bnxt: fix head underflow on XDP head-grow
Problem Details: The xdp.py test test_xdp_native_adjst_head_grow_data crashes when run on a bnxt machine (and also crashes in NIPA). It seems that the bug is an underflow in bnxt_rx_multi_page_skb, which builds the skb head: napi_build_skb(data_ptr - bp->rx_offset, rxr->rx_page_size); The problem with this express...
```diff diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index c999f9733326..112513044988 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -1011,6 +1011,7 @@ int bnxt_alloc_rx_data(struct bnxt *bp, struct bnxt_rx_...
d3265c19b35d036bba327b36b5366bee76b0157c
Analyze and fix the following issue in the Linux kernel code: net: stmmac: xgmac2: disable RBUE in default RX interrupt mask
Problem Details: Enabling the RX Buffer Unavailable (RBUE) interrupt is counterproductive and can trigger a MAC interrupt storm under heavy RX pressure. When the DMA runs out of RX descriptors it fires RBUE continuously until software refills the ring. However, RBUE is redundant: the normal RX completion interrupt (RI...
```diff diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h index 95fdf3133208..61b6d45a02f5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h @@ -379,9 +379,9 @@ #define XGMAC_RIE BIT(6) #define ...
81246a65303d9635266b1334490142caaf86a11f
Analyze and fix the following issue in the Linux kernel code: handshake: Require admin permission for DONE command
Problem Details: ACCEPT and DONE are the two downcalls of the handshake genl family, both intended for use by the trusted handshake agent (tlshd). ACCEPT already requires GENL_ADMIN_PERM; DONE has no privilege check at all. The fd-lookup in handshake_nl_done_doit() only confirms that some pending handshake request exi...
```diff diff --git a/Documentation/netlink/specs/handshake.yaml b/Documentation/netlink/specs/handshake.yaml index 1024297b3851..ffec12b46759 100644 --- a/Documentation/netlink/specs/handshake.yaml +++ b/Documentation/netlink/specs/handshake.yaml @@ -125,6 +125,7 @@ operations: name: done doc: Handler rep...
a888754e51e915731c8974c4d6d62709facb35d3
Analyze and fix the following issue in the Linux kernel code: Documentation: ABI: sysfs-class-reboot-mode-reboot_modes: fix doc warnings
Problem Details: Repair the docs build warnings in this file by unindenting the description, adding blank lines, and using `` to quote *arg. WARNING: Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes:36: abi_sys_class_reboot_mode_driver_reboot_modes doesn't have a description Documentation/ABI/testing/sys...
```diff diff --git a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes index a16c54ab841b..4306966b7fcc 100644 --- a/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot_modes +++ b/Documentation/ABI/testing/sysfs-class-reboot-mode-reboot...
4373cfa38ead58f980362c841b0d0bdf8c4d956c
Analyze and fix the following issue in the Linux kernel code: power: supply: charger-manager: fix refcount leak in is_full_charged()
Problem Details: In is_full_charged(), power_supply_get_by_name() is called to obtain a reference to the fuel_gauge power supply. If the voltage check (uV >= desc->fullbatt_uV) succeeds, the function returns true directly without releasing the reference, leaking the refcount. Fix this by setting a flag and jumping to ...
```diff diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index 5dc9cd37d697..10158b1bf8e2 100644 --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -303,8 +303,10 @@ static bool is_full_charged(struct charger_manager *cm) if (cm->...
ba61aed9a34671222d1149acfc2f0179a9ce7e80
Analyze and fix the following issue in the Linux kernel code: power: supply: core: fix supplied_from allocations
Problem Details: If dts property power-supplies has multiple values, then accessing to psy->supplied_from[i-1] in __power_supply_populate_supplied_from will overrun supplied_from array. Fixes: f6e0b081fb30 ("power_supply: Populate supplied_from hierarchy from the device tree") Signed-off-by: Lucas Tsai <lucas_tsai@ric...
```diff diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index a446d3d086fc..2532e221b2e1 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -292,18 +292,13 @@ static int power_supply_check_supplies(struct power_supply ...
d894c48a57d78206e4df9c90d4acfaf39394806a
Analyze and fix the following issue in the Linux kernel code: fbdev: modedb: Fix misaligned fields in the 1920x1080-60 mode
Problem Details: The 1920x1080@60 modedb entry has one too many initializers before its sync field: a stray "0" occupies the sync slot, which shifts the remaining values by one field. The entry therefore decodes as sync = 0, vmode = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT (0x3, i.e. FB_VMODE_INTERLACED | FB_VMODE_...
```diff diff --git a/drivers/video/fbdev/core/modedb.c b/drivers/video/fbdev/core/modedb.c index b6926764a99c..e1fd9298a702 100644 --- a/drivers/video/fbdev/core/modedb.c +++ b/drivers/video/fbdev/core/modedb.c @@ -259,7 +259,7 @@ static const struct fb_videomode modedb[] = { FB_VMODE_DOUBLE }, /* 1920x1080 @ 60...
383f69656359191d2236ef5ec259984c844fde9a
Analyze and fix the following issue in the Linux kernel code: cxl: Add dummy function for cxl_memdev_attach_region for !CONFIG_CXL_REGION
Problem Details: Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region when CONFIG_CXL_REGION is not enabled. This allow sbuilding when cxl/core/region.o isn't built. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202606100401.GOjzpKHo-lkp@intel.com/ F...
```diff diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h index d3bdd00f94b3..ed419d0c59f2 100644 --- a/drivers/cxl/cxlmem.h +++ b/drivers/cxl/cxlmem.h @@ -115,7 +115,14 @@ struct cxl_attach_region { struct range hpa_range; }; +#ifdef CONFIG_CXL_REGION int cxl_memdev_attach_region(struct cxl_memdev *cxlmd)...
bd3a6ff4b84e0fc3fca8556d338270603df13f2e
Analyze and fix the following issue in the Linux kernel code: cxl/memdev: Pin parents for entire memdev lifetime
Problem Details: In order to be able to manage the driver that uses a memdev attach mechanism the parent needs to stick around for the device_release_driver(cxlmd->dev.parent) event. Fixes: 29317f8dc6ed ("cxl/mem: Introduce cxl_memdev_attach for CXL-dependent operation") Signed-off-by: Dan Williams <djbw@kernel.org> R...
```diff diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c index 80e65690eb77..91c99eeea92c 100644 --- a/drivers/cxl/core/memdev.c +++ b/drivers/cxl/core/memdev.c @@ -25,9 +25,11 @@ static DEFINE_IDA(cxl_memdev_ida); static void cxl_memdev_release(struct device *dev) { struct cxl_memdev *cxlmd = to_...
4dd86ca99ffcc413cbf79063fd9956ef54e0ca91
Analyze and fix the following issue in the Linux kernel code: cxl/region: Resolve region deletion races
Problem Details: Sungwoo noticed that the sysfs trigger to delete a region may try to delete a region multiple times. It also has no exclusion relative to the kernel releasing the region via CXL root device teardown. Instead of installing new cxl root devres actions per region, use the existing root decoder unregistra...
```diff diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h index 82ca3a476708..07555ae63859 100644 --- a/drivers/cxl/core/core.h +++ b/drivers/cxl/core/core.h @@ -52,6 +52,7 @@ u64 cxl_dpa_to_hpa(struct cxl_region *cxlr, const struct cxl_memdev *cxlmd, u64 dpa); int devm_cxl_add_dax_region(struct cxl...
d91feb88692e81b00cd22f0125cfcd04970b4a0b
Analyze and fix the following issue in the Linux kernel code: cxl/region: Block region delete during region creation
Problem Details: Expand the range lock, rename it "regions_lock", to disable region deletion in the critical period between construct_region() and attach_target(), as well as the period between device_add() and registering the remove actions. Otherwise, userspace can confuse the kernel. It can violate the assumption t...
```diff diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index c5aacd7054f1..6e7a70d51cfe 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -2016,7 +2016,7 @@ struct cxl_root_decoder *cxl_root_decoder_alloc(struct cxl_port *port, return ERR_PTR(rc); } - mutex_init(&cxlrd->range_...
94dfdf6a1b25a7ae324f905df800d3dae9d8be61
Analyze and fix the following issue in the Linux kernel code: Documentation: bug-hunting.rst: fix grammar
Problem Details: Fix a grammar issue to improve readability Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260605190055.15921-2-manuelebner@mailbox.org>
```diff diff --git a/Documentation/admin-guide/bug-hunting.rst b/Documentation/admin-guide/bug-hunting.rst index 3901b43c96df..642bf8474726 100644 --- a/Documentation/admin-guide/bug-hunting.rst +++ b/Documentation/admin-guide/bug-hunting.rst @@ -63,8 +63,8 @@ Documentation/admin-guide/tainted-kernels.rst, "being loade...
30708f03721837b5fa5e034cb41c80f96bea0304
Analyze and fix the following issue in the Linux kernel code: docs: Fix minor grammatical error
Problem Details: Fix minor grammatical error in the administration guide. Signed-off-by: Brigham Campbell <me@brighamcampbell.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260609070618.12566-1-me@brighamcampbell.com>
```diff diff --git a/Documentation/admin-guide/quickly-build-trimmed-linux.rst b/Documentation/admin-guide/quickly-build-trimmed-linux.rst index cb178e0a6208..3432dc8e1a85 100644 --- a/Documentation/admin-guide/quickly-build-trimmed-linux.rst +++ b/Documentation/admin-guide/quickly-build-trimmed-linux.rst @@ -217,7 +21...
eb406b55d891113be04e80533f504c7100165d09
Analyze and fix the following issue in the Linux kernel code: docs/{it_it,sp_SP,zh_CN,zh_TW}: update references to removed CONFIG_DEBUG_SLAB
Problem Details: CONFIG_DEBUG_SLAB was removed in commit 2a19be61a651 ("mm/slab: remove CONFIG_SLAB from all Kconfig and Makefile"), but references to it remained in documentation. The English documentation was updated to refer to CONFIG_SLUB_DEBUG in commit 5969fbf30274 ("docs: submit-checklist: structure by category"...
```diff diff --git a/Documentation/translations/it_IT/process/submit-checklist.rst b/Documentation/translations/it_IT/process/submit-checklist.rst index 5bf1b4adebc1..c58d773fd297 100644 --- a/Documentation/translations/it_IT/process/submit-checklist.rst +++ b/Documentation/translations/it_IT/process/submit-checklist.r...
120a64c8021dfc2487e17205ef62554982fe35ec
Analyze and fix the following issue in the Linux kernel code: Documentation: process: fix brackets
Problem Details: Fix missing ')' and needless ')' Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260611064311.117023-2-manuelebner@mailbox.org>
```diff diff --git a/Documentation/process/deprecated.rst b/Documentation/process/deprecated.rst index ac75b7ecac47..03de71f654c7 100644 --- a/Documentation/process/deprecated.rst +++ b/Documentation/process/deprecated.rst @@ -388,7 +388,7 @@ allocations. For example, these open coded assignments:: ptr = kmalloc_arra...
b7851fa2c94a157b51db165ea00d5dacbd4ef24b
Analyze and fix the following issue in the Linux kernel code: Documentation: arch: fix brackets
Problem Details: Add missing and remove needless parentheses, brackets and curly braces. Fix typos. Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260612095432.177759-2-manuelebner@mailbox.org>
```diff diff --git a/Documentation/arch/arc/arc.rst b/Documentation/arch/arc/arc.rst index 6c4d978f3f4e..5923dee37a98 100644 --- a/Documentation/arch/arc/arc.rst +++ b/Documentation/arch/arc/arc.rst @@ -36,7 +36,7 @@ Important note on ARC processors configurability ARC processors are highly configurable and several ...