From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by sourceware.org (Postfix) with ESMTPS id A8704385840A for ; Thu, 11 Nov 2021 13:02:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A8704385840A Received: by mail-ua1-x934.google.com with SMTP id e2so11658190uax.7 for ; Thu, 11 Nov 2021 05:02:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=V0+EXQdUDYi2yus+ElGgpqpXsxqqOhDp4SrCIZYu8pQ=; b=MNsI8CdfNDxdrRgvAOIHQeh5gLbkiXdIfgX4h8I3YVrn7BZKK26LopmHU/+780gzOt Qy9uQ+9hR35KGmITcT+SU8xkl04OGKTVk06VoS6uKnJGMwTguN/c/wQYxIlfPjg5B9Wp Ud6M7RirYpKTzuWig5FXBc8y5u47cditXcm36ZgTXYI9NoPxz2NG5rsolyHtZAuLfBf6 L1XLrJAKKbtK9o7g0ISoT76WVUxCi13HeBtd/6WtHmifGlEukDvfrAjgXBOBEy3K6xGv nW9gnL5Hy/MindNudl1/7hMuSHaHLn2Mhw2myIrw3Y2De3hqKzBkMSh/e0v4nsxYWsSq ymVA== X-Gm-Message-State: AOAM530DT1pOLTErKCaQdbYEoB3MJXpMd09/o8j3iEilFLo1rbWk3GJT raO8zxDQdB0wbPvaMHrAcTOtbRTdM9saIQ== X-Google-Smtp-Source: ABdhPJz7Bjdu61K4LhrtvThrXisqLy9zhYpC7bAN8LRa7ynOofMMPXGJ3naoQpcVlOdyYMnlPqL4hA== X-Received: by 2002:a67:f754:: with SMTP id w20mr10508830vso.3.1636635753263; Thu, 11 Nov 2021 05:02:33 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:55a:48f2:1d0b:8ae8:643a? ([2804:431:c7cb:55a:48f2:1d0b:8ae8:643a]) by smtp.gmail.com with ESMTPSA id h13sm1878765vko.41.2021.11.11.05.02.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Nov 2021 05:02:33 -0800 (PST) Message-ID: <5b0153b9-a350-b3bd-e102-a763935af755@linaro.org> Date: Thu, 11 Nov 2021 10:02:30 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v5 04/22] elf: Suppress audit calls when a (new) namespace is empty (BZ #28062) Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org, John Mellor-Crummey , Ben Woodard , Vivek Das Mohapatra References: <20211109183347.2943786-1-adhemerval.zanella@linaro.org> <20211109183347.2943786-5-adhemerval.zanella@linaro.org> <871r3o5c77.fsf@oldenburg.str.redhat.com> <87o86qzyrk.fsf@oldenburg.str.redhat.com> <87zgqayir9.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87zgqayir9.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2021 13:02:35 -0000 On 11/11/2021 09:33, Florian Weimer wrote: > * Adhemerval Zanella: > >>> Hmm. I had a peeked at the Solaris documentation, and it says that >>> LA_ACT_ADD uses the head link map of the namespace as a cookie. >>> >>> I really dislike that we produce a LA_ACT_DELETE without the >>> corresponding LA_ACT_ADD due to this issue. >>> >>> Can we use the link map allocated used _dl_new_object as the cookie if >>> the namespace is empty? This seems like the right thing to do here. >>> The allocation happens just a few lines further down. >> >> But afaiu the LA_ACT_ADD activity is to inform already loaded objects >> that a new object is being processed. Both man-pages and Solaris >> documentation states 'objects are *being added*...', so I think passing >> the cookie of the new allocated is not what the interface is suppose >> to do. > > It's the only way to get a matching LA_ACT_DELETE call with the same > cookie. It's not particularly clean, I agree, but I think it's better > than a dropped LA_ACT_ADD. I think we can move the la_activity (LA_ACT_ADD) *after* _dl_add_to_namespace_list() on _dl_map_object_from_fd(), so the GL(dl_ns)[nsid]._ns_loaded is always valid and it will call both LA_ACT_ADD and LA_ACT_DELETE will a consistent set of cookies.