Re: [PATCH] sh: intc: Fix possible UAF in register_intc_controller
John Paul Adrian Glaubitz <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <cf281c9e0d04483d7cafd89aeb25b55878e81385.camel@physik.fu-berlin.de> |
Hi Chen, On Thu, 2024-11-07 at 08:57 +0800, Chen Ridong wrote: > > On 2024/10/30 14:08, Chen Ridong wrote: > > From: Chen Ridong <[email protected]> > > > > When it goes to error, the 'd' is freed, but 'd->list' was not deleted > > from 'intc_list', which may lead to a UAF. > > > > Fixes: 01e9651a21bc ("sh: add INTC out of memory error handling") > > Signed-off-by: Chen Ridong <[email protected]> > > --- > > drivers/sh/intc/core.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c > > index 74350b5871dc..a30d205e7a43 100644 > > --- a/drivers/sh/intc/core.c > > +++ b/drivers/sh/intc/core.c > > @@ -387,6 +387,7 @@ int __init register_intc_controller(struct intc_desc *desc) > > > > kfree(d->window); > > err1: > > + list_del(&d->list); > > kfree(d); > > err0: > > pr_err("unable to allocate INTC memory\n"); > > Friendly ping I have seen your patch. I will try to review it on the weekend. I have been very busy with lots of other work, unfortunately. I usually have one day where I do all the review and merge the patches for SH. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913