summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-01-23 02:19:45 +0000
committerIgor Pashev <pashev.igor@gmail.com>2013-01-23 02:21:03 +0000
commit816dfd29dcb137f744e02893384e4e082fe21e96 (patch)
tree2df584efa21b8217a1441b775f16c3d56a1b58ba
parent88e54a60efbd8a934f8c16e7e236f0cedf91e0b5 (diff)
downloadillumos-packaging-816dfd29dcb137f744e02893384e4e082fe21e96.tar.gz
Fixed segfault in svc.configd on amd64:
TX_SIZE macro must cast to uint32_t when using P2ROUNDUP macro.
-rw-r--r--svc.configd/debian/changelog6
-rw-r--r--svc.configd/debian/patches/series1
-rw-r--r--svc.configd/debian/patches/svc.configd-amd64-segfault.patch23
3 files changed, 28 insertions, 2 deletions
diff --git a/svc.configd/debian/changelog b/svc.configd/debian/changelog
index 2fcd1b9..0e2d415 100644
--- a/svc.configd/debian/changelog
+++ b/svc.configd/debian/changelog
@@ -1,8 +1,10 @@
-svc.configd (2.10-5) UNRELEASED; urgency=low
+svc.configd (2.10-6) unstable; urgency=low
* Build depends on libbsm1-dev (for svc.configd itself)
+ * Fixed segfault in svc.configd on amd64: TX_SIZE macro
+ must cast to uint32_t when using P2ROUNDUP macro.
- -- Igor Pashev <pashev.igor@gmail.com> Mon, 14 Jan 2013 00:02:57 +0000
+ -- Igor Pashev <pashev.igor@gmail.com> Wed, 23 Jan 2013 02:19:19 +0000
svc.configd (2.10-4) unstable; urgency=low
diff --git a/svc.configd/debian/patches/series b/svc.configd/debian/patches/series
index eb67790..8713bbd 100644
--- a/svc.configd/debian/patches/series
+++ b/svc.configd/debian/patches/series
@@ -6,3 +6,4 @@ svc.configd-libsqlite.patch
svc.configd-integer.patch
svc.configd-pointers.patch
svc.configd-rc_node_setup_iter.patch
+svc.configd-amd64-segfault.patch
diff --git a/svc.configd/debian/patches/svc.configd-amd64-segfault.patch b/svc.configd/debian/patches/svc.configd-amd64-segfault.patch
new file mode 100644
index 0000000..f1caafd
--- /dev/null
+++ b/svc.configd/debian/patches/svc.configd-amd64-segfault.patch
@@ -0,0 +1,23 @@
+Description: fix segfault of svc.configd on amd64
+ Both arguments of P2ROUNDUP must be of the same width.
+ "x" used to be uint32_t (4 bytes), but sizeof() returns
+ size_t which is 8 bytes on amd64. This gives *very* large
+ pointer value :-). The first argument must be casted too,
+ because libscf uses assert() with size_t type
+ (in usr/src/lib/libscf/common/lowlevel.c).
+ .
+ See https://blogs.oracle.com/jwadams/entry/macros_and_powers_of_two
+Bug-Dyson: http://osdyson.org/issues/92
+Index: svc.configd/usr/src/common/svc/repcache_protocol.h
+===================================================================
+--- svc.configd.orig/usr/src/common/svc/repcache_protocol.h 2012-10-08 00:25:35.000000000 +0000
++++ svc.configd/usr/src/common/svc/repcache_protocol.h 2013-01-23 01:57:07.372878733 +0000
+@@ -761,7 +761,7 @@
+ #define REP_PROTOCOL_TRANSACTION_CMD_MIN_SIZE \
+ REP_PROTOCOL_TRANSACTION_CMD_SIZE(0)
+
+-#define TX_SIZE(x) P2ROUNDUP((x), sizeof (uint32_t))
++#define TX_SIZE(x) P2ROUNDUP((uint32_t)(x), (uint32_t)sizeof (uint32_t))
+
+ struct rep_protocol_transaction_request {
+ enum rep_protocol_requestid rpr_request; /* SETUP, ABORT or TEARDOWN */