OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0fff9bd
)
net: ncsi: fix a missing check for nla_nest_start
author
Kangjie Lu
<kjlu@umn.edu>
Fri, 15 Mar 2019 06:14:33 +0000
(
01:14
-0500)
committer
David S. Miller
<davem@davemloft.net>
Sat, 16 Mar 2019 18:44:33 +0000
(11:44 -0700)
nla_nest_start may fail and thus deserves a check.
The fix returns -EMSGSIZE in case it fails.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ncsi/ncsi-netlink.c
patch
|
blob
|
history
diff --git
a/net/ncsi/ncsi-netlink.c
b/net/ncsi/ncsi-netlink.c
index
5d78244
..
bad17bb
100644
(file)
--- a/
net/ncsi/ncsi-netlink.c
+++ b/
net/ncsi/ncsi-netlink.c
@@
-251,6
+251,10
@@
static int ncsi_pkg_info_all_nl(struct sk_buff *skb,
}
attr = nla_nest_start(skb, NCSI_ATTR_PACKAGE_LIST);
+ if (!attr) {
+ rc = -EMSGSIZE;
+ goto err;
+ }
rc = ncsi_write_package_info(skb, ndp, package->id);
if (rc) {
nla_nest_cancel(skb, attr);