[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZypXq1Q0SfiFTOjX@mozart.vkv.me>
Date: Tue, 5 Nov 2024 09:36:43 -0800
From: Calvin Owens <calvin@...nvd.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Rodolfo Giometti <giometti@...eenne.com>,
George Spelvin <linux@...izon.com>, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v3] pps: Fix a use-after-free
On Tuesday 11/05 at 10:44 +0100, Greg Kroah-Hartman wrote:
> On Mon, Nov 04, 2024 at 11:56:19PM -0800, Calvin Owens wrote:
> > - dev_info(pps->dev, "removed\n");
> > + dev_info(&pps->dev, "removed\n");
>
> Nit, when drivers work properly, they are quiet, no need for these
> dev_info() calls.
I'll change these to dev_dbg().
> > static int pps_cdev_release(struct inode *inode, struct file *file)
> > {
> > - struct pps_device *pps = container_of(inode->i_cdev,
> > - struct pps_device, cdev);
> > - kobject_put(&pps->dev->kobj);
> > + struct pps_device *pps = file->private_data;
> > +
> > + WARN_ON(pps->id != iminor(inode));
>
> If this can happen, handle it and move on. Don't just reboot the
> machine if it's something that could be triggered (remember about
> panic-on-warn systems.)
It's a fairly paranoid WARN(): it's a bug if it happens, and I don't
think it can happen. Should I remove it?
The test-robot found a couple *pps->dev dereferences I missed, I'll send
a v4 in the next day or two with those fixed as well.
Thanks,
Calvin
> thanks,
>
> greg k-h
Powered by blists - more mailing lists