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]
Date:   Tue, 14 Jul 2020 13:38:34 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Palmer Dabbelt <palmer@...belt.com>,
        Nick Kossifidis <mick@....forth.gr>,
        Mark Rutland <mark.rutland@....com>,
        Gregory Fong <gregory.0xf0@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Palmer Dabbelt <palmerdabbelt@...gle.com>,
        Brendan Higgins <brendanhiggins@...gle.com>,
        Marco Elver <elver@...gle.com>,
        Alexander Potapenko <glider@...gle.com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Will Deacon <will@...nel.org>, Ingo Molnar <mingo@...nel.org>,
        "Uwe Kleine-K??nig" <uwe@...ine-koenig.org>,
        AKASHI Takahiro <takahiro.akashi@...aro.org>,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Russell King - ARM Linux <linux@...linux.org.uk>,
        Matthew Wilcox <willy@...radead.org>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Android Kernel Team <kernel-team@...roid.com>,
        Petr Mladek <pmladek@...e.com>, zaslonko@...ux.ibm.com,
        Kees Cook <keescook@...omium.org>,
        Mark Brown <broonie@...nel.org>,
        "Vaittinen, Matti" <matti.vaittinen@...rohmeurope.com>,
        Ben Dooks <ben-linux@...ff.org>,
        Dan Williams <dan.j.williams@...el.com>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        David Gow <davidgow@...gle.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        David Miller <davem@...emloft.net>
Subject: Re: [PATCH 1/3] lib: Add a generic copy_oldmem_page()

On Tue, Jul 14, 2020 at 1:06 PM Christoph Hellwig <hch@...radead.org> wrote:
> On Mon, Jul 13, 2020 at 03:39:17PM +0200, Arnd Bergmann wrote:
> > On Mon, Jul 13, 2020 at 3:07 PM Christoph Hellwig <hch@...radead.org> wrote:
> > > On Fri, Jul 10, 2020 at 08:55:42PM -0700, Palmer Dabbelt wrote:
> > > > +ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
> > > > +                      size_t csize, unsigned long offset,
> > > > +                      int userbuf)
> > > > +{
> > > > +     void *vaddr;
> > > > +
> > > > +     if (!csize)
> > > > +             return 0;
> > > > +
> > > > +     vaddr = memremap(__pfn_to_phys(pfn), PAGE_SIZE, MEMREMAP_WB);
> > > > +     if (!vaddr)
> > > > +             return -ENOMEM;
> > >
> > > Doing a memremap for every page is very inefficient.  Also I don't see
> > > why you'd want to even do that.  All memory is in the direct mapping
> > > for RISC-V.  For other architecture that support highmem kmap_atomic_pfn
> > > would do the job, which is what I'd use in a generic version.
> >
> > I would expect the 'oldmem' data to not have a 'struct page', which would
> > be a problem at least for the generic implementation of kmap_atomic_pfn()
>
> Why do you expect it to not have a struct page?

I was under the impression that the kdump kernel only accesses a small
amount of memory itself and would allocate its mem_map to fit that but
not pages of that were used by the kernel it is dumping.

       Arnd

Powered by blists - more mailing lists