Skip to content

platform/chrome: cros_ec_chardev: Fix a potential UAF

Tzung-Bi Shih chrome-platform lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/24 patches 2 repliesIn review
  2. v2 posting 2/24 patches 3 repliesSuperseded
  3. v3 posting 1/28 patches 15 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/26 patches0 repliesSuperseded
v12 patches3 repliesSuperseded

Changes in v3 from the cover letter

- Address review comment in patch 4.

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4platform/chrome: cros_ec_chardev: Introduce chardev_datadrivers/platform/chrome/cros_ec_chardev.c+39 -120 replies
2/4platform/chrome: cros_ec_chardev: Move data to chardev_pdatadrivers/platform/chrome/cros_ec_chardev.c+20 -160 replies
3/4platform/chrome: cros_ec_chardev: Add event relayerdrivers/platform/chrome/cros_ec_chardev.c+29 -30 replies
4/4platform/chrome: cros_ec_chardev: Introduce rwsem for protecting ec_devdrivers/platform/chrome/cros_ec_chardev.c+34 -51 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJason Gunthorpe
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] platform/chrome: cros_ec_chardev: Fix a potential UAF

This series addresses a potential Use-After-Free error when a device is
deregistered while file operations are still in progress or files remain open in cros_ec_chardev.

- Patches 1 to 3 are preparation steps in cros_ec_chardev driver. They introduce reference counting for platform driver data and an event relayer. This removes the direct access to ec_dev->event_notifier in cros_ec_chardev_release().
- Patch 4 introduces a rwsem for protecting ec_dev to prevent the UAF error.

---
v3:
- Address review comment in patch 4.

v2: https://lore.kernel.org/all/[email protected]
- Merge patches 5 to 7 from
https://lore.kernel.org/all/[email protected].

v1: Doesn't exist.

Tzung-Bi Shih (4):
platform/chrome: cros_ec_chardev: Introduce chardev_data platform/chrome: cros_ec_chardev: Move data to chardev_pdata platform/chrome: cros_ec_chardev: Add event relayer platform/chrome: cros_ec_chardev: Introduce rwsem for protecting
ec_dev

 drivers/platform/chrome/cros_ec_chardev.c | 146 +++++++++++++++++-----
 1 file changed, 116 insertions(+), 30 deletions(-)
Signature · 1 line
2.54.0.794.g4f17f83d09-goog