public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Corallo <yalbrymrb@mattcorallo.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: PMBus memory overflow
Date: Fri, 18 Apr 2025 17:03:14 -0400	[thread overview]
Message-ID: <1b1eccff-a306-4e17-a6bf-fd3203c61605@mattcorallo.com> (raw)
In-Reply-To: <336f298f-497f-4dd9-97ee-50b81221be06@roeck-us.net>



On 4/17/25 9:21 PM, Guenter Roeck wrote:
> On 4/17/25 11:14, Matt Corallo wrote:
>> I do not, sadly (though FSP support has been rumored to help out at least marginally, though they 
>> haven't been useful for me). Interestingly the (I guess ancient now) pmbus_peek.c script has no 
>> issues reading from it (added a quick print on the -E2BIG line and it didn't get hit). 
>> pmbuss_peek.c says the following:
>>
>> root@rackchill-refresh:~# ./a.out -b /dev/i2c-3 -s 0x59
>> PMBus slave on /dev/i2c-3, address 0x59
>>
> 
> pmbus_peek supports reading up to 255 bytes into the receive buffer.

Hmm, I'm using this version, which on L622 checks for a length > 32 (and doesn't get hit in the -s 
command) - https://github.com/jktjkt/pmbus_peek/blob/master/pmbus_peek.c#L622

> Anything above 32 bytes violates the SMBus specification. I found that
> the I2C controller driver should block that. If it doesn't, all kinds
> of chips could trigger this problem. Do you know which I2C controller
> is used by that system ? You mentioned an SMBus - USB adapter. The drivers
> for the adapters I am aware of (Diolan, Devantech) do validate the return
> length, so I assume you use something else or maybe an out-of-tree driver.

The driver appears to be in-tree (or at least was auto-loaded by the Proxmox kernel, which is mostly 
just the Ubuntu kernel). Its a 10c4:ea90 Silicon Labs CP2112 HID I2C Bridge.

Still, more generally, presumably it shouldn't be the case that a defective USB device can cause the 
kernel to memcpy past a buffer? I guess for hardened kernels it gets caught (though once the process 
gets killed by the hardening the system is still somewhat shaky, reboots dont work etc), but is 
there a build option that would turn this into a security vuln?

Matt

  reply	other threads:[~2025-04-18 21:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-17 15:39 PMBus memory overflow Matt Corallo
2025-04-17 18:00 ` Guenter Roeck
2025-04-17 18:14   ` Matt Corallo
2025-04-18  1:21     ` Guenter Roeck
2025-04-18 21:03       ` Matt Corallo [this message]
2025-04-18 22:30         ` Guenter Roeck
2025-04-19 17:53           ` Matt Corallo
2025-04-19 19:05             ` Guenter Roeck
2025-04-19 19:29               ` Matt Corallo
2025-04-19 22:38                 ` Guenter Roeck
2025-04-19 22:49                   ` Guenter Roeck
2025-04-20  2:29                     ` Matt Corallo
2025-04-20  3:03                       ` Guenter Roeck
2025-04-25  8:16                         ` Wolfram Sang
2025-05-05 20:41                           ` Matt Corallo
2025-05-05 20:50                             ` Guenter Roeck
2025-05-05 20:57                               ` Matt Corallo
2025-05-06  1:39                                 ` Guenter Roeck
2025-06-06 20:57                                   ` Matt Corallo
2025-06-07  8:19                                     ` Greg KH
2025-06-07 13:25                                       ` Matt Corallo
2025-06-08  7:14                                         ` Greg KH
2025-06-09 13:57                                           ` Matt Corallo
2026-03-01 13:46                                             ` Matt Corallo
2026-03-01 16:12                                               ` Kees Cook
2026-03-01 17:10                                                 ` Matt Corallo
2026-03-01 20:17                                                   ` Guenter Roeck
2026-03-02  5:09                                                   ` Kees Cook
2026-03-02  5:19                                                     ` Guenter Roeck

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=1b1eccff-a306-4e17-a6bf-fd3203c61605@mattcorallo.com \
    --to=yalbrymrb@mattcorallo.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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