• Doug Ledford's avatar
    RDMA/netlink: Audit policy settings for netlink attributes · 34d65cd8
    Doug Ledford authored
    For all string attributes for which we don't currently accept the element
    as input, we only use it as output, set the string length to
    RDMA_NLDEV_ATTR_EMPTY_STRING which is defined as 1.  That way we will only
    accept a null string for that element.  This will prevent someone from
    writing a new input routine that uses the element without also updating
    the policy to have a valid value.
    
    Also while there, make sure the existing entries that are valid have the
    correct policy, if not, correct the policy.  Remove unnecessary checks
    for nla_strlcpy() overflow once the policy has been set correctly.
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
    34d65cd8
rdma_netlink.h 3.77 KB