Re: [PATCH net-next v2] net: Implement fault injection forcing skb reallocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux