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:	Wed, 21 Aug 2013 17:04:21 +0200
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC:	Tang Chen <tangchen@...fujitsu.com>, robert.moore@...el.com,
	lv.zheng@...el.com, rjw@...k.pl, lenb@...nel.org,
	tglx@...utronix.de, mingo@...e.hu, akpm@...ux-foundation.org,
	tj@...nel.org, trenn@...e.de, yinghai@...nel.org,
	jiang.liu@...wei.com, wency@...fujitsu.com, laijs@...fujitsu.com,
	isimatu.yasuaki@...fujitsu.com, izumi.taku@...fujitsu.com,
	mgorman@...e.de, minchan@...nel.org, mina86@...a86.com,
	gong.chen@...ux.intel.com, vasilis.liaskovitis@...fitbricks.com,
	lwoodman@...hat.com, riel@...hat.com, jweiner@...hat.com,
	prarit@...hat.com, zhangyanfei@...fujitsu.com,
	yanghy@...fujitsu.com, x86@...nel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	linux-acpi@...r.kernel.org
Subject: Re: [PATCH 5/8] x86, brk: Make extend_brk() available with va/pa.



Konrad Rzeszutek Wilk <konrad.wilk@...cle.com> wrote:
>On Wed, Aug 21, 2013 at 02:35:36PM +0200, H. Peter Anvin wrote:
>> Global symbols are inaccessible in physical mode.
>
>Even if they are embedded in the assembler code and use
>GLOBAL(paging_enabled) ?

Yes, because the address is different in physical mode.  Think about it.  You could do a *function* like:

paging_enabled:
	mov (%esp),%edx
	xor %eax,%eax
	cmpl $PAGE_OFFSET,%edx
	setae %al
	ret

>> 
>> This is incidentally yet another example of "PV/weird platform
>violence", since in their absence it would be trivial to work around
>this by using segmentation.
>
>I don't follow why it could not.
>
>Why can't there be a __pa_symbol(paging_enabled) that is used. Won't
>that in effect allow you to check the contents of that 'global
>constant' even when you don't have paging enabled?

Yes.  But not once paging has been turned on.

>> >>As mentioned above, on 32bit before paging is enabled, we have to
>> >>access variables
>> >>with pa. So introduce a "bool is_phys" parameter to extend_brk(),
>and
>> >>convert va
>> >>to pa is it is true.
>> >
>> >Could you do it differently? Meaning have a global symbol
>> >(paging_enabled) which will be used by most of the functions you
>> >changed in this patch and the next ones? It would naturally be
>enabled
>> >when paging is on and __va addresses can be used. 
>> >
>> >That could also be used in the printk case to do a BUG_ON before
>paging
>> >is enabled on 32bit. Or perhaps use a different code path to deal
>with
>> >using __pa address. 
>> >
>> >? 

-- 
Sent from my mobile phone. Please excuse brevity and lack of formatting.
--
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