Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-04 Thread Axel Rasmussen
On Fri, Dec 4, 2020 at 8:36 AM Vlastimil Babka wrote: > > On 12/2/20 2:11 AM, Shakeel Butt wrote: > > On Tue, Dec 1, 2020 at 5:07 PM Steven Rostedt wrote: > >> > >> On Tue, 1 Dec 2020 16:36:32 -0800 > >> Shakeel Butt wrote: > >> > >> > SGTM but note that usually Andrew squash all the patches

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-04 Thread Vlastimil Babka
On 12/2/20 2:11 AM, Shakeel Butt wrote: > On Tue, Dec 1, 2020 at 5:07 PM Steven Rostedt wrote: >> >> On Tue, 1 Dec 2020 16:36:32 -0800 >> Shakeel Butt wrote: >> >> > SGTM but note that usually Andrew squash all the patches into one >> > before sending to Linus. If you plan to replace the path

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-02 Thread Tejun Heo
Hello, On Wed, Dec 02, 2020 at 03:23:57PM -0800, Shakeel Butt wrote: > > There've been some changes to cgroup ids recently and now cgroup id, ino and > > its file_handle are all compatible. On 64bit ino machines, they're all the > > same and won't be reused. On 32bit ino machines, the lower 32bit

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-02 Thread Shakeel Butt
On Wed, Dec 2, 2020 at 11:01 AM Tejun Heo wrote: > > Hello, > > On Tue, Dec 01, 2020 at 12:53:46PM -0800, Shakeel Butt wrote: > > The writeback tracepoint in include/trace/events/writeback.h is > > already using the cgroup IDs. Actually it used to use cgroup_path but > > converted to cgroup_ino.

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-02 Thread Tejun Heo
Hello, On Tue, Dec 01, 2020 at 12:53:46PM -0800, Shakeel Butt wrote: > The writeback tracepoint in include/trace/events/writeback.h is > already using the cgroup IDs. Actually it used to use cgroup_path but > converted to cgroup_ino. > > Tejun, how do you use these tracepoints? There've been

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Shakeel Butt
On Tue, Dec 1, 2020 at 5:07 PM Steven Rostedt wrote: > > On Tue, 1 Dec 2020 16:36:32 -0800 > Shakeel Butt wrote: > > > SGTM but note that usually Andrew squash all the patches into one > > before sending to Linus. If you plan to replace the path buffer with > > integer IDs then no need to spend

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Steven Rostedt
On Tue, 1 Dec 2020 16:36:32 -0800 Shakeel Butt wrote: > SGTM but note that usually Andrew squash all the patches into one > before sending to Linus. If you plan to replace the path buffer with > integer IDs then no need to spend time fixing buffer related bug. I don't think Andrew squashes all

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Shakeel Butt
On Tue, Dec 1, 2020 at 4:16 PM Axel Rasmussen wrote: > > On Tue, Dec 1, 2020 at 12:53 PM Shakeel Butt wrote: > > > > +Tejun Heo > > > > On Tue, Dec 1, 2020 at 11:14 AM Axel Rasmussen > > wrote: > > > > > > On Tue, Dec 1, 2020 at 10:42 AM Shakeel Butt wrote: > > > > > > > > On Tue, Dec 1, 2020

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Axel Rasmussen
On Tue, Dec 1, 2020 at 12:53 PM Shakeel Butt wrote: > > +Tejun Heo > > On Tue, Dec 1, 2020 at 11:14 AM Axel Rasmussen > wrote: > > > > On Tue, Dec 1, 2020 at 10:42 AM Shakeel Butt wrote: > > > > > > On Tue, Dec 1, 2020 at 9:56 AM Greg Thelen wrote: > > > > > > > > Axel Rasmussen wrote: > > >

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Shakeel Butt
+Tejun Heo On Tue, Dec 1, 2020 at 11:14 AM Axel Rasmussen wrote: > > On Tue, Dec 1, 2020 at 10:42 AM Shakeel Butt wrote: > > > > On Tue, Dec 1, 2020 at 9:56 AM Greg Thelen wrote: > > > > > > Axel Rasmussen wrote: > > > > > > > On Mon, Nov 30, 2020 at 5:34 PM Shakeel Butt > > > > wrote: > >

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Axel Rasmussen
On Tue, Dec 1, 2020 at 10:42 AM Shakeel Butt wrote: > > On Tue, Dec 1, 2020 at 9:56 AM Greg Thelen wrote: > > > > Axel Rasmussen wrote: > > > > > On Mon, Nov 30, 2020 at 5:34 PM Shakeel Butt wrote: > > >> > > >> On Mon, Nov 30, 2020 at 3:43 PM Axel Rasmussen > > >> wrote: > > >> > > > >> >

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Shakeel Butt
On Tue, Dec 1, 2020 at 9:56 AM Greg Thelen wrote: > > Axel Rasmussen wrote: > > > On Mon, Nov 30, 2020 at 5:34 PM Shakeel Butt wrote: > >> > >> On Mon, Nov 30, 2020 at 3:43 PM Axel Rasmussen > >> wrote: > >> > > >> > syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug > >>

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Greg Thelen
Axel Rasmussen wrote: > On Mon, Nov 30, 2020 at 5:34 PM Shakeel Butt wrote: >> >> On Mon, Nov 30, 2020 at 3:43 PM Axel Rasmussen >> wrote: >> > >> > syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug >> > is that an ongoing trace event might race with the tracepoint being

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-12-01 Thread Axel Rasmussen
On Mon, Nov 30, 2020 at 5:34 PM Shakeel Butt wrote: > > On Mon, Nov 30, 2020 at 3:43 PM Axel Rasmussen > wrote: > > > > syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug > > is that an ongoing trace event might race with the tracepoint being > > disabled (and therefore the

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-11-30 Thread Steven Rostedt
On Mon, 30 Nov 2020 15:35:04 -0800 Axel Rasmussen wrote: > syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug > is that an ongoing trace event might race with the tracepoint being > disabled (and therefore the _unreg() callback being called). Consider > this ordering: > >

Re: [PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-11-30 Thread Shakeel Butt
On Mon, Nov 30, 2020 at 3:43 PM Axel Rasmussen wrote: > > syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug > is that an ongoing trace event might race with the tracepoint being > disabled (and therefore the _unreg() callback being called). Consider > this ordering: > > T1:

[PATCH] mm: mmap_lock: fix use-after-free race and css ref leak in tracepoints

2020-11-30 Thread Axel Rasmussen
syzbot reported[1] a use-after-free introduced in 0f818c4bc1f3. The bug is that an ongoing trace event might race with the tracepoint being disabled (and therefore the _unreg() callback being called). Consider this ordering: T1: trace event fires, get_mm_memcg_path() is called T1: