diff options
| author | riastradh <riastradh@NetBSD.org> | 2023-03-29 09:44:25 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2023-03-29 09:44:25 +0000 |
| commit | 78bb5a5eff4435db6e6022e3a3b6f6ff0322703b (patch) | |
| tree | 7f5949144326608a5ee0dfae3dfc55deef88485c /sys/dev/microcode/tools | |
| parent | dc4b17131318dd924a6bfe78f606b960f36e4c44 (diff) | |
virtio(4): Fix sizing of virtqueue allocation.
vq->vq_avail[0].ring is a zero-length array, and thus sizeof is zero;
likewise vq->vq_used[0].ring.
Use vq->vq_avail[0].ring[0] and vq->vq_used[0].ring[0] to fix this
and restore the previous allocation sizing logic.
XXX We shouldn't use zero-length arrays here -- they are asking for
trouble like this, and C99 has a standard way to express what we're
actually trying to get at it, flexible array members.
PR kern/57304
Reported-by: syzbot+7fb1047f5dfa33b26331@syzkaller.appspotmail.com
Diffstat (limited to 'sys/dev/microcode/tools')
0 files changed, 0 insertions, 0 deletions
