]> git.itanic.dy.fi Git - linux-stable/commit
dccp: Fix out of bounds access in DCCP error handler
authorJann Horn <jannh@google.com>
Fri, 25 Aug 2023 13:32:41 +0000 (15:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:48:11 +0000 (10:48 +0200)
commit177212bf6dc1ff2d13d0409cddc5c9e81feec63d
treee36cad99501bd250001bd04cb94778ebd874ddd8
parent10214f9896312e5c6f2590943ac9fccc68468be9
dccp: Fix out of bounds access in DCCP error handler

commit 977ad86c2a1bcaf58f01ab98df5cc145083c489c upstream.

There was a previous attempt to fix an out-of-bounds access in the DCCP
error handlers, but that fix assumed that the error handlers only want
to access the first 8 bytes of the DCCP header. Actually, they also look
at the DCCP sequence number, which is stored beyond 8 bytes, so an
explicit pskb_may_pull() is required.

Fixes: 6706a97fec96 ("dccp: fix out of bound access in dccp_v4_err()")
Fixes: 1aa9d1a0e7ee ("ipv6: dccp: fix out of bound access in dccp_v6_err()")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dccp/ipv4.c
net/dccp/ipv6.c