Go to file
Hongbo Li b6f756726e lib/mpi: use kcalloc in mpi_resize
We should set the additional space to 0 in mpi_resize().
So use kcalloc() instead of kmalloc_array().

In lib/mpi/ec.c:
/****************
 * Resize the array of A to NLIMBS. the additional space is cleared
 * (set to 0) [done by m_realloc()]
 */
int mpi_resize(MPI a, unsigned nlimbs)

Like the comment of kernel's mpi_resize() said, the additional space
need to be set to 0, but when a->d is not NULL, it does not set.

The kernel's mpi lib is from libgcrypt, the mpi resize in libgcrypt
is _gcry_mpi_resize() which set the additional space to 0.

This bug may cause mpi api which use mpi_resize() get wrong result
under the condition of using the additional space without initiation.
If this condition is not met, the bug would not be triggered.
Currently in kernel, rsa, sm2 and dh use mpi lib, and they works well,
so the bug is not triggered in these cases.

add_points_edwards() use the additional space directly, so it will
get a wrong result.

Fixes: cdec9cb516 ("crypto: GnuPG based MPI lib - source files (part 1)")
Signed-off-by: Hongbo Li <herberthbli@tencent.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2021-08-12 19:17:00 +08:00
Documentation RTC for 5.14 2021-07-10 16:19:10 -07:00
LICENSES LICENSES: Add the CC-BY-4.0 license 2020-12-08 10:33:27 -07:00
arch crypto: x86/sm4 - add AES-NI/AVX/x86_64 implementation 2021-07-30 10:58:31 +08:00
block block-5.14-2021-07-08 2021-07-09 12:05:33 -07:00
certs Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
crypto crypto: ecc - handle unaligned input buffer in ecc_swap_digits 2021-07-30 10:58:36 +08:00
drivers crypto: virtio - Replace deprecated CPU-hotplug functions. 2021-08-12 19:16:58 +08:00
fs 13 cifs/smb3 fixes. Most are to address minor issues pointed out by Coverity. Also includes a packet signing enhancement and mount improvement 2021-07-10 12:04:58 -07:00
include padata: Convert from atomic_t to refcount_t on parallel_data->refcnt 2021-07-30 10:58:36 +08:00
init Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
ipc Merge branch 'akpm' (patches from Andrew) 2021-07-02 12:08:10 -07:00
kernel padata: Replace deprecated CPU-hotplug functions. 2021-08-12 19:16:59 +08:00
lib lib/mpi: use kcalloc in mpi_resize 2021-08-12 19:17:00 +08:00
mm mm/rmap: try_to_migrate() skip zone_device !device_private 2021-07-11 15:05:15 -07:00
net We have new filesystem client metrics for reporting I/O sizes from 2021-07-09 09:52:13 -07:00
samples VFIO update for v5.14-rc1 2021-07-03 11:49:33 -07:00
scripts Kbuild updates for v5.14 2021-07-10 11:01:38 -07:00
security asm-generic/unaligned: Unify asm/unaligned.h around struct helper 2021-07-02 12:43:40 -07:00
sound sound fixes for 5.14-rc1 2021-07-09 11:40:26 -07:00
tools perf tools changes for v5.14: 2nd batch 2021-07-11 10:54:24 -07:00
usr .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
virt Merge branch 'akpm' (patches from Andrew) 2021-06-29 17:29:11 -07:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap m68k updates for v5.14 2021-06-28 14:01:03 -07:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: move Murali Karicheri to credits 2021-04-29 15:47:30 -07:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS SCSI misc on 20210711 2021-07-11 10:59:53 -07:00
Makefile Linux 5.14-rc1 2021-07-11 15:07:40 -07:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.