Merge "netfilter: nfnetlink: correctly validate length of batch messages"

This commit is contained in:
Linux Build Service Account 2016-11-24 06:13:32 -08:00 committed by Gerrit - the friendly Code Review server
commit d2f94a9a44

View file

@ -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 */