Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 2014 10:40:03 -0700
From:      Sean Bruno <sbruno@ignoranthack.me>
To:        FreeBSD FS <freebsd-fs@freebsd.org>
Subject:   sys/boot/zfs out of bounds warning
Message-ID:  <1398706803.1089.3.camel@powernoodle.corp.yahoo.com>

next in thread | raw e-mail | index | archive | help

--=-jZFGj/1IUJZOT3Ykd/EZ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

looking at sys/boot things this morning, noted that there's a pretty
obvious warning about an out of bounds access.  I suspect that I don't
see a layer of abstraction here that makes this ok, but I'm not sure.

It seems like if this wasn't valid memory, things would go pretty badly=20
in zfs_lookup().  Is there a better way to do this memcpy() such that it
doesn't trip a warning here?

-----------------
In file included from /home/sbruno/bsd/head/sys/boot/zfs/zfs.c:49:
/home/sbruno/bsd/head/sys/boot/zfs/zfsimpl.c:2080:19: warning: array
index 264 is past the end of the array (which contains 192 elements)
[-Warray-bounds]
                                memcpy(path,
&dn.dn_bonus[sizeof(znode_phys_t)],
                                              ^
~~~~~~~~~~~~~~~~~~~~
/home/sbruno/bsd/head/sys/boot/zfs/../../cddl/boot/zfs/zfsimpl.h:790:2:
note: array 'dn_bonus' declared here
        uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)];
------



--=-jZFGj/1IUJZOT3Ykd/EZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAABAgAGBQJTXpJpAAoJEBkJRdwI6BaHIugH+wdDO3ncstCGMZP9w30PBviF
2wYwFzE6yMzdrgVK0lY7tkTjl4Q4NUnW0G0poufPN88bgA8BHCbcn/UV5MncTown
85ex5wrb1m56bc7IYMHf8cafSy4imUNRtVn29eXn6Cul2qVlSBFq5uFMti6R8AfZ
t/O63VKpRFdqiS7CdZF+sY432VIPKpmyGbLv5xta5olV4FySNSe2il1wkIX3Hq2f
iTYXYmV3E0iWFt2yexkxd3Ur+g1uYhga9OKXzbBi11cZiofghvXdWspEOPq1/sj+
opVJRnPzjVIvVL7G7+iu2wEbhIH84kYef4L+6a23rofen81rKe7ZE+zENHPolNc=
=M5mD
-----END PGP SIGNATURE-----

--=-jZFGj/1IUJZOT3Ykd/EZ--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1398706803.1089.3.camel>