netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] netlink: export policy on validation failures
@ 2020-10-06 12:32 Johannes Berg
  2020-10-06 12:32 ` [PATCH 1/2] netlink: policy: refactor per-attr policy writing Johannes Berg
  2020-10-06 12:32 ` [PATCH 2/2] netlink: export policy in extended ACK Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2020-10-06 12:32 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, Jakub Kicinski

Export the policy used for attribute validation when it fails,
so e.g. for an out-of-range attribute userspace immediately gets
the valid ranges back.

Tested using nl80211/iw in a few scenarios, seems to work fine
and return the policy back, e.g.

kernel reports: integer out of range
policy: 04 00 0b 00 0c 00 04 00 01 00 00 00 00 00 00 00 
        ^ padding
                    ^ minimum allowed value
policy: 04 00 0b 00 0c 00 05 00 ff ff ff ff 00 00 00 00 
        ^ padding
                    ^ maximum allowed value
policy: 08 00 01 00 04 00 00 00 
        ^ type 4 == U32

for an out-of-range case.

johannes



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

end of thread, other threads:[~2020-10-06 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 12:32 [PATCH 0/2] netlink: export policy on validation failures Johannes Berg
2020-10-06 12:32 ` [PATCH 1/2] netlink: policy: refactor per-attr policy writing Johannes Berg
2020-10-06 12:32 ` [PATCH 2/2] netlink: export policy in extended ACK Johannes Berg
2020-10-06 15:10   ` Johannes Berg
2020-10-06 16:16     ` Jakub Kicinski
2020-10-06 17:31       ` Johannes Berg

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).