From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F20E43858C60; Mon, 13 Mar 2023 10:01:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F20E43858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678701694; bh=T2yckTJkT+QDl6hJazPnggu9R/j4lFkobFgNepyj2Fo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yAxHJ7bzQIL+ercRQqJsuy6M9XCIzW2QEmEvKYzPorWxqATQe3vSUxW4EsDqDAmXy mlkOUdc533rJHSzIBvw8zntiDPOY0xrjzT+TH8N6ij7Pzrfts0P92jPzyIQNYoN5bf WE4cWl1A5KnNp41hvf1w8161cJHr16GWnexBMxac= From: "stsp at users dot sourceforge.net" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/30127] [rfe]: enable ld audit at run-time Date: Mon, 13 Mar 2023 10:01:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.38 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stsp at users dot sourceforge.net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30127 --- Comment #44 from Stas Sergeev --- (In reply to Jonathon Anderson from comment #42) > After all, all solibs are perfectly functional regardless of whether you > load it via LD_PRELOAD or dlopen or DT_NEEDED. Shouldn't auditors follow = the > same principle? Normally yes, but when you bring up things like "but it should run before any ctors", then these must be evaluated case-by-case. > > Is that picture remotely correct? I guess no, as > > it is based on too many assumptions from me. :) > It's in the right direction. The only reason I bring up my use case is as= an > example auditor that would be broken by this dynamic loading feature in i= ts > current state. This is a very harsh statement. Nothing will be broken. At worst, you won't be able to use that dynamic loading for your case. Given that you have only 1 auditor, no intention to change the app and a requirement for an auditor to run before any ctors, I think this "worst case" is already unavoidable. :) > The parallelism issue is present here too. There's no association between= an > la_objsearch and the resulting la_objopen, I think you can associate by "name". The name in objsearch and abjopen should match I think. But I've heard your other arguments against objsearch, yes. > Indeed. My primary goal is to ensure the proposed "tools" for your use ca= se > don't unwittingly destroy my use case in the process. :) I don't even see why this can be the case. If it is, why aren't we discussing _that_, instead of everything else? :) > If the interface is defined such that no other la_objopen calls from thre= ads > running in parallel can trigger before that first la_activity(CONSISTENT), > then I could consider that a reasonable enough solution. This happens within a single dlmopen() call. I think its up to glibc to make sure no one touches the link-map before ACT_CONSISTENT is reported. And I think you can also use pthread_self() to check for yourself from which threads things are called. So when you see la_dynload(), you remember pthread_self(). Then you know that: 1. Any la_objopen() call with that pthread_self() is "late" unless ACT_CONSISTENT was seen with that pthread_self(). 2. Any la_objopen() call with different pthread_self() is not "late". --=20 You are receiving this mail because: You are on the CC list for the bug.=