From: Stas Sergeev <stsp2@yandex.ru>
To: linux-kernel@vger.kernel.org
Cc: Stas Sergeev <stsp2@yandex.ru>
Subject: [PATCH v2 0/2] implement OA2_INHERIT_CRED flag for openat2()
Date: Tue, 23 Apr 2024 13:40:00 +0300 [thread overview]
Message-ID: <20240423104002.9012-1-stsp2@yandex.ru> (raw)
This patch-set implements the OA2_INHERIT_CRED flag for openat2() syscall.
It is needed to perform an open operation with the creds that were in
effect when the dir_fd was opened. This allows the process to pre-open
some dirs and switch eUID (and other UIDs/GIDs) to the less-privileged
user, while still retaining the possibility to open/create files within
the pre-opened directory set.
Changes in v2:
- capture full struct cred instead of just fsuid/fsgid.
Suggested by Stefan Metzmacher <metze@samba.org>
Stas Sergeev (2):
fs: reorganize path_openat()
openat2: add OA2_INHERIT_CRED flag
fs/internal.h | 2 +-
fs/namei.c | 52 +++++++++++++++++++++++++++++-------
fs/open.c | 2 +-
include/linux/fcntl.h | 2 ++
include/uapi/linux/openat2.h | 3 +++
5 files changed, 50 insertions(+), 11 deletions(-)
--
2.44.0
next reply other threads:[~2024-04-23 10:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 10:40 Stas Sergeev [this message]
2024-04-23 10:40 ` [PATCH 1/2] fs: reorganize path_openat() Stas Sergeev
2024-04-23 10:40 ` [PATCH 2/2] openat2: add OA2_INHERIT_CRED flag Stas Sergeev
2024-04-23 10:48 [PATCH v2 0/2] implement OA2_INHERIT_CRED flag for openat2() Stas Sergeev
2024-04-23 10:58 ` Stefan Metzmacher
2024-04-23 11:02 ` stsp
2024-04-23 11:01 Stas Sergeev
2024-04-23 16:44 ` Andy Lutomirski
2024-04-23 18:05 ` stsp
2024-04-23 22:52 ` stsp
2024-04-24 10:57 ` stsp
2024-04-25 0:43 ` Andy Lutomirski
2024-04-25 1:43 ` Al Viro
2024-04-25 3:31 ` Andy Lutomirski
2024-04-25 11:02 ` stsp
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=20240423104002.9012-1-stsp2@yandex.ru \
--to=stsp2@yandex.ru \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®