From nobody Sat Apr 22 19:18:41 2023 X-Original-To: dev-commits-src-main@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 4Q3h5H0td6z469WM; Sat, 22 Apr 2023 19:18:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q3h5F5NxPz49XV; Sat, 22 Apr 2023 19:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682191121; 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=nLPg6cpF+XO1IsvDs8z4xIFWQ27ZXgkZpag2d006BoQ=; b=m3jCnZU/cOq9pcwRxnMEUU6RjuxOICdEB5+NlXPQfilIAS46izMWoMJ2CGn6lnIRNXnjtU Bn2qSvZ78u6fNQ2JydLdF6M/6rtbV6Ehkn4kfNAl/XqwlghZZXnAdZGFvcRHyTcVh1OUVW JhubyW37pgde2OW3Lwq5gW6OekhYNtvblHCOl2BnXfRHVv2Cpmb1UmQokStfj1lZPzegCQ xybcBYDPiYT9PRLx6V0wRtw5uTXORuJ8KAriH1YnhiW30l3hsYmWikOJ70SRfIR5OHacwV z5WaI9sM27y4Qgnx3XAk+0hMlhIUteaRDstGwY6jZhdKHmddgd9DIwo/6Tgezw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682191121; 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=nLPg6cpF+XO1IsvDs8z4xIFWQ27ZXgkZpag2d006BoQ=; b=AlE022k5dW6Zk5do3LTZMITAf4yiJkDdj0u+BpG3SPHu9tijwq3mc7NGzMWSQrORvbbGB8 7ZsHxa3aQ1OiUKJ+7IArbIp/5Y4FZeWA1ZZIjdmKz8MisepjBV1QWckMpUdyUIDp0AndmH f0fDpOlXMWNoTcZnzZVfBsCVlkNTEat626roz/gFw+1gaFtwz0vYrb5T5moMf3GuEGvZU9 3Dqku6jexlaWpAmxcY4RW19YBkTzqsfpEOaGwYurEGZD3jz1A+63DDUYAonDvHP6fZ6ohq qVKG71YVn0TnAJ7iReV9zrUhDwqY3A3ILdrm2kP7Hgjvfm9J9Gwey0YfWnINYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682191121; a=rsa-sha256; cv=none; b=Meg4MNFEZEdnQ91RHzgvNiuQ02Tgk6FNAU8jSxACxF9+BAfG7fz5oN1BYP3BENpkkbDnuq 4TA3Pa7FcLy2hkbiRWK0bWzQ/5jJRllqxlmlFtvqSTV60CitMdhg4zFdAAe0jVfdXsfDxo n6KNyAH7w2XPx7FdIbr1tcax3KdRjZ7GnJHx/JU7CdmtBiaThI2Y+vwA3Buo1jxJ53cm83 HYz48h0EkwIUWFDxvsD7A/Y1syG9G6qETSJ4Q1w+BrN9b8E7LtcoLd1bj7QNhqk/fqeCAX wuTzxGPy5qxjjiCuqIQAm+iRaiJSQ6i7x2zbICk1ohDJxjDX3VRDg8EbokVsBw== 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 4Q3h5F4VkVz1Cjl; Sat, 22 Apr 2023 19:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33MJIfaI085130; Sat, 22 Apr 2023 19:18:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33MJIf2U085129; Sat, 22 Apr 2023 19:18:41 GMT (envelope-from git) Date: Sat, 22 Apr 2023 19:18:41 GMT Message-Id: <202304221918.33MJIf2U085129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 40c36c4674eb - main - linux(4): Export the AT_RANDOM depending on the process osreldata List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40c36c4674eb9602709cf9d0483a4f34ad9753f6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=40c36c4674eb9602709cf9d0483a4f34ad9753f6 commit 40c36c4674eb9602709cf9d0483a4f34ad9753f6 Author: Dmitry Chagin AuthorDate: 2023-04-22 19:17:17 +0000 Commit: Dmitry Chagin CommitDate: 2023-04-22 19:17:17 +0000 linux(4): Export the AT_RANDOM depending on the process osreldata AT_RANDOM has appeared in the 2.6.30 Linux kernel first time. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39646 MFC after: 1 month --- sys/compat/linux/linux_elf.c | 3 ++- sys/compat/linux/linux_mib.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 9b2c38aba444..d0e547c1b882 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -526,7 +526,8 @@ __linuxN(copyout_auxargs)(struct image_params *imgp, uintptr_t base) AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); AUXARGS_ENTRY(pos, LINUX_AT_SECURE, issetugid); - AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary); + if (p->p_osrel >= LINUX_KERNVER_2006030 || p->p_osrel == 0) + AUXARGS_ENTRY_PTR(pos, LINUX_AT_RANDOM, imgp->canary); if (imgp->execpathp != 0) AUXARGS_ENTRY(pos, LINUX_AT_EXECFN, PTROUT(imgp->execpathp)); if (args->execfd != -1) diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 615439b4d107..b1d5a0981a7d 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -58,6 +58,7 @@ int linux_kernver(struct thread *td); #define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL) #define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0) +#define LINUX_KERNVER_2006030 LINUX_KERNVER(2,6,30) #define LINUX_KERNVER_2006039 LINUX_KERNVER(2,6,39) #define LINUX_KERNVER_5004000 LINUX_KERNVER(5,4,0)