All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Günther Noack" <gnoack@google.com>
To: Oxana Kharitonova <oxana@cloudflare.com>
Cc: mic@digikod.net, paul@paul-moore.com, jmorris@namei.or,
	serge@hallyn.com, wangyan01@kylinos.cn,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, landlock@lists.linux.dev,
	webprosto@gmail.com
Subject: Re: [PATCH 1/6] ipc: Move mqueue fs magic to uapi magic header
Date: Wed, 22 Jul 2026 14:43:32 +0200	[thread overview]
Message-ID: <amC69LnwcgG7xo-5@google.com> (raw)
In-Reply-To: <20260722122952.42149-2-oxana@cloudflare.com>

Hello!

On Wed, Jul 22, 2026 at 01:29:37PM +0100, Oxana Kharitonova wrote:
> Move MQUEUE_MAGIC from ipc/mqueue.c to include/uapi/linux/magic.h so
> it can be shared by code outside of ipc/mqueue.c without duplicating
> the constant.
> 
> Signed-off-by: Oxana Kharitonova <oxana@cloudflare.com>
> ---
>  include/uapi/linux/magic.h | 2 ++
>  ipc/mqueue.c               | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
> index 4f2da935a76c..8e5d33bb1453 100644
> --- a/include/uapi/linux/magic.h
> +++ b/include/uapi/linux/magic.h
> @@ -78,6 +78,8 @@
>  
>  #define V9FS_MAGIC		0x01021997
>  
> +#define MQUEUE_MAGIC		0x19800202
> +
>  #define BDEVFS_MAGIC            0x62646576
>  #define DAXFS_MAGIC             0x64646178
>  #define BINFMTFS_MAGIC          0x42494e4d
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 4798b375972b..9515597d45ce 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -22,6 +22,7 @@
>  #include <linux/sysctl.h>
>  #include <linux/poll.h>
>  #include <linux/mqueue.h>
> +#include <linux/magic.h>
>  #include <linux/msg.h>
>  #include <linux/skbuff.h>
>  #include <linux/vmalloc.h>
> @@ -47,7 +48,6 @@ struct mqueue_fs_context {
>  	bool			 newns;	/* Set if newly created ipc namespace */
>  };
>  
> -#define MQUEUE_MAGIC	0x19800202
>  #define DIRENT_SIZE	20
>  #define FILENT_SIZE	80
>  
> -- 
> 2.50.1 (Apple Git-155)
> 

The only reference to MQUEUE_MAGIC that I find in your patchset is from
Landlock's kernel code -- For a value that gets serialized to disk, like
for the other file systems, I think there is actually a legitimate use
case for userspace to use that value, when dealing with raw images?  But
that's not the case here, I think?

Should this live in include/linux/ipc_namespace.h instead?  Or even be
exposed as a helper function that lets you check whether an inode is
referring to an mqueue?

—Günther

  reply	other threads:[~2026-07-22 12:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 12:29 [PATCH 0/6] landlock: Add POSIX message queue scoping Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 1/6] ipc: Move mqueue fs magic to uapi magic header Oxana Kharitonova
2026-07-22 12:43   ` Günther Noack [this message]
2026-07-22 15:14     ` Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 2/6] landlock: Scope POSIX message queue opens Oxana Kharitonova
2026-07-23 21:59   ` Justin Suess
2026-07-22 12:29 ` [PATCH 3/6] landlock: Bump ABI for LANDLOCK_SCOPE_POSIX_MSG_QUEUE Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 4/6] selftests/landlock: Test POSIX message queue scoping Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 5/6] samples/landlock: Support " Oxana Kharitonova
2026-07-22 12:29 ` [PATCH 6/6] landlock: Document " Oxana Kharitonova

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=amC69LnwcgG7xo-5@google.com \
    --to=gnoack@google.com \
    --cc=jmorris@namei.or \
    --cc=landlock@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=oxana@cloudflare.com \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=wangyan01@kylinos.cn \
    --cc=webprosto@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.