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


Groups > linux.kernel > #1248425

Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially freed memory

From Gabriel Paubert <paubert@iram.es>
Newsgroups linux.kernel
Subject Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially freed memory
Date 2015-10-16 09:50 +0200
Message-ID <qk7W2-872-35@gated-at.bofh.it> (permalink)
References <qjly2-3OG-5@gated-at.bofh.it> <qjJK1-5GL-7@gated-at.bofh.it> <qjKmK-6HK-31@gated-at.bofh.it> <qk6GB-6cl-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Oct 16, 2015 at 08:20:13AM +0200, Christophe JAILLET wrote:
> Le 15/10/2015 08:36, Michael Ellerman a écrit :
> >On Thu, 2015-10-15 at 07:56 +0200, Christophe JAILLET wrote:
> >>Use 'of_property_read_u32()' instead of 'of_get_property()'+pointer
> >>dereference in order to avoid access to potentially freed memory.
> >>
> >>Use 'of_get_next_parent()' to simplify the while() loop and avoid the
> >>need of a temp variable.
> >>
> >>Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> >>---
> >>v2: Use of_property_read_u32 instead of of_get_property+pointer dereference
> >>*** Untested ***
> >Thanks.
> >
> >Can someone with an mpc5xxx test this?
> >
> >cheers
> >
> 
> Hi,
> I don't think it is an issue, but while looking at another similar
> patch, I noticed that the proposed patch adds a call to
> be32_to_cpup() (within of_property_read_u32).
> Apparently, powerPC is a BE architecture, so this call should be a no-op.

Sadly no more. 32 bit is BE only, but 64 bit can be either BEtter or
LEsser.

    Gabriel
--
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 | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] powerpc/mpc5xxx: Use of_get_next_parent to simplify code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-11 22:40 +0200
  Re: [PATCH] powerpc/mpc5xxx: Use of_get_next_parent to simplify  code Julia Lawall <julia.lawall@lip6.fr> - 2015-10-11 22:50 +0200
    Re: [PATCH] powerpc/mpc5xxx: Use of_get_next_parent to simplify code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-12 07:10 +0200
  Re: powerpc/mpc5xxx: Use of_get_next_parent to simplify code Michael Ellerman <mpe@ellerman.id.au> - 2015-10-14 06:10 +0200
    [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially freed memory Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-15 08:00 +0200
      Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially  freed memory Michael Ellerman <mpe@ellerman.id.au> - 2015-10-15 08:40 +0200
        Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially freed  memory Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-16 08:30 +0200
          Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially  freed memory Gabriel Paubert <paubert@iram.es> - 2015-10-16 09:50 +0200
          Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially  freed memory Michael Ellerman <mpe@ellerman.id.au> - 2015-10-16 11:50 +0200
            Re: [PATCH v2] powerpc/mpc5xxx: Avoid dereferencing potentially freed  memory Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2015-10-16 22:10 +0200
  Re: powerpc/mpc5xxx: Use of_get_next_parent to simplify code Michael Ellerman <mpe@ellerman.id.au> - 2015-10-15 13:20 +0200

csiph-web