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] [day] [month] [year] [list]
Date:	Tue, 19 Jan 2016 14:17:03 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	"Kirill A. Shutemov" <kirill@...temov.name>
cc:	Arnd Bergmann <arnd@...db.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ebru Akagunduz <ebru.akagunduz@...il.com>,
	dan.carpenter@...cle.com, linux-mm@...ck.org,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Rik van Riel <riel@...hat.com>, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] mm: avoid uninitialized variable in tracepoint

On Tue, 19 Jan 2016, Kirill A. Shutemov wrote:

> > A newly added tracepoint in the hugepage code uses a variable in the
> > error handling that is not initialized at that point:
> > 
> > include/trace/events/huge_memory.h:81:230: error: 'isolated' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 
> > The result is relatively harmless, as the trace data will in rare
> > cases contain incorrect data.
> > 
> > This works around the problem by adding an explicit initialization.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
> > Fixes: 7d2eba0557c1 ("mm: add tracepoint for scanning pages")
> 
> There's the same patch in mm tree, but it got lost on the way to Linus'
> tree:
> 
> https://ozlabs.org/~akpm/mmots/broken-out/mm-make-optimistic-check-for-swapin-readahead-fix.patch
> 
> Andrew?
> 

Looks like the patch got the wrong title, 
mm-make-optimistic-check-for-swapin-readahead-fix.patch, since the subject 
is "khugepaged: avoid usage of uninitialized variable 'isolated'".

Anyway, feel free to add

Acked-by: David Rientjes <rientjes@...gle.com>

to either patch.

> > 
> > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > index b2db98136af9..bb3b763b1829 100644
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -2320,7 +2320,7 @@ static void collapse_huge_page(struct mm_struct *mm,
> >  	pgtable_t pgtable;
> >  	struct page *new_page;
> >  	spinlock_t *pmd_ptl, *pte_ptl;
> > -	int isolated, result = 0;
> > +	int isolated = 0, result = 0;
> >  	unsigned long hstart, hend;
> >  	struct mem_cgroup *memcg;
> >  	unsigned long mmun_start;	/* For mmu_notifiers */
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ