2013-08-30 16:31:44

by Davidlohr Bueso

[permalink] [raw]
Subject: Re: ipc-msg broken again on 3.11-rc7?

> From: Vineet Gupta <[email protected]>
> Date: Fri, Aug 30, 2013 at 4:46 AM
> Subject: Re: ipc-msg broken again on 3.11-rc7?
> To: "[email protected]" <[email protected]>
> Cc: linus Torvalds <[email protected]>, Davidlohr Bueso <[email protected]>, linux-next <[email protected]>, LKML <[email protected]>, Stephen Rothwell <[email protected]>, Andrew Morton <[email protected]>, linux-mm <[email protected]>, Andi Kleen <[email protected]>, Rik van Riel <[email protected]>, Manfred Spraul <[email protected]>, Jonathan Gonzalez <[email protected]>
>
>
> On 08/30/2013 01:57 PM, Sedat Dilek wrote:
> > On Fri, Aug 30, 2013 at 10:19 AM, Vineet Gupta <[email protected]> wrote:
> >> Ping ?
> >>
> >> It seems 3.11 is pretty close to releasing but we stil have LTP msgctl08 causing a
> >> hang (atleast on ARC) for both linux-next 20130829 as well as Linus tree.
> >>
> >> So far, I haven't seemed to have drawn attention of people involved.
> >>

I apologize for the delay, I am on vacations and wasnt interrupting my
days at the beach by checking email.

You mention that the msgctl08 test case just hangs, nothing
interesting in dmesg appart from "msgmni has been set to 479" (which
is a standard initialization message anyways)?

After a quick glance, I suspect that the problem might be because we
are calling security_msg_queue_msgsnd() without taking the lock. This
is similar to the issue Sedat reported in the original thread with
find_msg() concerning msgrcv. The rest of the code looks otherwise
standard. Unfortunately I dont have a computer available to write/test
such a fix. I think we can move calls to security_msg_queue_msgsnd()
to be done right before ss_add(), which would simplify the code
changes, something like:

...

/* queue full, wait: */
if (msgflg & IPC_NOWAIT) {
err = -EAGAIN;
goto out_unlock1;
}

ipc_lock_object(&msq->q_perm);
err = security_msg_queue_msgsnd(msq, msg, msgflg);
if (err)
goto out_unlock0;

ss_add(msq, &s);

...


Thanks,
Davidlohr


> >
> > Hi Vineet,
> >
> > I remember fakeroot was an another good test-case for me to test this
> > IPC breakage.
> > Attached is my build-script for Linux-next (tested with Debian/Ubuntu).
> > ( Cannot say if you can play with it in your environment. )
>
> Hi Sedat,
>
> I have a simpler buildroot based rootfs (initramfs based) and LTP is run off of
> NFS, although running of a local storage doesn't make a difference.
>
> For me msgctl08 standalone (w/o hassle of running full LTP) is enough to trigger
> it consistently.
>
> P.S. sorry my sender address kept flipping - mailer was broken !
>
> -Vineet
>
>


2013-08-31 17:50:56

by Linus Torvalds

[permalink] [raw]
Subject: Re: ipc-msg broken again on 3.11-rc7?

Vineet, actual patch for what Davidlohr suggests attached. Can you try it?

Linus

On Fri, Aug 30, 2013 at 9:31 AM, Davidlohr Bueso <[email protected]> wrote:
>
> After a quick glance, I suspect that the problem might be because we
> are calling security_msg_queue_msgsnd() without taking the lock. This
> is similar to the issue Sedat reported in the original thread with
> find_msg() concerning msgrcv.


Attachments:
patch.diff (782.00 B)