From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Joakim Tjernlund
<Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
Subject: Re: [patch 2.6.27-rc6] spi_mpc83xx: reject invalid transfer sizes
Date: Wed, 10 Sep 2008 19:00:30 -0700 [thread overview]
Message-ID: <20080910190030.5ef3c1fd.akpm@linux-foundation.org> (raw)
In-Reply-To: <200809101713.21496.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
On Wed, 10 Sep 2008 17:13:21 -0700 David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
> From: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>
>
> Error out on transfer length != multiple of bytes per word.
>
> Signed-off-by: Peter Korsgaard <jacmet-OfajU3CKLf1/SzgSGea1oA@public.gmane.org>
> Acked-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
> Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
> ---
> drivers/spi/spi_mpc83xx.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> --- a/drivers/spi/spi_mpc83xx.c
> +++ b/drivers/spi/spi_mpc83xx.c
> @@ -312,11 +312,20 @@ static int mpc83xx_spi_bufs(struct spi_d
> if (t->bits_per_word)
> bits_per_word = t->bits_per_word;
> len = t->len;
> - if (bits_per_word > 8)
> + if (bits_per_word > 8) {
> + /* invalid length? */
> + if (len & 1)
> + return -EINVAL;
> len /= 2;
> - if (bits_per_word > 16)
> + }
> + if (bits_per_word > 16) {
> + /* invalid length? */
> + if (len & 1)
> + return -EINVAL;
> len /= 2;
> + }
> mpc83xx_spi->count = len;
> +
> INIT_COMPLETION(mpc83xx_spi->done);
>
> /* enable rx ints */
Why? What user-visible problem (if any) does this fix?
I have not been provided with sufficient information to be able to
decide whether this fix is needed in 2.6.27. Please always provide
this.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
next prev parent reply other threads:[~2008-09-11 2:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-11 0:13 [patch 2.6.27-rc6] spi_mpc83xx: reject invalid transfer sizes David Brownell
[not found] ` <200809101713.21496.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-11 2:00 ` Andrew Morton [this message]
[not found] ` <20080910190030.5ef3c1fd.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-09-11 7:17 ` Peter Korsgaard
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=20080910190030.5ef3c1fd.akpm@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.