From nobody Fri May 08 16:26:48 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gBvdm6mrvz6cbtq for ; Fri, 08 May 2026 16:26:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gBvdm69kGz3MDw for ; Fri, 08 May 2026 16:26:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778257612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntdoX7YTMfj8nWM9dtTOIeMvwu3iHSpf+e4H7r0fBGk=; b=vUTrprVyH44XJpZ1cZbF6LvjKucEBPAEKbIr7V0mjZHgC7M4Q5auAXvVAuapCV/1mH0ySL 3JkNpfmaSNYmY4SvnzH7s4o93jj7uRb0+lZulVZsLK9P0D38tHTy48VL4UcreTCqOPokH4 iLj42vuDr9jJDnBfX0T+wSpPBmhzeYTc3Ghkli8Z7OSn8yfy+M+FgGh3Gk8vWYJo5FWrDu k9dspPIUE5WIF0BAX6nlMXefrHWRruEGKddM9dun2+sQSFnhFxvZJFKVPu4CiEqXqoDQUj lSPsQrI41et1I2Fx+LScEEBzoCxHYL+KWZu8N7wEvBHza9jiGzJLZxoNxT6mMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778257612; a=rsa-sha256; cv=none; b=VxaEtIIZYkJxWaPd8PhK+tLsrqo64qnql2peC6UYXTX58BuD/I0znbsLqZ1XlEdWS8Q7Za iH9bbYXiEah0s/wS+Cej2chQERkRt/z0zVABQ7kCfBVdUYblhJvMFeaqSn164rRPEol7eb qrAzhZwwW3H8MLGFnm5tGVOC0FT/tS+4OHYQ+aH/P1dsmaAfBdVS1EQQxCEV0O1UbodQC6 AEYKob5rnvuDx5h4KeUN32nHox8ZsPrvF76rsavUT06OaJAAF5L483XjaISnt6Xa77cftZ X5bGrEZZWZH30R0t74PJjbYTurqwR8w7MJPEYaSbub5+broSD0jqFerlUzfJjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778257612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ntdoX7YTMfj8nWM9dtTOIeMvwu3iHSpf+e4H7r0fBGk=; b=Yp01omFi39h4hJF9YPb7r5DCiaUvtHzM0pa6tlpA130fwp39yeOJ7xuqdlD1/PANSmUUm0 w9Ga6Q5Xihct0m1IJqLqmYAL1w0Fk0i1KPXwi43iybBT3BvhL73nEm9RlDQIj1x6InfA4k LDIGwm0lyHhemTY60ZQzy+ROCNMlZZMIcA/2+UnBKOg8789MVXKm5yLSZmfnA0n9Og3/Mt tlcOx2VzIMBEHzZN3JlRQ2wKTsw2eaHspgm7eku2cPAAXQzwC93bic75rBBnNfIkDbZmN2 1LRJ4mNr3uSPqXY2cxTypaNa0ykQXmVaJap86T5e/Udw555URGj2+Qxw/VCDQQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4gBvdm5Vkdz5dh for ; Fri, 08 May 2026 16:26:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 648GQqLK047097 for ; Fri, 8 May 2026 16:26:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 648GQqFP047088 for bugs@FreeBSD.org; Fri, 8 May 2026 16:26:52 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 295102] inadequate bounds check in nlattr_get_multipath() Date: Fri, 08 May 2026 16:26:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: rtm@lcs.mit.edu X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.mimetype attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D295102 Bug ID: 295102 Summary: inadequate bounds check in nlattr_get_multipath() Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rtm@lcs.mit.edu Attachment #270516 text/plain mime type: Created attachment 270516 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D270516&action= =3Dedit cause kernel crash in nlattr_get_multipath() In sys/netlink/route/rt.c nlattr_get_multipath(), this code is meant to prevent user code from passing in a too-large nethop array-element length: if (__predict_false(rtnh->rtnh_len <=3D sizeof(*rtnh) || rtnh->rtnh_len > data_len)) { But the critical use of rtnh_len is: len =3D NL_ITEM_ALIGN(rtnh->rtnh_len); data_len -=3D len; And the alignment can increase the value: #define NL_ITEM_ALIGN_SIZE sizeof(uint32_t) #define NL_ITEM_ALIGN(_len) __align_up(_len, NL_ITEM_ALIGN_SIZE) The attached demo program supplies nla->nla_len 71, so data_len starts out 67. The first rtnh_len is 65, which is < 67, but NL_ITEM_ALIGN changes it to 68, so that after subtraction data_len wraps to 65535. Then the loop writes beyond the end of mp->nhops[] into whatever was allocated after it by npt_alloc(). The result (for me) is the kernel dereferencing a garbage pointer and crashing. panic: Fatal page fault at 0xffffffc00076de7e: 0x2000f0008020203=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 cpu_exception_handler_supervisor() at cpu_exception_handler_supervisor+0x74= =20=20=20=20=20 --- exception 13, tval =3D 0x2000f0008020203=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 post_p_rtnh() at post_p_rtnh+0x12=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 nl_parse_header() at nl_parse_header+0xa2=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 nlattr_get_multipath() at nlattr_get_multipath+0xb4=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 nl_parse_attrs_raw() at nl_parse_attrs_raw+0xb6=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 nl_parse_header() at nl_parse_header+0x92=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 rtnl_handle_newroute() at rtnl_handle_newroute+0x58=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 rtnl_handle_message() at rtnl_handle_message+0x12a=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 nl_taskqueue_handler() at nl_taskqueue_handler+0x49e=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 taskqueue_run_locked() at taskqueue_run_locked+0x158=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 taskqueue_thread_loop() at taskqueue_thread_loop+0xd4=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 fork_exit() at fork_exit+0x68=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 fork_trampoline() at fork_trampoline+0xa=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20 KDB: enter: panic=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 FreeBSD 16.0-CURRENT FreeBSD 16.0-CURRENT #10 main-n251024-dc4728f334c9-di= rty: Fri May 8 12:05:42 EDT 2026=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv --=20 You are receiving this mail because: You are the assignee for the bug.=