From nobody Wed Jan 29 15:04:44 2025 X-Original-To: dev-commits-src-all@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 4Yjln83g50z5msR4; Wed, 29 Jan 2025 15:04:44 +0000 (UTC) (envelope-from git@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 4Yjln825bCz3Qk1; Wed, 29 Jan 2025 15:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738163084; 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=rMIR4CJ/tJPa/rZrH8nklh+010kZmSINVi6Ce29HvR4=; b=n/ml3WjXavc87m93sCOwX87jef26zUDrm0YhpYW4KpqFIVteCJlKRXJIf+pBs42SpEhtf5 HrH3OI3R/VPeiHKgEgKSjx8nWbnmbvQ+wipANi3ktHJtCwk0+gUPZh+YBiGkQ8VW1wn1Tr IUTp6kHqCg1/jUr8vp8eH1/1w7Xgl/nYIbdtx4rPqReQ3XT3I2ROLte5jM8zmAe6UL251v 2Vm6qx2X6pUmfZyv+eQrCiYglopmq35KHJQpB3zHNDSzE2bXUqzEb/SXNhPwbrhpBinjsw xTvh9DsuKwVMU+ARkOjBE1keJkwYo7JpWx7QEap9+2ZYuImMIKm2/Ho3mvPi2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738163084; 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=rMIR4CJ/tJPa/rZrH8nklh+010kZmSINVi6Ce29HvR4=; b=MsNCkvdquEaPiP8fz6nHKVKTGc3X7YJPIg0qG0G6XzlMSeAs7vpy/d41HeG1+AFCXmjJ8E wiZVAA75LkTSXX4J21WoyfzGNk49AQMLjh1WxQaaeGFUARb9nKjHXfVhmKcPgYY8L2C7vn SKZylw24G3VPWAXKwAeYGZKddqa0/sXuXqWQGvxxb8/i7VY1cBw9fBWnuoy131ClBsFjFL DDQfy1MkcOaucQ3jUO4mJD1atDQ6+kxL+Uz6xUpkoRH+1png+SG/WnUj3PFKVsFKbyR+fH KSl2hEzAWXjAhF0ua5n2fX/16Eq/VefwW18B7d4+YAyyjTMZ+SfjhfYJj4qsAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738163084; a=rsa-sha256; cv=none; b=oX527PC7Y8FdAhVAGZH71v+GcoKUnSJsLMQt2UvBq8L43ZUe2CXOXVULJ8f8gJpSo5RSxh SSGwGQjARxGGJUaaznwhK44Bx+lTTUEBmtcRS+c3kWVqXrROSgMH8flb+uCJQ7MKLpKeO/ YHU0vzQcdZMSnmHeB5FJCKBZ6VXmTsP5qxsPfYiD16MY6rPFhnYyETjInkkaI+Y66+T4UZ VgLDu2X1ZzMWyvjx1JX3xIfADvyJzxdsli8f5oJRmi629w2wyOIzB6Fy+HnvYMX/LqqdH6 v5QzOkpGvZchbAV7nf+nSTLgUVa8YVsaUa1BD67oyYqV5sy6GeqCW53yA9T4gA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4Yjln81Q7xz15jQ; Wed, 29 Jan 2025 15:04:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50TF4iQZ032551; Wed, 29 Jan 2025 15:04:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50TF4ide032548; Wed, 29 Jan 2025 15:04:44 GMT (envelope-from git) Date: Wed, 29 Jan 2025 15:04:44 GMT Message-Id: <202501291504.50TF4ide032548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7554746c43c5 - main - libdevinfo: Avoid false positives for the root0 sentinel value List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7554746c43c50d99d15bb63ff43c90e561a9792e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7554746c43c50d99d15bb63ff43c90e561a9792e commit 7554746c43c50d99d15bb63ff43c90e561a9792e Author: John Baldwin AuthorDate: 2025-01-29 15:03:59 +0000 Commit: John Baldwin CommitDate: 2025-01-29 15:03:59 +0000 libdevinfo: Avoid false positives for the root0 sentinel value Previously, a NULL pointer value was used to request the root0 device at the top of the device tree. However, this meant that resource ranges from a rman with a NULL device pointer were annotated as being owned by root0 instead of being unowned. Switch to a different value for root0's sentinel to avoid the clash. Since this is an ABI change, bump the SHLIB_MAJOR for libdevinfo to 7. Reported by: jrtc27 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48675 --- ObsoleteFiles.inc | 3 +++ lib/libdevinfo/Makefile | 2 +- lib/libdevinfo/devinfo.c | 2 +- lib/libdevinfo/devinfo.h | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index b406c3e281f1..8fc9e6f4e152 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 2025xxxx: libdevinfo bumped to version 7 +OLD_LIBS+=lib/libdevinfo.so.6 + # 20250123: Remove gvinum(8) OLD_FILES+=sbin/gvinum OLD_FILES+=usr/share/man/man8/gvinum.8.gz diff --git a/lib/libdevinfo/Makefile b/lib/libdevinfo/Makefile index 41e17f7de0be..b74806e42672 100644 --- a/lib/libdevinfo/Makefile +++ b/lib/libdevinfo/Makefile @@ -14,7 +14,7 @@ MLINKS+=devinfo.3 devinfo_foreach_device_resource.3 MLINKS+=devinfo.3 devinfo_foreach_rman_resource.3 MLINKS+=devinfo.3 devinfo_foreach_rman.3 -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 WARNS?= 3 diff --git a/lib/libdevinfo/devinfo.c b/lib/libdevinfo/devinfo.c index 115e7ea76602..65a26d871371 100644 --- a/lib/libdevinfo/devinfo.c +++ b/lib/libdevinfo/devinfo.c @@ -420,7 +420,7 @@ devinfo_handle_to_device(devinfo_handle_t handle) */ if (handle == DEVINFO_ROOT_DEVICE) { TAILQ_FOREACH(dd, &devinfo_dev, dd_link) - if (dd->dd_dev.dd_parent == DEVINFO_ROOT_DEVICE) + if (dd->dd_dev.dd_parent == 0) return(&dd->dd_dev); return(NULL); } diff --git a/lib/libdevinfo/devinfo.h b/lib/libdevinfo/devinfo.h index 07e2043d43ce..0d02a75195d3 100644 --- a/lib/libdevinfo/devinfo.h +++ b/lib/libdevinfo/devinfo.h @@ -34,7 +34,7 @@ #include typedef __uintptr_t devinfo_handle_t; -#define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)0) +#define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)-1) typedef enum device_state devinfo_state_t;