Re: [dhowells/mount-api] general protection fault in mqueue_get_tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 11, 2018 at 1:21 PM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Andrei Vagin <avagin@xxxxxxxxx> 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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux