mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 18:56:38 +00:00
netlink: descend into nested parsers when verifying
When we verify that the attributes are correctly sorted we should also try to verify the nested attribute parsers. Reviewed by: melifaro Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D42222
This commit is contained in:
parent
1c5c7e61c8
commit
fad5734995
|
@ -289,6 +289,14 @@ nl_verify_parsers(const struct nlhdr_parser **parser, int count)
|
|||
for (int j = 0; j < p->np_size; j++) {
|
||||
MPASS(p->np[j].type > attr_type);
|
||||
attr_type = p->np[j].type;
|
||||
|
||||
/* Recurse into nested objects. */
|
||||
if (p->np[j].cb == nlattr_get_nested ||
|
||||
p->np[j].cb == nlattr_get_nested_ptr) {
|
||||
const struct nlhdr_parser *np =
|
||||
(const struct nlhdr_parser *)p->np[j].arg;
|
||||
nl_verify_parsers(&np, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue