diff options
author | JP Abgrall <jpa@google.com> | 2011-10-07 22:14:24 -0700 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2011-10-07 22:16:01 -0700 |
commit | 8493beb1045539c0c43c07c6adeb71e3c00d990a (patch) | |
tree | b0748bf5deb8d67550b0e32d1b865d25339c01f4 /net/netfilter | |
parent | 3bc18c7282298005d4726de14e19c3f5c807bb51 (diff) | |
download | kernel_samsung_espresso10-8493beb1045539c0c43c07c6adeb71e3c00d990a.zip kernel_samsung_espresso10-8493beb1045539c0c43c07c6adeb71e3c00d990a.tar.gz kernel_samsung_espresso10-8493beb1045539c0c43c07c6adeb71e3c00d990a.tar.bz2 |
netfilter: xt_qtaguid: fix crash on ctrl delete command
Because for now the xt_qtaguid module allows procs to use tags without
having /dev/xt_qtaguid open, there was a case where it would try
to delete a resources from a list that was proc specific.
But that resource was never added to that list which is only
used when /dev/xt_qtaguid has been opened by the proc.
Once our userspace is fully updated, we won't need those exceptions.
Change-Id: Idd4bfea926627190c74645142916e10832eb2504
Signed-off-by: JP Abgrall <jpa@google.com>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/xt_qtaguid.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/netfilter/xt_qtaguid.c b/net/netfilter/xt_qtaguid.c index 5d73eca..08086d6 100644 --- a/net/netfilter/xt_qtaguid.c +++ b/net/netfilter/xt_qtaguid.c @@ -1919,7 +1919,15 @@ static int ctrl_cmd_delete(const char *input) tr_entry = lookup_tag_ref(st_entry->tag, NULL); BUG_ON(tr_entry->num_sock_tags <= 0); tr_entry->num_sock_tags--; - list_del(&st_entry->list); + /* + * TODO: remove if, and start failing. + * This is a hack to work around the fact that in some + * places we have "if (IS_ERR_OR_NULL(pqd_entry))" + * and are trying to work around apps + * that didn't open the /dev/xt_qtaguid. + */ + if (st_entry->list.next && st_entry->list.prev) + list_del(&st_entry->list); } } spin_unlock_bh(&sock_tag_list_lock); |