Skip to content

Commit

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

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

Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Krzysztof Mazur authored and David Woodhouse committed Dec 2, 2012
1 parent 007ef52 commit 9eba252
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/atm/br2684.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,13 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
return -ENOIOCTLCMD;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (cmd == ATM_SETBACKEND)
if (cmd == ATM_SETBACKEND) {
if (sock->state != SS_CONNECTED)
return -EINVAL;
return br2684_regvcc(atmvcc, argp);
else
} else {
return br2684_create(argp);
}
#ifdef CONFIG_ATM_BR2684_IPFILTER
case BR2684_SETFILT:
if (atmvcc->push != br2684_push)
Expand Down

0 comments on commit 9eba252

Please sign in to comment.