Thread (11 messages) 11 messages, 4 authors, 2024-09-24

Re: [PATCH 1/2] mm/madvise: introduce PR_MADV_SELF flag to process_madvise()

From: Lorenzo Stoakes <hidden>
Date: 2024-09-24 07:49:28
Also in: linux-mm, lkml

On Mon, Sep 23, 2024 at 09:49:43PM GMT, Arnd Bergmann wrote:
On Mon, Sep 23, 2024, at 19:34, Lorenzo Stoakes wrote:
quoted
On Mon, Sep 23, 2024 at 11:56:06AM GMT, Shakeel Butt wrote:

+	/* Require PTRACE_MODE_READ to avoid leaking ASLR metadata. */
+	mm = mm_access(task, PTRACE_MODE_READ_FSCREDS);
+	if (IS_ERR_OR_NULL(mm)) {
+		ret = IS_ERR(mm) ? PTR_ERR(mm) : -ESRCH;
+		goto release_task;
+	}
Any chance we can fix mm_access() to not be able to return
a NULL pointer and an error pointer?  IS_ERR_OR_NULL() is
usually an indication of a confusing API, and this is
clearly one of them, given that only one of the
callers actually wants the NULL value instead of -ESRCH.

    Arnd
Agreed, this should be fixed. I think it'd be a bit out of the scope of
this series so will send something separately for this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help