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]
Date:	Tue, 15 Dec 2015 08:34:58 -0800
From:	Dan Williams <dan.j.williams@...el.com>
To:	Joerg Roedel <joro@...tes.org>
Cc:	Jens Axboe <axboe@...com>, Russell King <linux@....linux.org.uk>,
	Vitaly Lavrov <vel21ripn@...il.com>, X86 ML <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...r.kernel.org" <stable@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Christoph Hellwig <hch@....de>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [for-4.4-rc6 PATCH] scatterlist: fix sg_phys() masking

On Tue, Dec 15, 2015 at 2:35 AM, Joerg Roedel <joro@...tes.org> wrote:
> On Mon, Dec 14, 2015 at 03:17:39PM -0800, Dan Williams wrote:
>> commit db0fa0cb0157 "scatterlist: use sg_phys()" did replacements of the
>> form:
>>
>>     phys_addr_t phys = page_to_phys(sg_page(s));
>>     phys_addr_t phys = sg_phys(s) & PAGE_MASK;
>>
>> However, this breaks platforms where sizeof(phys_addr_t) >
>> sizeof(unsigned long).  Since PAGE_MASK is an unsigned long this
>> inadvertently masks the high bits returned by sg_phys().  Convert to
>> PHYSICAL_PAGE_MASK in these cases which will do the proper sign
>> extension.
>>
>> As caught by the kbuild robot, a generic fallback definition of
>> PHYSICAL_PAGE_MASK is needed for several archs.
>
> It is getting late in the cycle already, isn't it better to revert
> db0fa0cb0157 for now and queue a fixed version for the next round? Then
> you can also replace all the 'sg_phys() & MASK' parts by a new sg helper
> which just returns the page-aligned physical address.
> This would not only be cleaner than your original patch but also leaves
> just one place where you need to fix things if necessary.
>

Sounds good to me.  Thanks, Joerg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ