NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/57304 CVS commit: src/sys/dev/pci



The following reply was made to PR kern/57304; it has been noted by GNATS.

From: "Taylor R Campbell" <riastradh%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/57304 CVS commit: src/sys/dev/pci
Date: Wed, 29 Mar 2023 09:44:26 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Mar 29 09:44:26 UTC 2023
 
 Modified Files:
 	src/sys/dev/pci: virtio.c
 
 Log Message:
 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@localhost
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.71 -r1.72 src/sys/dev/pci/virtio.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 


Home | Main Index | Thread Index | Old Index