From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbdHXMVM (ORCPT ); Thu, 24 Aug 2017 08:21:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:38871 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751280AbdHXMVK (ORCPT ); Thu, 24 Aug 2017 08:21:10 -0400 Subject: Re: [PATCH v1 1/1] mm: Reversed logic in memblock_discard To: Pavel Tatashin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org, terraluna977@gmail.com, stable References: <1503511441-95478-1-git-send-email-pasha.tatashin@oracle.com> <1503511441-95478-2-git-send-email-pasha.tatashin@oracle.com> From: Vlastimil Babka Message-ID: <398b8217-4d67-4a9d-26c3-872dbd575dce@suse.cz> Date: Thu, 24 Aug 2017 14:21:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1503511441-95478-2-git-send-email-pasha.tatashin@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +CC stable On 08/23/2017 08:04 PM, Pavel Tatashin wrote: > In recently introduced memblock_discard() there is a reversed logic bug. > Memory is freed of static array instead of dynamically allocated one. > > Fixes: 3010f876500f ("mm: discard memblock data later") That patch was CC'd stable. So this one should be too. Looks like it the original patch wasn't yet included in a stable release, so we can avoid breakage. > Reported-and-tested-by: Woody Suwalski > Signed-off-by: Pavel Tatashin > --- > mm/memblock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memblock.c b/mm/memblock.c > index bf14aea6ab70..91205780e6b1 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -299,7 +299,7 @@ void __init memblock_discard(void) > __memblock_free_late(addr, size); > } > > - if (memblock.memory.regions == memblock_memory_init_regions) { > + if (memblock.memory.regions != memblock_memory_init_regions) { > addr = __pa(memblock.memory.regions); > size = PAGE_ALIGN(sizeof(struct memblock_region) * > memblock.memory.max); > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v1 1/1] mm: Reversed logic in memblock_discard To: Pavel Tatashin , linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, akpm@linux-foundation.org, terraluna977@gmail.com, stable References: <1503511441-95478-1-git-send-email-pasha.tatashin@oracle.com> <1503511441-95478-2-git-send-email-pasha.tatashin@oracle.com> From: Vlastimil Babka Message-ID: <398b8217-4d67-4a9d-26c3-872dbd575dce@suse.cz> Date: Thu, 24 Aug 2017 14:21:07 +0200 MIME-Version: 1.0 In-Reply-To: <1503511441-95478-2-git-send-email-pasha.tatashin@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: +CC stable On 08/23/2017 08:04 PM, Pavel Tatashin wrote: > In recently introduced memblock_discard() there is a reversed logic bug. > Memory is freed of static array instead of dynamically allocated one. > > Fixes: 3010f876500f ("mm: discard memblock data later") That patch was CC'd stable. So this one should be too. Looks like it the original patch wasn't yet included in a stable release, so we can avoid breakage. > Reported-and-tested-by: Woody Suwalski > Signed-off-by: Pavel Tatashin > --- > mm/memblock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memblock.c b/mm/memblock.c > index bf14aea6ab70..91205780e6b1 100644 > --- a/mm/memblock.c > +++ b/mm/memblock.c > @@ -299,7 +299,7 @@ void __init memblock_discard(void) > __memblock_free_late(addr, size); > } > > - if (memblock.memory.regions == memblock_memory_init_regions) { > + if (memblock.memory.regions != memblock_memory_init_regions) { > addr = __pa(memblock.memory.regions); > size = PAGE_ALIGN(sizeof(struct memblock_region) * > memblock.memory.max); > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org