Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 11 Jun 2014 09:59:56 +0000 (UTC)
From: Thorsten Glaser <tg@...ian.org>
To: musl@...ts.openwall.com
Subject: Re: thoughts on reallocarray, explicit_bzero?

Szabolcs Nagy <nsz <at> port70.net> writes:

> static size_t sizemul(size_t a, size_t b)
> {
> 	return b>1 && a>1 && a>-1/b ? -1 : a*b;
> }

There is no -1 in size_t. (And *you* complain about OpenBSD checks…)

> i don't see how the openbsd explicit_bzero stops the
> compiler to do optimizations..

On OpenBSD: by being in libc which is not built with LTO.
I’ve wondered about how to do this either. Maybe:

void
explicit_bzero(void *s, size_t n)
{
	bzero(s, n);
	__lto_boundary
}

Then you #define __lto_boundary to something like
	__asm__ volatile ("" : : : "memory");
or
	__sync_synchronize();
or some C11 barrier function.

bye,
//mirabilos

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.