summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-06-07 19:21:30 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-07-21 10:39:07 -0700
commit45d65c46acc39945219eeb3752367ee80ed82799 (patch)
treedc4c6862953a519776a492924caa000516f747a2 /net
parent3cb123d1c03a0510d3c325bfaa971ce4df1e050d (diff)
downloadblackbird-obmc-linux-45d65c46acc39945219eeb3752367ee80ed82799.tar.gz
blackbird-obmc-linux-45d65c46acc39945219eeb3752367ee80ed82799.zip
Bluetooth: Check the tx_window size on setsockopt
We have to check if the proposed tx_window value is not greater that maximum value supported. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index f0441b0b0335..6094870d5d2a 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1912,6 +1912,11 @@ static int l2cap_sock_setsockopt_old(struct socket *sock, int optname, char __us
break;
}
+ if (opts.txwin_size > L2CAP_DEFAULT_TX_WINDOW) {
+ err = -EINVAL;
+ break;
+ }
+
l2cap_pi(sk)->mode = opts.mode;
switch (l2cap_pi(sk)->mode) {
case L2CAP_MODE_BASIC:
OpenPOWER on IntegriCloud