[SCM] Samba Shared Repository - branch master updated
Björn Jacke
bjacke at samba.org
Fri Feb 22 11:31:01 UTC 2019
The branch, master has been updated
via b33fad77268 notifyd: Fix SIGBUS on sparc
from 92a90524373 ctdb-tests: Add test for ctdb_io.c
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b33fad772682e87ecc2b46b1b54625caeccc9eb2
Author: Jiří Šašek <jiri.sasek at oracle.com>
Date: Thu Dec 6 14:10:53 2018 +0100
notifyd: Fix SIGBUS on sparc
Problem is the structure "struct notify_instance" can lay in message buffer on
address not dividable by 8 but this structure begins by uint_64 (secs in
time-stamp). Structure should be re-packed to standalone buffer before the use.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13704
Signed-off-by: jiri.sasek at oracle.com
Reviewed-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Stefan Metzmacher <metze at samba.org>
Autobuild-User(master): Björn Jacke <bjacke at samba.org>
Autobuild-Date(master): Fri Feb 22 12:30:11 CET 2019 on sn-devel-144
-----------------------------------------------------------------------
Summary of changes:
source3/smbd/notifyd/notifyd.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c
index 811ada969fb..6ff1de5b5fe 100644
--- a/source3/smbd/notifyd/notifyd.c
+++ b/source3/smbd/notifyd/notifyd.c
@@ -575,6 +575,7 @@ static void notifyd_rec_change(struct messaging_context *msg_ctx,
struct notify_rec_change_msg *msg;
size_t pathlen;
bool ok;
+ struct notify_instance instance;
DBG_DEBUG("Got %zu bytes from %s\n", data->length,
server_id_str_buf(src, &idbuf));
@@ -585,8 +586,10 @@ static void notifyd_rec_change(struct messaging_context *msg_ctx,
return;
}
+ memcpy(&instance, &msg->instance, sizeof(instance)); /* avoid SIGBUS */
+
ok = notifyd_apply_rec_change(
- &src, msg->path, pathlen, &msg->instance,
+ &src, msg->path, pathlen, &instance,
state->entries, state->sys_notify_watch, state->sys_notify_ctx,
state->msg_ctx);
if (!ok) {
@@ -1337,6 +1340,7 @@ static void notifyd_apply_reclog(struct notifyd_peer *peer,
struct notify_rec_change_msg *chg;
size_t pathlen;
bool ok;
+ struct notify_instance instance;
ok = notifyd_parse_rec_change(r->buf.data, r->buf.length,
&chg, &pathlen);
@@ -1346,8 +1350,11 @@ static void notifyd_apply_reclog(struct notifyd_peer *peer,
goto fail;
}
+ /* avoid SIGBUS */
+ memcpy(&instance, &chg->instance, sizeof(instance));
+
ok = notifyd_apply_rec_change(&r->src, chg->path, pathlen,
- &chg->instance, peer->db,
+ &instance, peer->db,
state->sys_notify_watch,
state->sys_notify_ctx,
state->msg_ctx);
--
Samba Shared Repository
More information about the samba-cvs
mailing list