Re: [RFC net-next v2 4/6] ptp: ocp: Validate EEPROM board IDs
| Newsgroups | org.kernel.vger.linux-devicetree,org.kernel.vger.linux-leds |
|---|---|
| Message-ID | <[email protected]> |
> The EEPROM board ID is a fixed 13-byte field. It is stored without room
> for a terminator and passed to devlink as a C string. An erased EEPROM
> therefore exposes 0xff bytes and can make devlink read beyond the field
> while formatting board.id.
>
> Reserve a trailing byte, classify erased and malformed contents, and
> publish board.id only when the field contains printable text with valid
> padding. Continue reporting the serial number when the board ID is
> absent.
>
> Fixes: 0cfcdd1ebcfe1a9b262f6ad8419580720dc843c4 ("ptp: ocp: add nvmem interface for accessing eeprom")
> Cc: [email protected]
> Signed-off-by: Ahmad Byagowi <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4