Skip to content

Commit c82b48b

Browse files
rleonklassert
authored andcommitted
xfrm: prevent configuration of interface index when offload is used
Both packet and crypto offloads perform decryption while packet is arriving to the HW from the wire. It means that there is no possible way to perform lookup on XFRM if_id as it can't be set to be "before' HW. So instead of silently ignore this configuration, let's warn users about misconfiguration. Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent e86212b commit c82b48b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

net/xfrm/xfrm_device.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,11 @@ int xfrm_dev_state_add(struct net *net, struct xfrm_state *x,
251251
return -EINVAL;
252252
}
253253

254+
if (xuo->flags & XFRM_OFFLOAD_INBOUND && x->if_id) {
255+
NL_SET_ERR_MSG(extack, "XFRM if_id is not supported in RX path");
256+
return -EINVAL;
257+
}
258+
254259
is_packet_offload = xuo->flags & XFRM_OFFLOAD_PACKET;
255260

256261
/* We don't yet support TFC padding. */

0 commit comments

Comments
 (0)