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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2023 09:15:56 +0000 (10:15 +0100)
commit977ad86c2a1bcaf58f01ab98df5cc145083c489c
tree9dc2b01ca19fed1db648ac231e9a67a1ef156dc6
parent72dd7e427e16fca901daaa399e4b0893c3bb85c0
dccp: Fix out of bounds access in DCCP error handler

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>
net/dccp/ipv4.c
net/dccp/ipv6.c