diff options
author | Brian Foster | 2022-10-03 09:35:34 -0400 |
---|---|---|
committer | Jens Axboe | 2022-10-10 08:26:59 -0600 |
commit | ca5eebda3e1c1a58a1c5a337da393ed6734593e3 (patch) | |
tree | e495b4e6a0daf56bd75eac53dcf36f39e7abe959 /ipc/mq_sysctl.c | |
parent | 285febabac4a16655372d23ff43e89ff6f216691 (diff) |
block: avoid sign extend problem with default queue flags mask
request_queue->queue_flags is unsigned long, which is 8-bytes on
64-bit architectures. Most queue flag modifications occur through
bit field helpers, but default flags can be logically OR'd via the
QUEUE_FLAG_MQ_DEFAULT mask. If this mask happens to include bit 31,
the assignment can sign extend the field and set all upper 32 bits.
This exact problem has been observed on a downstream kernel that
happens to use bit 31 for QUEUE_FLAG_NOWAIT. This is not an
immediate problem for current upstream because bit 31 is not
included in the default flag assignment (and is not used at all,
actually). Regardless, fix up the QUEUE_FLAG_MQ_DEFAULT mask
definition to avoid the landmine in the future.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221003133534.1075582-1-bfoster@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'ipc/mq_sysctl.c')
0 files changed, 0 insertions, 0 deletions