Johannes Berg 44f3625bc6 netlink: export policy in extended ACK
Add a new attribute NLMSGERR_ATTR_POLICY to the extended ACK
to advertise the policy, e.g. if an attribute was out of range,
you'll know the range that's permissible.

Add new NL_SET_ERR_MSG_ATTR_POL() and NL_SET_ERR_MSG_ATTR_POL()
macros to set this, since realistically it's only useful to do
this when the bad attribute (offset) is also returned.

Use it in lib/nlattr.c which practically does all the policy
validation.

v2:
 - add and use netlink_policy_dump_attr_size_estimate()
v3:
 - remove redundant break
v4:
 - really remove redundant break ... sorry

Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-09 20:22:32 -07:00
..
2020-09-18 17:49:20 -07:00
2020-08-07 12:58:11 -07:00
2020-08-15 08:09:38 -07:00
2020-06-05 14:05:57 -07:00
2020-08-07 08:54:16 +02:00
2020-06-25 22:25:13 -07:00
2020-06-16 14:19:57 +02:00
2020-07-27 14:55:22 +01:00
2020-08-15 08:26:55 -07:00
2020-08-03 19:30:59 -07:00
2020-05-24 20:48:11 +02:00
2020-07-21 08:24:52 -05:00
2020-07-08 10:48:35 -07:00
2020-09-21 15:00:40 -07:00
2020-09-28 18:26:58 -07:00
2020-04-10 15:36:21 -07:00
2020-06-24 17:08:31 +02:00
2020-08-03 11:57:03 -07:00
2020-03-09 11:12:19 +01:00
2020-08-07 12:41:36 -07:00
2020-06-16 19:25:20 +02:00
2020-07-27 14:29:23 -04:00
2020-05-04 11:19:58 -07:00
2020-01-18 09:19:18 -05:00
2020-06-17 00:07:38 +02:00
\n
2020-08-28 10:57:14 -07:00
2020-03-06 11:06:15 +01:00
2020-06-24 15:45:51 +10:00
2020-08-14 19:56:56 -07:00
2020-05-28 07:59:45 -07:00
2020-07-24 17:12:41 -07:00
2020-08-04 21:02:38 -04:00
2020-06-07 10:59:32 -07:00
2020-05-18 10:30:21 +01:00
2020-08-26 12:41:56 +02:00
2020-06-26 10:01:08 -06:00
2020-06-02 15:15:46 +01:00
2020-09-04 09:25:20 -07:00
2020-05-08 18:18:11 +01:00
2020-05-08 00:12:42 +02:00
2020-05-28 10:31:09 +02:00
2020-08-11 14:30:36 -07:00
2020-08-11 14:30:36 -07:00
2020-09-23 18:02:49 -07:00
2020-06-10 13:42:09 -07:00
2020-03-06 11:56:59 +01:00
2020-09-27 11:21:35 -07:00
2020-06-09 15:40:50 -07:00
2020-07-31 18:08:59 +10:00
2020-08-15 08:26:55 -07:00
2020-05-09 13:57:12 +02:00
2020-07-01 10:49:02 +02:00
2020-09-24 19:49:36 -07:00
2020-07-23 17:34:18 +10:00
2020-04-02 09:35:27 -07:00
2020-05-15 13:51:28 -07:00
2020-08-12 12:09:36 -07:00
2020-08-07 18:48:15 -07:00
2020-08-31 12:52:33 -07:00
2020-09-23 18:02:49 -07:00
2020-05-09 13:57:12 +02:00
2020-07-16 23:19:51 +02:00
2020-02-21 10:31:18 +01:00
2020-08-07 11:33:24 -07:00
2020-05-17 14:10:07 -06:00
2020-05-14 16:44:24 +02:00
2020-03-30 18:51:47 -07:00
2020-05-04 09:16:37 -07:00
2020-05-29 14:52:53 +02:00
2020-07-04 09:35:36 -05:00
2020-07-07 11:58:59 -05:00
2020-08-01 11:28:17 +02:00
2020-04-01 12:06:26 -04:00
2020-04-17 06:05:30 -04:00
2020-06-26 00:27:38 -07:00
2020-08-09 13:58:04 -07:00