Date: Mon, 25 Nov 2019 14:21:35 -0800 From: Ryan Libby <rlibby@gmail.com> To: Ed Maste <emaste@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r355101 - head/sys/dev/cfi Message-ID: <CAHgpiFyLde0QSZ87qzugWJm2AQ-%2BJ-ahvAR=7-caka-zXOy7kw@mail.gmail.com> In-Reply-To: <201911252121.xAPLLbpN041510@repo.freebsd.org> References: <201911252121.xAPLLbpN041510@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 25, 2019 at 1:21 PM Ed Maste <emaste@freebsd.org> wrote: > > Author: emaste > Date: Mon Nov 25 21:21:37 2019 > New Revision: 355101 > URL: https://svnweb.freebsd.org/changeset/base/355101 > > Log: > cfi: check for inter overflow in cfi_devioctl > > Reported by: Pietro Oliva > Reviewed by: markj > MFC after: 3 days > Security: Possible OOB read in root-only ioctl > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/cfi/cfi_dev.c > > Modified: head/sys/dev/cfi/cfi_dev.c > ============================================================================== > --- head/sys/dev/cfi/cfi_dev.c Mon Nov 25 19:59:53 2019 (r355100) > +++ head/sys/dev/cfi/cfi_dev.c Mon Nov 25 21:21:37 2019 (r355101) > @@ -280,7 +280,8 @@ cfi_devioctl(struct cdev *dev, u_long cmd, caddr_t dat > rq = (struct cfiocqry *)data; > if (rq->offset >= sc->sc_size / sc->sc_width) > return (ESPIPE); > - if (rq->offset + rq->count > sc->sc_size / sc->sc_width) > + if (rq->offset > ULONG_MAX - rq->count || > + rq->offset + rq->count > sc->sc_size / sc->sc_width) > return (ENOSPC); > > while (!error && rq->count--) { > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" This seems to have broken the some builds. Need sys/limits.h.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHgpiFyLde0QSZ87qzugWJm2AQ-%2BJ-ahvAR=7-caka-zXOy7kw>