Re: Fixed buffers have out-dated content

Martin Raiber
2021-01-17T20:09:42Z

On 17.01.2021 00:34 Linus Torvalds wrote:
> On Sat, Jan 16, 2021 at 3:05 PM Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> I'll go think about this.
>>
>> Martin, since you can apparently trigger the problem easily, hopefully
>> you're willing to try a couple of patches?
> Hmm. It might end up being as simple as the attached patch.
>
> I'm not super-happy with this situation (that whole nasty security
> issue had some horrible cascading problems), and this only really
> fixes _pinned_ pages.
>
> In particular, somebody doing a plain get_user_pages() for writing can
> still hit issues (admittedly that's true in general, but the vm
> changes made it much more obviously true).
>
> But for the case of io_uring buffers, this looks like the obvious simple fix.
>
> I don't have a load to test this with, so I'll come back to ask Martin
> to do so...
>
> Linus

Thanks! With the patch (skip swapping pinned pages) the problem doesn't
occur anymore, so it seems to fix it.