_dl_random: Typo in generic code, and definition for Hurd
Thomas Schwinge
tschwinge@gnu.org
Sun Jan 11 16:37:00 GMT 2009
Hello!
Ulrich, you introduced a typo with your recent commits. The first patch
below fixes this.
2009-01-11 Thomas Schwinge <tschwinge@gnu.org>
* sysdeps/generic/dl-osinfo.h (_dl_setup_stack_chk_guard)
(_dl_setup_pointer_guard): Use memcpy instead of memcmp.
diff --git a/sysdeps/generic/dl-osinfo.h b/sysdeps/generic/dl-osinfo.h
index 02ec28d..ee16a99 100644
--- a/sysdeps/generic/dl-osinfo.h
+++ b/sysdeps/generic/dl-osinfo.h
@@ -13,7 +13,7 @@ _dl_setup_stack_chk_guard (void *dl_random)
p[0] = 0;
}
else
- memcmp (&ret, dl_random, sizeof (ret));
+ memcpy (&ret, dl_random, sizeof (ret));
return ret;
}
@@ -24,6 +24,6 @@ _dl_setup_pointer_guard (void *dl_random, uintptr_t stack_chk_guard)
if (dl_random == NULL)
ret = stack_chk_guard;
else
- memcmp (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
+ memcpy (&ret, (char *) dl_random + sizeof (ret), sizeof (ret));
return ret;
}
And here is the snippet for the Hurd.
Again, when submitting such patches, should they include copyright year
updates, or rather not, as these may fall out of date?
2009-01-11 Thomas Schwinge <tschwinge@gnu.org>
* sysdeps/mach/hurd/dl-sysdep.c (_dl_random): Define.
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 2440682..c189c0a 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -59,6 +62,9 @@ void *__libc_stack_end;
hp_timing_t _dl_cpuclock_offset;
#endif
+/* This is never properly initialized in here. */
+void *_dl_random attribute_relro = NULL;
+
struct hurd_startup_data *_dl_hurd_data;
Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20090111/dbfb79ad/attachment.sig>
More information about the Libc-alpha
mailing list