Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1635736

Re: RFC v2: post-init-read-only protection for data allocated dynamically

From Igor Stoppa <igor.stoppa@huawei.com>
Newsgroups linux.kernel
Subject Re: RFC v2: post-init-read-only protection for data allocated dynamically
Date 2017-05-04 15:40 +0200
Message-ID <tDp97-43E-13@gated-at.bofh.it> (permalink)
References <tD1gw-5a8-45@gated-at.bofh.it> <tDn7j-2Ke-1@gated-at.bofh.it> <tDnTI-3io-11@gated-at.bofh.it> <tDoPM-3W2-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04/05/17 16:11, Michal Hocko wrote:
> On Thu 04-05-17 15:14:10, Igor Stoppa wrote:

> I believe that this is a fundamental question. Sealing sounds useful
> for after-boot usecases as well and it would change the approach
> considerably. Coming up with an ad-hoc solution for the boot only way
> seems like a wrong way to me. And as you've said SELinux which is your
> target already does the thing after the early boot.

I didn't spend too many thoughts on this so far, because the zone-based
approach seemed almost doomed, so I wanted to wait for the evolution of
the discussion :-)

The main question here is granularity, I think.

At least, as first cut, the simpler approach would be to have a master
toggle: when some legitimate operation needs to happen, the seal is
lifted across the entire range, then it is put back in place, once the
operation has concluded.

Simplicity is the main advantage.

The disadvantage is that anything can happen, undetected, while the seal
is lifted.
OTOH the amount of code that could backfire should be fairly limited, so
it doesn't seem a huge issue to me.

The alternative would be to somehow know what a write will change and
make only the appropriate page(s) writable. But it seems overkill to me.
Especially because in some cases, with huge pages, everything would fit
anyway in one page.

One more option that comes to mind - but I do not know how realistic it
would be - is to have multiple slabs, to be used for different purposes.
Ex: one for the monolithic kernel and one for modules.
It wouldn't help for livepatch, though, as it can modify both, so both
would have to be unprotected.

But live-patching is potentially a far less frequent event than module
loading/unloading (thinking about USB gadgets, for example).

[...]

> Slab pages are not migrateable currently. Even if they start being
> migrateable it would be an opt-in because that requires pointers tracking
> to make sure they are updated properly.

ok

[...]

> I haven't researched that too deeply. In principle both SLAB and SLUB
> maintain slab pages in a similar way so I do not see any fundamental
> problems.


good, then I could proceed with the prototype, if there are no further
objections/questions and we agree that, implementation aside, there are
no obvious fundamental problems preventing the merge


---
thanks, igor

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RFC v2: post-init-read-only protection for data allocated dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-03 14:10 +0200
  Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-04 10:20 +0200
    Re: RFC v2: post-init-read-only protection for data allocated  dynamically Dave Hansen <dave.hansen@intel.com> - 2017-05-04 16:40 +0200
      Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-05 11:00 +0200
  Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-04 13:30 +0200
    Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-04 14:20 +0200
      Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-04 15:20 +0200
        Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-04 15:40 +0200
          Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-04 16:10 +0200
            Re: RFC v2: post-init-read-only protection for data allocated  dynamically Dave Hansen <dave.hansen@intel.com> - 2017-05-04 19:30 +0200
              Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-05 14:10 +0200
            Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-05 14:30 +0200
              Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-10 09:50 +0200
  Re: RFC v2: post-init-read-only protection for data allocated  dynamically Laura Abbott <labbott@redhat.com> - 2017-05-04 19:00 +0200
    Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-05 12:50 +0200
      Re: RFC v2: post-init-read-only protection for data allocated  dynamically Laura Abbott <labbott@redhat.com> - 2017-05-08 17:30 +0200
        Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-09 11:50 +0200
      Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-10 10:10 +0200
        Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-10 11:00 +0200
          Re: RFC v2: post-init-read-only protection for data allocated  dynamically Michal Hocko <mhocko@kernel.org> - 2017-05-10 13:50 +0200
            Re: RFC v2: post-init-read-only protection for data allocated  dynamically Igor Stoppa <igor.stoppa@huawei.com> - 2017-05-10 17:30 +0200
              Re: RFC v2: post-init-read-only protection for data allocated  dynamically Dave Hansen <dave.hansen@intel.com> - 2017-05-10 17:50 +0200

csiph-web