HomeFreeBSD

ena: Fix crash when interrupt arrives after admin command timeout

Description

ena: Fix crash when interrupt arrives after admin command timeout

Bug description:
When invoking an admin command, in interrupt mode, if the interrupt
is received after timeout and also after the calling function finished
running, the response will be written into a memory that is no longer
valid.

We fix this by applying the following:

  1. Verifying that comp_ctx is occupied during the interrupt handler, otherwise it doesn't make sense to update its fields.
  2. Set user_cqe to NULL when the admin command times out. When the interrupt handler is later invoked, it will check if it is NULL and will not use it.

Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Details

Provenance
osamaabb_amazon.comAuthored on Aug 7 2024, 6:24 AM
Parents
rG06e8a547b616: ena: PHC activation check point
Branches
Unknown
Tags
Unknown