Messages in this thread Patch in this message |  | | From | Krzysztof Mazur <> | | Subject | [PATCH v3 6/7] pppoatm: don't send frames on not-ready vcc | | Date | Tue, 6 Nov 2012 23:17:01 +0100 |
| |
Patches "atm: detach protocol before closing vcc" and "pppoatm: allow assign only on a connected socket" fixed common cases where the pppoatm_send() crashes while sending frame to not-ready vcc. However there are still some other cases where we can send frames to vcc, which is flagged as ATM_VF_CLOSE (for instance after vcc_release_async()) or it's opened but not ready yet.
Now pppoatm_send(), like vcc_sendmsg(), checks for vcc flags that indicate that vcc is not ready.
Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net> Cc: David Woodhouse <David.Woodhouse@intel.com> --- net/atm/pppoatm.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c index c4a57bc..bf5d6c9 100644 --- a/net/atm/pppoatm.c +++ b/net/atm/pppoatm.c @@ -284,6 +284,10 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb) bh_lock_sock(sk_atm(vcc)); if (sock_owned_by_user(sk_atm(vcc))) goto nospace; + if (test_bit(ATM_VF_RELEASED, &vcc->flags) + || test_bit(ATM_VF_CLOSE, &vcc->flags) + || !test_bit(ATM_VF_READY, &vcc->flags)) + goto nospace; switch (pvcc->encaps) { /* LLC encapsulation needed */ case e_llc: -- 1.8.0.233.g54991f2
|  |