From: Maxime Devos <maximedevos@telenet.be>
To: Arun Isaac <arunisaac@systemreboot.net>, 57363@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#57363] [PATCH 0/1] Set #o640 permissions for log file of shepherd service in container.
Date: Fri, 26 Aug 2022 16:48:40 +0200 [thread overview]
Message-ID: <f774928e-ae82-007b-bbf1-71bd23b213b1@telenet.be> (raw)
In-Reply-To: <20220823173102.30242-1-arunisaac@systemreboot.net>
[-- Attachment #1.1.1: Type: text/plain, Size: 825 bytes --]
On 23-08-2022 19:31, Arun Isaac wrote:
> However, when a shepherd service is run using
> make-forkexec-constructor/container, the log file has #o644 permissions. This
> patch corrects that.
There is a small window during which the log file has overly-wide
permissions, which IIUC makes the log openable when it shouldn't, which
could later be exploited (after the daemon has been running for a while)
to extract anything secret written to the log by the service.
Try using (close (open log-file (logior O_CREAT O_APPEND O_CLOEXEC)
#o600)) instead, that should make things atomic.
I do not know if clearing the log file is desired -- if so, remove
O_APPEND, if not, keep O_APPEND.
Maybe O_RDONLY or O_WRONLY or O_RDWR needs to be added to make the call
to 'open' succeed.
Greetings,
Maxime
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2022-08-26 15:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 17:31 [bug#57363] [PATCH 0/1] Set #o640 permissions for log file of shepherd service in container Arun Isaac
2022-08-23 17:33 ` [bug#57363] [PATCH] shepherd: Set #o640 permissions for log file of " Arun Isaac
2022-08-26 14:48 ` Maxime Devos [this message]
2022-08-29 19:15 ` [bug#57363] [PATCH 0/1] Set #o640 permissions for log file of shepherd " Arun Isaac
2022-08-29 19:15 ` [bug#57363] [PATCH v2] shepherd: Set #o640 permissions for log file of " Arun Isaac
2022-09-02 9:21 ` Ludovic Courtès
2022-09-02 11:20 ` bug#57363: " Arun Isaac
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=f774928e-ae82-007b-bbf1-71bd23b213b1@telenet.be \
--to=maximedevos@telenet.be \
--cc=57363@debbugs.gnu.org \
--cc=arunisaac@systemreboot.net \
--cc=ludo@gnu.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
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.