On 10/8/24 13:13, Breno Leitao wrote:
+void skb_might_realloc(struct sk_buff *skb) +{ + struct net_device *net = skb->dev; + + if (skb_realloc.filtered && + strncmp(net->name, skb_realloc.devname, IFNAMSIZ)) + /* device name filter set, but names do not match */ + return; + + if (!should_fail(&skb_realloc.attr, 1)) + return;
if you wraps the above 2 statement in an helper() taking an skb argument, you could wrap it with the ALLOW_ERROR_INJECTION() macro, for added flexibility, i.e. look at the existing should_failslab().
Cheers, Paolo