From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [PATCH net-next 1/3] bpf: introduce current->pid, tgid, uid, gid, comm accessors Date: Fri, 12 Jun 2015 15:08:58 -0700 Message-ID: References: <1434145226-17892-1-git-send-email-ast@plumgrid.com> <1434145226-17892-2-git-send-email-ast@plumgrid.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "David S. Miller" , Ingo Molnar , Steven Rostedt , Wang Nan , Li Zefan , Daniel Wagner , Daniel Borkmann , Linux API , Network Development , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" To: Alexei Starovoitov Return-path: In-Reply-To: <1434145226-17892-2-git-send-email-ast-uqk4Ao+rVK5Wk0Htik3J/w@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Fri, Jun 12, 2015 at 2:40 PM, Alexei Starovoitov wrote: > eBPF programs attached to kprobes need to filter based on > current->pid, uid and other fields, so introduce helper functions: > > u64 bpf_get_current_pid_tgid(void) > Return: current->tgid << 32 | current->pid > > u64 bpf_get_current_uid_gid(void) > Return: current_gid << 32 | current_uid How does this work wrt namespaces, and why the weird packing? --Andy