From nobody Thu Oct 06 10:50:07 2022 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 4Mjp9q1gFRz4fYSy for ; Thu, 6 Oct 2022 10:50:07 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mjp9q0Yvjz43sS for ; Thu, 6 Oct 2022 10:50:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 4Mjp9p6lWJzDh0 for ; Thu, 6 Oct 2022 10:50:06 +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 296Ao6K0008041 for ; Thu, 6 Oct 2022 10:50:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 296Ao6OC008040 for bugs@FreeBSD.org; Thu, 6 Oct 2022 10:50:06 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 266862] devctl getpath cause panic invoking with root0 Date: Thu, 06 Oct 2022 10:50:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed 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 Many People X-Bugzilla-Who: takawata@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665053407; 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: in-reply-to:in-reply-to:references:references; bh=RhYSSJ/1FT2WDn4vcmDXXmkPq5LHYMqqaDzLhtMoZmY=; b=nLqVqapHtM18JCtSjABN3Gg7RMRHioxudLazRphNPSl6b3WCM2yEoVh2Cx9Eszty8+gEZa JHN0UgxdTTlHewaMCaa3dxFDqaQjISl1p2M7QwvYaNxrblDKbK90G+vN8DjRoBwEaIXWeq 4guKVjzJM+iNALCkzJ36M+479+aAdiR8L4wbHDqQs2BjKj7vVXDw0e0aGaykqwnxBU2sf0 cNQp+Kp0QNBrHUGK/tsBr07ZIyACUdrUacPv4iMwQp+vky8bU6t1Cs1SnJ0qO2z2uWyEJu cRGca45yKtsVdZowFWe1n7W69a6dp4CAek0K0oMRzebvyhjrbDhqY3gsJJTofA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665053407; a=rsa-sha256; cv=none; b=YNtNE6oW3AltNzavVeygYl5vN8m/Avfg+0c6VNIIRprPqg178xwhIYtfvjIMdKwywC+s6M 4jC+AK9ILN9zeJ79KmvmLTO8LdInvGfmH6mDez8M2m8VUlqt6n7LYrXphbzlFW/bX+NXwe YPVVj0nI3v6UItUoiIqKMI4S10+i43IGveWrsDXb3IALATI8JtfA34NRREyQHNQAZZZFNi Aiy5uXhUcaKGRVc60CVmVHcUSIHLpJY53hA6f+XeSr5aGVXjy67XLQnHQD7wsDqFxG/lfG YxxeTSffN5att91GDQCnJKuun1cVEifgmaOIeYReWdBg52Lo9ADE9i0mmctl/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266862 --- Comment #2 from Takanori Watanabe --- (In reply to Takanori Watanabe from comment #1) reverse patch ... diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 041e77259313..487e573451ed 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -5310,9 +5310,13 @@ device_get_path(device_t dev, const char *locator) ssize_t len; char *rv =3D NULL; int error; + device_t parent =3D device_get_parent(dev); + + if(parent =3D=3D NULL) + return rv; sb =3D sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND | SBUF_INCLUDENUL); - error =3D BUS_GET_DEVICE_PATH(device_get_parent(dev), dev, locator,= sb); + error =3D BUS_GET_DEVICE_PATH(parent, dev, locator, sb); sbuf_finish(sb); /* Note: errors checked with sbuf_len() bel= ow */ if (error !=3D 0) goto out; --=20 You are receiving this mail because: You are the assignee for the bug.=