lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <4187e35d-0965-cf65-bff5-e4f71a04d272@nvidia.com> Date: Wed, 31 Aug 2022 09:20:39 +0300 From: Gal Pressman <gal@...dia.com> To: Jakub Kicinski <kuba@...nel.org> Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org, Leon Romanovsky <leonro@...dia.com> Subject: Re: [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled On 31/08/2022 09:13, Jakub Kicinski wrote: > On Tue, 30 Aug 2022 13:12:37 +0300 Gal Pressman wrote: >> When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled, >> NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation >> error: >> net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'? >> 2503 | .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~ >> | NL802154_CMD_SET_CCA_ED_LEVEL >> >> Use __NL802154_CMD_AFTER_LAST instead of >> 'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command. >> >> Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes") >> Reviewed-by: Leon Romanovsky <leonro@...dia.com> >> Signed-off-by: Gal Pressman <gal@...dia.com> >> --- >> net/ieee802154/nl802154.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c >> index 38c4f3cb010e..dbfd24c70bd0 100644 >> --- a/net/ieee802154/nl802154.c >> +++ b/net/ieee802154/nl802154.c >> @@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = { >> .module = THIS_MODULE, >> .ops = nl802154_ops, >> .n_ops = ARRAY_SIZE(nl802154_ops), >> - .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1, >> + .resv_start_op = __NL802154_CMD_AFTER_LAST, >> .mcgrps = nl802154_mcgrps, >> .n_mcgrps = ARRAY_SIZE(nl802154_mcgrps), >> }; > Thanks for the fix! I think we should switch to > NL802154_CMD_SET_WPAN_PHY_NETNS + 1, tho. > > The point is to set the value to the cmd number after _currently_ > last defined command. The meta-value like LAST will move next time > someone adds a command, meaning the validation for new commands will > never actually come. I see, missed that part. So, shouldn't it be: #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1, #else .resv_start_op = NL802154_CMD_SET_WPAN_PHY_NETNS + 1, #endif ?
Powered by blists - more mailing lists