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 34CCE384404C for ; Wed, 23 Sep 2020 11:38:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 34CCE384404C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-4i-t4-CkNj-TPV1jd1F3FQ-1; Wed, 23 Sep 2020 07:38:09 -0400 X-MC-Unique: 4i-t4-CkNj-TPV1jd1F3FQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CDBB1007468; Wed, 23 Sep 2020 11:38:08 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-114-108.ams2.redhat.com [10.36.114.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B9CE7368E; Wed, 23 Sep 2020 11:38:07 +0000 (UTC) From: Florian Weimer To: linux-man@vger.kernel.org Cc: libc-alpha@sourceware.org Subject: [PATCH] rtld-audit.7: Clarify la_version handshake Date: Wed, 23 Sep 2020 13:38:05 +0200 Message-ID: <874knosoyq.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: Wed, 23 Sep 2020 11:38:12 -0000 Returning its argument without further checks is almost always wrong for la_version. Signed-off-by: Florian Weimer --- man7/rtld-audit.7 | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/man7/rtld-audit.7 b/man7/rtld-audit.7 index b1b7dfebc..ca8afa752 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 implement 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 -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill