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 linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <CAE40pdf0pNYyazjpdkzxNJi7iC4LOOr_XEu078OUqP_uoCXnHg@mail.gmail.com> Date: Thu, 14 Aug 2014 14:20:05 -0700 From: Brendan Gregg <brendan.d.gregg@...il.com> To: Alexei Starovoitov <ast@...mgrid.com> Cc: "David S. Miller" <davem@...emloft.net>, Ingo Molnar <mingo@...nel.org>, Linus Torvalds <torvalds@...ux-foundation.org>, Andy Lutomirski <luto@...capital.net>, Steven Rostedt <rostedt@...dmis.org>, Daniel Borkmann <dborkman@...hat.com>, Chema Gonzalez <chema@...gle.com>, Eric Dumazet <edumazet@...gle.com>, Peter Zijlstra <a.p.zijlstra@...llo.nl>, "H. Peter Anvin" <hpa@...or.com>, Andrew Morton <akpm@...ux-foundation.org>, Kees Cook <keescook@...omium.org>, linux-api@...r.kernel.org, netdev@...r.kernel.org, LKML <linux-kernel@...r.kernel.org> Subject: Re: [PATCH RFC v4 net-next 17/26] tracing: allow eBPF programs to be attached to events On Wed, Aug 13, 2014 at 12:57 AM, Alexei Starovoitov <ast@...mgrid.com> wrote: [...] > +/* For tracing filters save first six arguments of tracepoint events. > + * On 64-bit architectures argN fields will match one to one to arguments passed > + * to tracepoint events. > + * On 32-bit architectures u64 arguments to events will be seen into two > + * consecutive argN, argN+1 fields. Pointers, u32, u16, u8, bool types will > + * match one to one > + */ > +struct bpf_context { > + unsigned long arg1; > + unsigned long arg2; > + unsigned long arg3; > + unsigned long arg4; > + unsigned long arg5; > + unsigned long arg6; > + unsigned long ret; > +}; While this works, the argN+1 shift for 32-bit is a gotcha to learn. Lets say arg1 was 64-bit, and my program only examined arg2. I'd need two programs, one for 64-bit (using arg2) and 32-bit (arg3). If there was a way not to shift arguments, I could have one program for both. Eg, additional arg1hi, arg2hi, ... for the higher order u32s. Brendan -- 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