Skip to content

Commit 4424aa6

Browse files
peter-mitsiskartben
authored andcommitted
kernel: pipe: user threads may not re-init pipe
Updates z_vrfy_k_pipe_init() to use K_SYSCALL_OBJ_NEVER_INIT() instead of K_SYSCALL_OBJ() to prevent a user thread from re-initializing a pipe. This aligns the pipe initialization behavior to that of other kernel objects such as message queues. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
1 parent 3e5ed41 commit 4424aa6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void z_impl_k_pipe_close(struct k_pipe *pipe)
299299
#ifdef CONFIG_USERSPACE
300300
void z_vrfy_k_pipe_init(struct k_pipe *pipe, uint8_t *buffer, size_t buffer_size)
301301
{
302-
K_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
302+
K_OOPS(K_SYSCALL_OBJ_NEVER_INIT(pipe, K_OBJ_PIPE));
303303
K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, buffer_size));
304304

305305
z_impl_k_pipe_init(pipe, buffer, buffer_size);

0 commit comments

Comments
 (0)