gnrc_rpl: missing bounds checks in gnrc_rpl_validation_options #16062
Labels
Area: network
Area: Networking
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
The
gnrc_rpl_validation_options
function has a problem very similar to the one described in #16018: It casts packed structs without performing a prior bounds check. For example, consider the handler forGNRC_RPL_OPT_PAD1
:RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_validation.c
Lines 37 to 40 in 922e2ac
This is missing a check ala.:
Otherwise, reading
opt->length
(oropt->type
on the next iteration) may result in an out-of-bounds read:RIOT/sys/net/gnrc/routing/rpl/gnrc_rpl_validation.c
Line 103 in 922e2ac
Steps to reproduce the issue
Use
examples/gnrc_networking
, activategnrc_pktbuf_malloc
and setCONFIG_GNRC_RPL_DEFAULT_NETIF
to your netif (check withifconfig
in the shell provided bygnrc_networking
) mine is6
:Compile and run the application using:
Afterwards run
socat
as:Expected results
The application shouldn't crash.
Actual results
CC: @cgundogan
The text was updated successfully, but these errors were encountered: