From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 614963896803; Wed, 2 Dec 2020 21:13:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 614963896803 From: "guillaume at morinfr dot org" To: systemtap@sourceware.org Subject: [Bug runtime/27001] New: 4.4 runtime/transport/transport.c: security_locked_down can be undeclared depending the kernel config Date: Wed, 02 Dec 2020 21:13:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: guillaume at morinfr dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2020 21:13:40 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27001 Bug ID: 27001 Summary: 4.4 runtime/transport/transport.c: security_locked_down can be undeclared depending the kernel config Product: systemtap Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: runtime Assignee: systemtap at sourceware dot org Reporter: guillaume at morinfr dot org Target Milestone: --- I am having issues running systemtap on a custom built 5.4.80 kernel: Pass 1: parsed user script and 481 library scripts using 111236virt/97444res/7328shr/90372data kb, in 150usr/10sys/140real ms.=20=20= =20=20=20=20=20=20=20=20=20 Pass 2: analyzed script: 1 probe, 35 functions, 0 embeds, 0 globals using 114764virt/102084res/8288shr/93900data kb, in 30usr/70sys/447real ms.=20=20= =20=20=20=20=20=20=20=20=20 Pass 3: translated to C into "/tmp/stapSd29oh/stap_5e4f23ab5591f24875927e0341ccd64a_7093_src.c" using 120836virt/108472res/8476shr/99972data kb, in 310usr/40sys/325real ms.=20= =20=20=20=20=20=20=20=20=20 In file included from /usr/share/systemtap/runtime/linux/print.c:17, from /usr/share/systemtap/runtime/print.c:17, from /usr/share/systemtap/runtime/runtime_context.h:22, from /tmp/stapSd29oh/stap_5e4f23ab5591f24875927e0341ccd64a_7093_src.c:282: /usr/share/systemtap/runtime/transport/transport.c: In function =E2=80=98_stp_transport_fs_init=E2=80=99: /usr/share/systemtap/runtime/transport/transport.c:121:27: error: implicit declaration of function =E2=80=98security_locked_down=E2=80=99; did you mea= n =E2=80=98get_locked_pte=E2=80=99? [-Werror=3Dimplicit-function-declaration]=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 if (!debugfs_p && security_locked_down (LOCKDOWN_DEBUGFS)) { ^~~~~~~~~~~~~~~~~~~~ get_locked_pte /usr/share/systemtap/runtime/transport/transport.c:121:49: error: =E2=80=98LOCKDOWN_DEBUGFS=E2=80=99 undeclared (first use in this function);= did you mean =E2=80=98LOGLEVEL_DEBUG=E2=80=99?=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 if (!debugfs_p && security_locked_down (LOCKDOWN_DEBUGFS)) { ^~~~~~~~~~~~~~~~ LOGLEVEL_DEBUG /usr/share/systemtap/runtime/transport/transport.c:121:49: note: each undeclared identifier is reported only once for each function it appears in= =20=20=20=20=20 cc1: all warnings being treated as errors This appears to be due a recent change: https://sourceware.org/git/?p=3Dsystemtap.git;a=3Dcommit;h=3D7615cae790c899= bc8a82841c75c8ea9c6fa54df3 security_locked_down and LOCKDOWN_DEBUGFS are declared in linux/security.h= but with my kernel config they=E2=80=99re not included because the #include is = protected by: #ifdef CONFIG_SECURITY_LOCKDOWN_LSM #include #endif CONFIG_SECURITY_LOCKDOWN_LSM does not appear in my config. However the detector code does not protect that include the same way so it builds fine and STAPCONF_LOCKDOWN_DEBUGFS gets defined. #include int foo(void) { return security_locked_down(LOCKDOWN_DEBUGFS); } The simplest fix seems to protect the include the same way in the detector. --=20 You are receiving this mail because: You are the assignee for the bug.=