From nobody Fri May 29 22:08:26 2026 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 4gRyDC09WHz6gB3s for ; Fri, 29 May 2026 22:08:27 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRyDB1mwyz4GbZ for ; Fri, 29 May 2026 22:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780092506; 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=0WZSuTQHXf0RIdNXA/w8tXjP040rYkDxqDS7ZP9ok4g=; b=XixOfiUe7VlpDwLDNCah9szAoaCY1W4TU2PTNvuEKyIUIWb9WgTRdtjc/DN+eaab/WzQdo o8D/WRQmpTmlMMHK+P2fPgwU5+MfZxgGnXmNotZ0xIUUUxGJFBwQ9aJIM7geXkauVvz+wC k9qnoBCGpAUaiW4AgkZCQrpYp2CLFufKiiZPENiu80CMEbzidDL74I3cqc7p6tJDXUS5A8 TB6vKSGGIBgyJiii/zmbcNbSa1GK7MFU3Dbn/ryxYRBnx5uprNqpvt0ohug9EyUyfbGxMh NmAOh2Ns7rfszOv46RyEdYqeW8A6d7qnUe96nnr9IeOM11faPeMr3fEsNr9CmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780092506; a=rsa-sha256; cv=none; b=C6f/iSXUH0BCTAtRbZvhm+t7Ht+KT2nPB4xjTg8UsQrHDxEsU2Ci1Qi0Kc1/74qmWXdv1/ K2Po+PA0VKFWpI6FAiDD2JDlV4LB4idTIOotDzDyxEWcxi3rNgcbCOj/B9lz5oZv0BeIJo NcY2G+xGVvOF5N3XRt+rPfBhpO5HZrZEQfVYHvUEcimNQXrLUNtfReLf5M0H/zgyX7mWzG J1yV0J+kfEbEIjVhbXwjRUEcTedJYe5ZcDK2+ESxMWAQ/nsKFYcgwddfGntHQbVzNvpDh3 rpEf4rpB7PTQxXC55ZnUKZ11SYdgQABgG2tpo18Z06wOoz9ianZuUZxS8gkfTg== 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=1780092506; 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=0WZSuTQHXf0RIdNXA/w8tXjP040rYkDxqDS7ZP9ok4g=; b=cPeZwVdbl9gCyagFMRmQUOLGvveeJIAAOxCSCJaIj77ZgrvDCTNGWtpqNLctBwxUtxl7Wu m+w+GGsZID1LPtRaTCD2ddPjUNF56QGIOalaFsG8up5BaTywT2zL3rofClFPzqmbp2QZSH ne5DLW/mrDrNKrPqFb4Gi/xqD4lI28D1P7OqB6LNTXCpwn4bEEuelTNCACdq7NSoO4QGnO 3j+lLKGRJWlm2e+B6VfndyPavBfQbmsrYveMM5u3bmiPUxfSr7QCE3WR765lJ9VOEIvqBh xlmh+tKmcNe7++UMq2/Fvu3eMam/8KXWvS8PJyPaHHgMv97yVeUciO1WoIaySA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRyDB1N0Xzrhf for ; Fri, 29 May 2026 22:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b6ce by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 22:08:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7f8d45bb5f66 - stable/15 - linux: Fix some problems with header pollution 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 7f8d45bb5f665320d55d99f27c810d78c5b0b1a6 Auto-Submitted: auto-generated Date: Fri, 29 May 2026 22:08:26 +0000 Message-Id: <6a1a0e5a.3b6ce.20f782cd@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7f8d45bb5f665320d55d99f27c810d78c5b0b1a6 commit 7f8d45bb5f665320d55d99f27c810d78c5b0b1a6 Author: Mark Johnston AuthorDate: 2026-05-15 00:39:25 +0000 Commit: Mark Johnston CommitDate: 2026-05-29 19:46:48 +0000 linux: Fix some problems with header pollution - Avoid including sys/proc.h in linux_vdso_gtod.c. It's not needed, but the implicit inclusion of sys/param.h via sys/ucred.h->bsm/audit.h was bringing in some required definitions. - Include a couple of required headers: sys/time.h (for struct bintime), and limits.h (for INT_MAX). - Move some helpers from linux.h, which depend on sys/param.h for NODEV, to the one CU where they're actually used. No functional change intended. Reviewed by: imp, kib, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56982 (cherry picked from commit b99954433d42d978b257e846dbfe568e9af7b140) --- sys/amd64/linux/linux_vdso_gtod.c | 4 ++- sys/amd64/linux32/linux32_vdso_gtod.c | 4 ++- sys/arm64/linux/linux_vdso_gtod.c | 4 ++- sys/compat/linux/linux.h | 50 ----------------------------------- sys/compat/linux/linux_stats.c | 46 ++++++++++++++++++++++++++++++++ sys/i386/linux/linux_vdso_gtod.c | 4 ++- 6 files changed, 58 insertions(+), 54 deletions(-) diff --git a/sys/amd64/linux/linux_vdso_gtod.c b/sys/amd64/linux/linux_vdso_gtod.c index abe42d51a3ac..12c5c96dcead 100644 --- a/sys/amd64/linux/linux_vdso_gtod.c +++ b/sys/amd64/linux/linux_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/amd64/linux32/linux32_vdso_gtod.c b/sys/amd64/linux32/linux32_vdso_gtod.c index f32db30057d0..ff4b372ea3bc 100644 --- a/sys/amd64/linux32/linux32_vdso_gtod.c +++ b/sys/amd64/linux32/linux32_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/arm64/linux/linux_vdso_gtod.c b/sys/arm64/linux/linux_vdso_gtod.c index 203c76b6e3a9..55f039b74593 100644 --- a/sys/arm64/linux/linux_vdso_gtod.c +++ b/sys/arm64/linux/linux_vdso_gtod.c @@ -28,12 +28,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include diff --git a/sys/compat/linux/linux.h b/sys/compat/linux/linux.h index 6d276b8a69f4..90a71144c7c7 100644 --- a/sys/compat/linux/linux.h +++ b/sys/compat/linux/linux.h @@ -28,58 +28,8 @@ #ifndef _LINUX_MI_H_ #define _LINUX_MI_H_ -/* - * Machine independent set of types for the Linux types. - */ typedef uint32_t l_dev_t; -/* - * Linux dev_t conversion routines. - * - * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity - * with 12 bits set asaid for the major number and 20 for the minor number. - * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the - * major number and m is a hex digit of the minor number. - * The user-space dev_t encoded as mmmM MMmm, where M and m is the major - * and minor numbers accordingly. This is downward compatible with legacy - * systems where dev_t is 16 bits wide, encoded as MMmm. - * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers, - * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux - * kernel and with legacy systems where dev_t is 16 bits wide. - * - * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers - * are encoded as MMMmmmMm, therefore conversion of the device numbers between - * Linux user-space and FreeBSD kernel required. - */ -static __inline l_dev_t -linux_encode_dev(int _major, int _minor) -{ - - return ((_minor & 0xff) | ((_major & 0xfff) << 8) | - (((_minor & ~0xff) << 12) & 0xfff00000)); -} - -static __inline l_dev_t -linux_new_encode_dev(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev))); -} - -static __inline int -linux_encode_major(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : major(_dev) & 0xfff); -} - -static __inline int -linux_encode_minor(dev_t _dev) -{ - - return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff); -} - static __inline int linux_decode_major(l_dev_t _dev) { diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 6f96a219003b..5ac9394f3601 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -58,6 +58,52 @@ #include #include +/* + * Linux dev_t conversion routines. + * + * As of version 2.6.0 of the Linux kernel, dev_t is a 32-bit quantity + * with 12 bits set asaid for the major number and 20 for the minor number. + * The in-kernel dev_t encoded as MMMmmmmm, where M is a hex digit of the + * major number and m is a hex digit of the minor number. + * The user-space dev_t encoded as mmmM MMmm, where M and m is the major + * and minor numbers accordingly. This is downward compatible with legacy + * systems where dev_t is 16 bits wide, encoded as MMmm. + * In glibc dev_t is a 64-bit quantity, with 32-bit major and minor numbers, + * encoded as MMMM Mmmm mmmM MMmm. This is downward compatible with the Linux + * kernel and with legacy systems where dev_t is 16 bits wide. + * + * In the FreeBSD dev_t is a 64-bit quantity. The major and minor numbers + * are encoded as MMMmmmMm, therefore conversion of the device numbers between + * Linux user-space and FreeBSD kernel required. + */ +static l_dev_t +linux_encode_dev(int _major, int _minor) +{ + + return ((_minor & 0xff) | ((_major & 0xfff) << 8) | + (((_minor & ~0xff) << 12) & 0xfff00000)); +} + +static l_dev_t +linux_new_encode_dev(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : linux_encode_dev(major(_dev), minor(_dev))); +} + +static int +linux_encode_major(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : major(_dev) & 0xfff); +} + +static int +linux_encode_minor(dev_t _dev) +{ + + return (_dev == NODEV ? 0 : minor(_dev) & 0xfffff); +} static int linux_kern_fstat(struct thread *td, int fd, struct stat *sbp) diff --git a/sys/i386/linux/linux_vdso_gtod.c b/sys/i386/linux/linux_vdso_gtod.c index 00367d82139e..336f8d4c290d 100644 --- a/sys/i386/linux/linux_vdso_gtod.c +++ b/sys/i386/linux/linux_vdso_gtod.c @@ -27,12 +27,14 @@ #include #include -#include #include #include +#include #define _KERNEL #include #undef _KERNEL + +#include #include #include