NetBSD Problem Report #61081
From tsutsui@ceres.dti.ne.jp Thu Nov 26 15:56:14 2026
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 84AD31A923B
for <gnats-bugs@gnats.NetBSD.org>; Thu, 26 Nov 2026 15:56:14 +0000 (UTC)
Message-Id: <202611261556.6AQFu7rl007723@mirage.localdomain>
Date: Fri, 27 Nov 2026 00:56:07 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Double free of mbuf on bootparam RPC timeout during NFS mountroot
X-Send-Pr-Version: 3.95
X-From4GNATS: "Izumi Tsutsui via gnats" <gnats-admin@NetBSD.org>
>Number: 61081
>Category: kern
>Synopsis: Double free of mbuf on bootparam RPC timeout during NFS mountroot
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Nov 26 16:00:00 +0000 2026
>Originator: Izumi Tsutsui
>Release: NetBSD 11.99.11
>Organization:
>Environment:
System: NetBSD/news68k 11.99.11
Architecture: m68k (but maybe all)
Machine: news68k
>Description:
The following panic occurred during NFS mountroot after a network boot:
```
[ 82.4300040] nfs_boot: trying RARP (and RPC/bootparam)
[ 85.4400040] nfs_boot: client_addr=192.168.20.10 (RARP from 192.168.20.1)
[ 103.4700040] nfs_boot: timeout...
[ 108.4900040] nfs_boot: timeout...
[ 113.5100040] nfs_boot: timeout...
[ 118.5300040] panic: mbuf 0x5ea100 already freed
[ 118.5400040] cpu0: Begin traceback...
[ 118.5500040] ?(?)
[ 118.6300040] db_panic(5ea200,5ea100,347d30,1967e4,27e21f) at 0
[ 118.7600040] vpanic(27e21f,347d3c,347d48,1be818,27e21f) + 188
[ 118.9700040] panic(27e21f,5ea100,2acd00,1be7bc,347d58) + c
[ 119.1800040] m_free(5ea100) + 56
[ 119.2900040] m_freem(5ea100) + 16
[ 119.4700040] nfs_bootparam(5cd940,2acd00,347dfc,27360a) + 1f0
[ 119.6800040] nfs_boot_init(5cd940,2acd00,108,1) + be
[ 119.8700040] nfs_mountroot(2b58c0,1715c6,1965ec,347f98,1d92c4) + c6
[ 120.0000040] vfs_mountroot(5fe3c0) + 1c8
[ 120.1100040] main() + 588
[ 120.1300040] cpu0: End traceback...
```
It looks like bp_whoami() in sys/nfs/nfs_bootparam.c frees an mbuf
that has already been freed by krpc_call() in sys/nfs/krpc_subr.c.
>How-To-Repeat:
Try NFS mountroot using RARP with no response to the bootparam
WHOAMI RPC.
>Fix:
The ownership of the request mbuf in krpc_call() seems
inconsistent among its error paths. Some errors cause
the mbuf to be freed, while others do not.
This should be made consistent with its callers.
---
Izumi Tsutsui
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.