Skip to content

Commit 362ab4a

Browse files
author
justin
committed
Missing MAP_PRIVATE on mmap
1 parent d31cd07 commit 362ab4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/libc/gen/arc4random.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: arc4random.c,v 1.29 2015/03/19 05:46:25 riastradh Exp $ */
1+
/* $NetBSD: arc4random.c,v 1.30 2015/05/13 23:15:57 justin Exp $ */
22

33
/*-
44
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
5252
*/
5353

5454
#include <sys/cdefs.h>
55-
__RCSID("$NetBSD: arc4random.c,v 1.29 2015/03/19 05:46:25 riastradh Exp $");
55+
__RCSID("$NetBSD: arc4random.c,v 1.30 2015/05/13 23:15:57 justin Exp $");
5656

5757
#include "namespace.h"
5858
#include "reentrant.h"
@@ -444,7 +444,7 @@ arc4random_prng_create(void)
444444
struct arc4random_prng *prng;
445445
const size_t size = roundup(sizeof(*prng), sysconf(_SC_PAGESIZE));
446446

447-
prng = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_ANON, -1, 0);
447+
prng = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
448448
if (prng == MAP_FAILED)
449449
goto fail0;
450450
if (minherit(prng, size, MAP_INHERIT_ZERO) == -1)

0 commit comments

Comments
 (0)