projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a19edb
)
netlink: Add extack message to nlmsg_parse for invalid header length
author
David Ahern
<
[email protected]
>
Mon, 8 Oct 2018 03:16:23 +0000
(20:16 -0700)
committer
David S. Miller
<
[email protected]
>
Mon, 8 Oct 2018 17:39:03 +0000
(10:39 -0700)
Give a user a reason why EINVAL is returned in nlmsg_parse.
Signed-off-by: David Ahern <
[email protected]
>
Acked-by: Christian Brauner <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
include/net/netlink.h
patch
|
blob
|
history
diff --git
a/include/net/netlink.h
b/include/net/netlink.h
index 589683091f16790290e368449349b9451bb09626..9522a0bf1f3af5046f713e99c7be75cc183b31c2 100644
(file)
--- a/
include/net/netlink.h
+++ b/
include/net/netlink.h
@@
-516,8
+516,10
@@
static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
const struct nla_policy *policy,
struct netlink_ext_ack *extack)
{
- if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
+ if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) {
+ NL_SET_ERR_MSG(extack, "Invalid header length");
return -EINVAL;
+ }
return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
nlmsg_attrlen(nlh, hdrlen), policy, extack);