[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJedcCyLN1xEndJ6K0Dr8hux2kS2KFCtvcCcFAdFX7gSBKTmrg@mail.gmail.com>
Date: Mon, 26 Sep 2022 10:41:47 +0800
From: Zheng Hacker <hackerzheng666@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: Zheng Wang <zyytlz.wz@....com>, dimitri.sivanich@....com,
arnd@...db.de, linux-kernel@...r.kernel.org,
alex000young@...il.com, security@...nel.org
Subject: Re: [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@...uxfoundation.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@...il.com> Zhuorao Yang <alex000young@...il.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
Powered by blists - more mailing lists