[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190806053426.GA7108@luke-XPS-13>
Date: Mon, 5 Aug 2019 22:34:26 -0700
From: Luke Nowakowski-Krijger <lnowakow@....ucsd.edu>
To: Joe Perches <joe@...ches.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
syzbot+a4387f5b6b799f6becbf@...kaller.appspotmail.com
Subject: Re: [PATCH 5.2 10/20] media: radio-raremono: change devm_k*alloc to
k*alloc
Hi there,
On Fri, Aug 02, 2019 at 03:04:25AM -0700, Joe Perches wrote:
> On Fri, 2019-08-02 at 11:40 +0200, Greg Kroah-Hartman wrote:
> > From: Luke Nowakowski-Krijger <lnowakow@....ucsd.edu>
> >
> > commit c666355e60ddb4748ead3bdd983e3f7f2224aaf0 upstream.
> >
> > Change devm_k*alloc to k*alloc to manually allocate memory
> >
> > The manual allocation and freeing of memory is necessary because when
> > the USB radio is disconnected, the memory associated with devm_k*alloc
> > is freed. Meaning if we still have unresolved references to the radio
> > device, then we get use-after-free errors.
> >
> > This patch fixes this by manually allocating memory, and freeing it in
> > the v4l2.release callback that gets called when the last radio device
> > exits.
>
> This really should be commented in the code
> and not just in the commit changelog as some
> unsuspecting person will likely undo this in
> the future without one.
You reckon I should submit a patch with the necessary parts commented?
Thanks,
- Luke
Powered by blists - more mailing lists