On Thu, Aug 22, 2024 at 8:33 AM Jakub Kicinski <kuba@xxxxxxxxxx> wrote: > > On Thu, 22 Aug 2024 14:08:57 +0800 Gang Yan wrote: > > diff --git a/net/socket.c b/net/socket.c > > index fcbdd5bc47ac..63ce1caf75eb 100644 > > --- a/net/socket.c > > +++ b/net/socket.c > > @@ -1695,6 +1695,7 @@ __weak noinline int update_socket_protocol(int family, int type, int protocol) > > { > > return protocol; > > } > > +ALLOW_ERROR_INJECTION(update_socket_protocol, ERRNO); > > IDK if this falls under BPF or directly net, but could you explain > what test will use this? I'd prefer not to add test hooks into the > kernel unless they are exercised by in-tree tests. This looks unnecessary. update_socket_protocol is already registered as fmodret. There is even selftest that excises this feature: tools/testing/selftests/bpf/progs/mptcpify.c It doesn't need to be part of the error-inject. pw-bot: cr