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

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