Skip to content

Commit

Permalink
netdev-tc-offloads: Fix misaligned 8 byte read.
Browse files Browse the repository at this point in the history
UB Sanitizer report:

lib/netdev-offload-tc.c:1276:19: runtime error: load of misaligned
address 0x7f74e801976c for type 'union ovs_u128', which requires 8 byte
alignment

    0 in netdev_tc_flow_dump_next lib/netdev-offload-tc.c:1276
    1 in netdev_flow_dump_next lib/netdev-offload.c:303
    2 in dpif_netlink_flow_dump_next lib/dpif-netlink.c:1921
    [...]

Fixes: 8f7620e ("netdev-tc-offloads: Implement netdev flow dump api using tc interface")
Acked-by: Eelco Chaudron <[email protected]>
Signed-off-by: Mike Pattrick <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
mkp-rh authored and igsilya committed Mar 29, 2023
1 parent 7381fd4 commit 306583b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/netdev-offload-tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1282,8 +1282,8 @@ netdev_tc_flow_dump_next(struct netdev_flow_dump *dump,
continue;
}

if (flower.act_cookie.len) {
*ufid = *((ovs_u128 *) flower.act_cookie.data);
if (flower.act_cookie.len >= sizeof *ufid) {
*ufid = get_32aligned_u128(flower.act_cookie.data);
} else if (!find_ufid(netdev, &id, ufid)) {
continue;
}
Expand Down

0 comments on commit 306583b

Please sign in to comment.