Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Calvin Owens <calvin@wbinvd.org>
Cc: Rodolfo Giometti <giometti@enneenne.com>,
	George Spelvin <linux@horizon.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3] pps: Fix a use-after-free
Date: Tue, 5 Nov 2024 10:44:46 +0100	[thread overview]
Message-ID: <2024110551-fiction-casket-7597@gregkh> (raw)
In-Reply-To: <abc43b18f21379c21a4d2c63372a04b2746be665.1730792731.git.calvin@wbinvd.org>

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.

>  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.)

thanks,

greg k-h

  reply	other threads:[~2024-11-05  9:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ZuMvmbf6Ru_pxhWn@mozart.vkv.me>
2024-09-14  0:24 ` [PATCH v2] pps: Remove embedded cdev to fix a use-after-free Calvin Owens
2024-09-16  8:16   ` Rodolfo Giometti
2024-10-13 15:04   ` Greg Kroah-Hartman
2024-10-20 16:43     ` Calvin Owens
2024-11-05  7:56     ` [PATCH v3] pps: Fix " Calvin Owens
2024-11-05  9:44       ` Greg Kroah-Hartman [this message]
2024-11-05 17:36         ` Calvin Owens
2024-11-12  4:13         ` [PATCH v4] " Calvin Owens
2024-12-02 18:16           ` Michal Schmidt
2024-11-05 17:20       ` [PATCH v3] " kernel test robot
2024-11-06  4:24       ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2024110551-fiction-casket-7597@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=calvin@wbinvd.org \
    --cc=giometti@enneenne.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@horizon.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox