blob: 55628bf1989d6c9bda7cde0c8004a70abf3ce1b7 [file] [log] [blame] [raw]
Fix arithmetic with common pointers in OpenSolaris kernel compat and ZFS
modules.
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c freebsd-11.1/usr/src/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c
--- /usr/src/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c 2017-07-21 07:42:00.000000000 +0800
+++ freebsd-11.1/usr/src/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c 2019-03-22 23:49:15.087284000 +0800
@@ -103,7 +103,7 @@
uiop->uio_iovcnt--;
continue;
}
- iovp->iov_base += niovb;
+ iovp->iov_base = (char *)iovp->iov_base + niovb;
uiop->uio_loffset += niovb;
iovp->iov_len -= niovb;
uiop->uio_resid -= niovb;
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
--- /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c 2017-07-21 07:42:00.000000000 +0800
+++ freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c 2019-03-22 23:51:20.297964000 +0800
@@ -7112,7 +7112,7 @@
bcopy(hdr->b_l1hdr.b_pdata, to_write, size);
if (asize != size)
- bzero(to_write + size, asize - size);
+ bzero((char *)to_write + size, asize - size);
l2arc_free_data_on_write(to_write, asize, type);
}
wzio = zio_write_phys(pio, dev->l2ad_vdev,
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
--- /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c 2017-07-21 07:42:01.000000000 +0800
+++ freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c 2019-03-22 23:52:14.464934000 +0800
@@ -1859,7 +1859,7 @@
while (done < len) {
ssize_t resid;
- ra->err = restore_bytes(ra, buf + done,
+ ra->err = restore_bytes(ra, (char *)buf + done,
len - done, ra->voff, &resid);
if (resid == len - done) {
diff -ru --exclude-from freebsd-src-diff-exclude-names /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
--- /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 2017-07-21 07:42:00.000000000 +0800
+++ freebsd-11.1/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c 2019-03-22 23:55:16.409887000 +0800
@@ -2574,7 +2574,7 @@
*ncookies -= ncooks;
if (uio->uio_segflg == UIO_SYSSPACE && uio->uio_iovcnt == 1) {
- iovp->iov_base += outcount;
+ iovp->iov_base = (char *)iovp->iov_base + outcount;
iovp->iov_len -= outcount;
uio->uio_resid -= outcount;
} else if (error = uiomove(outbuf, (long)outcount, UIO_READ, uio)) {