lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202204071526.37364B5E3@keescook>
Date:   Thu, 7 Apr 2022 16:46:45 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Dan Williams <dan.j.williams@...el.com>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>, Ingo Molnar <mingo@...hat.com>,
        Matthew Wilcox <willy@...radead.org>,
        Russell King <linux@....linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>
Subject: Re: [PATCH v4] /dev/mem: Revoke mappings when a driver claims the
 region

On Thu, Apr 07, 2022 at 11:47:40AM -0700, Dan Williams wrote:
> On Wed, Apr 6, 2022 at 12:46 PM Kees Cook <keescook@...omium.org> wrote:
> >
> > *thread necromancy*
> 
> It's alive!

*lightning*

> > I'm doing a KSPP bug scrub and am reviewing
> > https://github.com/KSPP/linux/issues/74 again.
> >
> > Do you have a chance to look at this? I'd love a way to make mmap()
> > behave the same way as read() for the first meg of /dev/mem.
> 
> You want 0-reads or SIGBUS when attempting to access the first 1MB?
> 
> Because it sounds like what you want is instead of loudly failing with
> -EPERM in drivers/char/mem.c::mmap_mem() you want it to silently
> succeed but swap in the zero page, right? Otherwise if it's SIGBUS
> then IO_STRICT_DEVMEM=y + marking that span as IORESOURCE_BUSY will
> "Do the Right Thing (TM).".

I'd like it to just return zeros, which is what "read" currently does.
(i.e. if page_is_allowed(), really devmem_is_allowed(), returns 2, then
the user should see all zeros.)

So, yes, "silently succeed but swap in the zero page" is exactly what
I'd like. When I last looked, for the first meg, mmap did _not_ fail,
but _actually_ reads it.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ