From: Roberto Ricci <rroberto2r@gmail.com>
To: Ido Schimmel <idosch@idosch.org>
Cc: edumazet@google.com, davem@davemloft.net,
yoshfuji@linux-ipv6.org, dsahern@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: BUG: unable to handle page fault for address, with ipv6.disable=1
Date: Fri, 16 Sep 2022 01:41:51 +0200 [thread overview]
Message-ID: <YyO4P50YeI0wlGM2@riccipc> (raw)
In-Reply-To: <YyH3gBoUNT9yqrUx@shredder>
On 2022-09-14 Wed 18:47:12 +0300, Ido Schimmel wrote:
> This is most likely caused by commit 0daf07e52709 ("raw: convert raw
> sockets to RCU") which is being back ported to stable kernels.
>
> It made the initialization of 'raw_v6_hashinfo' conditional on IPv6
> being enabled. Can you try the following patch (works on my end)?
>
> diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
> index 19732b5dce23..d40b7d60e00e 100644
> --- a/net/ipv6/af_inet6.c
> +++ b/net/ipv6/af_inet6.c
> @@ -1072,13 +1072,13 @@ static int __init inet6_init(void)
> for (r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r)
> INIT_LIST_HEAD(r);
>
> + raw_hashinfo_init(&raw_v6_hashinfo);
> +
> if (disable_ipv6_mod) {
> pr_info("Loaded, but administratively disabled, reboot required to enable\n");
> goto out;
> }
>
> - raw_hashinfo_init(&raw_v6_hashinfo);
> -
> err = proto_register(&tcpv6_prot, 1);
> if (err)
> goto out;
>
> Another approach is the following, but I prefer the first:
>
> diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c
> index 999321834b94..4fbdd69a2be8 100644
> --- a/net/ipv4/raw_diag.c
> +++ b/net/ipv4/raw_diag.c
> @@ -20,7 +20,7 @@ raw_get_hashinfo(const struct inet_diag_req_v2 *r)
> if (r->sdiag_family == AF_INET) {
> return &raw_v4_hashinfo;
> #if IS_ENABLED(CONFIG_IPV6)
> - } else if (r->sdiag_family == AF_INET6) {
> + } else if (r->sdiag_family == AF_INET6 && ipv6_mod_enabled()) {
> return &raw_v6_hashinfo;
> #endif
> } else {
Both the solutions you proposed work for me. Thanks.
prev parent reply other threads:[~2022-09-15 23:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 21:22 BUG: unable to handle page fault for address, with ipv6.disable=1 Roberto Ricci
2022-09-14 15:47 ` Ido Schimmel
2022-09-14 17:56 ` Eric Dumazet
2022-09-15 23:41 ` Roberto Ricci [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=YyO4P50YeI0wlGM2@riccipc \
--to=rroberto2r@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=idosch@idosch.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/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