Avoid overfow in vtruncbuf()
Using daddr_t instead of int avoids trunclbn to become negative when it shouldn't. This isssue was found by running syzkaller. Reviewed by: mckusick, kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18763
This commit is contained in:
parent
aa320c199b
commit
e8a9c3693f
@ -1858,7 +1858,7 @@ vtruncbuf(struct vnode *vp, struct ucred *cred, off_t length, int blksize)
|
|||||||
{
|
{
|
||||||
struct buf *bp, *nbp;
|
struct buf *bp, *nbp;
|
||||||
int anyfreed;
|
int anyfreed;
|
||||||
int trunclbn;
|
daddr_t trunclbn;
|
||||||
struct bufobj *bo;
|
struct bufobj *bo;
|
||||||
|
|
||||||
CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__,
|
CTR5(KTR_VFS, "%s: vp %p with cred %p and block %d:%ju", __func__,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user