Re: [RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-11 Thread Jakub Kicinski
On Wed, 11 Nov 2020 03:59:47 -0800 Xie He wrote: > > @@ -825,7 +825,7 @@ static int x25_connect(struct socket *sock, struct > > sockaddr *uaddr, > > sock->state = SS_CONNECTED; > > rc = 0; > > out_put_neigh: > > - if (rc) { > > + if (rc && x25->neighbour) { > > read_lock_

Re: [RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-11 Thread Xie He
> @@ -825,7 +825,7 @@ static int x25_connect(struct socket *sock, struct > sockaddr *uaddr, > sock->state = SS_CONNECTED; > rc = 0; > out_put_neigh: > - if (rc) { > + if (rc && x25->neighbour) { > read_lock_bh(&x25_list_lock); > x25_neigh_put(x25->

Re: [RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-11 Thread Xie He
> This fixes a regression for blocking connects introduced by commit > 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect"). > The x25->neighbour is already set to "NULL" by x25_disconnect() now, > while a blocking connect is waiting in > x25_wait_for_connection_establishment().

[RESEND PATCH v2] net/x25: Fix null-ptr-deref in x25_connect

2020-11-08 Thread Martin Schiller
This fixes a regression for blocking connects introduced by commit 4becb7ee5b3d ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect"). The x25->neighbour is already set to "NULL" by x25_disconnect() now, while a blocking connect is waiting in x25_wait_for_connection_establishment(). Therefore