diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-03-31 18:58:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-01 20:26:01 -0400 |
commit | 6503d96168f891ffa3b70ae6c9698a1a722025a0 (patch) | |
tree | 9fafcd9eb2c0b3feda0cf4c36e4167ba3028d83a /net/can | |
parent | a1d6f3f65512cc90a636e6ec653b7bc9e2238753 (diff) |
net: check the length of the socket address passed to connect(2)
check the length of the socket address passed to connect(2).
Check the length of the socket address passed to connect(2). If the
length is invalid, -EINVAL will be returned.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/bluetooth/l2cap.c | 3 ++-
net/bluetooth/rfcomm/sock.c | 3 ++-
net/bluetooth/sco.c | 3 ++-
net/can/bcm.c | 3 +++
net/ieee802154/af_ieee802154.c | 3 +++
net/ipv4/af_inet.c | 5 +++++
net/netlink/af_netlink.c | 3 +++
7 files changed, 20 insertions(+), 3 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/bcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/can/bcm.c b/net/can/bcm.c index e32af52238a2..629ad1debe81 100644 --- a/net/can/bcm.c +++ b/net/can/bcm.c | |||
@@ -1478,6 +1478,9 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len, | |||
1478 | struct sock *sk = sock->sk; | 1478 | struct sock *sk = sock->sk; |
1479 | struct bcm_sock *bo = bcm_sk(sk); | 1479 | struct bcm_sock *bo = bcm_sk(sk); |
1480 | 1480 | ||
1481 | if (len < sizeof(*addr)) | ||
1482 | return -EINVAL; | ||
1483 | |||
1481 | if (bo->bound) | 1484 | if (bo->bound) |
1482 | return -EISCONN; | 1485 | return -EISCONN; |
1483 | 1486 | ||