• Jakub Kicinski's avatar
    netlink: add mask validation · bdbb4e29
    Jakub Kicinski authored
    We don't have good validation policy for existing unsigned int attrs
    which serve as flags (for new ones we could use NLA_BITFIELD32).
    With increased use of policy dumping having the validation be
    expressed as part of the policy is important. Add validation
    policy in form of a mask of supported/valid bits.
    
    Support u64 in the uAPI to be future-proof, but really for now
    the embedded mask member can only hold 32 bits, so anything with
    bit 32+ set will always fail validation.
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    bdbb4e29
policy.c 9.19 KB