From: Michael Tirado <mtirado418@gmail.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] mm/shmem.c: Add new seal to memfd: F_SEAL_WRITE_NONCREATOR
Date: Fri, 17 Apr 2015 00:28:47 -0400 [thread overview]
Message-ID: <20150417002847.1f5febf7@yak.slack> (raw)
In-Reply-To: <CANq1E4SbenR0-N4oLBMUe_2iiduU1TReA1RRTMA9_+h_mGwNOw@mail.gmail.com>
David,
Thank you for the reply and your work on memfd.
It's been a fun learning experience working with this code.
On Thu, 16 Apr 2015 14:01:07 +0200
David Herrmann <dh.herrmann@gmail.com> wrote:
> No. This is not what sealing is about. Seals are a property of an
> object, they're unrelated to the process accessing it. Sealing is not
> an access-control method, but describes the state and capabilities of
> a file.
The comments on sealing at the top of shmem_add_seals lead me to believe
that seals were in place specifically for access control purposes.
> The same functionality of F_SEAL_WRITE_NONCREATOR can be achieved by
> opening /proc/self/fd/<num> with O_RDONLY. Just pass that read-only FD
> to your peers but retain the writable one. But note that you must
> verify your peers do not have the same uid as you do, otherwise they
> can just gain a writable descriptor by opening /proc/self/fd/<num>
> themselves.
>
> Thanks
> David
My peers may be any uid, in the same or different pid namespace.
I would really like to not have to maintain an AF_UNIX connection to receive
memfd's with a write seal. It does make a lot of sense for multicasting,
but I feel memfd would be more versitile if there was a concept of ownership,
or directionality, so a user could shed the socket after SCM_RIGHTS message or
even fork without a socket at all. I am more than willing to put in the work
if someone can offer advice on how to better achieve this type of shared
memory. Maybe it's already out there and I just didn't know where to look?
-Michael
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-04-17 4:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-16 7:23 [PATCH] mm/shmem.c: Add new seal to memfd: F_SEAL_WRITE_NONCREATOR Michael Tirado
2015-04-16 8:14 ` Konstantin Khlebnikov
2015-04-16 12:01 ` David Herrmann
2015-04-17 4:28 ` Michael Tirado [this message]
2015-04-17 10:48 ` David Herrmann
2015-04-17 22:45 ` Michael Tirado
2015-04-18 12:13 ` David Herrmann
2015-04-17 4:18 ` Michael Tirado
2015-04-28 13:28 ` [PATCH] mm/shmem.c: Add new seal to memfd: F_SEAL_WRITE_PEER Michael Tirado
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=20150417002847.1f5febf7@yak.slack \
--to=mtirado418@gmail.com \
--cc=dh.herrmann@gmail.com \
--cc=linux-mm@kvack.org \
/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 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).