From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Hoang Le <hoang.h.le@dektech.com.au>,
Ying Xue <ying.xue@windriver.com>, Jon Maloy <maloy@donjonn.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net
Subject: [PATCH AUTOSEL 4.14 110/127] tipc: fix skb may be leaky in tipc_link_input
Date: Fri, 22 Nov 2019 00:55:28 -0500 [thread overview]
Message-ID: <20191122055544.3299-109-sashal@kernel.org> (raw)
In-Reply-To: <20191122055544.3299-1-sashal@kernel.org>
From: Hoang Le <hoang.h.le@dektech.com.au>
[ Upstream commit 7384b538d3aed2ed49d3575483d17aeee790fb06 ]
When we free skb at tipc_data_input, we return a 'false' boolean.
Then, skb passed to subcalling tipc_link_input in tipc_link_rcv,
<snip>
1303 int tipc_link_rcv:
...
1354 if (!tipc_data_input(l, skb, l->inputq))
1355 rc |= tipc_link_input(l, skb, l->inputq);
</snip>
Fix it by simple changing to a 'true' boolean when skb is being free-ed.
Then, tipc_link_rcv will bypassed to subcalling tipc_link_input as above
condition.
Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <maloy@donjonn.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tipc/link.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 631bfc7e9127e..da749916faac4 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1073,7 +1073,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb,
default:
pr_warn("Dropping received illegal msg type\n");
kfree_skb(skb);
- return false;
+ return true;
};
}
--
2.20.1
next prev parent reply other threads:[~2019-11-22 5:59 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191122055544.3299-1-sashal@kernel.org>
2019-11-22 5:53 ` [PATCH AUTOSEL 4.14 017/127] mwifiex: fix potential NULL dereference and use after free Sasha Levin
2019-11-22 5:53 ` [PATCH AUTOSEL 4.14 018/127] mwifiex: debugfs: correct histogram spacing, formatting Sasha Levin
2019-11-22 5:53 ` [PATCH AUTOSEL 4.14 019/127] rtl818x: fix potential use after free Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 025/127] iwlwifi: move iwl_nvm_check_version() into dvm Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 028/127] VSOCK: bind to random port for VMADDR_PORT_ANY Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 038/127] net/mlx5: Continue driver initialization despite debugfs failure Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 040/127] bnxt_en: Return linux standard errors in bnxt_ethtool.c Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 041/127] bnxt_en: query force speeds before disabling autoneg mode Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 052/127] vxlan: Fix error path in __vxlan_dev_create() Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 062/127] ath6kl: Only use match sets when firmware supports it Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 063/127] ath6kl: Fix off by one error in scan completion Sasha Levin
2019-11-22 5:54 ` [PATCH AUTOSEL 4.14 081/127] net/netlink_compat: Fix a missing check of nla_parse_nested Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 082/127] net/net_namespace: Check the return value of register_pernet_subsys() Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 085/127] net: (cpts) fix a missing check of clk_prepare Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 086/127] net: stmicro: " Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 087/127] net: dsa: bcm_sf2: Propagate error value from mdio_write Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 088/127] atl1e: checking the status of atl1e_write_phy_reg Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 089/127] tipc: fix a missing check of genlmsg_put Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 090/127] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 099/127] tipc: fix memory leak in tipc_nl_compat_publ_dump Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 100/127] net/core/neighbour: tell kmemleak about hash tables Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 102/127] net/core/neighbour: fix kmemleak minimal reference count for " Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 105/127] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 106/127] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 107/127] decnet: fix DN_IFREQ_SIZE Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 108/127] net/smc: prevent races between smc_lgr_terminate() and smc_conn_free() Sasha Levin
2019-11-22 5:55 ` Sasha Levin [this message]
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 111/127] sfc: initialise found bitmap in efx_ef10_mtd_probe Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 112/127] net: fix possible overflow in __sk_mem_raise_allocated() Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 113/127] sctp: don't compare hb_timer expire date before starting it Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 114/127] bpf: decrease usercnt if bpf_map_new_fd() fails in bpf_map_get_fd_by_id() Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 115/127] net: dev: Use unsigned integer as an argument to left-shift Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 117/127] bpf: drop refcount if bpf_map_new_fd() fails in map_create() Sasha Levin
2019-11-22 5:55 ` [PATCH AUTOSEL 4.14 118/127] net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191122055544.3299-109-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=hoang.h.le@dektech.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=maloy@donjonn.com \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).