From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by sourceware.org (Postfix) with ESMTPS id 7C4BA3858D37 for ; Fri, 25 Sep 2020 10:47:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C4BA3858D37 Received: by mail-ej1-x642.google.com with SMTP id lo4so2973259ejb.8 for ; Fri, 25 Sep 2020 03:47:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yvy7nUnY4PloW3Tt0vYsYJwNnJhFsxSf82OyVchcG/4=; b=srtSdrhHSsPlSHFDp9A1/HX4SaYBtVNDJYlzJNmQ2kIP6dUwuKmB/ddrgSOP2Kt2ry ApNQgq3hPXpyT1nbI0dWMOrCq6SN2C8UNArZpL1JLkwQeFLiEVARrD3xWdG8TPBR6u5E JeNH/2Rflc94IHI2xXDTOAaiLyI7tlb50ZUjkAaHEz4SR7XpSM0GsaEPPMDtOkc12Wru zYdWqpukjk1ZUp8vTQd6l6PMQQwPi6ua3L291ekw8XgJR72j5b8fP589vft5lsx72qVK 0ed8uJvIijT0ewjCpjzC1IIRyjip8sxftJma0wzqpuIg4j113uWtBItzc757e6H/olOH Tk3A== X-Gm-Message-State: AOAM531ngxeVCde8DrmGDbpwXjcvRrzRhw0beLDVkFGLx/gzUIp0hzY2 5gDzIK68WlEELHPS4re6BXs= X-Google-Smtp-Source: ABdhPJxc737wZHjoAPTx1S3MYM1W6Oh1CWEI2lnz5mKT5Prno3BUGz1dSIeNEYPhENv1I07CWTH9VA== X-Received: by 2002:a17:906:f897:: with SMTP id lg23mr2225835ejb.89.1601030827562; Fri, 25 Sep 2020 03:47:07 -0700 (PDT) Received: from ?IPv6:2001:a61:2479:6801:d8fe:4132:9f23:7e8f? ([2001:a61:2479:6801:d8fe:4132:9f23:7e8f]) by smtp.gmail.com with ESMTPSA id p20sm1595858eja.18.2020.09.25.03.47.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2020 03:47:06 -0700 (PDT) Cc: mtk.manpages@gmail.com, libc-alpha@sourceware.org, Carlos O'Donell Subject: Re: [PATCH] rtld-audit.7: Clarify la_version handshake To: Florian Weimer , linux-man@vger.kernel.org References: <87k0wifdi2.fsf@oldenburg2.str.redhat.com> From: "Michael Kerrisk (man-pages)" Message-ID: <299e6651-fa82-8350-f36f-e578e8180859@gmail.com> Date: Fri, 25 Sep 2020 12:47:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87k0wifdi2.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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 10:47:10 -0000 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. 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 * > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/