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: <20220712073001.GA6980@alpha.franken.de>
Date:   Tue, 12 Jul 2022 09:30:01 +0200
From:   Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Serge Semin <fancer.lancer@...il.com>, linux-mips@...r.kernel.org,
        gerg@...nel.org, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] MIPS: Fixed __debug_virt_addr_valid()

On Mon, Jul 11, 2022 at 05:02:51PM -0700, Florian Fainelli wrote:
> On 7/11/2022 4:29 AM, Serge Semin wrote:
> > On Mon, Jul 11, 2022 at 01:27:40PM +0200, Thomas Bogendoerfer wrote:
> > > On Mon, Jul 11, 2022 at 01:40:52PM +0300, Serge Semin wrote:
> > > > On Mon, Jul 11, 2022 at 10:38:48AM +0200, Thomas Bogendoerfer wrote:
> > > > > On Thu, Jul 07, 2022 at 02:52:36PM -0700, Florian Fainelli wrote:
> > > > > > It is permissible for kernel code to call virt_to_phys() against virtual
> > > > > > addresses that are in KSEG0 or KSEG1 and we need to be dealing with both
> > > > > > types. Add a final condition that ensures that the virtual address is
> > > > > > below KSEG2.
> > > > > > 
> > > > > > Fixes: dfad83cb7193 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL")
> > > > > > Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> > > > > > ---
> > > > > >   arch/mips/mm/physaddr.c | 3 ++-
> > > > > >   1 file changed, 2 insertions(+), 1 deletion(-)
> > > > > > 
> > > > > > diff --git a/arch/mips/mm/physaddr.c b/arch/mips/mm/physaddr.c
> > > > > > index a1ced5e44951..a82f8f57a652 100644
> > > > > > --- a/arch/mips/mm/physaddr.c
> > > > > > +++ b/arch/mips/mm/physaddr.c
> > > > > > @@ -5,6 +5,7 @@
> > > > > >   #include <linux/mmdebug.h>
> > > > > >   #include <linux/mm.h>
> > > > > > +#include <asm/addrspace.h>
> > > > > >   #include <asm/sections.h>
> > > > > >   #include <asm/io.h>
> > > > > >   #include <asm/page.h>
> > > > > > @@ -30,7 +31,7 @@ static inline bool __debug_virt_addr_valid(unsigned long x)
> > > > > >   	if (x == MAX_DMA_ADDRESS)
> > > > > >   		return true;
> > > > > > -	return false;
> > > > > > +	return KSEGX(x) < KSEG2;
> > > > > >   }
> > > > > >   phys_addr_t __virt_to_phys(volatile const void *x)
> > > > > > -- 
> > > > > > 2.25.1
> > > > > 
> > > > 
> > > > > applied to mips-next.
> > > > 
> > > > Are you sure it was ready to be applied?
> > > > Link: https://lore.kernel.org/linux-mips/20220708115851.ejsooiilxcopkoei@mobilestation/
> > > 
> > 
> > > your comment sounded like optimizing, which can be done later on, so
> > > I assumed it ready.
> > 
> > What about Malta and EVA?
> 
> Sergey's comment definitively need to be addressed, and I would not see the
> point in making an incremental change to a wrong fix. Can you drop that
> patch for now? Thanks!

dropped.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ