Re: [PATCH] pppoatm: don't send frames to destroyed vcc

From: Krzysztof Mazur
Date: Mon Oct 08 2012 - 02:23:39 EST


On Sat, Oct 06, 2012 at 05:38:04PM +0200, Krzysztof Mazur wrote:
> On Sat, Oct 06, 2012 at 02:32:50PM +0100, David Woodhouse wrote:
> > On Sat, 2012-10-06 at 14:19 +0200, Krzysztof Mazur wrote:
> > > Now pppoatm_send(), like vcc_sendmsg(), checks for vcc flags that
> > > indicate that vcc is not ready.
> >
> > And what locking prevents the flag from being set immediately after we
> > check it?
> >
>
> nothing, this patch should fix this.
>
>
> vcc = ATM_SKB(skb)->vcc;
> + bh_lock_sock(sk_atm(vcc));

After bh_lock_sock() sock_owned_by_user(sk_atm(vcc)) should be checked
here. I'm sending fixed patch.

> if (test_bit(ATM_VF_RELEASED, &vcc->flags)
> || test_bit(ATM_VF_CLOSE, &vcc->flags)

Krzysiek
--