Merge "netfilter: nfnetlink: correctly validate length of batch messages"
This commit is contained in:
commit
d2f94a9a44
1 changed files with 6 additions and 4 deletions
|
@ -326,10 +326,12 @@ replay:
|
|||
nlh = nlmsg_hdr(skb);
|
||||
err = 0;
|
||||
|
||||
if (nlmsg_len(nlh) < sizeof(struct nfgenmsg) ||
|
||||
skb->len < nlh->nlmsg_len) {
|
||||
err = -EINVAL;
|
||||
goto ack;
|
||||
if (nlh->nlmsg_len < NLMSG_HDRLEN ||
|
||||
skb->len < nlh->nlmsg_len ||
|
||||
nlmsg_len(nlh) < sizeof(struct nfgenmsg)) {
|
||||
nfnl_err_reset(&err_list);
|
||||
status |= NFNL_BATCH_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Only requests are handled by the kernel */
|
||||
|
|
Loading…
Add table
Reference in a new issue