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:	Thu, 22 Aug 2013 08:47:19 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Linus Torvalds" <torvalds@...ux-foundation.org>
Cc:	"Andy Lutomirski" <luto@...capital.net>,
	"David Vrabel" <david.vrabel@...rix.com>,
	"Cyrill Gorcunov" <gorcunov@...il.com>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	<Xen-devel@...ts.xen.org>,
	"Boris Ostrovsky" <boris.ostrovsky@...cle.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@...cle.com>,
	"Pavel Emelyanov" <xemul@...allels.com>,
	"Ingo Molnar" <mingo@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"H. Peter Anvin" <hpa@...or.com>
Subject: Re: Regression: x86/mm: new _PTE_SWP_SOFT_DIRTY bit conflicts
 with existing use

>>> On 22.08.13 at 01:04, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, Aug 21, 2013 at 12:03 PM, Cyrill Gorcunov <gorcunov@...il.com> wrote:
>>
>> I personally don't see bug here because
>>
>>  - this swapped page soft dirty bit is set for non-present entries only,
>>    never for present ones, just at moment we form swap pte entry
>>
>>  - i don't find any code which would test for this bit directly without
>>    is_swap_pte call
> 
> Ok, having gone through the places that use swp_*soft_dirty(), I have
> to agree. Afaik, it's only ever used on a swap-entry that has (by
> definition) the P bit clear. So with or without Xen, I don't see how
> it can make any difference.
> 
> David/Konrad - did you actually see any issues, or was this just from
> (mis)reading the code?

It was actually me (mis)reading the code - as pointed out to Cyrill
already, setting _PAGE_PAT in a pte_t without even a comment
saying that this can only ever be done with a non-present entry
made me expect problems on Xen, because it's clear that to date
bare metal Linux doesn't care about the state of _PAGE_PAT in
present entries due to the way the PAT MSR gets set (and hence
quite likely no-one would have noticed the supposed problem
while testing).

So a comment either alongside the definition of _PAGE_SWP_SOFT_DIRTY
or directly in pte_swp_{mk,clear_}soft_dirty() would have been
the minimal thing I'd have expected for this sort of re-use of bits.
Ideally even a VM_BUG_ON(pte_present()) or similar. And perhaps
pte_swp_soft_dirty() should be either looking at the present bit
too or similarly asserting that it's clear...

In any event - I'm sorry for the red herring.

Jan

--
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