From nobody Tue Jan 24 05:30:16 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 4P1FtB6Rw1z3bLpn; Tue, 24 Jan 2023 05:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1FtB55jmz4QTl; Tue, 24 Jan 2023 05:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674538226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EqvfiOmyjjiysmnc0rmsfpo2dE4YSqMNpA4GfOhO4sg=; b=ilTsnEzSXher2002O7CVHuwZTWXPfBCN/ytt8W0h9HGK46u0HfQlAzilEYD80uGSHKFpmQ Eu3ULS6pHRRe4FQ5URpagJAEqXwAGECDI5kre0sdNIE6EsxXLdk403WKA2+5WoOCSF2ef4 vlgtqWNdwMuVbsH9OQIvpPUYxUZNNiicVxQddPfMdOTo/CCxCjTjkH0YqxNYnxO/u3bB+7 b+dLlo5hBVBd88XH5KGFlBhhO58N3OtgH+HyAYcVD4IGHFLbd7t2LSy5pJTFA/zqNMHj8F mFfBO21N6Ddbbhdjt1bd0Kr6NT8XtTGFnp5kghDrkf+MK3cHivgczgp2XfxayA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674538226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EqvfiOmyjjiysmnc0rmsfpo2dE4YSqMNpA4GfOhO4sg=; b=hrOBt82ww5Tyd/S1n0Gm7U6LVQ1jhtFsrWC8lXHN8fVm5FZYXq0cRnCOelpEBfeoCb0cna lX6TvNPe1heNu/m08ko81Tj1u6+gECUFSj9t2QDZJDtPGwYNPaOQAjdpZqxsaGvr0Bm9QY sC5J1/20Y75GtgEwQPIZ16FXGqoCd6GDtKNp4TtXt6P5o1C9loE71jxwn01ucTGzoEmQPG TjP7SNGJECXHsGWs86svEAyWfAqBv7fm4AQrYiHu5Ya03wQH3zdhMcBYEAPBXomd6aXpCn inwZ9sdaZXtqfTxmfUGiYkffBiLgDyq4yTP0zixx4XDImuFzT8tLBtKwQ0qP1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674538226; a=rsa-sha256; cv=none; b=xv/ldF1TE0p/7l1Bxf+cmQj92715SP9pFb/pT8vTHjCkpY6r0x4k0+UhsvcDRdGF5VvyK1 ko87JNdvG7X4h3H1Khmh5CVE3sAdncWDEp9YkycQOTuYbbeC/YE4OaMzQ6By8Kia3kDM+d 51Nv/1rOsj+QGNCdx3GCTWdyG0o2dOSteBtk1PUizZNlErg32bizlrwGhejk67GbeiA4Sk cAZnMwe1NijTM7Wj7CY51rJJPQWlqrsKOoOmHN3gD88HoLWplSMLZk83nEqj0UklSD6uCp c+tA2gfyiEeCzd0DEEXxdP/8BMQARd8wXW126RHRIPBSX1C3d5nqbPiBy+y0jQ== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4P1FtB3QtlzYXw; Tue, 24 Jan 2023 05:30:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id F274947EC3; Tue, 24 Jan 2023 06:30:21 +0100 (CET) From: Kristof Provost To: Andrew Gallatin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: da81cc6035f8 - main - dtrace: conditionally load the systrace_linux klds when loading dtrace. Date: Tue, 24 Jan 2023 18:30:16 +1300 X-Mailer: MailMate (1.14r5918) Message-ID: <00187534-3A6D-471D-B9DD-6CD42486DA3C@FreeBSD.org> In-Reply-To: <202301240138.30O1cfL7004112@gitrepo.freebsd.org> References: <202301240138.30O1cfL7004112@gitrepo.freebsd.org> 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: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On 24 Jan 2023, at 14:38, Andrew Gallatin wrote: > The branch main has been updated by gallatin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dda81cc6035f8283b6adda1ef= 466977e8c1c5389e > > 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 dtr= ace. > > When dtrace starts, it tries to detect if the dtrace klds are loade= d, > 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 explicitl= y > 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 t= hey > 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 =3D=3D ENOENT && modfind("dtraceall") < 0) { > kldload("dtraceall"); /* ignore the error */ > +#if __SIZEOF_LONG__ =3D=3D 8 > + if (modfind("linux64elf") >=3D 0) > + kldload("systrace_linux"); > + if (modfind("linuxelf") >=3D 0) > + kldload("systrace_linux32"); > +#else > + if (modfind("linuxelf") >=3D 0) { Trond spotted the extra brace here. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D269128 > + kldload("systrace_linux"); > +#endif > dtfd =3D open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC); > err =3D errno; > } =E2=80=94 Kristof