linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Jon Maloy <jmaloy@redhat.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.4 02/19] tipc: convert dest node's address to network order
Date: Wed,  5 May 2021 12:41:45 -0400	[thread overview]
Message-ID: <20210505164203.3464510-2-sashal@kernel.org> (raw)
In-Reply-To: <20210505164203.3464510-1-sashal@kernel.org>

From: Hoang Le <hoang.h.le@dektech.com.au>

[ Upstream commit 1980d37565061ab44bdc2f9e4da477d3b9752e81 ]

(struct tipc_link_info)->dest is in network order (__be32), so we must
convert the value to network order before assigning. The problem detected
by sparse:

net/tipc/netlink_compat.c:699:24: warning: incorrect type in assignment (different base types)
net/tipc/netlink_compat.c:699:24:    expected restricted __be32 [usertype] dest
net/tipc/netlink_compat.c:699:24:    got int

Acked-by: Jon Maloy <jmaloy@redhat.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/netlink_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 0975a28f8686..fb1b5dcf0142 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -632,7 +632,7 @@ static int tipc_nl_compat_link_dump(struct tipc_nl_compat_msg *msg,
 
 	nla_parse_nested(link, TIPC_NLA_LINK_MAX, attrs[TIPC_NLA_LINK], NULL);
 
-	link_info.dest = nla_get_flag(link[TIPC_NLA_LINK_DEST]);
+	link_info.dest = htonl(nla_get_flag(link[TIPC_NLA_LINK_DEST]));
 	link_info.up = htonl(nla_get_flag(link[TIPC_NLA_LINK_UP]));
 	nla_strlcpy(link_info.str, link[TIPC_NLA_LINK_NAME],
 		    TIPC_MAX_LINK_NAME);
-- 
2.30.2


  reply	other threads:[~2021-05-05 17:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 16:41 [PATCH AUTOSEL 4.4 01/19] fs: dlm: fix debugfs dump Sasha Levin
2021-05-05 16:41 ` Sasha Levin [this message]
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 03/19] net: stmmac: Set FIFO sizes for ipq806x Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 04/19] ALSA: hdsp: don't disable if not enabled Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 05/19] ALSA: hdspm: " Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 06/19] ALSA: rme9652: " Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 07/19] Bluetooth: Set CONF_NOT_COMPLETE as l2cap_chan default Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 08/19] Bluetooth: verify AMP hci_chan before amp_destroy Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 09/19] Bluetooth: initialize skb_queue_head at l2cap_chan_create() Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 10/19] ip6_vti: proper dev_{hold|put} in ndo_[un]init methods Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 11/19] mac80211: clear the beacon's CRC after channel switch Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 12/19] cuse: prevent clone Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 13/19] selftests: Set CC to clang in lib.mk if LLVM is set Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 14/19] kconfig: nconf: stop endless search loops Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 15/19] sctp: Fix out-of-bounds warning in sctp_process_asconf_param() Sasha Levin
2021-05-05 16:41 ` [PATCH AUTOSEL 4.4 16/19] ASoC: rt286: Generalize support for ALC3263 codec Sasha Levin
2021-05-05 16:42 ` [PATCH AUTOSEL 4.4 17/19] wl3501_cs: Fix out-of-bounds warnings in wl3501_send_pkt Sasha Levin
2021-05-05 16:42 ` [PATCH AUTOSEL 4.4 18/19] wl3501_cs: Fix out-of-bounds warnings in wl3501_mgmt_join Sasha Levin
2021-05-05 16:42 ` [PATCH AUTOSEL 4.4 19/19] powerpc/iommu: Annotate nested lock for lockdep 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=20210505164203.3464510-2-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=hoang.h.le@dektech.com.au \
    --cc=jmaloy@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    /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).