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, 21 Feb 2013 09:34:45 +0000
From:	James Hogan <james.hogan@...tec.com>
To:	Vineet Gupta <Vineet.Gupta1@...opsys.com>
CC:	<linux-kernel@...r.kernel.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Arnd Bergmann <arnd@...db.de>,
	Rob Herring <rob.herring@...xeda.com>
Subject: Re: [PATCH 1/2] metag: copy devicetree to non-init memory

Hi Vineet,

On 21/02/13 09:08, Vineet Gupta wrote:
> On Wednesday 20 February 2013 08:22 PM, James Hogan wrote:
>> Make a copy of the device tree blob in non-init memory. It is required
>> when using built-in device tree files that the platform code copies the
>> blob to non-init memory prior to calling unflatten_device_tree(),
>> otherwise the strings that the device tree refer to will get poisoned
>> and potentially reused, breaking later reading of the device tree
>> post-init (such as compatible matching in modules, debugfs, and the
>> procfs interface).
> 
> While the patch conceptually looks correct, I'm not sure why any user of DT -
> post-init would refer to DT bindings using of_fdt_* API which use the flat tree,
> instead of the binary tree (more efficient in space/usage). Is this to support
> some in-transition drivers and other code.

The strings aren't copied when the devicetree is unflattened, so the
unflattened version still points into initdata, so all the strings "in"
the unflattened version are wiped when it's freed too.

Documentation/kbuild/makefiles.txt has this to say:
>     dtc
> 	Create flattend device tree blob object suitable for linking
> 	into vmlinux. Device tree blobs linked into vmlinux are placed
> 	in an init section in the image. Platform code *must* copy the
> 	blob to non-init memory prior to calling unflatten_device_tree().

Other architectures using the builtin dtb also do the copy. I presume
it's in initdata in the first place to avoid keeping the built-in one
around if one is provided by the bootloader instead.

Cheers
James

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