From 376367d917442c2dad07b4052b86c6f9972ecb45 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 14 Dec 2020 08:07:06 -0800 Subject: [PATCH 1/5] uapi: merge in change to bpf.h Signed-off-by: Stephen Hemminger --- include/uapi/linux/bpf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index eb407382..21f967a2 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -3897,8 +3897,8 @@ union bpf_attr { FN(seq_printf_btf), \ FN(skb_cgroup_classid), \ FN(redirect_neigh), \ - FN(bpf_per_cpu_ptr), \ - FN(bpf_this_cpu_ptr), \ + FN(per_cpu_ptr), \ + FN(this_cpu_ptr), \ FN(redirect_peer), \ /* */ From 309e6027e5013213ff6e5f8d4898b8756efdaf3b Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Fri, 11 Dec 2020 19:26:40 +0100 Subject: [PATCH 2/5] man: tc-flower: fix manpage Commit 924c43778a84 ("man: tc-ct.8: Add manual page for ct tc action") add man page for tc-ct, but it brings with it a bogus block of text in the benning of tc-flower man page. This commit simply removes it. Fixes: 924c43778a84 ("man: tc-ct.8: Add manual page for ct tc action") Reported-by: Paolo Valerio Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- man/man8/tc-flower.8 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/man/man8/tc-flower.8 b/man/man8/tc-flower.8 index da3dd757..1a76b375 100644 --- a/man/man8/tc-flower.8 +++ b/man/man8/tc-flower.8 @@ -1,11 +1,5 @@ .TH "Flower filter in tc" 8 "22 Oct 2015" "iproute2" "Linux" - "Usage: ct clear\n" - " ct commit [force] [zone ZONE] [mark MASKED_MARK] [label MASKED_LABEL] [nat NAT_SPEC] [OFFLOAD_POLICY]\n" - " ct [nat] [zone ZONE] [OFFLOAD_POLICY]\n" - "Where: ZONE is the conntrack zone table number\n" - " NAT_SPEC is {src|dst} addr addr1[-addr2] [port port1[-port2]]\n" - " OFFLOAD_POLICY is [policy_pkts PACKETS] [policy_timeout TIMEOUT]\n" .SH NAME flower \- flow based traffic control filter .SH SYNOPSIS From ec1346acbe9e5f0fe16242fc61b85d81f84ee592 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Fri, 11 Dec 2020 19:53:02 +0100 Subject: [PATCH 3/5] devlink: fix memory leak in cmd_dev_flash() nlg_ntf is dinamically allocated in mnlg_socket_open(), and is freed on the out: return path. However, some error paths do not free it, resulting in memory leak. This commit fix this using mnlg_socket_close(), and reporting the correct error number when required. Fixes: 9b13cddfe268 ("devlink: implement flash status monitoring") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- devlink/devlink.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/devlink/devlink.c b/devlink/devlink.c index ca99732e..43549965 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3371,19 +3371,21 @@ static int cmd_dev_flash(struct dl *dl) err = _mnlg_socket_group_add(nlg_ntf, DEVLINK_GENL_MCGRP_CONFIG_NAME); if (err) - return err; + goto err_socket; err = pipe(pipe_fds); - if (err == -1) - return -errno; + if (err == -1) { + err = -errno; + goto err_socket; + } pipe_r = pipe_fds[0]; pipe_w = pipe_fds[1]; pid = fork(); if (pid == -1) { - close(pipe_r); close(pipe_w); - return -errno; + err = -errno; + goto out; } else if (!pid) { /* In child, just execute the flash and pass returned * value through pipe once it is done. @@ -3412,6 +3414,7 @@ static int cmd_dev_flash(struct dl *dl) err = _mnlg_socket_recv_run(dl->nlg, NULL, NULL); out: close(pipe_r); +err_socket: mnlg_socket_close(nlg_ntf); return err; } From 0d78e8eabf865b47f98adae7c453884bdc19c2f2 Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Fri, 11 Dec 2020 19:53:03 +0100 Subject: [PATCH 4/5] tc: pedit: fix memory leak in print_pedit keys_ex is dinamically allocated with calloc on line 770, but is not freed in case of error at line 823. Fixes: 081d6c310d3a ("tc: pedit: Support JSON dumping") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- tc/m_pedit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tc/m_pedit.c b/tc/m_pedit.c index 51dcf109..aa874408 100644 --- a/tc/m_pedit.c +++ b/tc/m_pedit.c @@ -819,8 +819,10 @@ static int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg) print_uint(PRINT_FP, NULL, "\n\t key #%d at ", i); err = print_pedit_location(f, htype, key->off); - if (err) + if (err) { + free(keys_ex); return err; + } /* In FP, report the "set" command as "val" to keep * backward compatibility. Report the true name in JSON. From c8faeca5ad788bf0ad7a427213616b353e7a7e7f Mon Sep 17 00:00:00 2001 From: Andrea Claudi Date: Wed, 18 Nov 2020 15:24:18 +0100 Subject: [PATCH 5/5] ss: mptcp: fix add_addr_accepted stat print add_addr_accepted value is not printed if add_addr_signal value is 0. Fix this properly looking for add_addr_accepted value, instead. Fixes: 9c3be2c0eee01 ("ss: mptcp: add msk diag interface support") Signed-off-by: Andrea Claudi Signed-off-by: Stephen Hemminger --- misc/ss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ss.c b/misc/ss.c index 77e1847e..0593627b 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -3136,7 +3136,7 @@ static void mptcp_stats_print(struct mptcp_info *s) out(" subflows:%d", s->mptcpi_subflows); if (s->mptcpi_add_addr_signal) out(" add_addr_signal:%d", s->mptcpi_add_addr_signal); - if (s->mptcpi_add_addr_signal) + if (s->mptcpi_add_addr_accepted) out(" add_addr_accepted:%d", s->mptcpi_add_addr_accepted); if (s->mptcpi_subflows_max) out(" subflows_max:%d", s->mptcpi_subflows_max);