Skip to content

Wrong initialization of ringbuffer for local io channel creation requests. #108

Closed

Description

Describe the bug
The initialization of the local request channel buffer in jbpf_io_ipc_init() is done in the following way:

 ck_ring_init(&io_ctx->primary_ctx.ipc_ctx.local_queue->req_queue, MAX_NUMBER_JBPF_IPC_LOCAL_REQS + 1);

Furthermore, the size of the buffer used for passing local channel requests is MAX_NUMBER_JBPF_IPC_LOCAL_REQS + 1.

According to the documentation of ck_ring_init(), the size of the ringbuffer must be a power of two, greater or equal to 4. This is violated in the above case, and can therefore lead to undefined behavior when enqueueing and dequeueing elements..

Expected behavior
The size of the ringbuffer must be a power of two greater or equal to 4.

Activity

  1. xfoukas commented on Jun 4, 2025

    @xfoukas
    CollaboratorAuthor

    Fixed by #109 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions