Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3482935imm; Mon, 4 Jun 2018 04:29:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLztNUyM4UtSQVoIn9+JDOw4M3sBhwan0CGEDEEG1CkprcIYcGz1NiKaW9FvbdPSSa3oVlP X-Received: by 2002:a17:902:20c9:: with SMTP id v9-v6mr21486012plg.206.1528111745065; Mon, 04 Jun 2018 04:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528111745; cv=none; d=google.com; s=arc-20160816; b=JDPSdgHMSmxF0tQwIULK6oC8bwc6iwvg36QkhKgXYay9CeyBapN+JEoVlPE0gu3q1j BZWOLurFwr6W309jYK0Zk3RR05zSn4R+OioBe40eS6kc68MRMTHVi2DvrFI0aEDuuDHY zr6uTUOSjwt7HI6zFbgSkyIYC0MVOP02jIb2n4tzldVwTpDjkJvCTm6Ny7zFCrflM0iZ NU2G6XtbSZRkvzZ+/+FGUbRAnK4864VsLMgGbxItAyo9n7CXg8kjZB69hQbhIbO6WZE3 17bQ4T34C3uOHjGGVKFLzvGcmuwKKeTe5cvDoopVmCb3U6Dc0/APu0MqP9bmUxIUQ6tA ++cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=GWEmsd4yLmhE1pU+iRxxD1ZZlNqDhS1Elstt6YFbA90=; b=qPtqdbrBNn5OnylBN+4z0M9JyVkQ7rh87bITRfbYAJoMgByq2bWSQvQ0asB9Bx4IFU 6kER0vEFNb22Go93U/zBjEU7F12cx1cvGt6KsIbpdGnwdOZ6j8Uvg5tpHGwnINarJGwU nDkEAf19AxYFk+CYm4CEuWclcV29Vkc06bZJtQ5Bszf8ncsRO1XOAD/sdrL1enFgPo4V vrrRCMqMx8m9/k/oCmgRlqijzaqDz1b3dr+zbaWNjpclytTKb0tEzZEbPyYi5iHhelQn 9Mx+76TaHBeBWCp6hJOce2OG1NN+xJAmjqrdF+OlrBEjjZkYhVKEalr7r5dz6XrThUKY 6cNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o10-v6si9646441pgr.175.2018.06.04.04.28.50; Mon, 04 Jun 2018 04:29:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752517AbeFDL16 convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Jun 2018 07:27:58 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:5555 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751769AbeFDL1q (ORCPT ); Mon, 4 Jun 2018 07:27:46 -0400 Received: from DGGEMM403-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id E9AC9164680B3; Mon, 4 Jun 2018 19:27:26 +0800 (CST) Received: from DGGEMM507-MBX.china.huawei.com ([169.254.1.199]) by DGGEMM403-HUB.china.huawei.com ([10.3.20.211]) with mapi id 14.03.0382.000; Mon, 4 Jun 2018 19:27:26 +0800 From: Nixiaoming To: Michal Hocko CC: "akpm@linux-foundation.org" , "vdavydov.dev@gmail.com" , "hannes@cmpxchg.org" , "garsilva@embeddedor.com" , "ktkhai@virtuozzo.com" , "stummala@codeaurora.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" Subject: RE: [PATCH] mm: Add conditions to avoid out-of-bounds Thread-Topic: [PATCH] mm: Add conditions to avoid out-of-bounds Thread-Index: AQHT+/ODcalbMzUwQk2w0KnDFcXRgaRPbg8AgACHnjA= Date: Mon, 4 Jun 2018 11:27:26 +0000 Message-ID: References: <20180604103735.42781-1-nixiaoming@huawei.com> <20180604112026.GI19202@dhcp22.suse.cz> In-Reply-To: <20180604112026.GI19202@dhcp22.suse.cz> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.57.88.168] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I'm very sorry. It was my mistake. it won't cross the border here. Thanks -----Original Message----- From: Michal Hocko [mailto:mhocko@kernel.org] Sent: Monday, June 04, 2018 7:20 PM To: Nixiaoming Cc: akpm@linux-foundation.org; vdavydov.dev@gmail.com; hannes@cmpxchg.org; garsilva@embeddedor.com; ktkhai@virtuozzo.com; stummala@codeaurora.org; linux-kernel@vger.kernel.org; linux-mm@kvack.org Subject: Re: [PATCH] mm: Add conditions to avoid out-of-bounds On Mon 04-06-18 18:37:35, nixiaoming wrote: > In the function memcg_init_list_lru > if call goto fail when i == 0, will cause out-of-bounds at lru->node[i] How? All I can see is that the fail path does for (i = i - 1; i >= 0; i--) so it will not do anything for i=0. -- Michal Hocko SUSE Labs