netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/1] pull request: batman-adv 2025-09-01
@ 2025-09-01 16:15 Simon Wunderlich
  2025-09-01 16:15 ` [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode Simon Wunderlich
  2025-09-01 20:39 ` [PATCH net 0/1] pull request: batman-adv 2025-09-01 Jakub Kicinski
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Wunderlich @ 2025-09-01 16:15 UTC (permalink / raw)
  To: davem, kuba; +Cc: netdev, b.a.t.m.a.n, Simon Wunderlich

Hi David, hi Jakub,

here is a bugfix for batman-adv which we would like to have integrated into net.

Please pull or let me know of any problem!

Thank you,
      Simon

The following changes since commit 6439a0e64c355d2e375bd094f365d56ce81faba3:

  Merge tag 'net-6.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net (2025-08-21 13:51:15 -0400)

are available in the Git repository at:

  git+ssh://git@open-mesh.org/linux-merge.git tags/batadv-net-pullrequest-20250901

for you to fetch changes up to d77b6ff0ce35a6d0b0b7b9581bc3f76d041d4087:

  batman-adv: fix OOB read/write in network-coding decode (2025-08-31 17:01:35 +0200)

----------------------------------------------------------------
Here is a batman-adv bugfix:

 - fix OOB read/write in network-coding decode, by Stanislav Fort

----------------------------------------------------------------
Stanislav Fort (1):
      batman-adv: fix OOB read/write in network-coding decode

 net/batman-adv/network-coding.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode
  2025-09-01 16:15 [PATCH net 0/1] pull request: batman-adv 2025-09-01 Simon Wunderlich
@ 2025-09-01 16:15 ` Simon Wunderlich
  2025-09-01 20:40   ` patchwork-bot+netdevbpf
  2025-09-01 20:39 ` [PATCH net 0/1] pull request: batman-adv 2025-09-01 Jakub Kicinski
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wunderlich @ 2025-09-01 16:15 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, b.a.t.m.a.n, Stanislav Fort, stable, Stanislav Fort,
	Sven Eckelmann, Simon Wunderlich

From: Stanislav Fort <stanislav.fort@aisle.com>

batadv_nc_skb_decode_packet() trusts coded_len and checks only against
skb->len. XOR starts at sizeof(struct batadv_unicast_packet), reducing
payload headroom, and the source skb length is not verified, allowing an
out-of-bounds read and a small out-of-bounds write.

Validate that coded_len fits within the payload area of both destination
and source sk_buffs before XORing.

Fixes: 2df5278b0267 ("batman-adv: network coding - receive coded packets and decode them")
Cc: stable@vger.kernel.org
Reported-by: Stanislav Fort <disclosure@aisle.com>
Signed-off-by: Stanislav Fort <stanislav.fort@aisle.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/network-coding.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c
index 9f56308779cc3..af97d077369f9 100644
--- a/net/batman-adv/network-coding.c
+++ b/net/batman-adv/network-coding.c
@@ -1687,7 +1687,12 @@ batadv_nc_skb_decode_packet(struct batadv_priv *bat_priv, struct sk_buff *skb,
 
 	coding_len = ntohs(coded_packet_tmp.coded_len);
 
-	if (coding_len > skb->len)
+	/* ensure dst buffer is large enough (payload only) */
+	if (coding_len + h_size > skb->len)
+		return NULL;
+
+	/* ensure src buffer is large enough (payload only) */
+	if (coding_len + h_size > nc_packet->skb->len)
 		return NULL;
 
 	/* Here the magic is reversed:
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/1] pull request: batman-adv 2025-09-01
  2025-09-01 16:15 [PATCH net 0/1] pull request: batman-adv 2025-09-01 Simon Wunderlich
  2025-09-01 16:15 ` [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode Simon Wunderlich
@ 2025-09-01 20:39 ` Jakub Kicinski
  1 sibling, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2025-09-01 20:39 UTC (permalink / raw)
  To: Simon Wunderlich; +Cc: davem, netdev, b.a.t.m.a.n

On Mon,  1 Sep 2025 18:15:45 +0200 Simon Wunderlich wrote:
>   git+ssh://git@open-mesh.org/linux-merge.git tags/batadv-net-pullrequest-20250901

For the future PRs please prefer http(s) urls

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode
  2025-09-01 16:15 ` [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode Simon Wunderlich
@ 2025-09-01 20:40   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-01 20:40 UTC (permalink / raw)
  To: Simon Wunderlich
  Cc: davem, kuba, netdev, b.a.t.m.a.n, stanislav.fort, stable,
	disclosure, sven

Hello:

This patch was applied to netdev/net.git (main)
by Simon Wunderlich <sw@simonwunderlich.de>:

On Mon,  1 Sep 2025 18:15:46 +0200 you wrote:
> From: Stanislav Fort <stanislav.fort@aisle.com>
> 
> batadv_nc_skb_decode_packet() trusts coded_len and checks only against
> skb->len. XOR starts at sizeof(struct batadv_unicast_packet), reducing
> payload headroom, and the source skb length is not verified, allowing an
> out-of-bounds read and a small out-of-bounds write.
> 
> [...]

Here is the summary with links:
  - [net,1/1] batman-adv: fix OOB read/write in network-coding decode
    https://git.kernel.org/netdev/net/c/d77b6ff0ce35

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-01 20:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-01 16:15 [PATCH net 0/1] pull request: batman-adv 2025-09-01 Simon Wunderlich
2025-09-01 16:15 ` [PATCH net 1/1] batman-adv: fix OOB read/write in network-coding decode Simon Wunderlich
2025-09-01 20:40   ` patchwork-bot+netdevbpf
2025-09-01 20:39 ` [PATCH net 0/1] pull request: batman-adv 2025-09-01 Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).