[libcamera-devel] [PATCH 0/2] libcamera: Request: Catch double completions

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Mar 2 13:23:39 CET 2021


If a Request is completed, when it has already been completed, this is
the equivalent to a use-after-free.

When completed, the application regains control of the object, and can
choose to either free the memory, or call request->reuse().

In both of those scenarios the Request should not be touch by the
Pipeline Handler until it is re-queued.

There appear to be some races or bugs around here, so add an assert to
catch this early, and fix a comment related to the usage.

Kieran Bingham (2):
  libcamera: Request: validate state on complete
  libcamera: pipeline_handler: Update request usage comment

 src/libcamera/pipeline_handler.cpp | 4 ++--
 src/libcamera/request.cpp          | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.25.1



More information about the libcamera-devel mailing list