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

From: Bagas Sanjaya
Date: Thu Oct 24 2024 - 06:02:13 EST


On Wed, Oct 23, 2024 at 04:38:01AM -0700, Breno Leitao wrote:
> +- fail_skb_realloc
> +
> + inject skb (socket buffer) reallocation events into the network path. The
> + primary goal is to identify and prevent issues related to pointer
> + mismanagement in the network subsystem. By forcing skb reallocation at
> + strategic points, this feature creates scenarios where existing pointers to
> + skb headers become invalid.
> +
> + When the fault is injected and the reallocation is triggered, these pointers
> + no longer reference valid memory locations. This deliberate invalidation
> + helps expose code paths where proper pointer updating is neglected after a
> + reallocation event.
> +
> + By creating these controlled fault scenarios, the system can catch instances
> + where stale pointers are used, potentially leading to memory corruption or
> + system instability.
> +
> + To select the interface to act on, write the network name to the following file:
> + `/sys/kernel/debug/fail_skb_realloc/devname`
> + If this field is left empty (which is the default value), skb reallocation
> + will be forced on all network interfaces.
> +
> - NVMe fault injection
>
> inject NVMe status code and retry flag on devices permitted by setting
> @@ -216,6 +238,19 @@ configuration of fault-injection capabilities.
> use a negative errno, you better use 'printf' instead of 'echo', e.g.:
> $ printf %#x -12 > retval
>
> +- /sys/kernel/debug/fail_skb_realloc/devname:
> +
> + Specifies the network interface on which to force SKB reallocation. If
> + left empty, SKB reallocation will be applied to all network interfaces.
> +
> + Example usage::
> +
> + # Force skb reallocation on eth0
> + echo "eth0" > /sys/kernel/debug/fail_skb_realloc/devname
> +
> + # Clear the selection and force skb reallocation on all interfaces
> + echo "" > /sys/kernel/debug/fail_skb_realloc/devname
> +

The doc LGTM, thanks!

Reviewed-by: Bagas Sanjaya <bagasdotme@xxxxxxxxx>

--
An old man doll... just what I always wanted! - Clara

Attachment: signature.asc
Description: PGP signature