]> git.baikalelectronics.ru Git - kernel.git/commit
genetlink: fix genlmsg_nlhdr()
authorMichal Kubecek <mkubecek@suse.cz>
Wed, 15 Nov 2017 12:09:32 +0000 (13:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Nov 2017 01:49:00 +0000 (10:49 +0900)
commit9f3d58c209ae599922f82dea7d95e159dba76120
tree136494be53be2512054e257ae0cc0e0e4d011910
parentc4722e80ba49b120832ae7e0730c6a37acc09191
genetlink: fix genlmsg_nlhdr()

According to the description, first argument of genlmsg_nlhdr() points to
what genlmsg_put() returns, i.e. beginning of user header. Therefore we
should only subtract size of genetlink header and netlink message header,
not user header.

This also means we don't need to pass the pointer to genetlink family and
the same is true for genl_dump_check_consistent() which is the only caller
of genlmsg_nlhdr(). (Note that at the moment, these functions are only
used for families which do not have user header so that they are not
affected.)

Fixes: 7caf26e2beb7 ("netlink: advertise incomplete dumps")
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macsec.c
drivers/net/wireless/mac80211_hwsim.c
include/net/genetlink.h
net/nfc/netlink.c
net/wireless/nl80211.c