Skip to content

mq_open: missing mq_attr doesn't imply opening an existing queue#2752

Open
millert wants to merge 1 commit intonix-rust:masterfrom
millert:mq_open_fix
Open

mq_open: missing mq_attr doesn't imply opening an existing queue#2752
millert wants to merge 1 commit intonix-rust:masterfrom
millert:mq_open_fix

Conversation

@millert
Copy link
Copy Markdown

@millert millert commented Mar 10, 2026

It is valid to create a new queue with O_CREAT without specifying an attribute structure, in which case system-specific default attributes will be used. The mode should always be specified and if the mq attributes are missing, a NULL pointer should be used in its place.

Otherwise, stack garbage will be used for the mode and the attributes, which often results in failure with EINVAL (due to mq_msgsize and mq_maxmsg being too large).

It is valid to create a new queue with O_CREAT without specifying an
attribute structure, in which case system-specific default attributes will
be used.  The mode should always be specified and if the mq attributes
are missing, a NULL pointer should be used in its place.

Otherwise, stack garbage will be used for the mode and the attributes,
which often results in failure with EINVAL (due to mq_msgsize and
mq_maxmsg being too large).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant