lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 Oct 2014 17:07:36 -0600
From:	David Ahern <dsahern@...il.com>
To:	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...nel.org>
Subject: PERF_EVENT_IOC_SET_FILTER has different values based on bitness


32-bit perf binaries are not able to set filters on 64-bit kernels.

    $ perf record -e  net:netif_receive_skb --filter 'name == "eth1"
    Error: failed to set filter with 25 (Inappropriate ioctl for device)

The reason is that the definition of PERF_EVENT_IOC_SET_FILTER contains 
a pointer:

#define PERF_EVENT_IOC_SET_FILTER       _IOW('$', 6, char *)

the size of which of course differs for 32-bit and 64-bit. This has been 
there since the original commit (6fb2915df7f07) back in 2009.

Thoughts on how to fix this? Changing the definition of SET_FILTER 
breaks existing setups so that rules it out. What about something like this:

#define PERF_EVENT_IOC_SET_FILTER_32       _IOW('$', 6, u32)

and then

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 963bf139e2b2..c805132ac1cf 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -3714,6 +3714,7 @@ static long perf_ioctl(struct file *file, unsigned 
int cmd, unsigned long arg)
     }

     case PERF_EVENT_IOC_SET_FILTER:
+   case PERF_EVENT_IOC_SET_FILTER_32:
         return perf_event_set_filter(event, (void __user *)arg);

     default:

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists