mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
[PATCH] ctnetlink: check if protoinfo is present
This fixes an oops triggered from userspace. If we don't pass information about the private protocol info, the reference to attr will be NULL. This is likely to happen in update messages. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Harald Welte <laforge@netfilter.org> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c28dddc5dd
commit
36f73ff253
1 changed files with 5 additions and 0 deletions
|
@ -362,6 +362,11 @@ static int nfattr_to_tcp(struct nfattr *cda[], struct ip_conntrack *ct)
|
|||
struct nfattr *attr = cda[CTA_PROTOINFO_TCP-1];
|
||||
struct nfattr *tb[CTA_PROTOINFO_TCP_MAX];
|
||||
|
||||
/* updates could not contain anything about the private
|
||||
* protocol info, in that case skip the parsing */
|
||||
if (!attr)
|
||||
return 0;
|
||||
|
||||
if (nfattr_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr) < 0)
|
||||
goto nfattr_failure;
|
||||
|
||||
|
|
Loading…
Reference in a new issue