]> exis.tech > repos - linux.git/commit
xfrm: propagate -EINPROGRESS from validate_xmit_xfrm()
authorPetr Wozniak <petr.wozniak@gmail.com>
Sun, 21 Jun 2026 10:03:26 +0000 (12:03 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 26 Jun 2026 06:13:54 +0000 (08:13 +0200)
commit6860b467f569f732b11cbc588ae7e195e90e7e23
tree1c0bb385711e8f964b6129e772873cf9998ffa21
parent805185b7c7a1069e407b6f7b3bc98e44d415f484
xfrm: propagate -EINPROGRESS from validate_xmit_xfrm()

validate_xmit_xfrm() returns NULL both when a packet is dropped and
when it is stolen by async crypto (-EINPROGRESS from ->xmit()).
Callers cannot distinguish the two cases.

f53c723902d1 ("net: Add asynchronous callbacks for xfrm on layer 2.")
changed the semantics of a NULL return from "dropped" to "stolen or
dropped", but __dev_queue_xmit() was not updated.  On virtual/bridge
interfaces (noqueue qdisc) __dev_queue_xmit() initialises rc=-ENOMEM
and jumps to out: when skb is NULL, returning -ENOMEM to the caller
even though the packet will be delivered correctly via xfrm_dev_resume().

Return ERR_PTR(-EINPROGRESS) from validate_xmit_xfrm() for the async
case so callers can tell it apart from a real drop.  Update
__dev_queue_xmit() to handle ERR_PTR(-EINPROGRESS) from
validate_xmit_skb() correctly.  Update validate_xmit_skb_list() to
use IS_ERR_OR_NULL() so that ERR_PTR(-EINPROGRESS) is not mistakenly
added to the transmitted list.

Fixes: f53c723902d1 ("net: Add asynchronous callbacks for xfrm on layer 2.")
Suggested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Petr Wozniak <petr.wozniak@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/core/dev.c
net/xfrm/xfrm_device.c