From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Breno Leitao <leitao@debian.org>,
Jonathan Corbet <corbet@lwn.net>,
Akinobu Mita <akinobu.mita@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, kernel-team@meta.com
Subject: Re: [PATCH net-next v5] net: Implement fault injection forcing skb reallocation
Date: Sun, 3 Nov 2024 11:57:43 +0700 [thread overview]
Message-ID: <ZycCx6CqjvsxPMqd@archie.me> (raw)
In-Reply-To: <20241101-skb_fault_injection_v5-v5-1-a99696f0a853@debian.org>
[-- Attachment #1: Type: text/plain, Size: 2943 bytes --]
On Fri, Nov 01, 2024 at 03:09:33AM -0700, Breno Leitao wrote:
> diff --git a/Documentation/fault-injection/fault-injection.rst b/Documentation/fault-injection/fault-injection.rst
> index 8b8aeea71c685b358dfebb419ae74277e729298a..880237dca4ff78e7f11dac3cca70969a18a70cc3 100644
> --- a/Documentation/fault-injection/fault-injection.rst
> +++ b/Documentation/fault-injection/fault-injection.rst
> @@ -45,6 +45,32 @@ Available fault injection capabilities
> ALLOW_ERROR_INJECTION() macro, by setting debugfs entries
> under /sys/kernel/debug/fail_function. No boot option supported.
>
> +- 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, cached pointers
> + to skb headers and data 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`
"... write the network name to /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.
> +
> + The effectiveness of this fault detection is enhanced when KASAN is
> + enabled, as it helps identify invalid memory references and use-after-free
> + (UAF) issues.
> +
> - NVMe fault injection
>
> inject NVMe status code and retry flag on devices permitted by setting
> @@ -216,6 +242,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 rest of docs changes looks good.
Thanks.
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2024-11-03 4:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 10:09 Breno Leitao
2024-11-03 4:57 ` Bagas Sanjaya [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZycCx6CqjvsxPMqd@archie.me \
--to=bagasdotme@gmail.com \
--cc=akinobu.mita@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®