From nobody Tue Jan 24 01:38:41 2023 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 4P18kn6yBSz30vp4; Tue, 24 Jan 2023 01:38:41 +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 4P18kn6Mt7z44jf; Tue, 24 Jan 2023 01:38:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674524321; 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=mq3UcKU63EjWMVJAKHSE/BvrBtUO20CyUBIjO9/G724=; b=lnT2D7bQ2emSP4QQH7q55w5Jz7x663gVCQLx8DnW+z7rqlHBhs84wzrr33/hYvWJzG8Rx9 k9E87TmFxnQk9CrhjxvyoXrFkWcnKZp+FL2lSQsXx7rvfotdZNC0WRlFrDDgp9kK4FI6A5 vVQWWNOg71NkvKbugmuRglKW7RXn63hUgEkLyIdt5Yf44bsQBjZZBUnfNUReUu56f9fN+E AzORk0rY6YgTC//AuPKPbOLYhQ/aMxj6H0kSCGT2Y75RYZQe3SFF0yLXL5tzR5VbF7dDBi k9hcuuezo3AbrPyUgr78zHHnsR+apEY189BVRTAOTC7TyOR422wQiksT7sruvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674524321; 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=mq3UcKU63EjWMVJAKHSE/BvrBtUO20CyUBIjO9/G724=; b=JkgX6jjtnGCMm6SPeClZDJUSOetubvCGDWWgbcajGx+WbqtuUW3l5ux37I8HYmoLNr3dEW xCBAGAUjy1b99D1LxF85U1GSJ9WN5F0zFT+pdKZIU7wEsxpBZ8OxF6qbnHMqoRkDNrWcuP 7sa5SHJjaIEiKMTXcvk6pI6zJUNr3hSCtSxQMy2KR+rP7iLqy3tpHKV9HUmcNDqWhYj5XH NZMCNZirfS9RXJhdwKvyFMLXZ15MfGZPxg7Ya4jolEH1xHTCLjdNbKZ3xY4nZYry49UPcb dMrVE97+xtwO9kSiI5uggLtIXEJWO5nfPK9VOhwDK3y3Opc9gk9zC5sYYVJSfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674524321; a=rsa-sha256; cv=none; b=gQR5HUT4at+T3AeKrqM404expA/UQcyWyHeWuAg8gFrhfsIPAZ5m2bRhIMVB2v2eiWmbEs vI1py+igI0O5X9dlLRYzGS/6RW2WkKJ+5Vc81Fn/LniDD4fVvzGU2eSKtUJW0cUYbTwpwG hZ22dboLy0GnaaIXt4MCavufLtcn3a1fOdixsz6oTRA/1Zj5DY9vfznm52Q84TWXLuAecu im2/St8m3Hz/DTC5BjYQdaEXCntEkDbMwA9xO2qnLrkz/0WEoyakVkID4YGUu6jreZUY8U JA2yKfgRt6bIorF1gHx9rXuanQnNZxWibJbPS9w+SV8uXbzQGGwaYHP06RtFKA== 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 4P18kn4vVbzrKJ; Tue, 24 Jan 2023 01:38: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 30O1cfNU004113; Tue, 24 Jan 2023 01:38:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30O1cfL7004112; Tue, 24 Jan 2023 01:38:41 GMT (envelope-from git) Date: Tue, 24 Jan 2023 01:38:41 GMT Message-Id: <202301240138.30O1cfL7004112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: da81cc6035f8 - main - dtrace: conditionally load the systrace_linux klds when loading dtrace. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da81cc6035f8283b6adda1ef466977e8c1c5389e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=da81cc6035f8283b6adda1ef466977e8c1c5389e commit da81cc6035f8283b6adda1ef466977e8c1c5389e Author: Andrew Gallatin AuthorDate: 2023-01-24 01:27:17 +0000 Commit: Andrew Gallatin CommitDate: 2023-01-24 01:36:24 +0000 dtrace: conditionally load the systrace_linux klds when loading dtrace. When dtrace starts, it tries to detect if the dtrace klds are loaded, and if not, it loads them by loading the dtraceall kld. This module depends on most dtrace modules, including systrace for the native freebsd and freebsd32 ABIs. However, it does not depend on the systrace_linux klds, as they in turn depend on the linux ABI klds, and we don't want to load an ABI module that the user has not explicitly requested. This can leave a naive user in a state where they think all syscall providers have been loaded, yet linux ABI syscalls are "invisible" to dtrace. To fix this, check to see if the linux ABI modules are loaded. If they are, then load their systrace klds. Reviewed by: markj, (emaste & jhb, earlier versions) Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37986 --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 867259b5d77c..e11cdc954683 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1115,6 +1115,15 @@ dt_vopen(int version, int flags, int *errp, */ if (err == ENOENT && modfind("dtraceall") < 0) { kldload("dtraceall"); /* ignore the error */ +#if __SIZEOF_LONG__ == 8 + if (modfind("linux64elf") >= 0) + kldload("systrace_linux"); + if (modfind("linuxelf") >= 0) + kldload("systrace_linux32"); +#else + if (modfind("linuxelf") >= 0) { + kldload("systrace_linux"); +#endif dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC); err = errno; }