mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ast@plumgrid.com
Cc: mingo@kernel.org, torvalds@linux-foundation.org,
	luto@amacapital.net, dborkman@redhat.com,
	hannes@stressinduktion.org, chema@google.com,
	edumazet@google.com, a.p.zijlstra@chello.nl, pablo@netfilter.org,
	hpa@zytor.com, akpm@linux-foundation.org, keescook@chromium.org,
	linux-api@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 net-next 03/11] bpf: add lookup/update/delete/iterate methods to BPF maps
Date: Tue, 16 Sep 2014 15:16:06 -0400 (EDT)	[thread overview]
Message-ID: <20140916.151606.448751391205382097.davem@davemloft.net> (raw)
In-Reply-To: <1410808721-27493-4-git-send-email-ast@plumgrid.com>

From: Alexei Starovoitov <ast@plumgrid.com>
Date: Mon, 15 Sep 2014 12:18:33 -0700

> @@ -83,6 +112,15 @@ union bpf_attr {
>  		__u32	value_size;	/* size of value in bytes */
>  		__u32	max_entries;	/* max number of entries in a map */
>  	};
> +
> +	struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
> +		int map_fd;
> +		void __user *key;
> +		union {
> +			void __user *value;
> +			void __user *next_key;
> +		};
> +	};
>  };
>  
>  #endif /* _UAPI__LINUX_BPF_H__ */

Depending upon the processor ABI, this change can increase the
alignment requirements of union bpf_attr.  So the structure is not
compatible between patch #1 and patch #3 here.

Also, you haven't implemented any compat layer whatsoever for the
necessary translations.  This happens because you are using pointers
which are different sized between 32-bit and 64-bit ABIs.

I would suggest you use instead something like "aligned_u64" since
these are just arbitrary userland cookies and using "aligned_u64"
vs. "u64" will make it so that you don't have to deal with the 64-bit
type alignment differences between x86-32 and x86-64 while writing the
compat wrappers (if any).

  reply	other threads:[~2014-09-16 19:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 19:18 [PATCH v12 net-next 00/11] eBPF syscall, verifier, testsuite Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 01/11] bpf: introduce BPF syscall and maps Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 02/11] bpf: enable bpf syscall on x64 and i386 Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 03/11] bpf: add lookup/update/delete/iterate methods to BPF maps Alexei Starovoitov
2014-09-16 19:16   ` David Miller [this message]
2014-09-16 20:44     ` Alexei Starovoitov
2014-09-16 20:54       ` David Miller
2014-09-16 21:23         ` Alexei Starovoitov
2014-09-16 21:49           ` David Miller
2014-09-16 22:06             ` Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 04/11] bpf: expand BPF syscall with program load/unload Alexei Starovoitov
2014-09-16 19:17   ` David Miller
2014-09-15 19:18 ` [PATCH v12 net-next 05/11] bpf: handle pseudo BPF_CALL insn Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 06/11] bpf: verifier (add docs) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 07/11] bpf: verifier (add ability to receive verification log) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 08/11] bpf: handle pseudo BPF_LD_IMM64 insn Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 09/11] bpf: verifier (add branch/goto checks) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 10/11] bpf: verifier (add verifier core) Alexei Starovoitov
2014-09-15 19:18 ` [PATCH v12 net-next 11/11] bpf: mini eBPF library, test stubs and verifier testsuite Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140916.151606.448751391205382097.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=ast@plumgrid.com \
    --cc=chema@google.com \
    --cc=dborkman@redhat.com \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®