netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] netlink: add range checks for network byte integers
@ 2022-09-05 10:09 Florian Westphal
  2022-09-05 10:09 ` [PATCH net-next 1/2] netlink: introduce NLA_POLICY_MAX_BE Florian Westphal
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Florian Westphal @ 2022-09-05 10:09 UTC (permalink / raw)
  To: netdev
  Cc: netfilter-devel, Eric Dumazet, Jakub Kicinski, David S. Miller,
	Paolo Abeni, Florian Westphal

NLA_POLICY_MAX() can be used to let netlink core validate that the given
integer attribute is within the given min-max interval.

Add NLA_POLICY_MAX_BE to allow similar range check on unsigned integers
when those are in network byte order (big endian).

First patch adds the netlink change, second patch adds one user.

Florian Westphal (2):
  netlink: introduce NLA_POLICY_MAX_BE
  netfilter: nft_payload: reject out-of-range attributes via policy

 include/net/netlink.h       |  9 +++++++++
 lib/nlattr.c                | 31 +++++++++++++++++++++++++++----
 net/netfilter/nft_payload.c |  6 +++---
 3 files changed, 39 insertions(+), 7 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-10-28 16:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 10:09 [PATCH net-next 0/2] netlink: add range checks for network byte integers Florian Westphal
2022-09-05 10:09 ` [PATCH net-next 1/2] netlink: introduce NLA_POLICY_MAX_BE Florian Westphal
2022-10-27 20:31   ` Jakub Kicinski
2022-10-27 20:36     ` Johannes Berg
2022-10-27 23:35       ` Florian Westphal
2022-10-28  2:39         ` Jakub Kicinski
2022-10-28 10:16           ` Florian Westphal
2022-10-28 16:13             ` Jakub Kicinski
2022-09-05 10:09 ` [PATCH net-next 2/2] netfilter: nft_payload: reject out-of-range attributes via policy Florian Westphal
2022-09-07 11:40 ` [PATCH net-next 0/2] netlink: add range checks for network byte integers patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).