From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757586AbdACJH0 (ORCPT ); Tue, 3 Jan 2017 04:07:26 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50198 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752820AbdACJHS (ORCPT ); Tue, 3 Jan 2017 04:07:18 -0500 Subject: Re: [RFC] nodemask: Consider MAX_NUMNODES inside node_isset To: Michal Hocko , Anshuman Khandual References: <20170103082753.25758-1-khandual@linux.vnet.ibm.com> <20170103084418.GC30111@dhcp22.suse.cz> From: Anshuman Khandual Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, vbabka@suse.cz, akpm@linux-foundation.org Date: Tue, 3 Jan 2017 14:37:09 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170103084418.GC30111@dhcp22.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17010309-0008-0000-0000-000000F88D00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17010309-0009-0000-0000-000008CF8B39 Message-Id: <6c7ecb18-2ad0-f38a-1dc8-3c6c405b87ce@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-03_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701030150 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/2017 02:14 PM, Michal Hocko wrote: > On Tue 03-01-17 13:57:53, Anshuman Khandual wrote: >> node_isset can give incorrect result if the node number is beyond the >> bitmask size (MAX_NUMNODES in this case) which is not checked inside >> test_bit. Hence check for the bit limits (MAX_NUMNODES) inside the >> node_isset function before calling test_bit. > Could you be more specific when such a thing might happen? Have you seen > any in-kernel user who would give such a bogus node? Have not seen this through any in-kernel use case. While rebasing the CDM zonelist rebuilding series, I came across this through an error path when a bogus node value of 256 (MAX_NUMNODES on POWER) is received when we call first_node() on an empty nodemask (which itself seems weird as well).