Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1251152
| From | Tadeusz Struk <tadeusz.struk@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 1/5] MPI: fix off by one in mpi_read_raw_from_sgl |
| Date | 2015-10-20 01:30 +0200 |
| Message-ID | <qls2m-2zn-1@gated-at.bofh.it> (permalink) |
| References | <ql4jn-1Bn-3@gated-at.bofh.it> <ql4jn-1Bn-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 10/18/2015 03:45 AM, Stephan Mueller wrote:
> The patch fixes the analysis of the input data which contains an off
> by one.
>
> The issue is visible when the SGL contains one byte per SG entry.
> The code for checking for zero bytes does not operate on the data byte.
>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
> ---
> lib/mpi/mpicoder.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/mpi/mpicoder.c b/lib/mpi/mpicoder.c
> index c20ef27..c7e0a70 100644
> --- a/lib/mpi/mpicoder.c
> +++ b/lib/mpi/mpicoder.c
> @@ -446,8 +446,11 @@ MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int len)
> const u8 *buff = sg_virt(sg);
> int len = sg->length;
>
> - while (len-- && !*buff++)
> + while (len && !*buff) {
> lzeros++;
> + len--;
> + buff++;
> + }
>
> if (len && *buff)
> break;
ACK. Thanks for testing this Stephan.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 1/5] MPI: fix off by one in mpi_read_raw_from_sgl Stephan Mueller <smueller@chronox.de> - 2015-10-19 00:10 +0200 Re: [PATCH v2 1/5] MPI: fix off by one in mpi_read_raw_from_sgl Tadeusz Struk <tadeusz.struk@intel.com> - 2015-10-20 01:30 +0200 Re: [PATCH v2 1/5] MPI: fix off by one in mpi_read_raw_from_sgl Herbert Xu <herbert@gondor.apana.org.au> - 2015-10-20 16:30 +0200
csiph-web