Skip to contentSkip to conversation

Posix Message Queues

RFC PATCH Manfred Spraul 2 participants 2 messages Jul 14, 2003

lore
Share & tools
lore
#0 lore raw

Hi Michal,

You've implemented mq_open() in user space by combining open()+ioctl() syscalls. I think it's racy:

What if two processes call
{
fd = mq_open("dummy",O_CREAT,0777,{.mq_maxmsg=10000}); mq_send = mq_send(fd,buf,10000,0);
}

I think setting the queue options and creating a new queue must be atomic, i.e. we need a new syscall.

Could you replace the printk's with Dprintk or something like that? User space misbehaviour such as bad pointers should not generate printk messages.

--
Manfred

#1 lore raw
Quoted 5 lines · Manfred Spraul

Hi Michal,

You've implemented mq_open() in user space by combining open()+ioctl() syscalls. I think it's racy:

Quoted 8 lines

What if two processes call

{
    fd = mq_open("dummy",O_CREAT,0777,{.mq_maxmsg=10000});
    mq_send = mq_send(fd,buf,10000,0);
}

I think setting the queue options and creating a new queue must be atomic, i.e. we need a new syscall.

O_EXCL lets you know if you are the real creator. That means you can create it 000, fix it up, fchmod it and go