genetlink: optionally validate strictly/dumps
authorJohannes Berg <johannes.berg@intel.com>
Fri, 26 Apr 2019 12:07:31 +0000 (14:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Apr 2019 21:07:22 +0000 (17:07 -0400)
commitef6243acb4782df587a4d7d6c310fa5b5d82684b
tree81b4175fc03c61adbb8935f5f7b8ce02589c65dd
parent56738f460841761abc70347c919d5c45f6f05a42
genetlink: optionally validate strictly/dumps

Add options to strictly validate messages and dump messages,
sometimes perhaps validating dump messages non-strictly may
be required, so add an option for that as well.

Since none of this can really be applied to existing commands,
set the options everwhere using the following spatch:

    @@
    identifier ops;
    expression X;
    @@
    struct genl_ops ops[] = {
    ...,
     {
            .cmd = X,
    +       .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
            ...
     },
    ...
    };

For new commands one should just not copy the .validate 'opt-out'
flags and thus get strict validation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
37 files changed:
drivers/block/nbd.c
drivers/net/gtp.c
drivers/net/ieee802154/mac802154_hwsim.c
drivers/net/macsec.c
drivers/net/team/team.c
drivers/net/wireless/mac80211_hwsim.c
drivers/target/target_core_user.c
fs/dlm/netlink.c
include/net/genetlink.h
kernel/taskstats.c
net/batman-adv/netlink.c
net/core/devlink.c
net/core/drop_monitor.c
net/hsr/hsr_netlink.c
net/ieee802154/nl802154.c
net/ipv4/fou.c
net/ipv4/tcp_metrics.c
net/ipv6/ila/ila_main.c
net/ipv6/seg6.c
net/l2tp/l2tp_netlink.c
net/ncsi/ncsi-netlink.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netlabel/netlabel_calipso.c
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/netlink/genetlink.c
net/nfc/netlink.c
net/openvswitch/conntrack.c
net/openvswitch/datapath.c
net/openvswitch/meter.c
net/psample/psample.c
net/smc/smc_pnet.c
net/tipc/netlink.c
net/tipc/netlink_compat.c
net/wimax/stack.c
net/wireless/nl80211.c