Signed-off-by: Phil Sutter
---
lib/inet_proto.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/inet_proto.c b/lib/inet_proto.c
index ceda082b12a2e..87ed4769fc3da 100644
--- a/lib/inet_proto.c
+++ b/lib/inet_proto.c
@@ -35,8 +35,10 @@ const char *inet_proto_n2a
socket() returns -1 on error, not 0.
Signed-off-by: Phil Sutter
---
tipc/node.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tipc/node.c b/tipc/node.c
index 201fe1a4df3bd..fe085aec9b4ac 100644
--- a/tipc/node.c
+++ b/tipc/node.c
@@ -109,7 +109,8 @@ static int
The later check for 'k[0] != 0' requires a non-empty filter name,
otherwise NULL pointer dereference in 'q' might happen.
Signed-off-by: Phil Sutter
---
tc/tc_filter.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index b13fb918
Signed-off-by: Phil Sutter
---
lib/ll_map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 4e4556c9ac80b..4d06eb69f138a 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -120,11 +120,11 @@ int ll_remember_index(const struct sockaddr_nl
This series collects those patches from v1 which are clear programming
flaws.
No changes to the actual patches, just splitting into smaller series.
Phil Sutter (3):
iproute_lwtunnel: csum_mode value checking was ineffective
iproute_lwtunnel: Argument to strerror must be positive
tipc/node
This series collects patches from v1 which resolve situations where
garbage might be read, either due to missing initialization of
variables or accessing data which went out of scope.
No changes to the actual patches, just splitting into smaller series.
Phil Sutter (7):
ipaddress: Make buffer
Apart from trying to close(-1), this also leaked memory.
Signed-off-by: Phil Sutter
---
ip/ipvrf.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 0094cf8557cd7..e6fad32abd956 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -372,12 +372,12
If no address was given, ipaddr_modify() accesses uninitialized data
when assigning to req.ifa.ifa_prefixlen.
Signed-off-by: Phil Sutter
---
ip/ipaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 3c9decb51b412..9307c9416dde3
rs, bash prints "integer expression expected"
instead of "too many arguments".
- Use -print0/-0 when piping from find to xargs to allow for filenames
which contain whitespace.
- Quote arguments to 'eval' to prevent word-splitting.
Signed-off-by: Ph
This variable is initialized at declaration and nowhere else does any
assignment to it happen, so just drop the check.
Signed-off-by: Phil Sutter
---
ip/ipntable.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ip/ipntable.c b/ip/ipntable.c
index 7be1f04d33d90..30907146e85a3 100644
--- a
from upstream.
No changes to the actual patches, just splitting into smaller series.
Phil Sutter (7):
ipntable: Make sure filter.name is NULL-terminated
xfrm_state: Make sure alg_name is NULL-terminated
lib/fs: Fix format string in find_fs_mount()
lib/inet_proto: Make sure destination buffers are
ent
happens anywhere, all remaining checks for 'ok != 0' can be dropped.
Signed-off-by: Phil Sutter
---
tc/m_gact.c | 14 +++---
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 1a2583372c34e..df143c9e0953e 100644
--- a/tc/m_gact
The buffer is accessed outside of the function defining it, so make it
static.
Signed-off-by: Phil Sutter
---
ip/ipaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 4d37c5e045071..3c9decb51b412 100644
--- a/ip/ipaddress.c
+++ b
The passed 'addr' parameter is dereferenced by caller before and in
parse_hostcond() multiple times before this check, so assume it is
always true.
Signed-off-by: Phil Sutter
---
misc/ss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/
A field width of 4096 allows fscanf() to store that amount of characters
into the given buffer, though that doesn't include the terminating NULL
byte. Decrease the value by one to leave space for it.
Signed-off-by: Phil Sutter
---
lib/fs.c | 2 +-
1 file changed, 1 insertion(+), 1 del
multiq_parse_opt() doesn't change 'opt' at all. So at least make sure
it doesn't fill TCA_OPTIONS attribute with garbage from stack.
Signed-off-by: Phil Sutter
---
tc/q_multiq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
Signed-off-by: Phil Sutter
---
ip/ipntable.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/ipntable.c b/ip/ipntable.c
index 879626ee4f491..7be1f04d33d90 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -633,7 +633,8 @@ static int ipntable_show(int argc, char **argv
Signed-off-by: Phil Sutter
---
misc/ss.c | 32
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index d767b1103ea81..07eecfa7a36db 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2687,41 +2687,44 @@ static int tcp_show_netlink_file
Signed-off-by: Phil Sutter
---
ip/iproute_lwtunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 398ab5e077ed8..1a3dc4d4c0ed9 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -643,7 +643,7 @@ static int
dl_argv_handle_both() will either assign to handle_bit or error out in
which case the variable is not used by the caller.
Signed-off-by: Phil Sutter
---
devlink/devlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index
Signed-off-by: Phil Sutter
---
tipc/bearer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tipc/bearer.c b/tipc/bearer.c
index 810344f672af1..c3d4491f8f6ef 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -163,6 +163,7 @@ static int nl_add_udp_enable_opts(struct nlmsghdr *nlh,
struct
Assuming 'opt' might be NULL, move the call to RTA_PAYLOAD to after the
check since it dereferences its parameter.
Signed-off-by: Phil Sutter
---
tc/q_netem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 0975ae111de97..7e3
Signed-off-by: Phil Sutter
---
misc/ifstat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/misc/ifstat.c b/misc/ifstat.c
index a853ee6d7e3b3..8fa354265a9a1 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -143,8 +143,10 @@ static int get_nlmsg_extended(const struct
Fixes: 2d0e538f3e1cd ("ss: Drop list traversal from unix_stats_print()")
Signed-off-by: Phil Sutter
---
misc/ss.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index 07eecfa7a36db..34c6da5443642 100644
--- a/misc/ss.c
+++ b/misc/ss.c
Covscan complained about dead code but after reading it, I assume the
author's intention was to prefix the interface list with 'Oifs: '.
Initializing first to 1 and setting it to 0 after above prefix was
printed should fix it.
Signed-off-by: Phil Sutter
---
ip/iproute.c | 8 +
Signed-off-by: Phil Sutter
---
tipc/bearer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tipc/bearer.c b/tipc/bearer.c
index c3d4491f8f6ef..0598328ab1f1b 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -438,8 +438,8 @@ static int cmd_bearer_enable(struct nlmsghdr
alue of 16
to strncpy() would overwrite the previously NULL'ed 'k[15]'. Also, the
sanitization has to happen if 'tname' is exactly 16 bytes long as
well.
Signed-off-by: Phil Sutter
---
tc/m_xt.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
Signed-off-by: Phil Sutter
---
tc/em_ipset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
index fab975f5ea563..b59756515d239 100644
--- a/tc/em_ipset.c
+++ b/tc/em_ipset.c
@@ -84,6 +84,7 @@ static int get_version(unsigned int *version)
res
This has the additional benefit of initializing st.ino to zero which is
used later in is_sctp_assoc() function.
Signed-off-by: Phil Sutter
---
misc/ss.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index b2a7f069e294c..d767b1103ea81
After '*b = *a', 'b->next' already has the same value as 'a->next'.
Signed-off-by: Phil Sutter
---
misc/ss.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index 2debccce5260b..b2a7f069e294c 100644
--- a/misc/ss.c
+++ b/misc/s
Prevent passing NULL FILE pointer to fgets() later.
Fix both tools in a single patch since the code changes are basically
identical.
Signed-off-by: Phil Sutter
---
misc/ifstat.c | 16 +++-
misc/nstat.c | 16 +++-
2 files changed, 22 insertions(+), 10 deletions(-)
diff
This series collects patches from v1 which deal with potential file
descriptor leaks.
No changes to the actual patches, just splitting into smaller series.
Phil Sutter (2):
ss: Don't leak fd in tcp_show_netlink_file()
tc/em_ipset: Don't leak sockfd on error path
misc/ss.
Otherwise info.st_size may contain garbage.
Signed-off-by: Phil Sutter
---
netem/maketable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/netem/maketable.c b/netem/maketable.c
index 6aff927be7040..ad660e7d457f0 100644
--- a/netem/maketable.c
+++ b/netem/maketable.c
On Tue, Aug 15, 2017 at 09:09:45AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:05:09 +0200
> Phil Sutter wrote:
>
> > +void assert_valid_dev_name(const char *, const char *);
>
> Not a fan of long function names.
> “I have only made this letter longer be
On Tue, Aug 15, 2017 at 08:15:55AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:04:40 +0200
> Phil Sutter wrote:
>
> > Both addattr_l() and rta_addattr_l() may be called with NULL data
> > pointer and 0 alen parameters. Avoid calling memcpy() in that case.
&
On Tue, Aug 15, 2017 at 08:10:49AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:04:24 +0200
> Phil Sutter wrote:
>
> > can_state_names array contains at most CAN_STATE_MAX fields, so allowing
> > an index to it to be equal to that number is wrong. While here, a
On Tue, Aug 15, 2017 at 08:13:08AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:04:22 +0200
> Phil Sutter wrote:
>
> > The buffer is accessed outside of the function defining it, so make it
> > static.
> >
> > Signed-off-by: Phil Sutter
>
> W
On Tue, Aug 15, 2017 at 08:07:25AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:04:19 +0200
> Phil Sutter wrote:
>
> > Covscan really wasn't amused (indicated by the number of patches in this
> > series). Try to make it happy.
> >
> > Phil Su
On Mon, Aug 14, 2017 at 11:17:39AM +0200, Daniel Borkmann wrote:
> On 08/12/2017 02:05 PM, Phil Sutter wrote:
> > This is merely to silence the compiler warning. If write to stderr
> > failed, assume that printing an error message will fail as well so don't
> > even
Signed-off-by: Phil Sutter
---
lib/ll_map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ll_map.c b/lib/ll_map.c
index 4e4556c9ac80b..4d06eb69f138a 100644
--- a/lib/ll_map.c
+++ b/lib/ll_map.c
@@ -120,11 +120,11 @@ int ll_remember_index(const struct sockaddr_nl
This shouldn't happen but relying upon external data without checking
may lead to unexpected results.
Signed-off-by: Phil Sutter
---
misc/ss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index d767b1103ea81..4d2f75b571ea6 100644
--- a/misc
dl_argv_handle_both() will either assign to handle_bit or error out in
which case the variable is not used by the caller.
Signed-off-by: Phil Sutter
---
devlink/devlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index
Prevent passing NULL FILE pointer to fgets() later.
Fix both tools in a single patch since the code changes are basically
identical.
Signed-off-by: Phil Sutter
---
misc/ifstat.c | 16 +++-
misc/nstat.c | 16 +++-
2 files changed, 22 insertions(+), 10 deletions(-)
diff
ila_csum_name2mode() returning -1 on error but being declared as
returning __u8 doesn't make much sense. Change the code to correctly
detect this issue. Checking for __u8 overruns shouldn't be necessary
though since ila_csum_name2mode() return values are well-defined.
Signed-off-by: P
Signed-off-by: Phil Sutter
---
tipc/bearer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tipc/bearer.c b/tipc/bearer.c
index 810344f672af1..c3d4491f8f6ef 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -163,6 +163,7 @@ static int nl_add_udp_enable_opts(struct nlmsghdr *nlh,
struct
socket() returns -1 on error, not 0.
Signed-off-by: Phil Sutter
---
tipc/node.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tipc/node.c b/tipc/node.c
index 201fe1a4df3bd..fe085aec9b4ac 100644
--- a/tipc/node.c
+++ b/tipc/node.c
@@ -109,7 +109,8 @@ static int
The later check for 'k[0] != 0' requires a non-empty filter name,
otherwise NULL pointer dereference in 'q' might happen.
Signed-off-by: Phil Sutter
---
tc/tc_filter.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tc/tc_filter.c b/tc/tc_filter.c
index b13fb918
Apart from trying to close(-1), this also leaked memory.
Signed-off-by: Phil Sutter
---
ip/ipvrf.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 92e2db98ca7d7..75cc026d072b8 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -373,12 +373,12
Signed-off-by: Phil Sutter
---
ip/iplink_vrf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ip/iplink_vrf.c b/ip/iplink_vrf.c
index 917630e853375..809eda5de8f6e 100644
--- a/ip/iplink_vrf.c
+++ b/ip/iplink_vrf.c
@@ -131,7 +131,10 @@ __u32 ipvrf_get_table(const char
Looks like this can only happen if /proc/net/igmp is malformed, but
better be sure.
Signed-off-by: Phil Sutter
---
ip/ipmaddr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipmaddr.c b/ip/ipmaddr.c
index 4f726fdd976f1..85a69e779563d 100644
--- a/ip/ipmaddr.c
+++ b/ip
Assuming 'opt' might be NULL, move the call to RTA_PAYLOAD to after the
check since it dereferences its parameter.
Signed-off-by: Phil Sutter
---
tc/q_netem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tc/q_netem.c b/tc/q_netem.c
index 0975ae111de97..7e3
If fopen() succeeded but len != PATH_MAX, the function leaks the open
FILE pointer. Fix this by checking len value before calling fopen().
Signed-off-by: Phil Sutter
---
lib/bpf.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/bpf.c b/lib/bpf.c
index 4f52ad4a8f023
Signed-off-by: Phil Sutter
---
netem/maketable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/netem/maketable.c b/netem/maketable.c
index ad660e7d457f0..ccb8f0c68b062 100644
--- a/netem/maketable.c
+++ b/netem/maketable.c
@@ -38,8 +38,8 @@ readdoubles(FILE *fp, int
A field width of 4096 allows fscanf() to store that amount of characters
into the given buffer, though that doesn't include the terminating NULL
byte. Decrease the value by one to leave space for it.
Signed-off-by: Phil Sutter
---
lib/fs.c | 2 +-
1 file changed, 1 insertion(+), 1 del
Calling stat() before mkdir() is racey: The entry might change in
between. Also, the call to stat() seems to exist only to check if the
directory exists already. So simply call mkdir() unconditionally and
catch only errors other than EEXIST.
Signed-off-by: Phil Sutter
---
lib/fs.c | 20
Signed-off-by: Phil Sutter
---
ip/xfrm_state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index e11c93bf1c3b5..7c0389038986e 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -125,7 +125,8 @@ static int xfrm_algo_parse(struct
Signed-off-by: Phil Sutter
---
ip/ipvrf.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 0094cf8557cd7..92e2db98ca7d7 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -268,7 +268,7 @@ static int vrf_configure_cgroup(const char *path, int
therefore being looked up using
ll_name_to_index(), so if_nametoindex() will perform the necessary
checks already.
Signed-off-by: Phil Sutter
---
include/utils.h | 1 +
ip/ip6tunnel.c | 6 --
ip/ipl2tp.c | 1 +
ip/iplink.c | 27 ---
ip/ipmaddr.c| 1 +
i
This variable is initialized at declaration and nowhere else does any
assignment to it happen, so just drop the check.
Signed-off-by: Phil Sutter
---
ip/ipntable.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/ip/ipntable.c b/ip/ipntable.c
index 879626ee4f491..1837909fa42e7 100644
--- a
If no address was given, ipaddr_modify() accesses uninitialized data
when assigning to req.ifa.ifa_prefixlen.
Signed-off-by: Phil Sutter
---
ip/ipaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 3c9decb51b412..9307c9416dde3
Signed-off-by: Phil Sutter
---
misc/ss.c | 32
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index 4d2f75b571ea6..cda5e3b6a2d6f 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -2687,41 +2687,44 @@ static int tcp_show_netlink_file
Signed-off-by: Phil Sutter
---
misc/ss.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index cda5e3b6a2d6f..667b8faad6528 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3150,7 +3150,8 @@ static int unix_show(struct filter *f)
if (flags
Introduce a wrapper which does the sanity checking and returns NULL
in case fd is invalid.
Signed-off-by: Phil Sutter
---
misc/nstat.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/misc/nstat.c b/misc/nstat.c
index 23e1569d7872b..c1e7ddec271e2 100644
--- a
The passed 'addr' parameter is dereferenced by caller before and in
parse_hostcond() multiple times before this check, so assume it is
always true.
Signed-off-by: Phil Sutter
---
misc/ss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/
multiq_parse_opt() doesn't change 'opt' at all. So at least make sure
it doesn't fill TCA_OPTIONS attribute with garbage from stack.
Signed-off-by: Phil Sutter
---
tc/q_multiq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/q_multiq.c b/tc/q_multiq.c
alue of 16
to strncpy() would overwrite the previously NULL'ed 'k[15]'. Also, the
sanitization has to happen if 'tname' is exactly 16 bytes long as
well.
Signed-off-by: Phil Sutter
---
tc/m_xt.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
ent
happens anywhere, all remaining checks for 'ok != 0' can be dropped.
Signed-off-by: Phil Sutter
---
tc/m_gact.c | 14 +++---
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/tc/m_gact.c b/tc/m_gact.c
index 1a2583372c34e..df143c9e0953e 100644
--- a/tc/m_gact
The buffer is accessed outside of the function defining it, so make it
static.
Signed-off-by: Phil Sutter
---
ip/ipaddress.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 4d37c5e045071..3c9decb51b412 100644
--- a/ip/ipaddress.c
+++ b
Signed-off-by: Phil Sutter
---
tipc/bearer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tipc/bearer.c b/tipc/bearer.c
index c3d4491f8f6ef..0598328ab1f1b 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -438,8 +438,8 @@ static int cmd_bearer_enable(struct nlmsghdr
Covscan really wasn't amused (indicated by the number of patches in this
series). Try to make it happy.
Phil Sutter (51):
devlink: Check return code of strslashrsplit()
devlink: No need for this self-assignment
ipaddress: Make buffer for filter.flushb static
ipaddress: Avoid acce
Signed-off-by: Phil Sutter
---
lib/inet_proto.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/inet_proto.c b/lib/inet_proto.c
index ceda082b12a2e..87ed4769fc3da 100644
--- a/lib/inet_proto.c
+++ b/lib/inet_proto.c
@@ -35,8 +35,10 @@ const char *inet_proto_n2a
Otherwise info.st_size may contain garbage.
Signed-off-by: Phil Sutter
---
netem/maketable.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/netem/maketable.c b/netem/maketable.c
index 6aff927be7040..ad660e7d457f0 100644
--- a/netem/maketable.c
+++ b/netem/maketable.c
Signed-off-by: Phil Sutter
---
misc/ifstat.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/misc/ifstat.c b/misc/ifstat.c
index a853ee6d7e3b3..8fa354265a9a1 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -143,8 +143,10 @@ static int get_nlmsg_extended(const struct
rs, bash prints "integer expression expected"
instead of "too many arguments".
- Use -print0/-0 when piping from find to xargs to allow for filenames
which contain whitespace.
- Quote arguments to 'eval' to prevent word-splitting.
Signed-off-by: Ph
Signed-off-by: Phil Sutter
---
ip/ipntable.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ip/ipntable.c b/ip/ipntable.c
index 1837909fa42e7..30907146e85a3 100644
--- a/ip/ipntable.c
+++ b/ip/ipntable.c
@@ -631,7 +631,8 @@ static int ipntable_show(int argc, char **argv
Signed-off-by: Phil Sutter
---
ip/iproute.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 89caac124f489..5fe8a3a75d5b7 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1495,7 +1495,8 @@ static int iproute_list_flush_or_save(int argc
can_state_names array contains at most CAN_STATE_MAX fields, so allowing
an index to it to be equal to that number is wrong. While here, also
make sure the array is indeed that big so nothing bad happens if
CAN_STATE_MAX ever increases.
Signed-off-by: Phil Sutter
---
ip/iplink_can.c | 4 ++--
1
This prevents word-splitting and therefore leads to more accurate error
message in case 'grep -c' prints something other than a number.
Signed-off-by: Phil Sutter
---
ip/ifcfg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/ifcfg b/ip/ifcfg
index 083
Covscan complained about dead code but after reading it, I assume the
author's intention was to prefix the interface list with 'Oifs: '.
Initializing first to 1 and setting it to 0 after above prefix was
printed should fix it.
Signed-off-by: Phil Sutter
---
ip/iproute.c | 8 +
Signed-off-by: Phil Sutter
---
ip/iproute_lwtunnel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c
index 398ab5e077ed8..1a3dc4d4c0ed9 100644
--- a/ip/iproute_lwtunnel.c
+++ b/ip/iproute_lwtunnel.c
@@ -643,7 +643,7 @@ static int
This function shouldn't fail because all callers of
__dl_argv_handle_port() make sure the passed string contains enough
slashes already, but better make sure if this changes in future the
function won't access uninitialized data.
Signed-off-by: Phil Sutter
---
devlink/devl
Signed-off-by: Phil Sutter
---
tc/em_ipset.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tc/em_ipset.c b/tc/em_ipset.c
index fab975f5ea563..b59756515d239 100644
--- a/tc/em_ipset.c
+++ b/tc/em_ipset.c
@@ -84,6 +84,7 @@ static int get_version(unsigned int *version)
res
Relying upon callers and using unsafe strcpy() is probably not the best
idea. Aside from that, using snprintf() allows to format the string for
lf->path in one go.
Signed-off-by: Phil Sutter
---
misc/lnstat_util.c | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/m
If the string at 'p' contains neither space not newline, 'p' will become
NULL. Make sure this isn't the case before dereferencing it.
Signed-off-by: Phil Sutter
---
misc/nstat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/nstat.c b/misc/ns
Looks like this was forgotten when converting to common json output
formatter.
Fixes: fcc16c2287bf8 ("provide common json output formatter")
Signed-off-by: Phil Sutter
---
misc/ifstat.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/misc/ifstat.c b/mis
After '*b = *a', 'b->next' already has the same value as 'a->next'.
Signed-off-by: Phil Sutter
---
misc/ss.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index 5ea388fbf1c1a..d767b1103ea81 100644
--- a/misc/ss.c
+++ b/misc/s
Fixes: 2d0e538f3e1cd ("ss: Drop list traversal from unix_stats_print()")
Signed-off-by: Phil Sutter
---
misc/ss.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/misc/ss.c b/misc/ss.c
index 667b8faad6528..7d84b83c8ad71 100644
--- a/misc/ss.c
+++ b/misc/ss.c
This is merely to silence the compiler warning. If write to stderr
failed, assume that printing an error message will fail as well so don't
even try.
Signed-off-by: Phil Sutter
---
lib/bpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/bpf.c b/lib/bpf.c
This has the additional benefit of initializing st.ino to zero which is
used later in is_sctp_assoc() function.
Signed-off-by: Phil Sutter
---
misc/ss.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index f0d1c22f75cff..b4f89c85c2d52
Both addattr_l() and rta_addattr_l() may be called with NULL data
pointer and 0 alen parameters. Avoid calling memcpy() in that case.
Signed-off-by: Phil Sutter
---
lib/libnetlink.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
Since 'id' is 32bit unsigned, it can never exceed RT_TABLE_MAX (which is
defined to 0x). Therefore drop that never matching conditional.
Signed-off-by: Phil Sutter
---
lib/rt_names.c | 4
1 file changed, 4 deletions(-)
diff --git a/lib/rt_names.c b/lib/rt_nam
- CONTROL has to come last, otherwise 'index' applies to gact and not
simple itself.
- Man page wasn't updated to reflect syntax changes.
Signed-off-by: Phil Sutter
---
man/man8/tc-simple.8 | 29 ++---
tc/m_simple.c| 4 ++--
2 files changed
random content on a second line, like
e.g.:
| 4,40 0 0 12,21 0 1 2048,6 0 0 262144,6 0 0 0
| foobar
Cc: Daniel Borkmann
Signed-off-by: Phil Sutter
---
lib/bpf.c | 32
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/lib/bpf.c b/lib/bpf.c
index
olution in userspace for this dilemma as far as I
can tell, so try to detect whether a user might have run into this and
notify that the given error message might be irrelevant.
Signed-off-by: Phil Sutter
---
ip/iplink.c | 35 ++-
1 file changed, 34 insertions(+),
quot;.
Reported-by: Jaroslav Aster
Fixes: 334af76143368 ("fix get_addr() and get_prefix() error messages")
Signed-off-by: Phil Sutter
---
lib/utils.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lib/utils.c b/lib/utils.c
index 9aa3219c5547d..9143ed2284
On Tue, Aug 01, 2017 at 12:05:13PM +0200, Florian Lehner wrote:
[...]
> @@ -114,9 +114,13 @@ int addr64_n2a(__u64 addr, char *buff, size_t len);
> int af_bit_len(int af);
> int af_byte_len(int af);
>
> -const char *format_host_r(int af, int len, const void *addr,
> -c
On Mon, Jul 31, 2017 at 09:50:04PM +0200, Florian Lehner wrote:
> This updated patch adds support for RFC2732 IPv6 address format with
> brackets for the tool ss. Resolved hostnames will not be enclosed in
> brackets, therefore the global variable resolve_hosts is initialized and
> checked.
>
> Si
On Mon, Jul 31, 2017 at 09:27:55AM -0700, Stephen Hemminger wrote:
> On Mon, 31 Jul 2017 12:30:10 +0200
> Phil Sutter wrote:
>
> > On Sat, Jul 29, 2017 at 02:29:10PM +0200, Florian Lehner wrote:
> > > This patch adds support for RFC2732 IPv6 address format with brackets
&
On Sat, Jul 29, 2017 at 02:29:10PM +0200, Florian Lehner wrote:
> This patch adds support for RFC2732 IPv6 address format with brackets
> for the tool ss. So output for ss changes from
> 2a00:1450:400a:804::200e:443 to [2a00:1450:400a:804::200e]:443 for IPv6
> addresses with attached port number.
>
56e3eb4c3400 ("ip: route: fix multicast route dumps")
> Signed-off-by: Hangbin Liu
Acked-by: Phil Sutter
301 - 400 of 1099 matches
Mail list logo