From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 80085385EC55 for ; Fri, 25 Sep 2020 16:14:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 80085385EC55 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-596-ilGyZb02NHSoT3SsVA4oYQ-1; Fri, 25 Sep 2020 12:14:49 -0400 X-MC-Unique: ilGyZb02NHSoT3SsVA4oYQ-1 Received: by mail-qt1-f198.google.com with SMTP id t56so2327556qtt.19 for ; Fri, 25 Sep 2020 09:14:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=KxYl/gm9dXPHStE806yx8YetVSL6X9U7EykCWkM9cEY=; b=mJgXUslMQMxqiLGiKi+OwhqNxTJbccbQuVNbHAaso0CSJTJ0meMnI7oPUnZqsKeoqw n3PlSpW9F86BQOJdq+VHweLPmFTHb50FyYXWvlUJhqigwTn9hc90QrMwJJCgoDUhLoxi 9lvPOp/phfW6qoC3gbE8meRcZMW+R1nWqD9xQKbh3xiX37eDNlpjais0rZOH9YNoj83Z OFLSPhr2hUZc8hm1bb9g5JnRJ6YMdnB4t+wXel54SWP1wUoNasO7rdVukrR9BNpOXwAL X70kUnhWJWWyEJfynfP3uceyQzTb5ebvtknN6Y3YxvnJpevkkHnvy8KoYVHDBiUKb+T7 k/mA== X-Gm-Message-State: AOAM532SENuEbFYZtVG8tUJI6O5mSe+BgfwcK/fBNEwP6K4eXknwJVs8 wk6F13h3PTO4wUPrpo4sUqfw1FyKhhPMhSo6CXaIF/moF68pib8CRmT9SiOhbi5hOd8sSLEoW4A 20gU0MhD+/nF87bFUlFFS X-Received: by 2002:a05:620a:897:: with SMTP id b23mr706785qka.501.1601050488868; Fri, 25 Sep 2020 09:14:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjMOEL5cpQu05I2OegyTFVb4H+qBMIXvSO8b/GhzxU2g7q6oijv7ZvlQ4dqoaW/+VBdUCHTw== X-Received: by 2002:a05:620a:897:: with SMTP id b23mr706768qka.501.1601050488618; Fri, 25 Sep 2020 09:14:48 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id b34sm2285886qtc.73.2020.09.25.09.14.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2020 09:14:47 -0700 (PDT) Subject: Re: [PATCH] rtld-audit.7: Clarify la_version handshake To: "Michael Kerrisk (man-pages)" , Florian Weimer , linux-man@vger.kernel.org Cc: libc-alpha@sourceware.org References: <87k0wifdi2.fsf@oldenburg2.str.redhat.com> <299e6651-fa82-8350-f36f-e578e8180859@gmail.com> From: Carlos O'Donell Organization: Red Hat Message-ID: <1f2734bb-fed4-07f9-94d8-4dbce661b5cf@redhat.com> Date: Fri, 25 Sep 2020 12:14:46 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <299e6651-fa82-8350-f36f-e578e8180859@gmail.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 25 Sep 2020 16:14:52 -0000 On 9/25/20 6:47 AM, Michael Kerrisk (man-pages) wrote: > On 9/25/20 10:48 AM, Florian Weimer wrote: >> Returning its argument without further checks is almost always >> wrong for la_version. >> >> Signed-off-by: Florian Weimer > > Hello Florian, > > I've applied this patch locally. I'll merge into master > in a few hours. Perhaps in the meantime there are acks/reviews > that come in. Just for the record. This version looks good to me and addresses my previous comments. Reviewed-by: Carlos O'Donell > Cheers, > > Michael > >> --- >> man7/rtld-audit.7 | 36 +++++++++++++++++++++++++----------- >> 1 file changed, 25 insertions(+), 11 deletions(-) >> >> diff --git a/man7/rtld-audit.7 b/man7/rtld-audit.7 >> index b1b7dfebc..21cc339d0 100644 >> --- a/man7/rtld-audit.7 >> +++ b/man7/rtld-audit.7 >> @@ -70,17 +70,30 @@ the auditing library. >> When invoking this function, the dynamic linker passes, in >> .IR version , >> the highest version of the auditing interface that the linker supports. >> -If necessary, the auditing library can check that this version >> -is sufficient for its requirements. >> .PP >> -As its function result, >> -this function should return the version of the auditing interface >> -that this auditing library expects to use (returning >> +A typical implementation of this function simply returns the constant >> +.BR LAV_CURRENT , >> +which indicates the version of >> +.I >> +that was used to build the audit module. If the dynamic linker does >> +not support this version of the audit interface, it will refuse to >> +activate this audit module. If the function returns zero, the dynamic >> +linker also does not activate this audit module. >> +.PP >> +In order to enable backwards compatibility with older dynamic linkers, >> +an audit module can examine the >> +.I version >> +argument and return an earlier version than >> +.BR LAV_CURRENT , >> +assuming the module can adjust its implementation to match the >> +requirements of the previous version of the audit interface. The >> +.B la_version >> +function should not return the value of >> .I version >> -is acceptable). >> -If the returned value is 0, >> -or a version that is greater than that supported by the dynamic linker, >> -then the audit library is ignored. >> +without further checks because it could correspond to an interface >> +that does not match the >> +.I >> +definitions used to build the audit module. >> .SS la_objsearch() >> \& >> .nf >> @@ -508,9 +521,10 @@ This is reportedly fixed in glibc 2.10. >> unsigned int >> la_version(unsigned int version) >> { >> - printf("la_version(): %u\en", version); >> + printf("la_version(): version = %u; LAV_CURRENT = %u\en", >> + version, LAV_CURRENT); >> >> - return version; >> + return LAV_CURRENT; >> } >> >> char * >> > > -- Cheers, Carlos.