Re: [PATCH 2/6] netlink: extend policy range validation

2019-04-29 Thread Johannes Berg
On Mon, 2019-04-29 at 22:49 -0400, David Miller wrote: > From: Johannes Berg > Date: Fri, 26 Apr 2019 14:13:02 +0200 > > > * NLA_POLICY_RANGE() macros. > > + *NLA_U8, > > + *NLA_U16, > > + *NLA_U32, > > + *NLA_U64 If the validation_type field

Re: [PATCH 2/6] netlink: extend policy range validation

2019-04-29 Thread David Miller
From: Johannes Berg Date: Fri, 26 Apr 2019 14:13:02 +0200 > * NLA_POLICY_RANGE() macros. > + *NLA_U8, > + *NLA_U16, > + *NLA_U32, > + *NLA_U64 If the validation_type field instead is set to > + * NLA_VALIDATE_RANGE_PTR

[PATCH 2/6] netlink: extend policy range validation

2019-04-26 Thread Johannes Berg
From: Johannes Berg Using a pointer to a struct indicating the min/max values, extend the ability to do range validation for arbitrary values. Small values in the s16 range can be kept in the policy directly. Signed-off-by: Johannes Berg --- include/net/netlink.h | 45 + lib/n