Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
318ce727
Commit
318ce727
authored
May 09, 2003
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bluetooth] Detect and log error condition when first L2CAP fragment is too long.
parent
cb75e1ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+10
-4
No files found.
net/bluetooth/l2cap.c
View file @
318ce727
...
...
@@ -1940,21 +1940,27 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
}
if
(
skb
->
len
<
2
)
{
BT_ERR
(
"Frame is too s
mall
(len %d)"
,
skb
->
len
);
BT_ERR
(
"Frame is too s
hort
(len %d)"
,
skb
->
len
);
goto
drop
;
}
hdr
=
(
struct
l2cap_hdr
*
)
skb
->
data
;
len
=
__le16_to_cpu
(
hdr
->
len
)
+
L2CAP_HDR_SIZE
;
BT_DBG
(
"Start: total len %d, frag len %d"
,
len
,
skb
->
len
);
if
(
len
==
skb
->
len
)
{
/* Complete frame received */
l2cap_recv_frame
(
conn
,
skb
);
return
0
;
}
BT_DBG
(
"Start: total len %d, frag len %d"
,
len
,
skb
->
len
);
if
(
skb
->
len
>
len
)
{
BT_ERR
(
"Frame is too long (len %d, expected len %d)"
,
skb
->
len
,
len
);
goto
drop
;
}
/* Allocate skb for the complete frame (with header) */
if
(
!
(
conn
->
rx_skb
=
bt_skb_alloc
(
len
,
GFP_ATOMIC
)))
goto
drop
;
...
...
@@ -1970,7 +1976,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
}
if
(
skb
->
len
>
conn
->
rx_len
)
{
BT_ERR
(
"Fragment is too l
arge (len %d, expect
%d)"
,
BT_ERR
(
"Fragment is too l
ong (len %d, expected
%d)"
,
skb
->
len
,
conn
->
rx_len
);
kfree_skb
(
conn
->
rx_skb
);
conn
->
rx_skb
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment