lkml.org 
[lkml]   [2022]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] misc: sgi-gru: fix use-after-free error in gru_set_context_option, gru_fault and gru_handle_user_call_os
Hi Greg,

Very happy to receive your email. I was outgoing in the weekend and
sorry for my late reply. I'll fix the patch and resend it to you.

Best regards,
Zheng Wang

Greg KH <gregkh@linuxfoundation.org> 于2022年9月24日周六 20:54写道:
>
> On Mon, Sep 19, 2022 at 10:32:05PM +0800, Zheng Wang wrote:
> > In grufile.c, gru_file_unlocked_ioctl function can be called by user.
> >
> > If the req is GRU_SET_CONTEXT_OPTION, it will call gru_set_context_option.
> >
> > In gru_set_context_option, as req can be controlled by user,
> >
> > We can reach gru_check_context_placement function call.
> >
> > In gru_check_context_placement function, if the error path was steped,
> >
> > say gru_check_chiplet_assignment return 0,
> >
> > Then it will fall into gru_unload_context function.
> >
> > And it will finnaly call kfree gts in gts_drop function.
> >
> > Then gru_unlock_gts will be called in gru_set_context_option function.
> >
> > This is a typical Use after free.
> >
> > The same problem exists in gru_handle_user_call_os and gru_fault.
> >
> > Fix it by introduce the return value to see if gts is in good case or not.
> >
> > Free the gts in caller when gru_check_chiplet_assignment check failed.
>
> Your text formatting is a bit odd, don't you think?
>
> >
> > Reported-by: Zheng Wang <hackerzheng666@gmail.com> Zhuorao Yang <alex000young@gmail.com>
>
> Why twice?
>
> Should be two different reported-by lines, right?
>
> Otherwise looks good, can you fix that up and resend?
>
> thanks,
>
> greg k-h

\
 
 \ /
  Last update: 2022-09-26 04:43    [W:0.045 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site