From patchwork Fri Sep 28 11:28:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10619767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1467B6CB for ; Fri, 28 Sep 2018 11:28:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08F892B0C5 for ; Fri, 28 Sep 2018 11:28:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0B842B0F2; Fri, 28 Sep 2018 11:28:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CD982B0C5 for ; Fri, 28 Sep 2018 11:28:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1695C8E0003; Fri, 28 Sep 2018 07:28:41 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 119DD8E0001; Fri, 28 Sep 2018 07:28:41 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F23C38E0003; Fri, 28 Sep 2018 07:28:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id 935D48E0001 for ; Fri, 28 Sep 2018 07:28:40 -0400 (EDT) Received: by mail-wr1-f71.google.com with SMTP id u1-v6so6144162wrt.3 for ; Fri, 28 Sep 2018 04:28:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:date:message-id :user-agent:mime-version:content-transfer-encoding :spamdiagnosticoutput:spamdiagnosticmetadata; bh=vldumgOPLmlUIg7tZUj0e+vLrc3Ljq7CdIVYjOrxO0s=; b=hiF2cJOCpuV+6NJqsAnnXxbkG5JvHQn2xdQX3tRpc21mIPIekv8FM3U1yxOC5hsmyc sUTBObvB8C5u566qMeAu9biA9uQIj/u7yH15O5TiKv/AzT18HVBhVwsfhQPyKQ7tgRK1 zznYO2v7VN8bBTzAXjlmsUKKFaoxSRWQWa9M0gq1Jy+kMTkgHgxjWTZX7SIxqeLv2aJx 6vujzTDwPonnwjntkCoYPW9L5Fc2vzyEzW0I3OJMxBnh74bm9s84kuOz/7L3p0lGZUED K3Pz4fsWQXcGRGrFsFGNsIUxruGM/CT2GmR/WFqpq54HD1hGVpipU3Po7XHg9o3GdovI 54HQ== X-Gm-Message-State: ABuFfoiZvQ+l9CIGFegBywM5ho64J5BP4aGq/Krpa0CP5mA/nuyhD5Fr 8DcBU6ch7HxWqgpNSa4w2EQRGfNYEHwM5WpFIQYrXRrSQsXYfZCrQeBdCY0YWjWtIPFy1xYn15w JrAlqJsDjxp69DMIwmBBBkbqcICFtacTGGi/geHylFodp6nIF7rwLy1UWeP7bN++GRA== X-Received: by 2002:a1c:4d09:: with SMTP id o9-v6mr1382021wmh.134.1538134120012; Fri, 28 Sep 2018 04:28:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV63axPIcohNahmkpMHHsmulb7feaLD8hnwzp7osuINvMxRq25BDJTUxWbfFZcRhlG7kCupvz X-Received: by 2002:a1c:4d09:: with SMTP id o9-v6mr1381972wmh.134.1538134119042; Fri, 28 Sep 2018 04:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538134119; cv=none; d=google.com; s=arc-20160816; b=TGpXdzsLzea/v3UKwTZlHrHAEgkSfoLbipYCAiGrsKFhEChilMk7EaXSEOC9nFtOFO trhROZGSVZxHYm9O1rewqVV2/vQSjwB+6hf3V3LWqOIjWQZiL1w6E3XRascwjljI4f/r RxlpssNoE6V26Fx6phTcjTvwI5ycUg/W53dpUCcVrwtTYrPNScfTvEFdKKhDRdVe4LUq 0l9ss5m4UQCdquL8012CFEIn6HPEzFCcO8l4eCIPUf3n+bz60+TxRr+zMSOtkSrEdOuC DzoBBEW+BnZL6JmxQCerTxpb7KEFcDwJb6/4W/I3NXDVWSDD2jKSjbyqsAp06QfkcxIL 2pkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:mime-version:user-agent:message-id:date :to:from:subject:dkim-signature; bh=vldumgOPLmlUIg7tZUj0e+vLrc3Ljq7CdIVYjOrxO0s=; b=hxt2Dwm5c7RGnnk4LOWCrIjvXwoLiI19TTy+/GhrJGPn/o+NiAvWSuasbOd+oKyUap Jgw0EAyKnTAPlObDINm6SdvvmMNa6fZT3aa/2ir5TflvXEIEKbuADA3yKkc8q1gDwR5+ Ezo6npOSbYYw41xcoTk0/dlbBNoABYDOSSFDcZgqPepMfnnzGbJBw0KieUsXjGo0cDOR S/FArK5LniKuZazswxo0axlkvVICcgU3nB0agCp4lgArK4iOJUUCA/58zB/uEfz8wQY1 psPehRuOgVPW/rejSvZ9uMzCFLxA/x81eVHiWkoO0y+XM1JtObZfWXcgD8+S5CspgDae WLEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="Cmk9k/O6"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.130 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80130.outbound.protection.outlook.com. [40.107.8.130]) by mx.google.com with ESMTPS id s6-v6si4477969wrg.240.2018.09.28.04.28.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Sep 2018 04:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.130 as permitted sender) client-ip=40.107.8.130; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="Cmk9k/O6"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.130 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vldumgOPLmlUIg7tZUj0e+vLrc3Ljq7CdIVYjOrxO0s=; b=Cmk9k/O6VM+gloyIG4U83iWryFLNj3KaO2nopMpOA5H8WpVAceyBmUqOpAObFbQtS1DyF9aztsPElNGn7ar7ejMtk1qPs/p6dIPMWvhlWcSqNybiv/35zeWAzyVYqi0h3iXLqwoa53lRj9XkCvZD0vDJAqLw6X7cKNk5D2IxvAc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by AM5PR0801MB2018.eurprd08.prod.outlook.com (2603:10a6:203:4b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Fri, 28 Sep 2018 11:28:35 +0000 Subject: [PATCH] mm: Fix int overflow in callers of do_shrink_slab() From: Kirill Tkhai To: akpm@linux-foundation.org, gorcunov@openvz.org, ktkhai@virtuozzo.com, mhocko@suse.com, aryabinin@virtuozzo.com, hannes@cmpxchg.org, penguin-kernel@I-love.SAKURA.ne.jp, shakeelb@google.com, jbacik@fb.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Fri, 28 Sep 2018 14:28:32 +0300 Message-ID: <153813407177.17544.14888305435570723973.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: LO2P265CA0061.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::25) To AM5PR0801MB2018.eurprd08.prod.outlook.com (2603:10a6:203:4b::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6490c090-09dd-4390-228f-08d625358830 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:AM5PR0801MB2018; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2018;3:FGBoJPl5QU2eq9VKci8FnnpS7vBa+fRTK1fAlanAKtfbXEhnZE922HCXrb1q1JZL1D/HdTY0uyVvhTVeHuxLOnxQUZNtdPwBvuoi5NVd/prbW4Po8zCV1FLX6djnaZEScamExNp5fS+qBufmkq7RKdUHsrHabjnfkd4pDPJjbV3c9AFMhlAD94MIE060fK+0rMBjcqBLbEC6Zwjf0+/MeGMelVUWQmU0C9guocjj0Sxyy5jQfLNWfSXd9Mb/fWUE;25:2WqvVXIaXVwIMsbbpDwQgrWJRfMdcKvFYOU7c6LVjjHlTE4ceJo5D5hjMPT+feEmp3OVPxtwDNJhNZAjRE3d3tlWYzuhAI+h72B5zct75R3YUKR+8jgIo5/f0Lt5D1Kyzj9fRGDE0NgjPT1hNgda9205nwqWekRuJp+ArVm2FoVb/7xeurxg3qgNGfdSHjfsNqRXaijawiMUIIpH+/FIWl3+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woA87bn+5ygRJcj9oHP3IBrqSfUtXJQmDnWs7zS6SUaiKsPnN71jffeEklh4BFCdHnAO5bvdWVbUdrM9u9fk1rSEeepTd+2W+OREixXyFcJtir+o/lbU/pdpiBKmqW9/XGVOS7fed55R+d4sOgRiOIbWMnEedjhBOeyLwlQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051);SRVR:AM5PR0801MB2018;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0801MB2018; X-Forefront-PRVS: 0809C12563 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(136003)(376002)(396003)(366004)(346002)(189003)(199004)(103116003)(8936002)(8676002)(2906002)(6506007)(386003)(486006)(7736002)(34290500001)(305945005)(81156014)(106356001)(68736007)(81166006)(53936002)(105586002)(66066001)(97736004)(478600001)(956004)(476003)(9686003)(25786009)(230700001)(47776003)(52116002)(7696005)(5660300001)(86362001)(6666003)(55016002)(6116002)(1857600001)(26005)(33896004)(2486003)(61506002)(50466002)(58126008)(23676004)(3846002)(186003)(16526019)(316002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:AM5PR0801MB2018;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BAM5PR0801MB2018=3B23=3AHgOey?= =?utf-8?q?Hxi3QFYIDm54eXvrJF6lKPdl+1ox3LoxxeQMgx0awGZIQqxDZL3fflseABnBljH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8zRIeByJYaY61NZ3srRl2mhd6/KVhVOewdVg94s1lG/6vKRQ59r8N2iJHFygULPsd4hFDoE0F70+mZCD8DTRG5dT3T+hi5ap5A89c+ou0nylYo5djX0cF6duXJ7aJA5NZMYg/ROoeuA==;5:N2gre+mHtGL7KyZdeACxtN+8wxmBU2Eg1uejeRhch30LBxSeW6bXl+rhqMwnCT2VPtSRYaKF4i+kMyhohGXJd3XoVP9r/4gf3q8TeWOrfRzKZxqQ24D8vJBXp9e+2SD0zJUyp1T6DNo+yGU27I6eryvTTeVgBJd84i9FCxJax6o=;7:xaBdOTFstZNGDgbdM1H7kDZ4JW/0ttfSCUkm6PueoDFo5bwn0ZhmvthuLaPlOmaTeqt9OT9IKCJNc8oTcUl9DqQy5vWPfCCU1nM3f0dm3sJkKiuM6aGKp/HJxefBi9+6QpODWJ7F0HXVmOkr8ieVjQSBFgWXn9zSQRZukiecJg8xohb/P+TM+WF7u2zz2Gl+mD3ZHQCdRNAV6WZ1rXm9Tq5gl8Q/r4MkGcXJBX8ucpVRkb69MHLwNbFv7ZnlqVY8 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0801MB2018;20:3Nmm8jeFoAzF17kCWdLFFco/TB6le3gTCpfDrnn5IMaDwzHaiTRZ6Dc92u4k/pY7JJwsJ1R+nJyB0txCnw3pyEYP24W18EDUUPxY/4PxOXN9sNQSxKN6xVRwXa8nM5EE0DI+gd0qSf1grsabpmjytFxU4YlZQEwkG0H6G2ZsXDg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2018 11:28:35.9797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6490c090-09dd-4390-228f-08d625358830 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2018 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP do_shrink_slab() returns unsigned long value, and the placing into int variable cuts high bytes off. Then we compare ret and 0xfffffffe (since SHRINK_EMPTY is converted to ret type). Thus, big number of objects returned by do_shrink_slab() may be interpreted as SHRINK_EMPTY, if low bytes of their value are equal to 0xfffffffe. Fix that by declaration ret as unsigned long in these functions. Reported-by: Cyrill Gorcunov Signed-off-by: Kirill Tkhai Acked-by: Cyrill Gorcunov Reviewed-by: Josef Bacik --- mm/vmscan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 0b63d9a2dc17..8ea87586925e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -581,8 +581,8 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg, int priority) { struct memcg_shrinker_map *map; - unsigned long freed = 0; - int ret, i; + unsigned long ret, freed = 0; + int i; if (!memcg_kmem_enabled() || !mem_cgroup_online(memcg)) return 0; @@ -678,9 +678,8 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg, int priority) { + unsigned long ret, freed = 0; struct shrinker *shrinker; - unsigned long freed = 0; - int ret; if (!mem_cgroup_is_root(memcg)) return shrink_slab_memcg(gfp_mask, nid, memcg, priority);