All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*()
@ 2020-11-07  8:24 Souptick Joarder
  2020-11-07  8:24 ` [PATCH 2/2] tomoyo: Fixed typo in documentation Souptick Joarder
  2020-11-07  9:04 ` [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() John Hubbard
  0 siblings, 2 replies; 15+ messages in thread
From: Souptick Joarder @ 2020-11-07  8:24 UTC (permalink / raw)
  To: takedakn, penguin-kernel, jmorris, serge
  Cc: linux-security-module, linux-kernel, Souptick Joarder, John Hubbard

In 2019, we introduced pin_user_pages*() and now we are converting
get_user_pages*() to the new API as appropriate. [1] & [2] could
be referred for more information. This is case 5 as per document [1].

[1] Documentation/core-api/pin_user_pages.rst

[2] "Explicit pinning of user-space pages":
        https://lwn.net/Articles/807108/

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
Cc: John Hubbard <jhubbard@nvidia.com>
---
 security/tomoyo/domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/tomoyo/domain.c b/security/tomoyo/domain.c
index dc4ecc0..bd748be 100644
--- a/security/tomoyo/domain.c
+++ b/security/tomoyo/domain.c
@@ -914,7 +914,7 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos,
 	 * (represented by bprm).  'current' is the process doing
 	 * the execve().
 	 */
-	if (get_user_pages_remote(bprm->mm, pos, 1,
+	if (pin_user_pages_remote(bprm->mm, pos, 1,
 				FOLL_FORCE, &page, NULL, NULL) <= 0)
 		return false;
 #else
@@ -936,7 +936,7 @@ bool tomoyo_dump_page(struct linux_binprm *bprm, unsigned long pos,
 	}
 	/* Same with put_arg_page(page) in fs/exec.c */
 #ifdef CONFIG_MMU
-	put_page(page);
+	unpin_user_page(page);
 #endif
 	return true;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-11-10  3:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-07  8:24 [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() Souptick Joarder
2020-11-07  8:24 ` [PATCH 2/2] tomoyo: Fixed typo in documentation Souptick Joarder
2020-11-07  8:57   ` John Hubbard
2020-11-09  3:41     ` Souptick Joarder
2020-11-09  4:17       ` John Hubbard
2020-11-09  4:45         ` Tetsuo Handa
2020-11-10  3:08           ` James Morris
2020-11-07  9:04 ` [PATCH 1/2] tomoyo: Convert get_user_pages*() to pin_user_pages*() John Hubbard
2020-11-07 19:17   ` John Hubbard
2020-11-08  1:13     ` Tetsuo Handa
2020-11-08  2:17       ` John Hubbard
2020-11-08  4:12         ` Tetsuo Handa
2020-11-08  5:00           ` John Hubbard
2020-11-09  3:38             ` Souptick Joarder
2020-11-09  3:36         ` Souptick Joarder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.