[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <93E6B243-9A0F-410C-8EE4-9D57E28AF5AF@lca.pw>
Date: Tue, 18 Feb 2020 07:40:06 -0500
From: Qian Cai <cai@....pw>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Andrew Morton <akpm@...ux-foundation.org>, elver@...gle.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
peterz@...radead.org,
syzbot+c034966b0b02f94f7f34@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH -next] fork: annotate a data race in vm_area_dup()
> On Feb 18, 2020, at 5:29 AM, Kirill A. Shutemov <kirill@...temov.name> wrote:
>
> I think I've got this:
>
> vm_area_dup() blindly copies all fields of orignal VMA to the new one.
> This includes coping vm_area_struct::shared.rb which is normally protected
> by i_mmap_lock. But this is fine because the read value will be
> overwritten on the following __vma_link_file() under proper protectection.
Right, multiple processes could share the same file-based address space where those vma have been linked into address_space::i_mmap via vm_area_struct::shared.rb. Thus, the reader could see its shared.rb linkage pointers got updated by other processes.
>
> So the fix is correct, but justificaiton is lacking.
>
> Also, I would like to more fine-grained annotation: marking with
> data_race() 200 bytes copy may hide other issues.
That is the harder part where I don’t think we have anything for that today. Macro, any suggestions? ASSERT_IGNORE_FIELD()?
Powered by blists - more mailing lists