netfilter 01/01: xt_quota: fix wrong return value (error case)
Subsystems (3)
Hi Dave,
the following patch for 2.6.31 fixes a regression in the xt_quota module introduced in 2.6.30-rc1, causing a crash when memory allocation fails.
Please apply, thanks.
commit 53fa59e004cd02b1bd97edff965d063222bd0171
Author: Jan Engelhardt <[email protected]> Date: Thu Aug 13 15:42:17 2009 +0200
netfilter: xt_quota: fix wrong return value (error case)
Success was indicated on a memory allocation failure, thereby causing a crash due to a later NULL deref.
(Affects v2.6.30-rc1 up to here.)
Signed-off-by Jan Engelhardt <[email protected]>
Signed-off-by Patrick McHardy <[email protected]>
net/netfilter/xt_quota.c +1 -1
@@ -52,7 +52,7 @@ static bool quota_mt_check(const struct xt_mtchk_param *par) q->master =kmalloc (sizeof (*q->master),GFP_KERNEL );if (q->master ==NULL ) -return -ENOMEM ; +return false; q->master->quota = q->quota;return true;