Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
L
libfprint
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 44
    • Issues 44
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libfprint
  • libfprint
  • Issues
  • #352

Closed
Open
Opened Jan 13, 2021 by Benjamin Berg@benzeaOwner0 of 1 task completed0/1 task

Follow-up from "synaptics: check if current firmware supports during device probe"

The following discussion from !232 (merged) should be addressed:

  • @benzea started a discussion: (+2 comments)

So, bmkt_parse_message_header looks like this:

int
bmkt_parse_message_header (uint8_t *resp_buf, int resp_len, bmkt_msg_resp_t *msg_resp)
{
  if (resp_buf[BMKT_MESSAGE_HEADER_ID_FIELD] != BMKT_MESSAGE_HEADER_ID)
    return BMKT_CORRUPT_MESSAGE;

  msg_resp->seq_num = resp_buf[BMKT_MESSAGE_SEQ_NUM_FIELD];
  msg_resp->msg_id = resp_buf[BMKT_MESSAGE_ID_FIELD];
  msg_resp->payload_len = resp_buf[BMKT_MESSAGE_PAYLOAD_LEN_FIELD];
  if (msg_resp->payload_len > 0)
    msg_resp->payload = &resp_buf[BMKT_MESSAGE_PAYLOAD_FIELD];
  else
    msg_resp->payload = NULL;

  return BMKT_SUCCESS;
}

So, I think this is completely fine (from a security standpoint), because the buffer has a length of MAX_TRANSFER_LEN, and payload_len is restricted to 255.

But, I stumbled over it. Could you maybe add an explicit check against resp_len to verify that the packet we received is long enough?

CC: @ALin

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: libfprint/libfprint#352