netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next][V2] net: filter: fix the comments
@ 2014-10-10  5:56 roy.qing.li
  2014-10-10  6:01 ` Alexei Starovoitov
  2014-10-10 19:12 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: roy.qing.li @ 2014-10-10  5:56 UTC (permalink / raw)
  To: netdev; +Cc: ast, alexei.starovoitov

From: Li RongQing <roy.qing.li@gmail.com>

1. sk_run_filter has been renamed, sk_filter() is using SK_RUN_FILTER.
2. Remove wrong comments about storing intermediate value.
3. replace sk_run_filter with __bpf_prog_run for check_load_and_stores's
comments

Cc: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/core/filter.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index fcd3f67..647b122 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -51,9 +51,9 @@
  *	@skb: buffer to filter
  *
  * Run the filter code and then cut skb->data to correct size returned by
- * sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
+ * SK_RUN_FILTER. If pkt_len is 0 we toss packet. If skb->len is smaller
  * than pkt_len we keep whole skb->data. This is the socket level
- * wrapper to sk_run_filter. It returns 0 if the packet should
+ * wrapper to SK_RUN_FILTER. It returns 0 if the packet should
  * be accepted or -EPERM if the packet should be tossed.
  *
  */
@@ -566,11 +566,8 @@ err:
 
 /* Security:
  *
- * A BPF program is able to use 16 cells of memory to store intermediate
- * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter()).
- *
  * As we dont want to clear mem[] array for each packet going through
- * sk_run_filter(), we check that filter loaded by user never try to read
+ * __bpf_prog_run(), we check that filter loaded by user never try to read
  * a cell if not previously written, and we check all branches to be sure
  * a malicious user doesn't try to abuse us.
  */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next][V2] net: filter: fix the comments
  2014-10-10  5:56 [PATCH][net-next][V2] net: filter: fix the comments roy.qing.li
@ 2014-10-10  6:01 ` Alexei Starovoitov
  2014-10-10 19:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2014-10-10  6:01 UTC (permalink / raw)
  To: roy.qing.li, Daniel Borkmann; +Cc: Network Development, Alexei Starovoitov

On Thu, Oct 9, 2014 at 10:56 PM,  <roy.qing.li@gmail.com> wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
>
> 1. sk_run_filter has been renamed, sk_filter() is using SK_RUN_FILTER.
> 2. Remove wrong comments about storing intermediate value.
> 3. replace sk_run_filter with __bpf_prog_run for check_load_and_stores's
> comments
>
> Cc: Alexei Starovoitov <ast@plumgrid.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

Acked-by: Alexei Starovoitov <ast@plumgrid.com>

Thanks!

> ---
>  net/core/filter.c |    9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index fcd3f67..647b122 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -51,9 +51,9 @@
>   *     @skb: buffer to filter
>   *
>   * Run the filter code and then cut skb->data to correct size returned by
> - * sk_run_filter. If pkt_len is 0 we toss packet. If skb->len is smaller
> + * SK_RUN_FILTER. If pkt_len is 0 we toss packet. If skb->len is smaller
>   * than pkt_len we keep whole skb->data. This is the socket level
> - * wrapper to sk_run_filter. It returns 0 if the packet should
> + * wrapper to SK_RUN_FILTER. It returns 0 if the packet should
>   * be accepted or -EPERM if the packet should be tossed.
>   *
>   */
> @@ -566,11 +566,8 @@ err:
>
>  /* Security:
>   *
> - * A BPF program is able to use 16 cells of memory to store intermediate
> - * values (check u32 mem[BPF_MEMWORDS] in sk_run_filter()).
> - *
>   * As we dont want to clear mem[] array for each packet going through
> - * sk_run_filter(), we check that filter loaded by user never try to read
> + * __bpf_prog_run(), we check that filter loaded by user never try to read
>   * a cell if not previously written, and we check all branches to be sure
>   * a malicious user doesn't try to abuse us.
>   */
> --
> 1.7.10.4
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][net-next][V2] net: filter: fix the comments
  2014-10-10  5:56 [PATCH][net-next][V2] net: filter: fix the comments roy.qing.li
  2014-10-10  6:01 ` Alexei Starovoitov
@ 2014-10-10 19:12 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-10-10 19:12 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev, ast, alexei.starovoitov

From: roy.qing.li@gmail.com
Date: Fri, 10 Oct 2014 13:56:51 +0800

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> 1. sk_run_filter has been renamed, sk_filter() is using SK_RUN_FILTER.
> 2. Remove wrong comments about storing intermediate value.
> 3. replace sk_run_filter with __bpf_prog_run for check_load_and_stores's
> comments
> 
> Cc: Alexei Starovoitov <ast@plumgrid.com>
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-10 19:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-10  5:56 [PATCH][net-next][V2] net: filter: fix the comments roy.qing.li
2014-10-10  6:01 ` Alexei Starovoitov
2014-10-10 19:12 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).