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

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