<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/platform/chrome, branch master</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge tag 'chrome-platform-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux</title>
<updated>2026-08-19T15:27:06+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-08-19T15:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c36a4991e231242c04141536718d47255ec80887'/>
<id>c36a4991e231242c04141536718d47255ec80887</id>
<content type='text'>
Pull chrome platform updates from Tzung-Bi Shih:
 "New:
   - Add post_power_on_delay_ms for Hana in of_hw_prober

  Improvements:
   - Use dumb trackpad prober for Spherion in of_hw_prober

  Fixes:
   - Check bound of firmware-reported data in cros_ec_sensorhub and
     cros_ec_typec
   - Fix memory overread in cros_ec_sensorhub
   - Fix resource leak in cros_ec_debugfs
   - Clamp payload length for LIGHTBAR_CMD_SET_PROGRAM_EX in
     cros_ec_lightbar

  Cleanups:
   - Drop unused platform_device_id driver data
   - Remove redundant log"

* tag 'chrome-platform-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: of_hw_prober: Add delay for hana trackpads
  platform/chrome: lightbar: Limit payload to max packet size
  platform/chrome: cros_ec_debugfs: Unregister panic notifier
  platform/chrome: cros_ec_debugfs: Clean up console log on probe failure
  platform/chrome: cros_ec: Remove redundant dev_err()
  platform/chrome: sensorhub: Fix dropped timestamp events and log spam
  platform/chrome: sensorhub: Fix memory overread in ring handler
  platform/chrome: cros_ec_typec: Reject out-of-bounds PD cap count
  platform/chrome: of_hw_prober: Use dumb trackpad prober for Spherion
  platform/chrome: Drop unused assignment of platform_device_id driver data
  platform/chrome: sensorhub: Bound the EC-reported sensor number
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull chrome platform updates from Tzung-Bi Shih:
 "New:
   - Add post_power_on_delay_ms for Hana in of_hw_prober

  Improvements:
   - Use dumb trackpad prober for Spherion in of_hw_prober

  Fixes:
   - Check bound of firmware-reported data in cros_ec_sensorhub and
     cros_ec_typec
   - Fix memory overread in cros_ec_sensorhub
   - Fix resource leak in cros_ec_debugfs
   - Clamp payload length for LIGHTBAR_CMD_SET_PROGRAM_EX in
     cros_ec_lightbar

  Cleanups:
   - Drop unused platform_device_id driver data
   - Remove redundant log"

* tag 'chrome-platform-v7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: of_hw_prober: Add delay for hana trackpads
  platform/chrome: lightbar: Limit payload to max packet size
  platform/chrome: cros_ec_debugfs: Unregister panic notifier
  platform/chrome: cros_ec_debugfs: Clean up console log on probe failure
  platform/chrome: cros_ec: Remove redundant dev_err()
  platform/chrome: sensorhub: Fix dropped timestamp events and log spam
  platform/chrome: sensorhub: Fix memory overread in ring handler
  platform/chrome: cros_ec_typec: Reject out-of-bounds PD cap count
  platform/chrome: of_hw_prober: Use dumb trackpad prober for Spherion
  platform/chrome: Drop unused assignment of platform_device_id driver data
  platform/chrome: sensorhub: Bound the EC-reported sensor number
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: of_hw_prober: Add delay for hana trackpads</title>
<updated>2026-08-13T03:05:17+00:00</updated>
<author>
<name>Chen-Yu Tsai</name>
<email>wenst@chromium.org</email>
</author>
<published>2026-08-11T12:20:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=81c1c0cb68a13d14dd1bbffcf4c49e26f9a6478c'/>
<id>81c1c0cb68a13d14dd1bbffcf4c49e26f9a6478c</id>
<content type='text'>
Up until now, the MT8173 elm/hana device tree has set the dedicated
regulator supplying the trackpad as always-on, simply because the Elan
driver was missing proper delays. As a result the delay for the
Synaptics trackpad was also omitted, as it was not strictly required
under such a model and delayed the availability of the trackpad to the
user.

The Elan driver recently gained proper delays after power-up, with
adaptive skipping of the delay if the regulator was originally
on. The I2C HID driver and I2C OF component prober library gained
similar adaptive delay skipping. The device tree will be fixed to have
the regulator not be always on, and proper post-power-on delay time
added to the I2C HID device.

Also add the post-power-on delay to the ChromeOS OF component prober,
so that if the regulator is off at the time of probing, the prober knows
to wait for the hardware to initialize.

Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Link: https://lore.kernel.org/r/20260811122011.3539250-8-wenst@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Up until now, the MT8173 elm/hana device tree has set the dedicated
regulator supplying the trackpad as always-on, simply because the Elan
driver was missing proper delays. As a result the delay for the
Synaptics trackpad was also omitted, as it was not strictly required
under such a model and delayed the availability of the trackpad to the
user.

The Elan driver recently gained proper delays after power-up, with
adaptive skipping of the delay if the regulator was originally
on. The I2C HID driver and I2C OF component prober library gained
similar adaptive delay skipping. The device tree will be fixed to have
the regulator not be always on, and proper post-power-on delay time
added to the I2C HID device.

Also add the post-power-on delay to the ChromeOS OF component prober,
so that if the regulator is off at the time of probing, the prober knows
to wait for the hardware to initialize.

Signed-off-by: Chen-Yu Tsai &lt;wenst@chromium.org&gt;
Link: https://lore.kernel.org/r/20260811122011.3539250-8-wenst@chromium.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: lightbar: Limit payload to max packet size</title>
<updated>2026-07-31T02:21:31+00:00</updated>
<author>
<name>Alexis Savery</name>
<email>asavery@google.com</email>
</author>
<published>2026-07-30T20:42:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ed1d1f519c56c6c2ffa13f3d52cd77beb023db13'/>
<id>ed1d1f519c56c6c2ffa13f3d52cd77beb023db13</id>
<content type='text'>
The LIGHTBAR_CMD_SET_PROGRAM command uses an 8-bit size field for its
payload length, but the protocol-negotiated `max_request` may exceed
the maximum value an 8-bit integer can represent.

When this occurs, large payloads (e.g., &gt;255 bytes) integer wrap the
8-bit size variable when assigning `param-&gt;set_program_ex.size`, causing
truncation and parse failures downstream in the EC firmware stack.

Clamp `max_size` to the maximum value the structural size field can
support.

Fixes: 9600b8bdbfe4 ("platform/chrome: lightbar: Add support for large sequence")
Signed-off-by: Alexis Savery &lt;asavery@google.com&gt;
Link: https://lore.kernel.org/r/20260730204240.2227178-1-asavery@google.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LIGHTBAR_CMD_SET_PROGRAM command uses an 8-bit size field for its
payload length, but the protocol-negotiated `max_request` may exceed
the maximum value an 8-bit integer can represent.

When this occurs, large payloads (e.g., &gt;255 bytes) integer wrap the
8-bit size variable when assigning `param-&gt;set_program_ex.size`, causing
truncation and parse failures downstream in the EC firmware stack.

Clamp `max_size` to the maximum value the structural size field can
support.

Fixes: 9600b8bdbfe4 ("platform/chrome: lightbar: Add support for large sequence")
Signed-off-by: Alexis Savery &lt;asavery@google.com&gt;
Link: https://lore.kernel.org/r/20260730204240.2227178-1-asavery@google.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: Unregister panic notifier</title>
<updated>2026-07-30T01:43:14+00:00</updated>
<author>
<name>Hongyan Xu</name>
<email>getshell@seu.edu.cn</email>
</author>
<published>2026-07-29T10:32:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e5954d3031fb55dd31aa59bae477d63c68e941c0'/>
<id>e5954d3031fb55dd31aa59bae477d63c68e941c0</id>
<content type='text'>
cros_ec_debugfs_probe() registers notifier_panic with the EC panic
notifier chain. The remove path tears down debugfs and the console log,
but leaves the notifier registered. A later panic notification can call
back into the removed instance and queue work that accesses released
data.

Unregister the panic notifier before tearing down the debugfs and
console log state.

This issue was found by a static analysis tool.

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Hongyan Xu &lt;getshell@seu.edu.cn&gt;
Link: https://lore.kernel.org/r/f3ab74ef8034be63bb45a325f3d54656d658817f.1785320940.git.getshell@seu.edu.cn
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cros_ec_debugfs_probe() registers notifier_panic with the EC panic
notifier chain. The remove path tears down debugfs and the console log,
but leaves the notifier registered. A later panic notification can call
back into the removed instance and queue work that accesses released
data.

Unregister the panic notifier before tearing down the debugfs and
console log state.

This issue was found by a static analysis tool.

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Hongyan Xu &lt;getshell@seu.edu.cn&gt;
Link: https://lore.kernel.org/r/f3ab74ef8034be63bb45a325f3d54656d658817f.1785320940.git.getshell@seu.edu.cn
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_debugfs: Clean up console log on probe failure</title>
<updated>2026-07-30T01:40:34+00:00</updated>
<author>
<name>Hongyan Xu</name>
<email>getshell@seu.edu.cn</email>
</author>
<published>2026-07-29T10:32:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5d187600c4603b8f7812b12ce359a11ad7a7fd3a'/>
<id>5d187600c4603b8f7812b12ce359a11ad7a7fd3a</id>
<content type='text'>
Add a dedicated error label for failures after successful console log
setup.

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Hongyan Xu &lt;getshell@seu.edu.cn&gt;
Link: https://lore.kernel.org/r/c00974953a1b952f51f0f021d7f9fad134159909.1785320940.git.getshell@seu.edu.cn
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a dedicated error label for failures after successful console log
setup.

Fixes: d90fa2c64d59 ("platform/chrome: cros_ec: Poll EC log on EC panic")
Signed-off-by: Hongyan Xu &lt;getshell@seu.edu.cn&gt;
Link: https://lore.kernel.org/r/c00974953a1b952f51f0f021d7f9fad134159909.1785320940.git.getshell@seu.edu.cn
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec: Remove redundant dev_err()</title>
<updated>2026-07-20T03:24:35+00:00</updated>
<author>
<name>Pan Chuang</name>
<email>panchuang@vivo.com</email>
</author>
<published>2026-07-17T11:20:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=17376e7311cdec252b61cb1ecec43be61907781b'/>
<id>17376e7311cdec252b61cb1ecec43be61907781b</id>
<content type='text'>
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang &lt;panchuang@vivo.com&gt;
Link: https://lore.kernel.org/r/20260717112103.213017-3-panchuang@vivo.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_threaded_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang &lt;panchuang@vivo.com&gt;
Link: https://lore.kernel.org/r/20260717112103.213017-3-panchuang@vivo.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: sensorhub: Fix dropped timestamp events and log spam</title>
<updated>2026-07-16T02:40:57+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2026-07-15T02:44:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9a3f43b30373c61477d0d3ab52946c05f9492bf9'/>
<id>9a3f43b30373c61477d0d3ab52946c05f9492bf9</id>
<content type='text'>
Commit 833740a2333c ("platform/chrome: sensorhub: Bound the EC-reported
sensor number") evaluated the `sensor_num` against the bounds limit even
for timestamp events.  A timestamp event typically has a `sensor_num` of
0xff [1], causing the driver to flag it as invalid and skip to the next
event.

As a result, we'd see a flooding of "Invalid sensor number 255 from EC"
warning logs and these timestamp events were being dropped.

Move the bounds-check into cros_ec_sensor_ring_process_event() and
evaluate it only after standalone timestamp events have already been
processed and returned early.

[1] https://crrev.com/219ca6ef82ba266da788b673ee4ad50bd3ea1285/common/motion_sense_fifo.c#427

Fixes: 833740a2333c ("platform/chrome: sensorhub: Bound the EC-reported sensor number")
Reviewed-by: Tomasz Figa &lt;tfiga@chromium.org&gt;
Link: https://lore.kernel.org/r/20260715024454.4127571-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 833740a2333c ("platform/chrome: sensorhub: Bound the EC-reported
sensor number") evaluated the `sensor_num` against the bounds limit even
for timestamp events.  A timestamp event typically has a `sensor_num` of
0xff [1], causing the driver to flag it as invalid and skip to the next
event.

As a result, we'd see a flooding of "Invalid sensor number 255 from EC"
warning logs and these timestamp events were being dropped.

Move the bounds-check into cros_ec_sensor_ring_process_event() and
evaluate it only after standalone timestamp events have already been
processed and returned early.

[1] https://crrev.com/219ca6ef82ba266da788b673ee4ad50bd3ea1285/common/motion_sense_fifo.c#427

Fixes: 833740a2333c ("platform/chrome: sensorhub: Bound the EC-reported sensor number")
Reviewed-by: Tomasz Figa &lt;tfiga@chromium.org&gt;
Link: https://lore.kernel.org/r/20260715024454.4127571-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Replace &lt;linux/mod_devicetable.h&gt; by more specific &lt;linux/device-id/*.h&gt; (c files)</title>
<updated>2026-07-03T05:38:17+00:00</updated>
<author>
<name>Uwe Kleine-König (The Capable Hub)</name>
<email>u.kleine-koenig@baylibre.com</email>
</author>
<published>2026-06-30T09:24:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=995832b2cebe6969d1b42635db698803ee31294d'/>
<id>995832b2cebe6969d1b42635db698803ee31294d</id>
<content type='text'>
Replace the #include of &lt;linux/mod_devicetable.h&gt; by the more specific
&lt;linux/device-id/*.h&gt; where applicable. For most cases the include
can be dropped completely, only a few drivers need one or two headers
added.

Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Acked-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König (The Capable Hub) &lt;u.kleine-koenig@baylibre.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the #include of &lt;linux/mod_devicetable.h&gt; by the more specific
&lt;linux/device-id/*.h&gt; where applicable. For most cases the include
can be dropped completely, only a few drivers need one or two headers
added.

Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Acked-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Acked-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Link: https://patch.msgid.link/1a3f2007c5c5dcf555c09a4035ce3ae8ef1b6c49.1782808461.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König (The Capable Hub) &lt;u.kleine-koenig@baylibre.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: sensorhub: Fix memory overread in ring handler</title>
<updated>2026-07-03T03:29:07+00:00</updated>
<author>
<name>Tzung-Bi Shih</name>
<email>tzungbi@kernel.org</email>
</author>
<published>2026-07-02T08:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d1ceb2b2324717fa30b44d56ef0c52813e239569'/>
<id>d1ceb2b2324717fa30b44d56ef0c52813e239569</id>
<content type='text'>
`max_response` and `sensor_num` are read from different EC commands:

- `max_response` is from cros_ec_get_proto_info().
    ec_dev-&gt;max_response = info-&gt;max_response_packet_size -
                                    sizeof(struct ec_host_response);

- `sensor_num` is from cros_ec_get_sensor_count().
    sensor_num = cros_ec_get_sensor_count(ec);

With a malfunctioning EC firmware, it is possible that the `msg-&gt;insize`
(i.e., `fifo_info_length` in the context) could be clamped in
cros_ec_cmd_xfer() because `msg-&gt;insize` is greater than `max_response`.

    int fifo_info_length =
            sizeof(struct ec_response_motion_sense_fifo_info) +
            sizeof(u16) * sensorhub-&gt;sensor_num;

This means the number of read bytes could be less than expected.  As a
result, the subsequent memcpy() in cros_ec_sensorhub_ring_handler()
overreads the `resp-&gt;fifo_info` buffer.

Check the return value of cros_ec_cmd_xfer_status() and abort if the
number of bytes read does not match the expected length.

Fixes: 145d59baff59 ("platform/chrome: cros_ec_sensorhub: Add FIFO support")
Reviewed-by: Tomasz Figa &lt;tfiga@chromium.org&gt;
Link: https://lore.kernel.org/r/20260702082745.1014968-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`max_response` and `sensor_num` are read from different EC commands:

- `max_response` is from cros_ec_get_proto_info().
    ec_dev-&gt;max_response = info-&gt;max_response_packet_size -
                                    sizeof(struct ec_host_response);

- `sensor_num` is from cros_ec_get_sensor_count().
    sensor_num = cros_ec_get_sensor_count(ec);

With a malfunctioning EC firmware, it is possible that the `msg-&gt;insize`
(i.e., `fifo_info_length` in the context) could be clamped in
cros_ec_cmd_xfer() because `msg-&gt;insize` is greater than `max_response`.

    int fifo_info_length =
            sizeof(struct ec_response_motion_sense_fifo_info) +
            sizeof(u16) * sensorhub-&gt;sensor_num;

This means the number of read bytes could be less than expected.  As a
result, the subsequent memcpy() in cros_ec_sensorhub_ring_handler()
overreads the `resp-&gt;fifo_info` buffer.

Check the return value of cros_ec_cmd_xfer_status() and abort if the
number of bytes read does not match the expected length.

Fixes: 145d59baff59 ("platform/chrome: cros_ec_sensorhub: Add FIFO support")
Reviewed-by: Tomasz Figa &lt;tfiga@chromium.org&gt;
Link: https://lore.kernel.org/r/20260702082745.1014968-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>platform/chrome: cros_ec_typec: Reject out-of-bounds PD cap count</title>
<updated>2026-06-29T03:09:51+00:00</updated>
<author>
<name>Maoyi Xie</name>
<email>maoyixie.tju@gmail.com</email>
</author>
<published>2026-06-25T13:00:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a0a8cd9fc9c48b95095bcec4b146f7a99486f58e'/>
<id>a0a8cd9fc9c48b95095bcec4b146f7a99486f58e</id>
<content type='text'>
cros_typec_register_partner_pdos() copies the partner PDOs from the EC
TYPEC_STATUS response into the fixed caps_desc.pdo[PDO_MAX_OBJECTS] array.

	memcpy(caps_desc.pdo, resp-&gt;source_cap_pdos,
	       sizeof(u32) * resp-&gt;source_cap_count);
	...
	memcpy(caps_desc.pdo, resp-&gt;sink_cap_pdos,
	       sizeof(u32) * resp-&gt;sink_cap_count);

PDO_MAX_OBJECTS is 7. source_cap_count and sink_cap_count are u8 fields
from the EC. The only check is that they are not both zero. If either is
larger than 7, the memcpy writes past the end of the array on the stack.
A count of 255 overflows it by about 1 KB. The EC source arrays are only
seven entries wide. A larger count reads past them too.

The ChromeOS EC firmware caps these counts today, so a compliant setup
does not hit this. The kernel should still validate these values rather
than trust them.

Validate the counts in cros_typec_register_partner_pdos() next to the
memcpy. Skip the PDO registration if either count is above PDO_MAX_OBJECTS.
The rest of cros_typec_handle_status() still runs so events are handled
and cleared.

Fixes: 348a2e8c93d3 ("platform/chrome: cros_ec_typec: Register partner PDOs")
Suggested-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Co-developed-by: Kaixuan Li &lt;kaixuan.li@ntu.edu.sg&gt;
Signed-off-by: Kaixuan Li &lt;kaixuan.li@ntu.edu.sg&gt;
Signed-off-by: Maoyi Xie &lt;maoyixie.tju@gmail.com&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Reviewed-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Link: https://lore.kernel.org/r/20260625130056.3378097-1-maoyixie.tju@gmail.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cros_typec_register_partner_pdos() copies the partner PDOs from the EC
TYPEC_STATUS response into the fixed caps_desc.pdo[PDO_MAX_OBJECTS] array.

	memcpy(caps_desc.pdo, resp-&gt;source_cap_pdos,
	       sizeof(u32) * resp-&gt;source_cap_count);
	...
	memcpy(caps_desc.pdo, resp-&gt;sink_cap_pdos,
	       sizeof(u32) * resp-&gt;sink_cap_count);

PDO_MAX_OBJECTS is 7. source_cap_count and sink_cap_count are u8 fields
from the EC. The only check is that they are not both zero. If either is
larger than 7, the memcpy writes past the end of the array on the stack.
A count of 255 overflows it by about 1 KB. The EC source arrays are only
seven entries wide. A larger count reads past them too.

The ChromeOS EC firmware caps these counts today, so a compliant setup
does not hit this. The kernel should still validate these values rather
than trust them.

Validate the counts in cros_typec_register_partner_pdos() next to the
memcpy. Skip the PDO registration if either count is above PDO_MAX_OBJECTS.
The rest of cros_typec_handle_status() still runs so events are handled
and cleared.

Fixes: 348a2e8c93d3 ("platform/chrome: cros_ec_typec: Register partner PDOs")
Suggested-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Co-developed-by: Kaixuan Li &lt;kaixuan.li@ntu.edu.sg&gt;
Signed-off-by: Kaixuan Li &lt;kaixuan.li@ntu.edu.sg&gt;
Signed-off-by: Maoyi Xie &lt;maoyixie.tju@gmail.com&gt;
Reviewed-by: Benson Leung &lt;bleung@chromium.org&gt;
Reviewed-by: Andrei Kuchynski &lt;akuchynski@chromium.org&gt;
Link: https://lore.kernel.org/r/20260625130056.3378097-1-maoyixie.tju@gmail.com
Signed-off-by: Tzung-Bi Shih &lt;tzungbi@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
