Zero out the uio structure prior to initializing it. A garbage (uninitialized)

proc pointer is believed to have been the cause of panics related to vnconfig
    on top of intr-optioned NFS mounts.

Reported by: "Sean O'Connell" <sean@stat.Duke.EDU>
This commit is contained in:
dillon 2000-05-14 17:15:58 +00:00
parent 923e94d400
commit 47d5b4051e

View File

@ -277,8 +277,6 @@ vnstrategy(struct bio *bp)
struct vn_softc *vn;
int error;
int isvplocked = 0;
struct uio auio;
struct iovec aiov;
unit = dkunit(bp->bio_dev);
vn = bp->bio_dev->si_drv1;
@ -360,6 +358,11 @@ vnstrategy(struct bio *bp)
* B_INVAL because (for a write anyway), the buffer is
* still valid.
*/
struct uio auio;
struct iovec aiov;
bzero(&auio, sizeof(auio));
aiov.iov_base = bp->bio_data;
aiov.iov_len = bp->bio_bcount;
auio.uio_iov = &aiov;
@ -672,8 +675,6 @@ vniocattach_swap(vn, vio, dev, flag, p)
int
vnsetcred(struct vn_softc *vn, struct ucred *cred)
{
struct uio auio;
struct iovec aiov;
char *tmpbuf;
int error = 0;
@ -690,7 +691,11 @@ vnsetcred(struct vn_softc *vn, struct ucred *cred)
*/
if (vn->sc_vp) {
struct uio auio;
struct iovec aiov;
tmpbuf = malloc(vn->sc_secsize, M_TEMP, M_WAITOK);
bzero(&auio, sizeof(auio));
aiov.iov_base = tmpbuf;
aiov.iov_len = vn->sc_secsize;