diff options
author | Xin Li <delphij@FreeBSD.org> | 2011-10-21 11:44:31 -0400 |
---|---|---|
committer | Xin Li <delphij@FreeBSD.org> | 2011-10-21 11:44:31 -0400 |
commit | 383e7c74ff3827d20f23fa87e37bd52d86fc1a26 (patch) | |
tree | 88cbac5de7b7d743e5578fcdc3dccee8e53aa7a5 /usr/src | |
parent | 1df56ada43861dec046a93e1643fec1c4e7b2ed5 (diff) | |
download | illumos-joyent-383e7c74ff3827d20f23fa87e37bd52d86fc1a26.tar.gz |
1661 ZFS bug in sa_find_sizes() that can lead to panic
1313 Integer overflow in txg_delay() (fix copyright)
Reviewed by: Matthew Ahrens <matt@delphix.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/fs/zfs/sa.c | 5 | ||||
-rw-r--r-- | usr/src/uts/common/fs/zfs/txg.c | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/zfs/sa.c b/usr/src/uts/common/fs/zfs/sa.c index 4cb4546b25..57b3565cba 100644 --- a/usr/src/uts/common/fs/zfs/sa.c +++ b/usr/src/uts/common/fs/zfs/sa.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 iXsystems, Inc */ #include <sys/zfs_context.h> @@ -605,14 +606,14 @@ sa_find_sizes(sa_os_t *sa, sa_bulk_attr_t *attr_desc, int attr_count, * and spill buffer. */ if (buftype == SA_BONUS && *index == -1 && - P2ROUNDUP(*total + hdrsize, 8) > + *total + P2ROUNDUP(hdrsize, 8) > (full_space - sizeof (blkptr_t))) { *index = i; done = B_TRUE; } next: - if (P2ROUNDUP(*total + hdrsize, 8) > full_space && + if (*total + P2ROUNDUP(hdrsize, 8) > full_space && buftype == SA_BONUS) *will_spill = B_TRUE; } diff --git a/usr/src/uts/common/fs/zfs/txg.c b/usr/src/uts/common/fs/zfs/txg.c index ed454aa87b..55b1f3884b 100644 --- a/usr/src/uts/common/fs/zfs/txg.c +++ b/usr/src/uts/common/fs/zfs/txg.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright 2011 Martin Matuska */ #include <sys/zfs_context.h> |