iproute2/include
Phil Sutter 625df645b7 Check user supplied interface name lengths
The original problem was that something like:

| strncpy(ifr.ifr_name, *argv, IFNAMSIZ);

might leave ifr.ifr_name unterminated if length of *argv exceeds
IFNAMSIZ. In order to fix this, I thought about replacing all those
cases with (equivalent) calls to snprintf() or even introducing
strlcpy(). But as Ulrich Drepper correctly pointed out when rejecting
the latter from being added to glibc, truncating a string without
notifying the user is not to be considered good practice. So let's
excercise what he suggested and reject empty, overlong or otherwise
invalid interface names right from the start - this way calls to
strncpy() like shown above become safe and the user has a chance to
reconsider what he was trying to do.

Note that this doesn't add calls to check_ifname() to all places where
user supplied interface name is parsed. In many cases, the interface
must exist already and is therefore looked up using ll_name_to_index(),
so if_nametoindex() will perform the necessary checks already.

Signed-off-by: Phil Sutter <phil@nwl.cc>
2017-10-02 08:01:21 -07:00
..
iptables Update to current iptables headers 2016-01-03 15:14:27 -08:00
libiptc Update to current iptables headers 2016-01-03 15:14:27 -08:00
linux BPF: update headers from 4.14-rc1 2017-09-20 18:00:55 -07:00
netinet ss: report ecnseen 2011-11-23 14:51:54 -08:00
rdma rdma: Add basic infrastructure for RDMA tool 2017-08-21 17:07:44 -07:00
SNAPSHOT.h v4.13.0 2017-09-05 09:39:32 -07:00
bpf_api.h lwt: BPF support for LWT 2016-12-12 15:32:54 -08:00
bpf_elf.h bpf: support loading map in map from obj 2017-07-18 17:20:45 -07:00
bpf_scm.h tc, bpf: finalize eBPF support for cls and act front-end 2015-04-10 13:31:19 -07:00
bpf_util.h bpf: consolidate dumps to use bpf_dump_prog_info 2017-09-05 09:26:34 -07:00
color.h color: add new COLOR_NONE and disable_color function 2017-08-17 18:02:40 -07:00
dlfcn.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
ip6tables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
iptables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00
json_print.h lib: json_print: rework 'new_json_obj' drop FILE* argument 2017-09-29 10:10:47 -07:00
json_writer.h json_writer: add new json handlers (null, float with format, lluint, hu) 2017-08-17 18:02:40 -07:00
libgenl.h libgenl: introduce genl_init_handle 2016-08-17 13:59:21 -07:00
libnetlink.h iproute: Add support for extended ack to rtnl_talk 2017-08-04 09:54:00 -07:00
list.h list: add list_add_tail helper 2016-04-19 08:01:05 -07:00
ll_map.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
names.h tc class: Ignore if default class name file does not exist 2015-04-07 08:31:56 -07:00
namespace.h remove unnecessary extern 2015-08-13 14:09:58 -07:00
rt_names.h make the addr argument of ll_addr_n2a const 2015-03-24 15:45:23 -07:00
rtm_map.h ip, realms: also allow to pass in raw realms value 2015-10-22 23:40:51 -07:00
utils.h Check user supplied interface name lengths 2017-10-02 08:01:21 -07:00
xt-internal.h Breakage noticed when debian upgraded to xtables (iptables > 1.4.1) 2009-02-19 09:02:13 -08:00
xtables.h Update to current iptables headers 2016-01-03 15:14:27 -08:00