Re: [PATCH v2] fork: avoid inappropriate uprobe access to invalid mm

2024-12-10 Thread David Hildenbrand
On 10.12.24 21:59, Lorenzo Stoakes wrote: On Tue, Dec 10, 2024 at 08:35:30PM +0100, David Hildenbrand wrote: On 10.12.24 18:24, Lorenzo Stoakes wrote: If dup_mmap() encounters an issue, currently uprobe is able to access the relevant mm via the reverse mapping (in build_map_info()), and if we a

Re: [PATCH v2] fork: avoid inappropriate uprobe access to invalid mm

2024-12-10 Thread Lorenzo Stoakes
On Tue, Dec 10, 2024 at 08:35:30PM +0100, David Hildenbrand wrote: > On 10.12.24 18:24, Lorenzo Stoakes wrote: > > If dup_mmap() encounters an issue, currently uprobe is able to access the > > relevant mm via the reverse mapping (in build_map_info()), and if we are > > very unlucky with a race wind

Re: [PATCH v2] fork: avoid inappropriate uprobe access to invalid mm

2024-12-10 Thread David Hildenbrand
On 10.12.24 18:24, Lorenzo Stoakes wrote: If dup_mmap() encounters an issue, currently uprobe is able to access the relevant mm via the reverse mapping (in build_map_info()), and if we are very unlucky with a race window, observe invalid XA_ZERO_ENTRY state which we establish as part of the fork

[PATCH v2] fork: avoid inappropriate uprobe access to invalid mm

2024-12-10 Thread Lorenzo Stoakes
If dup_mmap() encounters an issue, currently uprobe is able to access the relevant mm via the reverse mapping (in build_map_info()), and if we are very unlucky with a race window, observe invalid XA_ZERO_ENTRY state which we establish as part of the fork error path. This occurs because uprobe_writ