summaryrefslogtreecommitdiff
path: root/svc.configd/debian/patches/svc.configd-amd64-segfault.patch
diff options
context:
space:
mode:
Diffstat (limited to 'svc.configd/debian/patches/svc.configd-amd64-segfault.patch')
-rw-r--r--svc.configd/debian/patches/svc.configd-amd64-segfault.patch23
1 files changed, 23 insertions, 0 deletions
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 */