projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06dd3df
)
net: fool proof dev_valid_name()
author
Eric Dumazet
<edumazet@google.com>
Thu, 5 Apr 2018 13:39:26 +0000
(06:39 -0700)
committer
David S. Miller
<davem@davemloft.net>
Thu, 5 Apr 2018 19:16:15 +0000
(15:16 -0400)
We want to use dev_valid_name() to validate tunnel names,
so better use strnlen(name, IFNAMSIZ) than strlen(name) to make
sure to not upset KASAN.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
patch
|
blob
|
history
diff --git
a/net/core/dev.c
b/net/core/dev.c
index 9b04a9fd1dfd0e065a7fe798dd840a07f0e0a4df..969462ebb296250fe5f3b7c4621e9ba9720a2dbe 100644
(file)
--- a/
net/core/dev.c
+++ b/
net/core/dev.c
@@
-1027,7
+1027,7
@@
bool dev_valid_name(const char *name)
{
if (*name == '\0')
return false;
- if (str
len(name) >
= IFNAMSIZ)
+ if (str
nlen(name, IFNAMSIZ) =
= IFNAMSIZ)
return false;
if (!strcmp(name, ".") || !strcmp(name, ".."))
return false;