From patchwork Wed Sep 23 11:38:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 40480 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B2DD384404C; Wed, 23 Sep 2020 11:38:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B2DD384404C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1600861093; bh=HsTm/HPcvCNXP4PB/uvWBSEMzv9An+Ym+octvp3ErYs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=C3kj/Cv3GOC94XrrXk6j8AA3Pz6GioVgYfjO0wZd2ICS23Jqn/n5cJuHfBJ6pn9o7 B8v5wHER1CrU6IHkKQ/cEDT21z7KgArvYn6OSobyiRe1IC/tPcXyu2AcxOjWw6PYtB O1lvMSRi5YP1SHOsgnq08e1sYa8PUnAssYsMcFDs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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) To: linux-man@vger.kernel.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 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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