mesh: Verify padding bits in Friend Poll messages
authorIsak Westin <isak.westin@loytec.com>
Tue, 4 Oct 2022 08:25:28 +0000 (10:25 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:55 +0000 (14:55 +0530)
The padding bits in a Friend Poll message must be zero.
See MshPRFv1.0.1 section 3.6.5.1.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
mesh/net.c

index a19575a..a5dcdb1 100644 (file)
@@ -2057,7 +2057,7 @@ static bool ctl_received(struct mesh_net *net, uint32_t net_key_id,
                break;
 
        case NET_OP_FRND_POLL:
-               if (len != 1 || ttl)
+               if (len != 1 || ttl || pkt[0] > 1)
                        return false;
 
                print_packet("Rx-NET_OP_FRND_POLL", pkt, len);