* [PATCH] trivial: net: filter: Fix typo in comment
@ 2014-06-24 13:33 Tobias Klauser
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
` (4 more replies)
0 siblings, 5 replies; 12+ messages in thread
From: Tobias Klauser @ 2014-06-24 13:33 UTC (permalink / raw)
To: David S. Miller, Daniel Borkmann, Alexei Starovoitov; +Cc: netdev
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 735fad8..243fb5d 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1382,7 +1382,7 @@ static struct sk_filter *__sk_migrate_realloc(struct sk_filter *fp,
fp_new = sock_kmalloc(sk, len, GFP_KERNEL);
if (fp_new) {
*fp_new = *fp;
- /* As we're kepping orig_prog in fp_new along,
+ /* As we're keeping orig_prog in fp_new along,
* we need to make sure we're not evicting it
* from the old fp.
*/
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] trivial: net: filter: Change kerneldoc parameter order
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
@ 2014-06-24 13:33 ` Tobias Klauser
2014-06-24 13:42 ` Daniel Borkmann
` (2 more replies)
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
` (3 subsequent siblings)
4 siblings, 3 replies; 12+ messages in thread
From: Tobias Klauser @ 2014-06-24 13:33 UTC (permalink / raw)
To: David S. Miller, Daniel Borkmann, Alexei Starovoitov; +Cc: netdev
Change the order of the parameters to sk_unattached_filter_create() in
the kerneldoc to reflect the order they appear in the actual function.
This fix is only cosmetic, in the generated doc they still appear in the
correct order without the fix.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 243fb5d..ed8d929 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1524,8 +1524,8 @@ static struct sk_filter *__sk_prepare_filter(struct sk_filter *fp,
/**
* sk_unattached_filter_create - create an unattached filter
- * @fprog: the filter program
* @pfp: the unattached filter that is created
+ * @fprog: the filter program
*
* Create a filter independent of any socket. We first run some
* sanity checks on it to make sure it does not explode on us later.
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
@ 2014-06-24 13:33 ` Tobias Klauser
2014-06-24 13:47 ` Daniel Borkmann
` (2 more replies)
2014-06-24 13:41 ` [PATCH] trivial: net: filter: Fix typo in comment Daniel Borkmann
` (2 subsequent siblings)
4 siblings, 3 replies; 12+ messages in thread
From: Tobias Klauser @ 2014-06-24 13:33 UTC (permalink / raw)
To: David S. Miller, Daniel Borkmann, Alexei Starovoitov; +Cc: netdev
Use kcalloc/kmalloc_array to make it clear we're allocating arrays. No
integer overflow can actually happen here, since len/flen is guaranteed
to be less than BPF_MAXINSNS (4096). However, this changed makes sure
we're not going to get one if BPF_MAXINSNS were ever increased.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
net/core/filter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index ed8d929..e44c1c4 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -844,7 +844,7 @@ int sk_convert_filter(struct sock_filter *prog, int len,
return -EINVAL;
if (new_prog) {
- addrs = kzalloc(len * sizeof(*addrs), GFP_KERNEL);
+ addrs = kcalloc(len, sizeof(*addrs), GFP_KERNEL);
if (!addrs)
return -ENOMEM;
}
@@ -1101,7 +1101,7 @@ static int check_load_and_stores(struct sock_filter *filter, int flen)
BUILD_BUG_ON(BPF_MEMWORDS > 16);
- masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
+ masks = kmalloc_array(flen, sizeof(*masks), GFP_KERNEL);
if (!masks)
return -ENOMEM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Fix typo in comment
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
@ 2014-06-24 13:41 ` Daniel Borkmann
2014-06-24 15:01 ` Alexei Starovoitov
2014-06-25 23:39 ` David Miller
4 siblings, 0 replies; 12+ messages in thread
From: Daniel Borkmann @ 2014-06-24 13:41 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Alexei Starovoitov, netdev
On 06/24/2014 03:33 PM, Tobias Klauser wrote:
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Change kerneldoc parameter order
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
@ 2014-06-24 13:42 ` Daniel Borkmann
2014-06-24 15:02 ` Alexei Starovoitov
2014-06-25 23:39 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: Daniel Borkmann @ 2014-06-24 13:42 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Alexei Starovoitov, netdev
On 06/24/2014 03:33 PM, Tobias Klauser wrote:
> Change the order of the parameters to sk_unattached_filter_create() in
> the kerneldoc to reflect the order they appear in the actual function.
>
> This fix is only cosmetic, in the generated doc they still appear in the
> correct order without the fix.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
@ 2014-06-24 13:47 ` Daniel Borkmann
2014-06-24 15:03 ` Alexei Starovoitov
2014-06-25 23:40 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: Daniel Borkmann @ 2014-06-24 13:47 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Alexei Starovoitov, netdev
On 06/24/2014 03:33 PM, Tobias Klauser wrote:
> Use kcalloc/kmalloc_array to make it clear we're allocating arrays. No
> integer overflow can actually happen here, since len/flen is guaranteed
> to be less than BPF_MAXINSNS (4096). However, this changed makes sure
> we're not going to get one if BPF_MAXINSNS were ever increased.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Fix typo in comment
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
` (2 preceding siblings ...)
2014-06-24 13:41 ` [PATCH] trivial: net: filter: Fix typo in comment Daniel Borkmann
@ 2014-06-24 15:01 ` Alexei Starovoitov
2014-06-25 23:39 ` David Miller
4 siblings, 0 replies; 12+ messages in thread
From: Alexei Starovoitov @ 2014-06-24 15:01 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Daniel Borkmann, Network Development
On Tue, Jun 24, 2014 at 6:33 AM, Tobias Klauser <tklauser@distanz.ch> wrote:
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Change kerneldoc parameter order
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
2014-06-24 13:42 ` Daniel Borkmann
@ 2014-06-24 15:02 ` Alexei Starovoitov
2014-06-25 23:39 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: Alexei Starovoitov @ 2014-06-24 15:02 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Daniel Borkmann, Network Development
On Tue, Jun 24, 2014 at 6:33 AM, Tobias Klauser <tklauser@distanz.ch> wrote:
> Change the order of the parameters to sk_unattached_filter_create() in
> the kerneldoc to reflect the order they appear in the actual function.
>
> This fix is only cosmetic, in the generated doc they still appear in the
> correct order without the fix.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
2014-06-24 13:47 ` Daniel Borkmann
@ 2014-06-24 15:03 ` Alexei Starovoitov
2014-06-25 23:40 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: Alexei Starovoitov @ 2014-06-24 15:03 UTC (permalink / raw)
To: Tobias Klauser; +Cc: David S. Miller, Daniel Borkmann, Network Development
On Tue, Jun 24, 2014 at 6:33 AM, Tobias Klauser <tklauser@distanz.ch> wrote:
> Use kcalloc/kmalloc_array to make it clear we're allocating arrays. No
> integer overflow can actually happen here, since len/flen is guaranteed
> to be less than BPF_MAXINSNS (4096). However, this changed makes sure
> we're not going to get one if BPF_MAXINSNS were ever increased.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
typo in the commit log '… this changeD…'
other than that:
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
> ---
> net/core/filter.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index ed8d929..e44c1c4 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -844,7 +844,7 @@ int sk_convert_filter(struct sock_filter *prog, int len,
> return -EINVAL;
>
> if (new_prog) {
> - addrs = kzalloc(len * sizeof(*addrs), GFP_KERNEL);
> + addrs = kcalloc(len, sizeof(*addrs), GFP_KERNEL);
> if (!addrs)
> return -ENOMEM;
> }
> @@ -1101,7 +1101,7 @@ static int check_load_and_stores(struct sock_filter *filter, int flen)
>
> BUILD_BUG_ON(BPF_MEMWORDS > 16);
>
> - masks = kmalloc(flen * sizeof(*masks), GFP_KERNEL);
> + masks = kmalloc_array(flen, sizeof(*masks), GFP_KERNEL);
> if (!masks)
> return -ENOMEM;
>
> --
> 1.7.9.5
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Fix typo in comment
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
` (3 preceding siblings ...)
2014-06-24 15:01 ` Alexei Starovoitov
@ 2014-06-25 23:39 ` David Miller
4 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2014-06-25 23:39 UTC (permalink / raw)
To: tklauser; +Cc: dborkman, ast, netdev
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 24 Jun 2014 15:33:20 +0200
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] trivial: net: filter: Change kerneldoc parameter order
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
2014-06-24 13:42 ` Daniel Borkmann
2014-06-24 15:02 ` Alexei Starovoitov
@ 2014-06-25 23:39 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2014-06-25 23:39 UTC (permalink / raw)
To: tklauser; +Cc: dborkman, ast, netdev
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 24 Jun 2014 15:33:21 +0200
> Change the order of the parameters to sk_unattached_filter_create() in
> the kerneldoc to reflect the order they appear in the actual function.
>
> This fix is only cosmetic, in the generated doc they still appear in the
> correct order without the fix.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
2014-06-24 13:47 ` Daniel Borkmann
2014-06-24 15:03 ` Alexei Starovoitov
@ 2014-06-25 23:40 ` David Miller
2 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2014-06-25 23:40 UTC (permalink / raw)
To: tklauser; +Cc: dborkman, ast, netdev
From: Tobias Klauser <tklauser@distanz.ch>
Date: Tue, 24 Jun 2014 15:33:22 +0200
> Use kcalloc/kmalloc_array to make it clear we're allocating arrays. No
> integer overflow can actually happen here, since len/flen is guaranteed
> to be less than BPF_MAXINSNS (4096). However, this changed makes sure
> we're not going to get one if BPF_MAXINSNS were ever increased.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Applied, thank you.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-06-25 23:40 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-24 13:33 [PATCH] trivial: net: filter: Fix typo in comment Tobias Klauser
2014-06-24 13:33 ` [PATCH] trivial: net: filter: Change kerneldoc parameter order Tobias Klauser
2014-06-24 13:42 ` Daniel Borkmann
2014-06-24 15:02 ` Alexei Starovoitov
2014-06-25 23:39 ` David Miller
2014-06-24 13:33 ` [PATCH] net: filter: Use kcalloc/kmalloc_array to allocate arrays Tobias Klauser
2014-06-24 13:47 ` Daniel Borkmann
2014-06-24 15:03 ` Alexei Starovoitov
2014-06-25 23:40 ` David Miller
2014-06-24 13:41 ` [PATCH] trivial: net: filter: Fix typo in comment Daniel Borkmann
2014-06-24 15:01 ` Alexei Starovoitov
2014-06-25 23:39 ` 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).