nl80211: Add NL80211_FLAG_CLEAR_SKB flag for other NL commands

This commit adds NL80211_FLAG_CLEAR_SKB flag to other NL commands
that carry key data to ensure they do not stick around on heap
after the SKB is freed.

Also introduced this flag for NL80211_CMD_VENDOR as there are sub
commands which configure the keys.

Signed-off-by: Sunil Dutt <usdutt@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Sunil Dutt 2019-02-25 15:37:20 +05:30 committed by Johannes Berg
parent 90abf96abd
commit d6db02a88a

View File

@ -13650,7 +13650,8 @@ static const struct genl_ops nl80211_ops[] = {
.policy = nl80211_policy, .policy = nl80211_policy,
.flags = GENL_UNS_ADMIN_PERM, .flags = GENL_UNS_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_DEAUTHENTICATE, .cmd = NL80211_CMD_DEAUTHENTICATE,
@ -13701,7 +13702,8 @@ static const struct genl_ops nl80211_ops[] = {
.policy = nl80211_policy, .policy = nl80211_policy,
.flags = GENL_UNS_ADMIN_PERM, .flags = GENL_UNS_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS, .cmd = NL80211_CMD_UPDATE_CONNECT_PARAMS,
@ -13709,7 +13711,8 @@ static const struct genl_ops nl80211_ops[] = {
.policy = nl80211_policy, .policy = nl80211_policy,
.flags = GENL_ADMIN_PERM, .flags = GENL_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_DISCONNECT, .cmd = NL80211_CMD_DISCONNECT,
@ -13738,7 +13741,8 @@ static const struct genl_ops nl80211_ops[] = {
.policy = nl80211_policy, .policy = nl80211_policy,
.flags = GENL_UNS_ADMIN_PERM, .flags = GENL_UNS_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_DEL_PMKSA, .cmd = NL80211_CMD_DEL_PMKSA,
@ -14090,7 +14094,8 @@ static const struct genl_ops nl80211_ops[] = {
.policy = nl80211_policy, .policy = nl80211_policy,
.flags = GENL_UNS_ADMIN_PERM, .flags = GENL_UNS_ADMIN_PERM,
.internal_flags = NL80211_FLAG_NEED_WIPHY | .internal_flags = NL80211_FLAG_NEED_WIPHY |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_SET_QOS_MAP, .cmd = NL80211_CMD_SET_QOS_MAP,
@ -14145,7 +14150,8 @@ static const struct genl_ops nl80211_ops[] = {
.doit = nl80211_set_pmk, .doit = nl80211_set_pmk,
.policy = nl80211_policy, .policy = nl80211_policy,
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP | .internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL, NL80211_FLAG_NEED_RTNL |
NL80211_FLAG_CLEAR_SKB,
}, },
{ {
.cmd = NL80211_CMD_DEL_PMK, .cmd = NL80211_CMD_DEL_PMK,