Skip to content

Commit 9eba252

Browse files
Krzysztof MazurDavid Woodhouse
authored andcommitted
br2684: allow assign only on a connected socket
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 <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
1 parent 007ef52 commit 9eba252

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/atm/br2684.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,10 +735,13 @@ static int br2684_ioctl(struct socket *sock, unsigned int cmd,
735735
return -ENOIOCTLCMD;
736736
if (!capable(CAP_NET_ADMIN))
737737
return -EPERM;
738-
if (cmd == ATM_SETBACKEND)
738+
if (cmd == ATM_SETBACKEND) {
739+
if (sock->state != SS_CONNECTED)
740+
return -EINVAL;
739741
return br2684_regvcc(atmvcc, argp);
740-
else
742+
} else {
741743
return br2684_create(argp);
744+
}
742745
#ifdef CONFIG_ATM_BR2684_IPFILTER
743746
case BR2684_SETFILT:
744747
if (atmvcc->push != br2684_push)

0 commit comments

Comments
 (0)