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] [day] [month] [year] [list]
Message-ID: <1406e091-d288-c5d6-5340-1bbca25d39c2@synopsys.com>
Date:   Thu, 28 Jun 2018 17:37:56 -0700
From:   Vineet Gupta <Vineet.Gupta1@...opsys.com>
To:     Alexey Brodkin <Alexey.Brodkin@...opsys.com>,
        "linux-snps-arc@...ts.infradead.org" 
        <linux-snps-arc@...ts.infradead.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] ARC: Fix __swp_offset() implementation

On 06/28/2018 04:59 PM, Alexey Brodkin wrote:
> We encode offset from swapcache page in __swp_entry() this way, see [1]:
> | /* Encode swap {type,off} tuple into PTE
> |  * We reserve 13 bits for 5-bit @type, keeping bits 12-5 zero, ensuring that
> |  * PAGE_PRESENT is zero in a PTE holding swap "identifier"
> |  */
> | #define __swp_entry(type, off)	((swp_entry_t) { \
> | 					((type) & 0x1f) | ((off) << 13) })
>
> But decode in __swp_offset() as:
> | #define __swp_offset(pte_lookalike)	((pte_lookalike).val << 13)
> which is obviously wrong, we should ">> 13" instead.
>
> This basically fixes swap usage on ARC finally.

Nice. Wish all fixes were so simple ;-)

I've added this to for-curr and will also make its way to stable, but lets clean
up this mess of hardcoded 13 properly as a cleanup patch. There are good
references to look at : arm, riscv etc

Thx,
-Vineet

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ