Skip to content

Fix qemu_strtosz() read-out-of-bounds

Eric Blake qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest19 patches 5 repliesIn review
  2. v219 patches 28 repliesSuperseded
  3. v111 patches 13 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19test-cutils: Avoid g_assert in unit teststests/unit/test-cutils.c+162 -1620 replies
2/19test-cutils: Use g_assert_cmpuint where appropriatetests/unit/test-cutils.c+74 -740 replies
3/19test-cutils: Test integral qemu_strto* value on failurestests/unit/test-cutils.c+51 -70 replies
4/19test-cutils: Test more integer corner casestests/unit/test-cutils.c+864 -652 replies
5/19cutils: Fix wraparound parsing in qemu_strtouitests/unit/test-cutils.c util/cutils.c+28 -171 reply
6/19cutils: Document differences between parse_uint and qemu_strtou64util/cutils.c+12 -80 replies
7/19cutils: Adjust signature of parse_uint[_full]audio/audio_legacy.c block/gluster.c block/nfs.c +9 more+85 -1000 replies
8/19cutils: Allow NULL endptr in parse_uint()tests/unit/test-cutils.c util/cutils.c+28 -240 replies
9/19test-cutils: Add coverage of qemu_strtodtests/unit/test-cutils.c+512 -00 replies
10/19test-cutils: Prepare for upcoming semantic change in qemu_strtosztests/unit/test-cutils.c+27 -150 replies
11/19test-cutils: Refactor qemu_strtosz tests for less boilerplatetests/unit/test-cutils.c+100 -4030 replies
12/19cutils: Allow NULL str in qemu_strtosztests/unit/test-cutils.c util/cutils.c+10 -20 replies
13/19numa: Check for qemu_strtosz_MiB errorhw/core/numa.c+9 -20 replies
14/19test-cutils: Add more coverage to qemu_strtosztests/unit/test-cutils.c+129 -110 replies
15/19cutils: Set value in all qemu_strtosz* error pathstests/unit/test-cutils.c util/cutils.c+63 -600 replies
16/19cutils: Set value in all integral qemu_strto* error pathstests/unit/test-cutils.c util/cutils.c+38 -280 replies
17/19cutils: Use parse_uint in qemu_strtosz for negative rejectiontests/qemu-iotests/049.out tests/qemu-iotests/178.out.qcow2 tests/qemu-iotests/178.out.raw +2 more+9 -190 replies
18/19cutils: Improve qemu_strtod* error pathstests/unit/test-cutils.c util/cutils.c+55 -400 replies
19/19cutils: Improve qemu_strtosz handling of fractionstests/unit/test-cutils.c util/cutils.c+86 -531 reply

Reviews trailers per patch

All 19 patches have a Reviewed-by or Acked-by.

PatchHanna CzenczekPhilippe Mathieu-Daudé
1/19R-b R-b
2/19R-b
3/19R-b
4/19R-b
5/19R-b
6/19R-b
7/19R-b
8/19R-b
9/19R-b
10/19R-b
11/19R-b
12/19R-b R-b
13/19R-b
14/19R-b
15/19R-b
16/19R-b
17/19R-b
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/19] Fix qemu_strtosz() read-out-of-bounds

v2 was here:
https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg02951.html

Since then:
- fix another qemu_strtoui bug
- address review comments from Hanna

001/19:[----] [--] 'test-cutils: Avoid g_assert in unit tests' 002/19:[----] [--] 'test-cutils: Use g_assert_cmpuint where appropriate' 003/19:[----] [--] 'test-cutils: Test integral qemu_strto* value on failures' 004/19:[0204] [FC] 'test-cutils: Test more integer corner cases' 005/19:[0048] [FC] 'cutils: Fix wraparound parsing in qemu_strtoui' 006/19:[----] [--] 'cutils: Document differences between parse_uint and qemu_strtou64' 007/19:[0016] [FC] 'cutils: Adjust signature of parse_uint[_full]' 008/19:[----] [--] 'cutils: Allow NULL endptr in parse_uint()' 009/19:[0006] [FC] 'test-cutils: Add coverage of qemu_strtod' 010/19:[----] [--] 'test-cutils: Prepare for upcoming semantic change in qemu_strtosz' 011/19:[----] [--] 'test-cutils: Refactor qemu_strtosz tests for less boilerplate' 012/19:[0007] [FC] 'cutils: Allow NULL str in qemu_strtosz' 013/19:[----] [--] 'numa: Check for qemu_strtosz_MiB error' 014/19:[0007] [FC] 'test-cutils: Add more coverage to qemu_strtosz' 015/19:[----] [--] 'cutils: Set value in all qemu_strtosz* error paths' 016/19:[----] [--] 'cutils: Set value in all integral qemu_strto* error paths' 017/19:[0013] [FC] 'cutils: Use parse_uint in qemu_strtosz for negative rejection' 018/19:[----] [--] 'cutils: Improve qemu_strtod* error paths' 019/19:[----] [--] 'cutils: Improve qemu_strtosz handling of fractions'

Eric Blake (19):
test-cutils: Avoid g_assert in unit tests
test-cutils: Use g_assert_cmpuint where appropriate
test-cutils: Test integral qemu_strto* value on failures
test-cutils: Test more integer corner cases
cutils: Fix wraparound parsing in qemu_strtoui
cutils: Document differences between parse_uint and qemu_strtou64
cutils: Adjust signature of parse_uint[_full]
cutils: Allow NULL endptr in parse_uint()
test-cutils: Add coverage of qemu_strtod
test-cutils: Prepare for upcoming semantic change in qemu_strtosz
test-cutils: Refactor qemu_strtosz tests for less boilerplate
cutils: Allow NULL str in qemu_strtosz
numa: Check for qemu_strtosz_MiB error
test-cutils: Add more coverage to qemu_strtosz
cutils: Set value in all qemu_strtosz* error paths
cutils: Set value in all integral qemu_strto* error paths
cutils: Use parse_uint in qemu_strtosz for negative rejection
cutils: Improve qemu_strtod* error paths
cutils: Improve qemu_strtosz handling of fractions

 include/qemu/cutils.h            |    5 +-
 audio/audio_legacy.c             |    4 +-
 block/gluster.c                  |    4 +-
 block/nfs.c                      |    4 +-
 blockdev.c                       |    4 +-
 contrib/ivshmem-server/main.c    |    4 +-
 hw/core/numa.c                   |   11 +-
 qapi/opts-visitor.c              |   10 +-
 tests/unit/test-cutils.c         | 2469 ++++++++++++++++++++++--------
 ui/vnc.c                         |    4 +-
 util/cutils.c                    |  262 ++--
 util/guest-random.c              |    4 +-
 util/qemu-sockets.c              |   10 +-
 tests/qemu-iotests/049.out       |    7 +-
 tests/qemu-iotests/178.out.qcow2 |    3 +-
 tests/qemu-iotests/178.out.raw   |    3 +-
 16 files changed, 2030 insertions(+), 778 deletions(-)

base-commit: ad3387396a71416cacc0b394e5e440dd6e9ba19a
prerequisite-patch-id: 7d7341e4caa6f8ef05dda8dd5f43b98a6ef969f1

Signature · 1 line
2.40.1