Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360103

[PATCH 0/8] lib/mpi: bug fixes and cleanup

From Nicolai Stange <nicstange@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 0/8] lib/mpi: bug fixes and cleanup
Date 2016-03-17 19:10 +0100
Message-ID <rdKwX-2ml-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


With linux-next-20160317, KASAN splats for both, mpi_write_sgl()
and mpi_read_buffer().

While the first isn't dramatic on x86 (as long as it doesn't fault),
the latter potentially overwrites unrelated memory.

These two issues are fixed by

  [4/8] ("lib/mpi: mpi_write_sgl(): fix out-of-bounds stack access")

and

  [8/8] ("lib/mpi: mpi_read_buffer(): fix buffer overflow")


While reviewing the code, I found another bug, c.f.

  [1/8] ("lib/mpi: mpi_write_sgl(): fix skipping of leading zero limbs")


The rest are cleanup/style patches I couldn't hold back ;)

There is still room for improvement in that the leading zero handling
could get easily moved out of the loop, but that's not the business of
this series.


Specifically. this patchset fixes

  2d4d1eea540b ("lib/mpi: Add mpi sgl helpers")

and

  9cbe21d8f89d ("lib/mpi: only require buffers as big as needed for
                 the integer")


 
This series is applicable to linux-next-20160317.


Nicolai Stange (8):
  lib/mpi: mpi_write_sgl(): fix skipping of leading zero limbs
  lib/mpi: mpi_write_sgl(): fix style issue with lzero decrement
  lib/mpi: mpi_write_sgl(): purge redundant pointer arithmetic
  lib/mpi: mpi_write_sgl(): fix out-of-bounds stack access
  lib/mpi: mpi_write_sgl(): replace open coded endian conversion
  lib/mpi: mpi_read_buffer(): optimize skipping of leading zero limbs
  lib/mpi: mpi_read_buffer(): replace open coded endian conversion
  lib/mpi: mpi_read_buffer(): fix buffer overflow

 lib/mpi/mpicoder.c | 91 ++++++++++++++++++++----------------------------------
 1 file changed, 33 insertions(+), 58 deletions(-)

-- 
2.7.2

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 0/8] lib/mpi: bug fixes and cleanup Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 8/8] lib/mpi: mpi_read_buffer(): fix buffer overflow Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 2/8] lib/mpi: mpi_write_sgl(): fix style issue with lzero decrement Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 5/8] lib/mpi: mpi_write_sgl(): replace open coded endian conversion Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 1/8] lib/mpi: mpi_write_sgl(): fix skipping of leading zero limbs Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 4/8] lib/mpi: mpi_write_sgl(): fix out-of-bounds stack access Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 3/8] lib/mpi: mpi_write_sgl(): purge redundant pointer arithmetic Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  [PATCH 6/8] lib/mpi: mpi_read_buffer(): optimize skipping of leading zero limbs Nicolai Stange <nicstange@gmail.com> - 2016-03-17 19:10 +0100
  Re: [PATCH 0/8] lib/mpi: bug fixes and cleanup Nicolai Stange <nicstange@gmail.com> - 2016-03-20 13:50 +0100

csiph-web