New issue
Advanced search Search tips

Issue 717127 link

Starred by 1 user

Issue metadata

Status: Archived
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

biod: FpcBiometricsManager::SensorLibrary::AcquireImage() can return 0 (success) on failure

Project Member Reported by norvez@chromium.org, May 1 2017

Issue description


Looking at https://chromium.googlesource.com/chromiumos/platform2/+/master/biod/fpc_biometrics_manager.cc#98

We return acquire_result which will always be 0 in that case. We should instead return an error.
 
Components: OS>Kernel

Comment 2 by mqg@chromium.org, Jun 16 2017

Status: Assigned (was: Unconfirmed)

Comment 3 by mqg@chromium.org, Jun 16 2017

It seems like that bug would be safeguarded here (https://chromium.googlesource.com/chromiumos/platform2/+/master/biod/fpc_biometrics_manager.cc#531), but I agree we need to return an error instead. 

As for the specific error code, I don't want to conflict with any error code that acquire_image_ generates, which is documented here (https://chromium.googlesource.com/chromiumos/platform2/+/master/biod/fpc/fp_sensor.h#87).

According to fp_sensor.h, error have negative code, but it didn't specify which negative code are used, so maybe return 4 for the bug identified? 

Comment 4 by norvez@chromium.org, Jun 16 2017

It might, yes, but I'm not sure how AddImage would behave with an empty image. It might crash or register something strange. So yes, let's fix it :-)

Don't use return code 4, we may later need that value for a more valuable return code of fp_sensor_acquire_image(), say for example a made up FP_SENSOR_TOO_SLOW.

I'd return -ENOMEM because it seems the most likely cause of error in that case. It's OK if we can't make the difference with fp_sensor_acquire_image() returning -ENOMEM, since it's the same root cause anyway. Ideally, we could do 2 things:
- add more logs in error cases to easily tell which of the calls failed (assuming at that point you can still log, not sure that's the case if we're really running out of memory...)
- also bubble up the error codes in calls to libfp inside CreateImage() and return those

Comment 5 by mqg@chromium.org, Jun 19 2017

Cc: norvez@chromium.org
Status: Fixed (was: Assigned)

Comment 6 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment