Skip to content

Commit

Permalink
pppoatm: allow assign only on a connected socket
Browse files Browse the repository at this point in the history
The pppoatm does not check if used vcc is in connected state,
causing an Oops in pppoatm_send() when vcc->send() is called
on not fully connected socket.

Now pppoatm can be assigned only on connected sockets; otherwise
-EINVAL error is returned.

Signed-off-by: Krzysztof Mazur <[email protected]>
Cc: Chas Williams - CONTRACTOR <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
Krzysztof Mazur authored and David Woodhouse committed Nov 28, 2012
1 parent ec809bd commit 3b1a914
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/atm/pppoatm.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,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:
Expand Down

0 comments on commit 3b1a914

Please sign in to comment.