lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[11/45] ax25: Fix possible oops in ax25_make_new
    2.6.27-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Jarek Poplawski <jarkao2@gmail.com>

    commit 8c185ab6185bf5e67766edb000ce428269364c86 upstream.

    In ax25_make_new, if kmemdup of digipeat returns an error, there would
    be an oops in sk_free while calling sk_destruct, because sk_protinfo
    is NULL at the moment; move sk->sk_destruct initialization after this.

    BTW of reported-by: Bernard Pidoux F6BVP <f6bvp@free.fr>

    Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    net/ax25/af_ax25.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/ax25/af_ax25.c
    +++ b/net/ax25/af_ax25.c
    @@ -894,7 +894,6 @@ struct sock *ax25_make_new(struct sock *

    sock_init_data(NULL, sk);

    - sk->sk_destruct = ax25_free_sock;
    sk->sk_type = osk->sk_type;
    sk->sk_priority = osk->sk_priority;
    sk->sk_protocol = osk->sk_protocol;
    @@ -932,6 +931,7 @@ struct sock *ax25_make_new(struct sock *
    }

    sk->sk_protinfo = ax25;
    + sk->sk_destruct = ax25_free_sock;
    ax25->sk = sk;

    return sk;



    \
     
     \ /
      Last update: 2010-03-31 02:45    [W:4.073 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site