Thread (89 messages) flat view 89 messages, 6 authors, 2012-12-03

Re: [PATCH v2 1/3] pppoatm: don't send frames to destroyed vcc

From: Krzysztof Mazur <hidden>
Date: 2012-10-30 20:19:42
Also in: lkml
Subsystem: atm, networking [general], ppp over atm (rfc 2364), the rest · Maintainers: Chas Williams, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Mitchell Blank Jr, Linus Torvalds

On Tue, Oct 30, 2012 at 09:35:00AM +0000, David Woodhouse wrote:
On Mon, 2012-10-22 at 19:14 +0200, Krzysztof Mazur wrote:
quoted
Now pppoatm_send(), like vcc_sendmsg(), checks for vcc flags that
indicate that vcc is not ready.
I note that vcc_sendmsg() also checks for sock->state == SS_CONNECTED.
Is that check not needed here? Otherwise, looks sane enough.

Acked-By: David Woodhouse <redacted>
I don't think so. We never leave SS_CONNECTED state. This check is
done in vcc_sendmsg() because it's called from userspace.

However maybe we should check socket state before assigning vcc to
pppoatm (untested):
diff --git a/net/atm/pppoatm.c b/net/atm/pppoatm.c
index 0dcb5dc..df06d14 100644
--- a/net/atm/pppoatm.c
+++ b/net/atm/pppoatm.c
@@ -414,6 +414,8 @@ static int pppoatm_ioctl(struct socket *sock, unsigned int cmd,
 			return -ENOIOCTLCMD;
 		if (!capable(CAP_NET_ADMIN))
 			return -EPERM;
+		if (sock->state != SS_CONNECTED)
+			return -EINVAL;
 		return pppoatm_assign_vcc(atmvcc, argp);
 		}
 	case PPPIOCGCHAN:
Thanks.

Krzysiek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help