Skip to content

netlink: strict attribute checking follow-up

Michal Kubecek lkml netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 9 repliesIn review
  2. v13 patches 12 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3genetlink: do not validate dump requests if there is no policynet/netlink/genetlink.c+14 -100 replies
2/3netlink: set bad attribute also on maxtype checklib/nlattr.c+2 -10 replies
3/3netlink: add validation of NLA_F_NESTED flaginclude/net/netlink.h lib/nlattr.c+25 -18 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJohannes BergDavid Ahern
1/3R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH net-next v2 0/3] netlink: strict attribute checking follow-up

Three follow-up patches for recent strict netlink validation series.

Patch 1 fixes dump handling for genetlink families which validate and parse messages themselves (e.g. because they need different policies for diferent commands).

Patch 2 sets bad_attr in extack in one place where this was omitted.

Patch 3 adds new NL_VALIDATE_NESTED flags for strict validation to enable checking that NLA_F_NESTED value in received messages matches expectations and includes this flag in NL_VALIDATE_STRICT. This would change userspace visible behavior but the previous switching to NL_VALIDATE_STRICT for new code is still only in net-next at the moment.

v2: change error messages to mention NLA_F_NESTED explicitly

Michal Kubecek (3):
genetlink: do not validate dump requests if there is no policy
netlink: set bad attribute also on maxtype check
netlink: add validation of NLA_F_NESTED flag

 include/net/netlink.h   | 11 ++++++++++-
 lib/nlattr.c            | 18 +++++++++++++++++-
 net/netlink/genetlink.c | 24 ++++++++++++++----------
 3 files changed, 41 insertions(+), 12 deletions(-)
Signature · 1 line
2.21.0