Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1472410rwn; Thu, 15 Sep 2022 16:57:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7oEPO1wJE4V3sD8xLQqxZH9oeEKM9xb8X8dfQTvCO2jyvKPtAKGgnMK+li8kWk6Q35kDJk X-Received: by 2002:a63:2fc7:0:b0:438:6e74:92e5 with SMTP id v190-20020a632fc7000000b004386e7492e5mr2010029pgv.546.1663286265721; Thu, 15 Sep 2022 16:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663286265; cv=none; d=google.com; s=arc-20160816; b=wb+8lS1l+jv0Lvz/N8+IVA2sO6MZyzd1H5n/rWpctF45z6ksRANJ8Bw7GRxGHH2IIY dayh7guGyOIA4N7XXJEVsBx0URSJoFvKsKNNGoAeZ0FQOwdKMD6H+Pm9wNsIGGKJ2ClA VdWSWgXMcOelVIpPJeZzMzjodVLnXl4Lkeno5U1AIJP8GxkcwrFMbUBfLNHjBQMeKWe8 8kDHyEVLXlKnCKXafK+wJ+UWzxJGS/JlEe89atrCZUQOhxwqzXivPHMb3tbGDvNlkpeQ 5gujdpmhG6Z2kqPLokINIYKd8UDSHvkIJolixiytpghUCRYXkKpXvk/hzd2HqKuyBB9t hNqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sHMR97DN2FQYRWVlG2zH0x9z7vHfZEf3PBRE1At7yLg=; b=QGOJJCaGUGfQZms4WO7YD2gXlUuSf5Af3GqJmG3HwoyvYAxt0lBm40iFmzAnpJzk9f rSxu5bVLBGc9TL2zUdaaYgmtzhbjUGiBDhl44m3b7ATsOCYd5nudFW3tiSspHh48O7xE ddzK+vKOsYuDL/HsKef/NbiECxHHjwxGZT9udig4rdm5GmV+pRsjL9RCPzLQ6qQD7+04 nJ1C7XtHQ6oLgbDqoYNzwvWMOsJA4eYFoki7DJqq4V2Leg9liXVQtqszFS9Z4DUHHXrP j/Vyd81B0Y9GnRkVGbSeDN2cU+6ZfbqkypzaHzosPcpArjLhmaeFEtW8YuhZXZ6qOeaH Zzxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bQdvfLd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g129-20020a636b87000000b003816043f10bsi20035299pgc.768.2022.09.15.16.57.34; Thu, 15 Sep 2022 16:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bQdvfLd4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229561AbiIOXl6 (ORCPT + 99 others); Thu, 15 Sep 2022 19:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiIOXl5 (ORCPT ); Thu, 15 Sep 2022 19:41:57 -0400 Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B592C326CA; Thu, 15 Sep 2022 16:41:56 -0700 (PDT) Received: by mail-qv1-xf2a.google.com with SMTP id m9so15450632qvv.7; Thu, 15 Sep 2022 16:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=sHMR97DN2FQYRWVlG2zH0x9z7vHfZEf3PBRE1At7yLg=; b=bQdvfLd48/sT/hQnm27udtvEdZR5/FpluiY3Tv+g4vpPkKc6elu1J6GH5kd8xu3E3i fDDq3Xk8b6XrQBOgVGCObEuDiWGDoqO6EEYt348jmQ0n8iNU1QUX2uyX/77gVD4ZxfcA atRSK8ZviD/MPR5b/81xTOADewcrHGjoNcBgbdR0msmaLzoc6CNDvje6MTxrMub+0IFe kAhwBN5ekIot7M8alcWYbXWkgHUlvGOEOaJ9M5W2EbNDTb8GEalt7SA3Opu0JhsxD3dL 8Y6wYHx8RF8rRDwTE47TG8hL4YikLlHK/o1kYz6LAJuviHnDwQHue5ZZhllFXusqHYoP L84g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=sHMR97DN2FQYRWVlG2zH0x9z7vHfZEf3PBRE1At7yLg=; b=hVXLq49jw0Sks07gbrj7MgKUtXElA1DdjlM4t59C+cLv9P/LbHJYpyPieDQUUziM+7 Y7jiauWXH6VDZUenECgg0KPe0U37cL6x5ZVmXgbjaCBFO8eJPLl1w6BG4A6M5B6+RZnU oNTZjq5RMvIsgE6O7rMoEdbdNirX5QIovHnsO8WbyoEtYc8JmR4QZgVvAmrfx2UU5q+V wJhXjNpGjx4/nhFwORz7eZYr4Q+6kYNzHUmavbz+dXhDQFE6EuzcayStPx/3diPFhkiC EU9ityljJs1vSkumNuiZtHMo5SILHdD758yVhPTuTmgrweghTQ+cYyvufBkxRKAG3EkY YkKA== X-Gm-Message-State: ACrzQf2z7h89PXmUsX5dgrpGCPNE5/t5aac47kuuIOlmV9r7B4kqUkoE WvzKjSLkw6J/zdmBnp7NF7A= X-Received: by 2002:a05:6214:301a:b0:4ac:a4ec:b8b1 with SMTP id ke26-20020a056214301a00b004aca4ecb8b1mr1743897qvb.122.1663285315814; Thu, 15 Sep 2022 16:41:55 -0700 (PDT) Received: from riccipc ([31.187.109.46]) by smtp.gmail.com with ESMTPSA id i18-20020a05620a405200b006bb9125363fsm4529300qko.121.2022.09.15.16.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Sep 2022 16:41:55 -0700 (PDT) Date: Fri, 16 Sep 2022 01:41:51 +0200 From: Roberto Ricci To: Ido Schimmel 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 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.