mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] sctp: Prevent TOCTOU out-of-bounds write
@ 2025-10-27  8:48 Stefan Wiehler
  2025-10-27  9:15 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wiehler @ 2025-10-27  8:48 UTC (permalink / raw)
  To: Xin Long, David S . Miller ,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-sctp, netdev, linux-kernel, Stefan Wiehler

Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
Signed-off-by: Stefan Wiehler <stefan.wiehler@nokia.com>
---
 net/sctp/diag.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sctp/diag.c b/net/sctp/diag.c
index 996c2018f0e6..4ee44e0111ae 100644
--- a/net/sctp/diag.c
+++ b/net/sctp/diag.c
@@ -85,6 +85,9 @@ static int inet_diag_msg_sctpladdrs_fill(struct sk_buff *skb,
 		memcpy(info, &laddr->a, sizeof(laddr->a));
 		memset(info + sizeof(laddr->a), 0, addrlen - sizeof(laddr->a));
 		info += addrlen;
+
+		if (!--addrcnt)
+			break;
 	}
 
 	return 0;
-- 
2.51.0


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

* Re: [PATCH net] sctp: Prevent TOCTOU out-of-bounds write
  2025-10-27  8:48 [PATCH net] sctp: Prevent TOCTOU out-of-bounds write Stefan Wiehler
@ 2025-10-27  9:15 ` Eric Dumazet
  2025-10-27  9:46   ` Stefan Wiehler
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2025-10-27  9:15 UTC (permalink / raw)
  To: Stefan Wiehler
  Cc: Xin Long, David S . Miller, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-sctp, netdev, linux-kernel

No changelog ?

Also no mention/credits of who diagnosed this issue ?

Please do not forget to give credits.


On Mon, Oct 27, 2025 at 1:49 AM Stefan Wiehler <stefan.wiehler@nokia.com> wrote:
>
> Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
> Signed-off-by: Stefan Wiehler <stefan.wiehler@nokia.com>
> ---
>  net/sctp/diag.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/net/sctp/diag.c b/net/sctp/diag.c
> index 996c2018f0e6..4ee44e0111ae 100644
> --- a/net/sctp/diag.c
> +++ b/net/sctp/diag.c
> @@ -85,6 +85,9 @@ static int inet_diag_msg_sctpladdrs_fill(struct sk_buff *skb,
>                 memcpy(info, &laddr->a, sizeof(laddr->a));
>                 memset(info + sizeof(laddr->a), 0, addrlen - sizeof(laddr->a));
>                 info += addrlen;
> +
> +               if (!--addrcnt)
> +                       break;
>         }
>
>         return 0;
> --
> 2.51.0
>

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

* Re: [PATCH net] sctp: Prevent TOCTOU out-of-bounds write
  2025-10-27  9:15 ` Eric Dumazet
@ 2025-10-27  9:46   ` Stefan Wiehler
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Wiehler @ 2025-10-27  9:46 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Xin Long, David S . Miller, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-sctp, netdev, linux-kernel,
	Kuniyuki Iwashima

> No changelog ?
> 
> Also no mention/credits of who diagnosed this issue ?
> 
> Please do not forget to give credits.

Sorry, changelog with a reference to the discussion is indeed missing, and
credit goes of course to Kuniyuki Iwashima (Thanks!) who found this issue
during review; will send a v2.

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

end of thread, other threads:[~2025-10-27  9:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-27  8:48 [PATCH net] sctp: Prevent TOCTOU out-of-bounds write Stefan Wiehler
2025-10-27  9:15 ` Eric Dumazet
2025-10-27  9:46   ` Stefan Wiehler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®