From: Daniel Borkmann <daniel@iogearbox.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Alexei Starovoitov <ast@kernel.org>,
Kaixu Xia <xiakaixu@huawei.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] bpf: off by one in check_map_func_compatibility()
Date: Thu, 13 Aug 2015 20:31:50 +0000 [thread overview]
Message-ID: <55CCFEB6.3080502@iogearbox.net> (raw)
In-Reply-To: <20150813202747.GA6478@mwanda>
On 08/13/2015 10:27 PM, Dan Carpenter wrote:
> The loop iterates one space too far, so we might read beyond the end of
> the func_limit[] array.
>
> Fixes: 35578d798400 ('bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for the fix, Dan!
There's however already one queued up here:
https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id\x140d8b335a9beb234fd0ed9a15aa6a47f47fd771
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 48e1c71..ed12e38 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -853,7 +853,7 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id)
> if (!map)
> return 0;
>
> - for (i = 0; i <= ARRAY_SIZE(func_limit); i++) {
> + for (i = 0; i < ARRAY_SIZE(func_limit); i++) {
> bool_map = (map->map_type = func_limit[i].map_type);
> bool_func = (func_id = func_limit[i].func_id);
> /* only when map & func pair match it can continue.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
WARNING: multiple messages have this Message-ID (diff)
From: Daniel Borkmann <daniel@iogearbox.net>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Alexei Starovoitov <ast@kernel.org>,
Kaixu Xia <xiakaixu@huawei.com>
Cc: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] bpf: off by one in check_map_func_compatibility()
Date: Thu, 13 Aug 2015 22:31:50 +0200 [thread overview]
Message-ID: <55CCFEB6.3080502@iogearbox.net> (raw)
In-Reply-To: <20150813202747.GA6478@mwanda>
On 08/13/2015 10:27 PM, Dan Carpenter wrote:
> The loop iterates one space too far, so we might read beyond the end of
> the func_limit[] array.
>
> Fixes: 35578d798400 ('bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for the fix, Dan!
There's however already one queued up here:
https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=140d8b335a9beb234fd0ed9a15aa6a47f47fd771
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 48e1c71..ed12e38 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -853,7 +853,7 @@ static int check_map_func_compatibility(struct bpf_map *map, int func_id)
> if (!map)
> return 0;
>
> - for (i = 0; i <= ARRAY_SIZE(func_limit); i++) {
> + for (i = 0; i < ARRAY_SIZE(func_limit); i++) {
> bool_map = (map->map_type == func_limit[i].map_type);
> bool_func = (func_id == func_limit[i].func_id);
> /* only when map & func pair match it can continue.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-08-13 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-13 20:27 [patch -next] bpf: off by one in check_map_func_compatibility() Dan Carpenter
2015-08-13 20:27 ` Dan Carpenter
2015-08-13 20:31 ` Daniel Borkmann [this message]
2015-08-13 20:31 ` Daniel Borkmann
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=55CCFEB6.3080502@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=ast@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xiakaixu@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.