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]
Message-ID: <CADRPPNTeLH1ChyYgP3fwqkHLTYCcV48tY1W+91nufFJu+yFKrA@mail.gmail.com>
Date:   Thu, 10 Jan 2019 13:43:01 -0600
From:   Li Yang <leoyang.li@....com>
To:     Nicholas Mc Guire <der.herr@...r.at>
Cc:     Scott Wood <oss@...error.net>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        lkml <linux-kernel@...r.kernel.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        Nicholas Mc Guire <hofrat@...dl.org>
Subject: Re: [PATCH] soc: fsl: guts: us devm_kstrdup_const() for RO data

On Sat, Dec 22, 2018 at 2:02 AM Nicholas Mc Guire <der.herr@...r.at> wrote:
>
> On Fri, Dec 21, 2018 at 08:29:56PM -0600, Scott Wood wrote:
> > On Fri, 2018-12-07 at 09:22 +0100, Nicholas Mc Guire wrote:
> > > devm_kstrdup() may return NULL if internal allocation failed, but
> > > as  machine  is from the device tree, and thus RO, devm_kstrdup_const()
> > > can be used here, which will only copy the reference.
> >
> > Is it really going to only copy the reference?  That would require that
> > is_kernel_rodata(machine) be true, which it shouldn't be since it's not part
> > of the kernel image.
> >
> I had tried to figure out what is RO and what not but was not
> able to determine that - from the discussion it seemed that the
> assumption of RO is correct though I did not ask if it would
> satisfy is_kernel_rodata() so that explains the incorrect assertion.
> see https://lkml.org/lkml/2018/12/6/42
> So then the only option is to check the return and cleanup
> on allocation failure as the orriginal patch proposed.

Thanks for the good discussion. I will drop the previous patch. But
would it also be good to just have "soc_dev_attr.machine = machine"
directly?

Regards,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ