]> sourceware.org Git - systemtap.git/commitdiff
linux/runtime.h: more CONFIG_USER_NS fallout
authorFrank Ch. Eigler <fche@redhat.com>
Sat, 17 May 2014 20:15:01 +0000 (16:15 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Sat, 17 May 2014 20:18:48 +0000 (16:18 -0400)
Partially unrolling commit 7d35a948401, because on modern kernels
(3.14+), the from_k?id_munged functions are defined as inlines, and
should be used regardless of CONFIG_USER_NS etc.  The buildrun.cxx
exportedness test for from_kuid_munged would fail, triggering our
runtime to use a do-nothing macro instead.

Until a more programmatic way is found for those unidentified older
kernels that have CONFIG_USER_NS but no from_k?id_munged inlines,
for now a user will have to work around the build problem with

  % stap -DSTAP_FAKE_KID_MUNGED

runtime/linux/runtime.h

index 569794571f398e2c1b748e4cb523c9ce9a009602..cccff2dd59d6348ea88cf4fcb464caa471bdefc3 100644 (file)
@@ -97,11 +97,15 @@ static void _stp_exit(void);
 #ifdef STAPCONF_TASK_UID
 #define STP_CURRENT_EUID (current->euid)
 #else
-#if defined(CONFIG_USER_NS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
-#ifndef STAPCONF_FROM_KUID_MUNGED
+
+/* intending to catch old distros where from_k*id_munged didn't exist or weren't exported; 
+   we lack a programmatic way of catching this right now. */
+#ifdef STAP_FAKE_KID_MUNGED
 #define from_kuid_munged(user_ns, uid) ((uid))
 #define from_kgid_munged(user_ns, gid) ((gid))
-#endif /* !STAPCONF_FROM_KUID_MUNGED */
+#endif
+
+#if defined(CONFIG_USER_NS) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
 #define STP_CURRENT_EUID (from_kuid_munged(current_user_ns(), task_euid(current)))
 #else
 #define STP_CURRENT_EUID (task_euid(current))
This page took 0.03169 seconds and 5 git commands to generate.