linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Vagin <avagin@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [dhowells/mount-api] general protection fault in mqueue_get_tree
Date: Tue, 11 Sep 2018 13:27:03 -0700	[thread overview]
Message-ID: <CANaxB-yqypZ50XoLL2mP1U_nDprqqBt1cbg_jSNDw7bjgr3mXw@mail.gmail.com> (raw)
In-Reply-To: <24102.1536697257@warthog.procyon.org.uk>

On Tue, Sep 11, 2018 at 1:21 PM David Howells <dhowells@redhat.com> wrote:
>
> Andrei Vagin <avagin@gmail.com> wrote:
>
> > +       ns->mq_mnt = NULL;
>
> Should I instead be allocating the namespace with kzalloc()?

The ipc_namespace structure is big, so I am not sure about kzalloc().
ns->mq_mnt can be initialized in mq_init_ns, it looks better than my
previous patch.

diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index ab1fe762baa8..e05147b5ea39 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1618,6 +1618,7 @@ int mq_init_ns(struct ipc_namespace *ns)
        ns->mq_msg_default   = DFLT_MSG;
        ns->mq_msgsize_default  = DFLT_MSGSIZE;

+       ns->mq_mnt = NULL;
        m = mq_create_mount(ns);
        if (IS_ERR(m))
                return PTR_ERR(m);

>
> David

  reply	other threads:[~2018-09-12  1:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 22:43 Andrei Vagin
2018-09-11 20:20 ` David Howells
2018-09-11 20:27   ` Andrei Vagin [this message]
2018-09-11 21:00   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANaxB-yqypZ50XoLL2mP1U_nDprqqBt1cbg_jSNDw7bjgr3mXw@mail.gmail.com \
    --to=avagin@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [dhowells/mount-api] general protection fault in mqueue_get_tree' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).