[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025062404-overcook-drank-a3ed@gregkh>
Date: Tue, 24 Jun 2025 16:41:31 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Akshay Gupta <akshay.gupta@....com>
Cc: linux-kernel@...r.kernel.org, arnd@...db.de, Anand.Umarji@....com,
Dan Carpenter <dan.carpenter@...aro.org>,
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@....com>
Subject: Re: [PATCH] misc: amd-sbi: Address issues reported in smatch
On Fri, May 30, 2025 at 01:41:58PM +0530, Akshay Gupta wrote:
> Smatch warnings are reported for below commit,
>
> Commit bb13a84ed6b7 ("misc: amd-sbi: Add support for CPUID protocol")
> from Apr 28, 2025 (linux-next), leads to the following Smatch static
> checker warning:
>
> drivers/misc/amd-sbi/rmi-core.c:132 rmi_cpuid_read() warn: bitwise OR is zero '0xffffffff00000000 & 0xffff'
> drivers/misc/amd-sbi/rmi-core.c:132 rmi_cpuid_read() warn: potential integer overflow from user 'msg->cpu_in_out << 32'
> drivers/misc/amd-sbi/rmi-core.c:213 rmi_mca_msr_read() warn: bitwise OR is zero '0xffffffff00000000 & 0xffff'
> drivers/misc/amd-sbi/rmi-core.c:213 rmi_mca_msr_read() warn: potential integer overflow from user 'msg->mcamsr_in_out << 32'
> drivers/misc/amd-sbi/rmi-core.c:376 apml_rmi_reg_xfer() warn: maybe return -EFAULT instead of the bytes remaining?
> drivers/misc/amd-sbi/rmi-core.c:394 apml_mailbox_xfer() warn: maybe return -EFAULT instead of the bytes remaining?
> drivers/misc/amd-sbi/rmi-core.c:411 apml_cpuid_xfer() warn: maybe return -EFAULT instead of the bytes remaining?
> drivers/misc/amd-sbi/rmi-core.c:428 apml_mcamsr_xfer() warn: maybe return -EFAULT instead of the bytes remaining?
>
> copy_to/from_user() returns number of bytes, not copied.
> In case data not copied, return "-EFAULT".
>
> CPUID thread data from input is available at byte 4 & 5, this
> patch fixes to copy the user data correctly in the argument.
>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
> Closes: https://lore.kernel.org/all/aDVyO8ByVsceybk9@stanley.mountain/
> Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@....com>
> Signed-off-by: Akshay Gupta <akshay.gupta@....com>
> ---
> This patch is created on top of linux-next
You are doing multiple things here in the same patch, please break this
up into a patch series.
thanks,
greg k-h
Powered by blists - more mailing lists