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: <11f4143b4ef55739ff1441e848c1f66f@kernel.org>
Date:   Thu, 05 Nov 2020 13:12:02 +0000
From:   Marc Zyngier <maz@...nel.org>
To:     "xuqiang (M)" <xuqiang36@...wei.com>
Cc:     tglx@...utronix.de, linux-kernel@...r.kernel.org,
        rui.xiang@...wei.com
Subject: Re: [PATCH -next] irq-chip/gic-v3-its: Fixed an issue where the ITS
 executes the residual commands in the queue again when the ITS wakes up from
 sleep mode.

Please don't top-post.

On 2020-11-05 11:54, xuqiang (M) wrote:
> The kernel sends three commands in the following sequence:
> 
> 1.mapd(deviceA, ITT_addr1, valid:1)
> 
> 2.mapti(deviceA):ITS write ITT_addr1 memory;
> 
> 3.mapd(deviceA, ITT_addr1, valid:0) and kfree(ITT_addr1);
> 
> 4.mapd(deviceA, ITT_addr2, valid:1);
> 
> 5.mapti(deviceA):ITS write ITT_addr2 memory;
> 
> In this case, the processor enters the sleep mode. After the kernel
> performs the suspend operation, the firmware performs the store
> operation and saves GITS_CBASER and GITS_CWRITER registers.
> 
> Then, the processor is woken up, and the firmware restores GITS_CBASER
> and GITS_CWRITER registers. Because GITS_CWRITER register is not 0,
> ITS will read the above command sequence execution from the command
> queue, causing ITT_addr1 memory to be trampled.

This cannot work. By doing a memset on the command queue, you are
only feeding crap to the ITS (command 0 simply does not exist).
Consider yourself lucky that it doesn't just lock-up.

What needs to happen is the restore sequence that is already in the
driver, so that the command queue is in a sane state before re-enabling
the ITS.

         M.
-- 
Jazz is not dead. It just smells funny...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ