From: Steffen Klassert <steffen.klassert@secunet.com>
To: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Dan Kruchinin <dkruchinin@acm.org>,
Andrew Morton <akpm@linux-foundation.org>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] padata: Check for valid cpumasks
Date: Tue, 20 Jul 2010 08:51:25 +0200 [thread overview]
Message-ID: <20100720065125.GE11081@secunet.com> (raw)
In-Reply-To: <20100720064736.GB11081@secunet.com>
Now that we allow to change the cpumasks from userspace, we have
to check for valid cpumasks in padata_do_parallel. This patch adds
the necessary check. This fixes a division by zero crash if the
parallel cpumask contains no active cpu.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
kernel/padata.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/padata.c b/kernel/padata.c
index 6a51945..7f895e2 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -114,7 +114,7 @@ int padata_do_parallel(struct padata_instance *pinst,
pd = rcu_dereference(pinst->pd);
err = -EINVAL;
- if (!(pinst->flags & PADATA_INIT))
+ if (!(pinst->flags & PADATA_INIT) || pinst->flags & PADATA_INVALID)
goto out;
if (!cpumask_test_cpu(cb_cpu, pd->cpumask.cbcpu))
--
1.5.6.5
next prev parent reply other threads:[~2010-07-20 6:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-14 10:29 [PATCH 0/3] padata: cpumasks Dan Kruchinin
2010-07-19 6:04 ` Herbert Xu
2010-07-19 6:40 ` Steffen Klassert
2010-07-19 7:32 ` Herbert Xu
2010-07-20 6:47 ` [PATCH 0/4] padata/pcrypt: fixes Steffen Klassert
2010-07-20 6:48 ` [PATCH 1/4] padata: Fix cpu index counting Steffen Klassert
2010-07-20 6:49 ` [PATCH 2/4] padata: Allocate cpumask dependend recources in any case Steffen Klassert
2010-07-20 6:51 ` Steffen Klassert [this message]
2010-07-20 6:52 ` [PATCH 4/4] crypto: pcrypt - Dont calulate a callback cpu on empty callback cpumask Steffen Klassert
2010-07-26 6:16 ` [PATCH 0/4] padata/pcrypt: fixes Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100720065125.GE11081@secunet.com \
--to=steffen.klassert@secunet.com \
--cc=akpm@linux-foundation.org \
--cc=dkruchinin@acm.org \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox