From nobody Fri Jan 03 14:01:03 2025 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 4YPlbh0CLhz5k1v8 for ; Fri, 03 Jan 2025 14:01:04 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPlbg56gtz4LRg for ; Fri, 3 Jan 2025 14:01:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735912863; 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=S+fwJvOhwtTttESRQGOurkVO2bUkS9lNSe2HcmEXUg8=; b=ZnY5731wzbVma3qUTG6JZZUbont+gEifUMlWPYNtlz9ef3vWJMKoOGf1Up/Ng7+dOwe3lO m/rtXPwxphpWfjuAjFCvSczi16O48dcEWXIPFQ62qomPi0XKoCHbPCdIGsl47CUrBgB1QP u00BibdCg5DpUrjMxMl2Ny1V7h0cQFNMw0bqw1yL+46VBVjJKIYfwNYijzWqcC53H65qc4 4higzay9pmYl7YtzzIYGmGw+ayrcfc3DISzb0IF9FVP2mA91+YntuDyIN68gTQtk3UAYPr Va0j6CWZ42ezgNE5+9LdGdzo9rdwxISxA4omdWy1kdn0BSc1rHkSclA8PlTBTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735912863; a=rsa-sha256; cv=none; b=SPmuasxom59UOkgP4NSIG5oGtbQv1HFZb0NBflNhMse76Mdc/pJ2aIm1i8vdBna6f94TZm 2Rrn4dbjbPlKDQQ7EZUTjqwXIMi5rUenITwGSfBPrNvwHcR6LyZbnbgxcs6AWGn6U7wRpU iwolaP8CO/6SVgPnoIShJUTlUqsOYvIiE40pcQQe5PJ8IRpg7k0Uftp6CMF7SvR3oeEjbS 5yTd2DLm04kp76eEDj+0WeEMTZEu0G08tyj2v+N5MUTBHSfpFUhVPcp/+2jnIlpPgvvIeh BKiJ+EHYZT0vj9P0KcmJKVY9RJk88mvryR4sFybtoKUHUUSBCdOT6a5wwNZZYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YPlbg4kvPz1NVy for ; Fri, 03 Jan 2025 14:01:03 +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 503E13n7096621 for ; Fri, 3 Jan 2025 14:01:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 503E13v0096620 for bugs@FreeBSD.org; Fri, 3 Jan 2025 14:01:03 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 283818] too-large rtmsg.rtm_family for RTM_GETADDR can cause wild pointer ref Date: Fri, 03 Jan 2025 14:01:03 +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-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283818 Bug ID: 283818 Summary: too-large rtmsg.rtm_family for RTM_GETADDR can cause wild pointer ref 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 #256375 text/plain mime type: Created attachment 256375 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D256375&action= =3Dedit RTM_GETROUTE with illegal rtm_family The attached program supplies an illegally large rtm_family to netlink RTM_GETROUTE, which causes rt_tables_get_rnh_ptr() to fetch a pointer from beyond the end of V_rt_tables, which can lead to a crash in rib_walk_ext_internal(). With INVARIANTS, this fails: KASSERT(family < (AF_MAX + 1), ("%s: fam out of bounds (%d < %d)", __func__, family, AF_MAX + = 1)); # uname -a FreeBSD 15.0-CURRENT FreeBSD 15.0-CURRENT #339 main-n250995-3750873316a1-dirty: Fri Jan 3 08:33:55 EST 2025=20=20=20=20 rtm@xxx:/usr/obj/usr/rtm/symbsd/src/riscv.riscv64/sys/RTM riscv # cc netlink6c.c # ./a.out panic: Fatal page fault at 0xffffffc0002f6e64: 0x424242424242432a cpuid =3D 0 time =3D 1735908209 KDB: stack backtrace: db_trace_self() at db_trace_self db_trace_self_wrapper() at db_trace_self_wrapper+0x36 kdb_backtrace() at kdb_backtrace+0x2c vpanic() at vpanic+0x16e panic() at panic+0x26 page_fault_handler() at page_fault_handler+0x214 do_trap_supervisor() at do_trap_supervisor+0x6c cpu_exception_handler_supervisor() at cpu_exception_handler_supervisor+0x74 --- exception 13, tval =3D 0x424242424242432a _rm_rlock_debug() at _rm_rlock_debug+0x24 rib_walk() at rib_walk+0x7e dump_rtable_one() at dump_rtable_one+0x68 rtnl_handle_getroute() at rtnl_handle_getroute+0x12c rtnl_handle_message() at rtnl_handle_message+0x12a nl_taskqueue_handler() at nl_taskqueue_handler+0x49a taskqueue_run_locked() at taskqueue_run_locked+0x158 taskqueue_thread_loop() at taskqueue_thread_loop+0xd4 fork_exit() at fork_exit+0x68 fork_trampoline() at fork_trampoline+0xa KDB: enter: panic --=20 You are receiving this mail because: You are the assignee for the bug.=