Blame SOURCES/1560191-mpo-7.6.0-madvise.2.patch

96cc1f
From 1bcf4b3aaf39cedd42bb5b34a81c6044b8a02d5a Mon Sep 17 00:00:00 2001
96cc1f
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
96cc1f
Date: Tue, 19 Jun 2018 13:13:18 +0200
96cc1f
Subject: [PATCH] madvise.2: document MADV_WIPEONFORK and MADV_KEEPONFORK
96cc1f
---
96cc1f
 man-pages/en/man2/madvise.2 | 39 +++++++++++++++++++++++++++++++++++++
96cc1f
 man-pages/man2/madvise.2    | 39 +++++++++++++++++++++++++++++++++++++
96cc1f
 2 files changed, 78 insertions(+)
96cc1f
96cc1f
diff --git a/man-pages/en/man2/madvise.2 b/man-pages/en/man2/madvise.2
96cc1f
index 4e693da..8a1c46d 100644
96cc1f
--- a/man-pages/en/man2/madvise.2
96cc1f
+++ b/man-pages/en/man2/madvise.2
96cc1f
@@ -265,6 +265,33 @@ file (see
96cc1f
 .BR MADV_DODUMP " (since Linux 3.4)"
96cc1f
 Undo the effect of an earlier
96cc1f
 .BR MADV_DONTDUMP .
96cc1f
+.TP
96cc1f
+.BR MADV_WIPEONFORK " (since Linux 4.14)"
96cc1f
+.\" commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
96cc1f
+Present the child process with zero-filled memory in this range after a
96cc1f
+.BR fork (2).
96cc1f
+This is useful in forking servers in order to ensure
96cc1f
+that sensitive per-process data
96cc1f
+(for example, PRNG seeds, cryptographic secrets, and so on)
96cc1f
+is not handed to child processes.
96cc1f
+.IP
96cc1f
+The
96cc1f
+.B MADV_WIPEONFORK
96cc1f
+operation can be applied only to private anonymous pages (see
96cc1f
+.BR mmap (2)).
96cc1f
+.IP
96cc1f
+Within the child created by
96cc1f
+.BR fork (2),
96cc1f
+the
96cc1f
+.B MADV_WIPEONFORK
96cc1f
+setting remains in place on the specified address range.
96cc1f
+This setting is cleared during
96cc1f
+.BR execve (2).
96cc1f
+.TP
96cc1f
+.BR MADV_KEEPONFORK " (since Linux 4.14)"
96cc1f
+.\" commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
96cc1f
+Undo the effect of an earlier
96cc1f
+.BR MADV_WIPEONFORK .
96cc1f
 .SH RETURN VALUE
96cc1f
 On success
96cc1f
 .BR madvise ()
96cc1f
@@ -308,6 +335,18 @@ but the kernel was not configured with
96cc1f
 .BR CONFIG_KSM .
96cc1f
 .RE
96cc1f
 .TP
96cc1f
+.B EINVAL
96cc1f
+.I advice
96cc1f
+is
96cc1f
+.BR MADV_FREE
96cc1f
+or
96cc1f
+.BR MADV_WIPEONFORK
96cc1f
+but the specified address range includes file, Huge TLB,
96cc1f
+.BR MAP_SHARED ,
96cc1f
+or
96cc1f
+.BR VM_PFNMAP
96cc1f
+ranges.
96cc1f
+.TP
96cc1f
 .B EIO
96cc1f
 (for
96cc1f
 .BR MADV_WILLNEED )
96cc1f
diff --git a/man-pages/man2/madvise.2 b/man-pages/man2/madvise.2
96cc1f
index 4e693da..8a1c46d 100644
96cc1f
--- a/man-pages/man2/madvise.2
96cc1f
+++ b/man-pages/man2/madvise.2
96cc1f
@@ -265,6 +265,33 @@ file (see
96cc1f
 .BR MADV_DODUMP " (since Linux 3.4)"
96cc1f
 Undo the effect of an earlier
96cc1f
 .BR MADV_DONTDUMP .
96cc1f
+.TP
96cc1f
+.BR MADV_WIPEONFORK " (since Linux 4.14)"
96cc1f
+.\" commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
96cc1f
+Present the child process with zero-filled memory in this range after a
96cc1f
+.BR fork (2).
96cc1f
+This is useful in forking servers in order to ensure
96cc1f
+that sensitive per-process data
96cc1f
+(for example, PRNG seeds, cryptographic secrets, and so on)
96cc1f
+is not handed to child processes.
96cc1f
+.IP
96cc1f
+The
96cc1f
+.B MADV_WIPEONFORK
96cc1f
+operation can be applied only to private anonymous pages (see
96cc1f
+.BR mmap (2)).
96cc1f
+.IP
96cc1f
+Within the child created by
96cc1f
+.BR fork (2),
96cc1f
+the
96cc1f
+.B MADV_WIPEONFORK
96cc1f
+setting remains in place on the specified address range.
96cc1f
+This setting is cleared during
96cc1f
+.BR execve (2).
96cc1f
+.TP
96cc1f
+.BR MADV_KEEPONFORK " (since Linux 4.14)"
96cc1f
+.\" commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
96cc1f
+Undo the effect of an earlier
96cc1f
+.BR MADV_WIPEONFORK .
96cc1f
 .SH RETURN VALUE
96cc1f
 On success
96cc1f
 .BR madvise ()
96cc1f
@@ -308,6 +335,18 @@ but the kernel was not configured with
96cc1f
 .BR CONFIG_KSM .
96cc1f
 .RE
96cc1f
 .TP
96cc1f
+.B EINVAL
96cc1f
+.I advice
96cc1f
+is
96cc1f
+.BR MADV_FREE
96cc1f
+or
96cc1f
+.BR MADV_WIPEONFORK
96cc1f
+but the specified address range includes file, Huge TLB,
96cc1f
+.BR MAP_SHARED ,
96cc1f
+or
96cc1f
+.BR VM_PFNMAP
96cc1f
+ranges.
96cc1f
+.TP
96cc1f
 .B EIO
96cc1f
 (for
96cc1f
 .BR MADV_WILLNEED )
96cc1f
-- 
96cc1f
2.17.1
96cc1f