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
nexedi
linux
Commits
03cc059d
Commit
03cc059d
authored
Jan 23, 2004
by
James Morris
Committed by
James Morris
Jan 23, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Guard against potentially fatal stack usage for auth_data.
parent
08506b24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
include/net/ah.h
include/net/ah.h
+3
-0
net/ipv4/ah4.c
net/ipv4/ah4.c
+3
-1
net/ipv6/ah6.c
net/ipv6/ah6.c
+3
-1
No files found.
include/net/ah.h
View file @
03cc059d
...
...
@@ -3,6 +3,9 @@
#include <net/xfrm.h>
/* This is the maximum truncated ICV length that we know of. */
#define MAX_AH_AUTH_LEN 12
struct
ah_data
{
u8
*
key
;
...
...
net/ipv4/ah4.c
View file @
03cc059d
...
...
@@ -199,7 +199,7 @@ int ah_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_buf
goto
out
;
}
{
u8
auth_data
[
ahp
->
icv_trunc_len
];
u8
auth_data
[
MAX_AH_AUTH_LEN
];
memcpy
(
auth_data
,
ah
->
auth_data
,
ahp
->
icv_trunc_len
);
skb_push
(
skb
,
skb
->
data
-
skb
->
nh
.
raw
);
...
...
@@ -285,6 +285,8 @@ static int ah_init_state(struct xfrm_state *x, void *args)
ahp
->
icv_full_len
=
aalg_desc
->
uinfo
.
auth
.
icv_fullbits
/
8
;
ahp
->
icv_trunc_len
=
aalg_desc
->
uinfo
.
auth
.
icv_truncbits
/
8
;
BUG_ON
(
ahp
->
icv_trunc_len
>
MAX_AH_AUTH_LEN
);
ahp
->
work_icv
=
kmalloc
(
ahp
->
icv_full_len
,
GFP_KERNEL
);
if
(
!
ahp
->
work_icv
)
goto
error
;
...
...
net/ipv6/ah6.c
View file @
03cc059d
...
...
@@ -315,7 +315,7 @@ int ah6_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
skb
->
nh
.
ipv6h
->
hop_limit
=
0
;
{
u8
auth_data
[
ahp
->
icv_trunc_len
];
u8
auth_data
[
MAX_AH_AUTH_LEN
];
memcpy
(
auth_data
,
ah
->
auth_data
,
ahp
->
icv_trunc_len
);
memset
(
ah
->
auth_data
,
0
,
ahp
->
icv_trunc_len
);
...
...
@@ -420,6 +420,8 @@ static int ah6_init_state(struct xfrm_state *x, void *args)
ahp
->
icv_full_len
=
aalg_desc
->
uinfo
.
auth
.
icv_fullbits
/
8
;
ahp
->
icv_trunc_len
=
aalg_desc
->
uinfo
.
auth
.
icv_truncbits
/
8
;
BUG_ON
(
ahp
->
icv_trunc_len
>
MAX_AH_AUTH_LEN
);
ahp
->
work_icv
=
kmalloc
(
ahp
->
icv_full_len
,
GFP_KERNEL
);
if
(
!
ahp
->
work_icv
)
goto
error
;
...
...
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