public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@codeconstruct•com.au>
To: Karthikeyan KS <karthiproffesional@gmail•com>
Cc: joel@jms•id.au, andrew@aj•id.au,
	linux-arm-kernel@lists•infradead.org,
	 linux-aspeed@lists•ozlabs.org, linux-kernel@vger•kernel.org,
	 stable@vger•kernel.org
Subject: Re: [PATCH v3] soc: aspeed: lpc-snoop: Fix usercopy overflow in snoop_file_read
Date: Thu, 28 May 2026 12:09:34 +0930	[thread overview]
Message-ID: <1e2b77c7916259e3e269d19f637c29427c175350.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20260527175939.2939714-1-karthiproffesional@gmail.com>

Hi Karthikeyan,

On Wed, 2026-05-27 at 17:59 +0000, Karthikeyan KS wrote:
> diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c
> index eceeaf8df..ef6697a42 100644
> --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c
> +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c
> @@ -60,6 +60,7 @@ struct aspeed_lpc_snoop_model_data {
>  
>  struct aspeed_lpc_snoop_channel {
>  	struct kfifo		fifo;
> +	spinlock_t		lock;
>  	wait_queue_head_t	wq;
>  	struct miscdevice	miscdev;
>  };
> @@ -93,7 +94,11 @@ static ssize_t snoop_file_read(struct file *file, char __user *buffer,
>  		if (ret == -ERESTARTSYS)
>  			return -EINTR;
>  	}
> +
> +	spin_lock_irq(&chan->lock);
>  	ret = kfifo_to_user(&chan->fifo, buffer, count, &copied);
> +	spin_unlock_irq(&chan->lock);

This seems inappropriate and I expect is flagged if you compile with
CONFIG_PROVE_LOCKING=y or CONFIG_DEBUG_ATOMIC_SLEEP=y. I suggest both
if you're not already.

Further, I hit conflicts when applying your change on v7.1-rc5. Can you
please ensure you develop, build and test on recent releases.

Thanks,

Andrew


  reply	other threads:[~2026-05-28  3:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c3d474a1ec807e686c0b7ac70cc75f86898aee99.camel@codeconstruct.com.au>
2026-05-23 17:35 ` [PATCH v2] soc: aspeed: lpc-snoop: Fix usercopy overflow in snoop_file_read Karthikeyan KS
2026-05-27  3:53   ` Andrew Jeffery
2026-05-27 17:59     ` [PATCH v3] " Karthikeyan KS
2026-05-28  2:39       ` Andrew Jeffery [this message]
2026-06-01 12:52         ` [PATCH v4] " Karthikeyan KS

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=1e2b77c7916259e3e269d19f637c29427c175350.camel@codeconstruct.com.au \
    --to=andrew@codeconstruct$(echo .)com.au \
    --cc=andrew@aj$(echo .)id.au \
    --cc=joel@jms$(echo .)id.au \
    --cc=karthiproffesional@gmail$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-aspeed@lists$(echo .)ozlabs.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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