]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commitdiff
odp-execute: Fix null pointer dereference on null nlattr.
authorEelco Chaudron <echaudro@redhat.com>
Mon, 13 Oct 2025 12:32:48 +0000 (14:32 +0200)
committerEelco Chaudron <echaudro@redhat.com>
Wed, 15 Oct 2025 10:41:18 +0000 (12:41 +0200)
This patch fixes a potential null pointer dereference reported
by Coverity if an null actions list is passed to nl_attr_get()
in odp_execute_sample().

Fixes: 26c6b6cd2b2e ("dpif-netdev: Implement OVS_ACTION_ATTR_SAMPLE action.")
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
lib/odp-execute.c

index 7f4e337f8aadc3d2e5cacb9425da4cdcfd1aaf6c..ecbda8c010e8962caf5b3d6091d018bbb717f5e4 100644 (file)
@@ -739,6 +739,14 @@ odp_execute_sample(void *dp, struct dp_packet *packet, bool steal,
         }
     }
 
+    if (!subactions) {
+        if (steal) {
+            COVERAGE_INC(datapath_drop_sample_error);
+            dp_packet_delete(packet);
+        }
+        return;
+    }
+
     if (!steal) {
         /* The 'subactions' may modify the packet, but the modification
          * should not propagate beyond this sample action. Make a copy