mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:19:34 +02:00
The LLSEC ADD/DEL doit handlers under the legacy IEEE802154_NL family
consume IEEE802154_ATTR_LLSEC_KEY_BYTES and
IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS, both declared in
net/ieee802154/nl_policy.c as bare length entries with no .type
(defaulting to NLA_UNSPEC). Generic netlink strict validation rejects
all NLA_UNSPEC attributes via validate_nla(), so every LLSEC_ADD_KEY,
LLSEC_DEL_KEY, LLSEC_ADD_DEV, LLSEC_DEL_DEV, LLSEC_ADD_DEVKEY,
LLSEC_DEL_DEVKEY, LLSEC_ADD_SECLEVEL, and LLSEC_DEL_SECLEVEL request
fails at the dispatcher with "Unsupported attribute" before reaching
the handler.
The doit path has been silently dead since strict validation became
the default for genl families that do not opt out. The dump path is
unaffected because dump requests carry no LLSEC attributes to
validate, which is why the LLSEC_LIST_KEY read remained reachable
(patch 1/2). Introduce IEEE802154_OP_RELAXED() mirroring
IEEE802154_OP() but with .validate = GENL_DONT_VALIDATE_STRICT, and
use it for the eight legacy LLSEC mutate ops so admin-driven LLSEC
configuration via the legacy interface works again.
Fixes: 3e9c156e2c ("ieee802154: add netlink interfaces for llsec")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Link: https://lore.kernel.org/20260520141640.1149513-3-michael.bommarito@gmail.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
93 lines
3.3 KiB
C
93 lines
3.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2007, 2008, 2009 Siemens AG
|
|
*/
|
|
#ifndef IEEE_802154_LOCAL_H
|
|
#define IEEE_802154_LOCAL_H
|
|
|
|
int __init ieee802154_nl_init(void);
|
|
void ieee802154_nl_exit(void);
|
|
|
|
#define IEEE802154_OP(_cmd, _func) \
|
|
{ \
|
|
.cmd = _cmd, \
|
|
.doit = _func, \
|
|
.dumpit = NULL, \
|
|
.flags = GENL_ADMIN_PERM, \
|
|
}
|
|
|
|
#define IEEE802154_OP_RELAXED(_cmd, _func) \
|
|
{ \
|
|
.cmd = _cmd, \
|
|
.doit = _func, \
|
|
.dumpit = NULL, \
|
|
.flags = GENL_ADMIN_PERM, \
|
|
.validate = GENL_DONT_VALIDATE_STRICT,\
|
|
}
|
|
|
|
#define IEEE802154_DUMP(_cmd, _func, _dump) \
|
|
{ \
|
|
.cmd = _cmd, \
|
|
.doit = _func, \
|
|
.dumpit = _dump, \
|
|
}
|
|
|
|
#define IEEE802154_DUMP_PRIV(_cmd, _func, _dump) \
|
|
{ \
|
|
.cmd = _cmd, \
|
|
.doit = _func, \
|
|
.dumpit = _dump, \
|
|
.flags = GENL_ADMIN_PERM, \
|
|
}
|
|
|
|
struct genl_info;
|
|
|
|
struct sk_buff *ieee802154_nl_create(int flags, u8 req);
|
|
int ieee802154_nl_mcast(struct sk_buff *msg, unsigned int group);
|
|
struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info,
|
|
int flags, u8 req);
|
|
int ieee802154_nl_reply(struct sk_buff *msg, struct genl_info *info);
|
|
|
|
extern struct genl_family nl802154_family;
|
|
|
|
/* genetlink ops/groups */
|
|
int ieee802154_list_phy(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_dump_phy(struct sk_buff *skb, struct netlink_callback *cb);
|
|
int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_del_iface(struct sk_buff *skb, struct genl_info *info);
|
|
|
|
enum ieee802154_mcgrp_ids {
|
|
IEEE802154_COORD_MCGRP,
|
|
IEEE802154_BEACON_MCGRP,
|
|
};
|
|
|
|
int ieee802154_associate_req(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_associate_resp(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_disassociate_req(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_scan_req(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_start_req(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_list_iface(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_dump_iface(struct sk_buff *skb, struct netlink_callback *cb);
|
|
int ieee802154_set_macparams(struct sk_buff *skb, struct genl_info *info);
|
|
|
|
int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_setparams(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_add_key(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_del_key(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_dump_keys(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int ieee802154_llsec_add_dev(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_del_dev(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_dump_devs(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int ieee802154_llsec_add_devkey(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_del_devkey(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_dump_devkeys(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int ieee802154_llsec_add_seclevel(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_del_seclevel(struct sk_buff *skb, struct genl_info *info);
|
|
int ieee802154_llsec_dump_seclevels(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
|
|
#endif
|