This is a note to let you know that I've just added the patch titled inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill() to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sun Nov 22 10:24:40 AM CET 2020 From: Wang Hai <wanghai38@xxxxxxxxxx> Date: Mon, 16 Nov 2020 16:20:18 +0800 Subject: inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill() From: Wang Hai <wanghai38@xxxxxxxxxx> [ Upstream commit e33de7c5317e2827b2ba6fd120a505e9eb727b05 ] nlmsg_cancel() needs to be called in the error path of inet_req_diag_fill to cancel the message. Fixes: d545caca827b ("net: inet: diag: expose the socket mark to privileged processes.") Reported-by: Hulk Robot <hulkci@xxxxxxxxxx> Signed-off-by: Wang Hai <wanghai38@xxxxxxxxxx> Link: https://lore.kernel.org/r/20201116082018.16496-1-wanghai38@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/ipv4/inet_diag.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c @@ -462,8 +462,10 @@ static int inet_req_diag_fill(struct soc r->idiag_inode = 0; if (net_admin && nla_put_u32(skb, INET_DIAG_MARK, - inet_rsk(reqsk)->ir_mark)) + inet_rsk(reqsk)->ir_mark)) { + nlmsg_cancel(skb, nlh); return -EMSGSIZE; + } nlmsg_end(skb, nlh); return 0; Patches currently in stable-queue which might be from wanghai38@xxxxxxxxxx are queue-5.9/devlink-add-missing-genlmsg_cancel-in-devlink_nl_sb_port_pool_fill.patch queue-5.9/inet_diag-fix-error-path-to-cancel-the-meseage-in-inet_req_diag_fill.patch