On Thu, Apr 1, 2021 at 11:59 AM Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Thu, Apr 1, 2021 at 11:17 AM Suren Baghdasaryan <surenb@xxxxxxxxxx> wrote: > > > > We received a report that the copy-on-write issue repored by Jann Horn in > > https://bugs.chromium.org/p/project-zero/issues/detail?id=2045 is still > > reproducible on 4.14 and 4.19 kernels (the first issue with the reproducer > > coded in vmsplice.c). > > Gaah. > > > I confirmed this and also that the issue was not > > reproducible with 5.10 kernel. I tracked the fix to the following patch > > introduced in 5.9 which changes the do_wp_page() logic: > > > > 09854ba94c6a 'mm: do_wp_page() simplification' > > The problem here is that there's a _lot_ more patches than the few you > found that fixed various other cases (THP etc). > > > I backported this patch (#2 in the series) along with 2 prerequisite patches > > (#1 and #4) that keep the backports clean and two followup fixes to the main > > patch (#3 and #5). I had to skip the following fix: > > > > feb889fb40fa 'mm: don't put pinned pages into the swap cache' > > > > because it uses page_maybe_dma_pinned() which does not exists in earlier > > kernels. Because pin_user_pages() does not exist there as well, I *think* > > we can safely skip this fix on older kernels, but I would appreciate if > > someone could confirm that claim. > > Hmm. I think this means that swap activity can now break the > connection to a GUP page (the whole pre-pinning model), but it > probably isn't a new problem for 4.9/4.19. > > I suspect the test there should be something like > > /* Single mapper, more references than us and the map? */ > if (page_mapcount(page) == 1 && page_count(page) > 2) > goto keep_locked; > > in the pre-pinning days. > > But I really think that there are a number of other commits you're > missing too, because we had a whole series for THP fixes for the same > exact issue. > > Added Peter Xu to the cc, because he probably tracked those issues > better than I did. > > So NAK on this for now, I think this limited patch-set likely > introduces more problems than it fixes. Thanks for confirming my worries. I'll be happy to add additional backports if Peter can point me to them. Thanks, Suren. > > Linus