mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
[NETFILTER]: SIP conntrack: fix out of bounds memory access
When checking for an @-sign in skp_epaddr_len, make sure not to run over the packet boundaries. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7da5bfbb12
commit
adcb471110
@ -292,7 +292,7 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift)
|
||||
dptr++;
|
||||
}
|
||||
|
||||
if (*dptr == '@') {
|
||||
if (dptr <= limit && *dptr == '@') {
|
||||
dptr++;
|
||||
(*shift)++;
|
||||
} else
|
||||
|
@ -312,7 +312,7 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
|
||||
dptr++;
|
||||
}
|
||||
|
||||
if (*dptr == '@') {
|
||||
if (dptr <= limit && *dptr == '@') {
|
||||
dptr++;
|
||||
(*shift)++;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user