Home | History | Annotate | Download | only in dist
History log of /src/sys/external/bsd/libnv/dist/nv_kern_netbsd.c
RevisionDateAuthorComments
 1.7  04-Sep-2024  riastradh libnv: Avoid arithmetic overflow in array allocation.

1. Teach nv_calloc and nv_strdup to detect arithmetic overflow.
2. Convert nv_malloc(sizeof(...) * N) to nv_calloc(N, sizeof(...)).

I reviewed all the remaining nv_malloc calls, because some of them
have the multiplication separated from the nv_malloc call. Of the
remaining callers:

- nv_calloc (now) checks for overflow
- nv_strdup (now) checks for overflow
- nvlist_create uses a fixed sizeof(...) without arithmetic
- nvlist_xpack doesn't directly check bounds, but as long as the wire
format is smaller than the in-memory size, that's not a problem
- nvlist_recv checks for sizeof(nvlhdr) + nvlhdr.nvlh_size overflow
- nvpair_unpack_binary uses nvp->nvp_datasize without arithmetic
- nvpair_unpack_bool_array checks for unsigned overflow
- nvpair_unpack_number_array checks for unsigned overflow
- nvpair_unpack_descriptor_array checks for unsigned overflow
- nvpair_create_binary uses caller-supplied size without arithmetic

Matches upstream FreeBSD change by Mariusz Zaborski
<oshogbo@FreeBSD.org>.

CVE-2024-45287

PR security/58652: libnv: Integer overflow and buffer overrun
vulnerabilities
 1.6  16-Oct-2018  maxv branches: 1.6.4;
fix the shit, as usual
 1.5  23-Sep-2018  rmind branches: 1.5.2;
nvlist_copyin: fix the flag handling.
 1.4  23-Sep-2018  rmind libnv: add a wrapper around free(9) since in FreeBSD it can take NULL.
 1.3  22-Sep-2018  rmind libnv: fix some NetBSD wrappers.
 1.2  08-Sep-2018  christos FIx userland build
 1.1  08-Sep-2018  christos Add NetBSD stuff.
 1.5.2.3  20-Oct-2018  pgoyette Sync with head
 1.5.2.2  30-Sep-2018  pgoyette Ssync with HEAD
 1.5.2.1  23-Sep-2018  pgoyette file nv_kern_netbsd.c was added on branch pgoyette-compat on 2018-09-30 01:45:55 +0000
 1.6.4.2  10-Jun-2019  christos Sync with HEAD
 1.6.4.1  16-Oct-2018  christos file nv_kern_netbsd.c was added on branch phil-wifi on 2019-06-10 22:08:38 +0000

RSS XML Feed