[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADo0ohgNR4XGQM1BnfDgHX2v42ov-obhfQpc-vbDHZ4oABx5zA@mail.gmail.com>
Date: Mon, 17 Oct 2011 21:28:24 +1100
From: Andrew Hendry <andrew.hendry@...il.com>
To: Matthew Daley <mattjd@...il.com>
Cc: netdev@...r.kernel.org, Eric Dumazet <eric.dumazet@...il.com>,
stable <stable@...nel.org>
Subject: Re: [PATCH 3/3] x25: Prevent skb overreads when checking call user data
Acked-by: Andrew Hendry <andrew.hendry@...il.com>
On Sat, Oct 15, 2011 at 3:45 PM, Matthew Daley <mattjd@...il.com> wrote:
> x25_find_listener does not check that the amount of call user data given
> in the skb is big enough in per-socket comparisons, hence buffer
> overreads may occur. Fix this by adding a check.
>
> Signed-off-by: Matthew Daley <mattjd@...il.com>
> Cc: Eric Dumazet <eric.dumazet@...il.com>
> Cc: Andrew Hendry <andrew.hendry@...il.com>
> Cc: stable <stable@...nel.org>
> ---
> net/x25/af_x25.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
> index aa567b0..5f03e4e 100644
> --- a/net/x25/af_x25.c
> +++ b/net/x25/af_x25.c
> @@ -295,7 +295,8 @@ static struct sock *x25_find_listener(struct x25_address *addr,
> * Found a listening socket, now check the incoming
> * call user data vs this sockets call user data
> */
> - if(skb->len > 0 && x25_sk(s)->cudmatchlength > 0) {
> + if (x25_sk(s)->cudmatchlength > 0 &&
> + skb->len >= x25_sk(s)->cudmatchlength) {
> if((memcmp(x25_sk(s)->calluserdata.cuddata,
> skb->data,
> x25_sk(s)->cudmatchlength)) == 0) {
> --
> 1.7.2.5
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists