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: <CAMuHMdUDxemAOsE1E1Ba3zjhtMSp-k=n4_YxRJ2k_C_kZdBr=Q@mail.gmail.com>
Date:	Wed, 8 Oct 2014 13:54:40 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	"Wang, Yalin" <Yalin.Wang@...ymobile.com>
Cc:	Will Deacon <will.deacon@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	Russell King - ARM Linux <linux@....linux.org.uk>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>,
	Catalin Marinas <Catalin.Marinas@....com>,
	DL-WW-ContributionOfficers-Linux 
	<DL-WW-ContributionOfficers-Linux@...ymobile.com>
Subject: Re: [PATCH resend] arm:extend the reserved memory for initrd to be
 page aligned

On Fri, Sep 19, 2014 at 9:09 AM, Wang, Yalin <Yalin.Wang@...ymobile.com> wrote:
> this patch extend the start and end address of initrd to be page aligned,
> so that we can free all memory including the un-page aligned head or tail
> page of initrd, if the start or end address of initrd are not page
> aligned, the page can't be freed by free_initrd_mem() function.
>
> Signed-off-by: Yalin Wang <yalin.wang@...ymobile.com>
> ---
>  arch/arm/mm/init.c   | 5 +++++
>  arch/arm64/mm/init.c | 8 +++++++-
>  2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index 659c75d..9221645 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -636,6 +636,11 @@ static int keep_initrd;
>  void free_initrd_mem(unsigned long start, unsigned long end)
>  {
>         if (!keep_initrd) {
> +               if (start == initrd_start)
> +                       start = round_down(start, PAGE_SIZE);
> +               if (end == initrd_end)
> +                       end = round_up(end, PAGE_SIZE);
> +
>                 poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
>                 free_reserved_area((void *)start, (void *)end, -1, "initrd");
>         }

Who guarantees there's no valuable data in [start, initrd_start)
and [initrd_end, end) being corrupted?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
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