From: Gregory Price <gourry@gourry.net>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: krisman@collabora.com, tglx@linutronix.de, luto@kernel.org,
peterz@infradead.org, keescook@chromium.org,
gregory.price@memverge.com, Marco Elver <elver@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] syscall_user_dispatch: Allow allowed range wrap-around
Date: Tue, 18 Feb 2025 11:58:48 -0500 [thread overview]
Message-ID: <Z7S8SAGt8blFiFTg@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <607562bf50ddc81ebd404e8dc1710e5221f80342.1739894594.git.dvyukov@google.com>
On Tue, Feb 18, 2025 at 05:04:34PM +0100, Dmitry Vyukov wrote:
> There are two possible scenarios for syscall filtering:
> - having a trusted/allowed range of PCs, and intercepting everything else
> - or the opposite: a single untrusted/intercepted range and allowing
> everything else
> The current implementation only allows the former use case due to
> allowed range wrap-around check. Allow the latter use case as well
> by removing the wrap-around check.
> The latter use case is relevant for any kind of sandboxing scenario,
> or monitoring behavior of a single library. If a program wants to
> intercept syscalls for PC range [START, END) then it needs to call:
> prctl(..., END, -(END-START), ...);
I don't necessarily disagree with the idea, but this sounds like using
the wrong tool for the job. The purpose of SUD was for emulating
foreign OS system calls of entire programs - not a single library.
The point being that it's very difficult to sandbox an individual
library when you can't ensure it won't allocate resources outside the
monitored bounds (this would be very difficult to guarantee, at least).
If the intent is to load and re-use a single foreign-OS library, this
change seems to be the question of "why not allow multiple ranges?",
and you'd be on your way to reimplementing seccomp or BPF.
~Gregory
next prev parent reply other threads:[~2025-02-18 16:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1739894594.git.dvyukov@google.com>
2025-02-18 16:04 ` [PATCH 1/3] syscall_user_dispatch: Allow allowed range wrap-around Dmitry Vyukov
2025-02-18 16:58 ` Gregory Price [this message]
2025-02-18 17:34 ` Dmitry Vyukov
2025-02-18 18:00 ` Gregory Price
2025-02-19 8:54 ` Dmitry Vyukov
2025-02-19 13:29 ` Gregory Price
2025-02-18 16:04 ` [PATCH 2/3] selftests: Fix errno checking in syscall_user_dispatch test Dmitry Vyukov
2025-02-19 17:19 ` Kees Cook
2025-02-18 16:04 ` [PATCH 3/3] selftests: Extend syscall_user_dispatch test to check allowed range Dmitry Vyukov
2025-02-20 15:17 ` Gregory Price
2025-02-24 8:48 ` Dmitry Vyukov
2025-03-03 15:57 ` Gregory Price
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=Z7S8SAGt8blFiFTg@gourry-fedora-PF4VCD3F \
--to=gourry@gourry.net \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=gregory.price@memverge.com \
--cc=keescook@chromium.org \
--cc=krisman@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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