From patchwork Tue Jan 15 13:36:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 10764477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1125191E for ; Tue, 15 Jan 2019 13:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 004EC2AC09 for ; Tue, 15 Jan 2019 13:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8ADE2AC40; Tue, 15 Jan 2019 13:36:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9566F2AC09 for ; Tue, 15 Jan 2019 13:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729714AbfAONgo (ORCPT ); Tue, 15 Jan 2019 08:36:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38914 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729264AbfAONgn (ORCPT ); Tue, 15 Jan 2019 08:36:43 -0500 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 mx1.redhat.com (Postfix) with ESMTPS id 8CB542D7F7 for ; Tue, 15 Jan 2019 13:36:43 +0000 (UTC) Received: from workstation.brq.redhat.com (unknown [10.43.12.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DAA060606; Tue, 15 Jan 2019 13:36:40 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach Subject: [PATCH] libselinux/audit2why.so: Filter out non-python related symbols Date: Tue, 15 Jan 2019 14:36:29 +0100 Message-Id: <20190115133629.21263-1-plautrba@redhat.com> In-Reply-To: <353f9889-d43c-9a14-4605-5ba1eac22284@tycho.nsa.gov> References: <353f9889-d43c-9a14-4605-5ba1eac22284@tycho.nsa.gov> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 15 Jan 2019 13:36:43 +0000 (UTC) Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP audit2why.so used to export libsepol.a symbols. We only need Python related symbols: - initaudit2why for python 2 - PyInit_audit2why for python3 Signed-off-by: Petr Lautrbach Acked-by: Stephen Smalley --- libselinux/src/Makefile | 2 +- libselinux/src/audit2why.map | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 libselinux/src/audit2why.map diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile index 8891086e..92e30738 100644 --- a/libselinux/src/Makefile +++ b/libselinux/src/Makefile @@ -165,7 +165,7 @@ $(AUDIT2WHYLOBJ): audit2why.c $(CC) $(filter-out -Werror, $(CFLAGS)) $(PYINC) -fPIC -DSHARED -c -o $@ $< $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ) $(LIBSEPOLA) - $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(LDLIBS_LIBSEPOLA) $(PYLIBS) + $(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -o $@ $^ -lselinux $(LDLIBS_LIBSEPOLA) $(PYLIBS) -Wl,-soname,audit2why.so,--version-script=audit2why.map,-z,defs %.o: %.c policy.h $(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $< diff --git a/libselinux/src/audit2why.map b/libselinux/src/audit2why.map new file mode 100644 index 00000000..65989a8d --- /dev/null +++ b/libselinux/src/audit2why.map @@ -0,0 +1,6 @@ +AUDIT2WHY_2.9 { + global: + initaudit2why; + PyInit_audit2why; + local: *; +};