diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2017-11-13 00:15:04 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-14 16:38:45 +0900 |
commit | 51f299dd94bb1e28d03eefbc4fe0b9282f9ee2fa (patch) | |
tree | c4caf118661ec22af9844f6cd26ee80cbcdfca26 /net/core/timestamping.c | |
parent | 951b7966959fde507e1718627b37795f40b704f4 (diff) |
net: core: improve sanity checking in __dev_alloc_name
__dev_alloc_name is called from the public (and exported)
dev_alloc_name(), so we don't have a guarantee that strlen(name) is at
most IFNAMSIZ. If somebody manages to get __dev_alloc_name called with a
% char beyond the 31st character, we'd be making a snprintf() call that
will very easily crash the kernel (using an appropriate %p extension,
we'll likely dereference some completely bogus pointer).
In the normal case where strlen() is sane, we don't even save anything
by limiting to IFNAMSIZ, so just use strchr().
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/timestamping.c')
0 files changed, 0 insertions, 0 deletions