From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-f66.google.com ([209.85.222.66]:39651 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbeILB2N (ORCPT ); Tue, 11 Sep 2018 21:28:13 -0400 Received: by mail-ua1-f66.google.com with SMTP id g18-v6so21977008uam.6 for ; Tue, 11 Sep 2018 13:27:15 -0700 (PDT) MIME-Version: 1.0 References: <24102.1536697257@warthog.procyon.org.uk> In-Reply-To: <24102.1536697257@warthog.procyon.org.uk> From: Andrei Vagin Date: Tue, 11 Sep 2018 13:27:03 -0700 Message-ID: Subject: Re: [dhowells/mount-api] general protection fault in mqueue_get_tree To: David Howells Cc: linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Sep 11, 2018 at 1:21 PM David Howells wrote: > > Andrei Vagin 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