From: "David Hildenbrand (Arm)" <david@kernel.org>
To: David Laight <david.laight.linux@gmail.com>
Cc: Usama Arif <usama.arif@linux.dev>,
Alban Crequy <alban.crequy@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christian Brauner <brauner@kernel.org>,
Lorenzo Stoakes <ljs@kernel.org>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Alban Crequy <albancrequy@microsoft.com>,
Peter Xu <peterx@redhat.com>, Willy Tarreau <w@1wt.eu>,
linux-kselftest@vger.kernel.org, shuah@kernel.org
Subject: Re: [PATCH v2 1/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev
Date: Thu, 23 Apr 2026 16:17:16 +0200 [thread overview]
Message-ID: <07f546eb-e523-4742-a8b1-ab830ec4d0d0@kernel.org> (raw)
In-Reply-To: <20260423150423.1a428820@pumpkin>
On 4/23/26 16:04, David Laight wrote:
> On Thu, 23 Apr 2026 14:52:26 +0200
> "David Hildenbrand (Arm)" <david@kernel.org> wrote:
>
>>>
>>> pidfd_get_task() returns ERR_PTR() on failure (e.g. ERR_PTR(-EBADF)),
>>> but the code checks "if (!task)" which only catches NULL. An invalid
>>> pidfd will cause mm_access() and put_task_struct() to dereference an
>>> error pointer, crashing the kernel.
>>
>> Yes. Should we add proper selftests that exercise these code paths?
>>
Just to clarify: I meant adding more tests to patch #2 that trigger the issue here.
>
> Probably worth checking what happens when a 64bit process tries to
> read high addresses of a 32bit process.
>
I guess these are a bit harder to write, but would certainly be useful.
--
Cheers,
David
next prev parent reply other threads:[~2026-04-23 14:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 14:54 [PATCH v2 0/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev Alban Crequy
2026-04-08 14:54 ` [PATCH v2 1/2] " Alban Crequy
2026-04-09 14:22 ` Usama Arif
2026-04-23 12:52 ` David Hildenbrand (Arm)
2026-04-23 14:04 ` David Laight
2026-04-23 14:17 ` David Hildenbrand (Arm) [this message]
2026-04-08 14:54 ` [PATCH v2 2/2] selftests/mm: add tests for process_vm_readv flags Alban Crequy
2026-04-09 12:38 ` [PATCH v2 0/2] mm/process_vm_access: pidfd and nowait support for process_vm_readv/writev Christian Brauner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=07f546eb-e523-4742-a8b1-ab830ec4d0d0@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alban.crequy@gmail.com \
--cc=albancrequy@microsoft.com \
--cc=brauner@kernel.org \
--cc=david.laight.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=shuah@kernel.org \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox