[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210329110909.GD2763@work>
Date: Mon, 29 Mar 2021 16:39:09 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Du Cheng <ducheng2@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
Shuah Khan <skhan@...uxfoundation.org>,
syzbot+3eec59e770685e3dc879@...kaller.appspotmail.com,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v2] net:qrtr: fix atomic idr allocation in
qrtr_port_assign()
On Mon, Mar 29, 2021 at 06:55:56PM +0800, Du Cheng wrote:
> On Sun, Mar 28, 2021 at 11:04:17AM +0100, Matthew Wilcox wrote:
> > On Sun, Mar 28, 2021 at 08:56:17AM +0200, Greg Kroah-Hartman wrote:
> > > On Sat, Mar 27, 2021 at 03:51:10PM +0000, Matthew Wilcox wrote:
> > > > On Sat, Mar 27, 2021 at 03:31:18PM +0100, Greg Kroah-Hartman wrote:
> > > > > On Sat, Mar 27, 2021 at 10:25:20PM +0800, Du Cheng wrote:
> > > > > > On Sat, Mar 27, 2021 at 03:12:14PM +0100, Greg Kroah-Hartman wrote:
> > > > > > > Adding the xarray maintainer...
> > > > > > >
> > > > > > > On Sat, Mar 27, 2021 at 10:07:02PM +0800, Du Cheng wrote:
> > > > > > > > add idr_preload() and idr_preload_end() around idr_alloc_u32(GFP_ATOMIC)
> > > > > > > > due to internal use of per_cpu variables, which requires preemption
> > > > > > > > disabling/enabling.
> > > > > > > >
> > > > > > > > reported as "BUG: "using smp_processor_id() in preemptible" by syzkaller
> > > > > > > >
> > > > > > > > Reported-by: syzbot+3eec59e770685e3dc879@...kaller.appspotmail.com
> > > > > > > > Signed-off-by: Du Cheng <ducheng2@...il.com>
> > > > > > > > ---
> > > > > > > > changelog
> > > > > > > > v1: change to GFP_KERNEL for idr_alloc_u32() but might sleep
> > > > > > > > v2: revert to GFP_ATOMIC but add preemption disable/enable protection
> > > > > > > >
> > > > > > > > net/qrtr/qrtr.c | 6 ++++++
> > > > > > > > 1 file changed, 6 insertions(+)
> > > > > > > >
> > > > > > > > diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
> > > > > > > > index edb6ac17ceca..6361f169490e 100644
> > > > > > > > --- a/net/qrtr/qrtr.c
> > > > > > > > +++ b/net/qrtr/qrtr.c
> > > > > > > > @@ -722,17 +722,23 @@ static int qrtr_port_assign(struct qrtr_sock *ipc, int *port)
> > > > > > > > mutex_lock(&qrtr_port_lock);
> > > > > > > > if (!*port) {
> > > > > > > > min_port = QRTR_MIN_EPH_SOCKET;
> > > > > > > > + idr_preload(GFP_ATOMIC);
> > > > > > > > rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, QRTR_MAX_EPH_SOCKET, GFP_ATOMIC);
> > > > > > > > + idr_preload_end();
> > > > > > >
[...]
> > > Ok, it looks like this code is just abandonded, should we remove it
> > > entirely as no one wants to maintain it?
> >
> > Fine by me. I don't use it. Better to get rid of abandonware than keep
> > a potential source of security holes.
>
> Hi Manivannan,
>
> For your information.
>
Thanks for letting me know. I'll look into it once back to work.
Thanks,
Mani
> Regards,
> Du Cheng
Powered by blists - more mailing lists