Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1250502

Re: [PATCH v2] powerpc/prom: Avoid reference to potentially freed memory

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH v2] powerpc/prom: Avoid reference to potentially freed memory
Date 2015-10-19 11:30 +0200
Message-ID <qleVt-aI-17@gated-at.bofh.it> (permalink)
References <qk6wW-610-9@gated-at.bofh.it> <qkkTf-1Tk-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2015-10-16 at 23:38 +0200, Christophe JAILLET wrote:

> of_get_property() is used inside the loop, but then the reference to the
> node is dropped before dereferencing the prop pointer, which could by then
> point to junk if the node has been freed.
> 
> Instead use of_property_read_u32() to actually read the property
> value before dropping the reference.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: Fix missing '{'
> *** COMPILE-TESTED ONLY ***

Thanks, this looks good. I'll test it on real hardware.

Can you send me a follow up which does the of_get_next_parent() conversion?

cheers

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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] powerpc/prom: Avoid reference to potentially freed  memory Michael Ellerman <mpe@ellerman.id.au> - 2015-10-19 11:30 +0200
  [PATCH v3] powerpc/prom: Avoid reference to potentially freed memory Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-21 06:40 +0200

csiph-web