From: Solar Designer <solar@openwall.com>
To: kernel-hardening@lists.openwall.com
Subject: Re: [kernel-hardening] HARDEN_VM86
Date: Wed, 15 Jun 2011 18:38:44 +0400 [thread overview]
Message-ID: <20110615143844.GB32753@openwall.com> (raw)
In-Reply-To: <20110614083559.GB7973@albatros>
Vasiliy,
On Tue, Jun 14, 2011 at 12:35:59PM +0400, Vasiliy Kulikov wrote:
> While actual implementation of CONFIG_HARDEN_VM86 is trivial, the most
> important part of pushing the feature into upstream is clarifying to
> what security domain vm86(2)/vm86old(2) should be restricted. In -ow
> and -grsecurity it is restricted to CAP_SYS_RAWIO.
>
> I see 3 possibilities:
>
> 1) Restrict it to CAP_SYS_RAWIO and make it configurable via sysctl
> kernel.vm86_restricted. 0 means current behaviour, 1 means
> CAP_SYS_RAWIO-only.
>
> 2) The same as (1), but CAP_SYS_ADMIN.
CAP_SYS_RAWIO makes more sense to me. This is relatively low level
access to hardware, similar in spirit to what e.g. X servers do/did.
There's little sysadmin'ish in running dosemu.
> 3) Restrict it to some group or CAP_SYS_ADMIN, configurable via
> kernel.vm86_group_allowed. As vm86 is a rarely used thing, group range
> makes little sense for me. 0 means root only, -1 means current
> behaviour, X>0 means group X.
This would definitely be more usable than a capability, because both
CAP_SYS_RAWIO and CAP_SYS_ADMIN grant way too much (actually "root").
If upstream is fine with sysctl's setting gids, and this appears to be
the case, then let's go for this.
A group range would make some sense to me, but a single group is also
fine. With just a single number to specify, you reserve two values for
special meaning, but that's OK. Just make sure you don't grant anything
to group root by default, because gid 0 is sometimes leaked to a user
inadvertently.
BTW, a related syscall is modify_ldt(2). You could want to research
what programs use it, and consider restricting it as well. Perhaps with
a separate sysctl?
Thanks,
Alexander
next prev parent reply other threads:[~2011-06-15 14:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 8:35 [kernel-hardening] HARDEN_VM86 Vasiliy Kulikov
2011-06-15 14:38 ` Solar Designer [this message]
2011-06-15 15:38 ` Vasiliy Kulikov
2011-06-16 14:26 ` Vasiliy Kulikov
2011-06-19 14:12 ` Vasiliy Kulikov
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=20110615143844.GB32753@openwall.com \
--to=solar@openwall.com \
--cc=kernel-hardening@lists.openwall.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox