netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <nicolas.cavallari@green-communications.fr>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
	<edumazet@google.com>, <kuba@kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>, Kuniyuki Iwashima <kuniyu@amazon.com>
Subject: Re: [PATCH] ipv6: delay procfs initialization after the ipv6 structs are ready
Date: Wed, 20 Mar 2024 15:18:13 -0700	[thread overview]
Message-ID: <20240320221813.11611-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20240320171858.2671-1-nicolas.cavallari@green-communications.fr>

From: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>
Date: Wed, 20 Mar 2024 18:17:36 +0100
> procfs files are created before the structure they reference are
> initialized.  For example, if6_proc_init() creates procfs files that
> access structures initialized by addrconf_init().
> 
> If ipv6 is compiled as a module and a program manages to open an ipv6
> procfs file during the loading of the module, it can oops the kernel.
> 
> It appears that we were unlucky enough to reproduce this problem
> multiple times already, out of maybe 100 boots:
> 
> NET: Registered PF_INET6 protocol family
> 8<--- cut here ---
> pwm-backlight backlight: supply power not found, using dummy regulator
> Segment Routing with IPv6
> In-situ OAM (IOAM) with IPv6
> Unable to handle kernel NULL pointer dereference at virtual address
>  00000000
> mt7915e 0000:03:00.0 wlp3s0: renamed from wlan0
> [00000000] *pgd=00000000
> Internal error: Oops: 5 [#1] SMP ARM
> Modules linked in: ipv6 mt7915e mt76_connac_lib mt76 dw_hdmi_imx
>  mac80211 dw_hdmi drm_display_helper imxdrm drm_dma_helper
>  drm_kms_helper snd_soc_imx_sgtl5000 syscopyarea sysfillrect sysimgblt
>  fb_sys_fops imx_ipu_v3 snd_soc_fsl_asoc_card cfg80211 snd_soc_sgtl5000
>  drm libarc4 snd_soc_fsl_ssi snd_soc_simple_card_utils imx_pcm_dma
>  snd_soc_core rfkill snd_pcm_dmaengine snd_pcm
>  drm_panel_orientation_quirks cfbfillrect cfbimgblt cfbcopyarea
>  snd_timer snd egalax_ts snd_soc_imx_audmux soundcore flexcan mux_mmio
>  imx2_wdt mux_core can_dev pwm_bl
> CPU: 2 PID: 850 Comm: snmpd Not tainted 6.1.14 #1
> Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
> PC is at if6_seq_start+0x2c/0x98 [ipv6]
> LR is at init_net+0x0/0xc00
> [...]
>  if6_seq_start [ipv6] from seq_read_iter+0xb4/0x510
>  seq_read_iter from seq_read+0x80/0xac
>  seq_read from proc_reg_read+0xac/0x100
>  proc_reg_read from vfs_read+0xb0/0x284
>  vfs_read from ksys_read+0x64/0xec
>  ksys_read from ret_fast_syscall+0x0/0x54
> Exception stack(0xf0e31fa8 to 0xf0e31ff0)
> 1fa0:                   b67fd0b0 be8a666b 0000000a b67fd148 00000400
>  00000000
> 1fc0: b67fd0b0 be8a666b 00000001 00000003 be8a67ec 00000000 b6d7e000
>  b6c9954a
> 1fe0: b6d7eb30 be8a6638 b6ef11b4 b6ef0ddc
> Code: e5931004 e35100ff ca000014 e59e25dc (e7920101)
> ---[ end trace 0000000000000000 ]---
> 
> Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr>

Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>

  reply	other threads:[~2024-03-20 22:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20 17:17 [PATCH] ipv6: delay procfs initialization after the ipv6 structs are ready Nicolas Cavallari
2024-03-20 22:18 ` Kuniyuki Iwashima [this message]
2024-03-21  1:36 ` Shigeru Yoshida
2024-03-21  3:39 ` Jakub Kicinski

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=20240320221813.11611-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.cavallari@green-communications.fr \
    --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;
as well as URLs for NNTP newsgroup(s).