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:	Tue, 5 Feb 2013 20:24:01 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	shuah.khan@...com
Cc:	Andrew Morton <akpm@...ux-foundation.org>, tglx@...utronix.de,
	hpa@...or.com, mingo@...hat.com, tangchen@...fujitsu.com,
	wency@...fujitsu.com, LKML <linux-kernel@...r.kernel.org>,
	x86@...nel.org, shuahkhan@...il.com
Subject: Re: [PATCH linux-next] x86/mm: Fix compile warning in remove_pagetable()

On Tue, Feb 5, 2013 at 6:52 PM, Shuah Khan <shuah.khan@...com> wrote:
> Fix the following compile warning in remove_pagetable():
> arch/x86/mm/init_64.c: In function ‘remove_pagetable’:
> arch/x86/mm/init_64.c:996:9: warning: ‘next’ may be used uninitialized in this function [-Wuninitialized]
>
>
> Signed-off-by: Shuah Khan <shuah.khan@...com>
> ---
>  arch/x86/mm/init_64.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 67bad4b..ed78400 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -987,7 +987,7 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
>  static void __meminit
>  remove_pagetable(unsigned long start, unsigned long end, bool direct)
>  {
> -       unsigned long next;
> +       unsigned long next = pgd_addr_end(start, end);
>         pgd_t *pgd;
>         pud_t *pud;
>         bool pgd_changed = false;
> --
> 1.7.9.5

Andrew already had one fix-fix-...-fix for that.



On Mon, Feb 4, 2013 at 3:28 PM, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Mon, 4 Feb 2013 15:18:58 -0800
> Yinghai Lu <yinghai@...nel.org> wrote:
>
>> On Mon, Feb 4, 2013 at 3:04 PM,  <akpm@...ux-foundation.org> wrote:
>> >
>> > The patch titled
>> >      Subject: memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>> > has been added to the -mm tree.  Its filename is
>> >      memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix.patch
>> >
>> > Before you just go and hit "reply", please:
>> >    a) Consider who else should be cc'ed
>> >    b) Prefer to cc a suitable mailing list as well
>> >    c) Ideally: find the original patch on the mailing list and do a
>> >       reply-to-all to that, adding suitable additional cc's
>> >
>> > *** Remember to use Documentation/SubmitChecklist when testing your code ***
>> >
>> > The -mm tree is included into linux-next and is updated
>> > there every 3-4 working days
>> >
>> > ------------------------------------------------------
>> > From: Andrew Morton <akpm@...ux-foundation.org>
>> > Subject: memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>> >
>> > fix used-uninitialised bug
>> >
>> > Cc: Jiang Liu <jiang.liu@...wei.com>
>> > Cc: Jianguo Wu <wujianguo@...wei.com>
>> > Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
>> > Cc: Lai Jiangshan <laijs@...fujitsu.com>
>> > Cc: Tang Chen <tangchen@...fujitsu.com>
>> > Cc: Wen Congyang <wency@...fujitsu.com>
>> > Cc: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
>> > Cc: Yinghai Lu <yinghai@...nel.org>
>> > Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
>> > ---
>> >
>> >  arch/x86/mm/init_64.c |    4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff -puN arch/x86/mm/init_64.c~memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix arch/x86/mm/init_64.c
>> > --- a/arch/x86/mm/init_64.c~memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix
>>
>> it is hard to count fix now!
>
> Yes, I think that's a world record ;)
>
>> > +++ a/arch/x86/mm/init_64.c
>> > @@ -993,12 +993,12 @@ remove_pagetable(unsigned long start, un
>> >         bool pgd_changed = false;
>> >
>> >         for (; start < end; start = next) {
>> > +               next = pgd_addr_end(start, end);
>> > +
>> >                 pgd = pgd_offset_k(start);
>> >                 if (!pgd_present(*pgd))
>> >                         continue;
>> >
>> > -               next = pgd_addr_end(start, end);
>> > -
>> >                 pud = (pud_t *)pgd_page_vaddr(*pgd);
>> >                 remove_pud_table(pud, start, next, direct);
>> >                 if (free_pud_table(pud, pgd))
>> > _
>>
>> It's a real bug fix.
>> Without this fix, it will get dead loop if there is 512G (and aligned)
>> memory hole in the range.
>
> OK, thanks.
--
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