Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3308337imm; Mon, 6 Aug 2018 02:22:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeHZFoKoo/An6msvVD1+liBTFymopPxkHIvdPcYIPVbjeDqQio2A8cIkJe7c1X15AZ3o8Kh X-Received: by 2002:a63:1a20:: with SMTP id a32-v6mr13737690pga.446.1533547343941; Mon, 06 Aug 2018 02:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533547343; cv=none; d=google.com; s=arc-20160816; b=LyINBE/vBblDELOm9lxyzzhG/cGJJ8CJqPqcL2E3q2eeLFI5ikOrX5FBRy4MQLs+nZ GWViIxls4VDxSDsO9912b7l7fMZ3ZT4ycSXPJ5r97NW8m1yWdCxtnq/IbP+F/vldcbBj 6nrl0NZTIzey0PknjGB0UwNhgUp6HO37at/gUvOUnK67Srvs1rNkVQTeiH/CUMgALHLb CLeUN+SM2gNF4AffKS8WJScp9YTTTwiIjMVtl+8Y+dRY2HM251jO+bh5vHUg17gfxvoC Bppk6rZGFeEj5eVd8QnchgUKRd53LLIp3Yh2BGDJga8muEjsSKoTDQeSSukb/VRjv+XX 9U5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MwNWgyceaomRCS7vb9vv5zzJQp5DO/TXvTDJKzr7npg=; b=f0tvkouT1/5INeQj6J/WOInlleTc3HNG1TF+aeB+pVgODpneGAzbQxs/ZJplQPJgJB exyW/iBizs3oKhur+Du7qhcJqkfxDTswiU/XuKAS9LmRwyHkZZ0bf7t5beKDPCVo4wSG JZQWENNoUYQthTGxy6NhaD/I11Mu8OAuPwPgIJ8UaVsmKz1/CM/fKyzoVc873QTEfnDm WaWjG4ovhLOKHbAos2rJz6G6OAn1Ejpw+yd9HwP96fzu1NWeJEK6Ld/CYqlypjvdKnJA a4xTfX/W98c77z1jkiqqhOWAxOw89Pkcpg/lreDs4+Ljzkoi1rNNdRBLmcCmod+BlV4d YUOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nio365.onmicrosoft.com header.s=selector1-ni-com header.b="Lomc/H6E"; 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 w3-v6si10016021pgp.220.2018.08.06.02.22.08; Mon, 06 Aug 2018 02:22:23 -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; dkim=pass header.i=@nio365.onmicrosoft.com header.s=selector1-ni-com header.b="Lomc/H6E"; 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 S1728983AbeHFL0S (ORCPT + 99 others); Mon, 6 Aug 2018 07:26:18 -0400 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:47248 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728787AbeHFL0S (ORCPT ); Mon, 6 Aug 2018 07:26:18 -0400 Received: from pps.filterd (m0098780.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w769BDT1013912; Mon, 6 Aug 2018 04:17:50 -0500 Authentication-Results: ppops.net; dkim=pass header.d=nio365.onmicrosoft.com header.s=selector1-ni-com Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp0022.outbound.protection.outlook.com [216.32.180.22]) by mx0a-00010702.pphosted.com with ESMTP id 2kn9nruyu4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 06 Aug 2018 04:17:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nio365.onmicrosoft.com; s=selector1-ni-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MwNWgyceaomRCS7vb9vv5zzJQp5DO/TXvTDJKzr7npg=; b=Lomc/H6EN+pbhVwFjnNVhJ3jJbs5CJ60qPMFR6ihZogwMNGb9pwaRxQ/m8nwqyqQ0yczaOtqXKS5GT6Fh2cTdlIKyeuprvGwPo8BU+/tXleMdoB/8Q3iJvxb7yPygm4Ae9qKxoT3eR1mmzj5CltnvIjHZOPybENv3Xetu1eRcmA= Received: from jcartwri.amer.corp.natinst.com (130.164.62.116) by BN6PR04MB0965.namprd04.prod.outlook.com (2603:10b6:405:43::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Mon, 6 Aug 2018 09:17:46 +0000 Received: by jcartwri.amer.corp.natinst.com (Postfix, from userid 1000) id F3CF8302F5D; Mon, 6 Aug 2018 04:17:38 -0500 (CDT) From: Julia Cartwright To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Cc: Thomas Gleixner , Steven Rostedt , Carsten Emde , Sebastian Andrzej Siewior , John Kacur , Paul Gortmaker , Daniel Wagner , tom.zanussi@linux.intel.com, stable-rt@vger.kernel.org Subject: [PATCH RT 11/22] mm/slub: close possible memory-leak in kmem_cache_alloc_bulk() Date: Mon, 6 Aug 2018 04:17:27 -0500 Message-Id: X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [130.164.62.116] X-ClientProxiedBy: MWHPR19CA0012.namprd19.prod.outlook.com (2603:10b6:300:d4::22) To BN6PR04MB0965.namprd04.prod.outlook.com (2603:10b6:405:43::37) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 567d7c88-efe0-4f96-7b93-08d5fb7d7976 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BN6PR04MB0965; X-Microsoft-Exchange-Diagnostics: 1;BN6PR04MB0965;3:fzHPnLN2MDdxjsImGHY1EEzaOzzcOsawXNP5TYG7qCviWU+QJwOgDFSpN4vPEpZhui0AWzIhIrHuufFMkHcM2DfiILqzARUNmlcgR0quqoRfyLuvsXrjTuahnQXf7dYHhgcml1G+36o5MuEhkBOt0MCHDJieQXFjzuvjVQhty24Wx97SEj9zT6XJYqKv0Or/+ju0CjgGSKTN8n/sZf7Cqjar/2pqS5MWH2xencqKZbctovABeZe4PGAYe8OsxEbd;25:G1Sb8JliWtiBBnccryiWg699sea7Ohbhc9KEaa3qb2WimGCbq+qSzLF/3nF8iI/AKD8Xq42JKKcIzT1rhp5aaqnRK4NosbqMZsHa2z4Jl4Fj8zUPlADIydJPTxu88Mv7H2ayPS7l0kKiXEv6NZnv2aAKR4dSVg3NBC/4Kmr3szyg0L8qu7dPHcez4CCRgu9MqikG8nGNOKe3kmrO+fuDOQZYFBRi8cr1g8Kx+QSwggw2415QWCFMEpoDqoXAwcKFcgFrHz0aaKCIPmAEISg+BhJzPd7QUeA/JOUeH5lmuhrkqQ+dt9eT8T0r5gc5FxoLqRHP4W+rz8wto06epiSuxg==;31:3R+3iEKVpBB4lGqkAi70ArBYAjxdAEsB+TpHtZUdG6X/FzLYJFwF5D73DIunNoBhBkhaW46rPJ9OdfteDgzE6wQF3pb0LqU1cMqibbr3mCOFLt0tZ/KqRADRZu9VnenAAh05zyTJNK3ia7dXrAQav2N1Wbf8WTnb4BdWnlEEccrqG2+AN5yVH6Bsx6bPrfq+51+q4B4ICRailXGBCSURhoIOEVMPkCffmG3U5RYmzqg= X-MS-TrafficTypeDiagnostic: BN6PR04MB0965: X-Microsoft-Exchange-Diagnostics: 1;BN6PR04MB0965;20:Fe5FrLOTpmCInYpclsQ04z6UhaE8ws05oYYHm3p43Iz+gJP7i5p8HZi/mqfVFMC+yB2Crg5TvVtbfF3Oof7MsWc6XUAvgt6jDjwQdwSfFLBBUIkWNVgS8BD0xKF0yvJJ7ryJW93X7YdIQ8tCeCnM4sAMG5v39QdY1Jlt5GNQaPnXCmiov3AiIjReigygLOFdxmsruiBkTk468HfEOQpxja2RHNqxzXblhgQ1BjoNLtT/3gRCL8JaLbsKH5BSxJvqDNBnLx0YZQfEcC3JqPcWs6rXNSmf7xuqhJKDxUMHVlRwjmKwKy6B7r/HBuFgcDodlRqm74BfFokMfH1AdI+hGjNgg3Rv/NR7TRBjvxZ3ABYR5xcHxQfU7Gvg47Xp9A4vrBE1HvisomiTSmMMazdRRypzmKm/Bhomoo1QjmxF3fzFvAnUdGIXSfJKPLpZZbRNJmLx1Q2exnpd10xMxGvDNaxA6wxjqRlXpQlactH27APH/hz+CHMoUQKagvUREDx5eFf2+lhMoMOwAWo4vjJuHj7g/Z0Iq6/0sEFk7U8/Up5+2ZcbUuNHaGEy765Jnceds6oPiuW6nO0H+Ujr+JQ5kKz1x6I+W7xgaiaiHy77aTE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(131327999870524)(145744241990776); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BN6PR04MB0965;BCL:0;PCL:0;RULEID:;SRVR:BN6PR04MB0965; X-Microsoft-Exchange-Diagnostics: 1;BN6PR04MB0965;4:cbCK0BurXSwjLnhzjxtGt/BuPGCdLp5gtChzgen053LD+EVrrnc97G9+tDuH6LQIk8F7cdVxDf62LvFWxe9Cl58O6gFdaTIYp5A0oJlkvFTw144g94eSQzOwME7eP5kaEkh08KelaKvwfoIOceYQ0UNOHsD0cAnk9IWGC3j9SLJOuEQIj7VAEgCqI6LkCBu/aPf1asEjMINxpALrWQ/425bkCAHumzb5lM2xCCuYpGSrkSvbN8ktGH7JWb0+qhJJNGKUFn4jFK2V+R5ACcXZKz9wyK0Qk6j0hXGtQXJ6XWy5DAKXJI2WGdFj3kd/5SJtbwgWZ2WBjtUkUKzU3Eye32ko4K5d2fNx7hNzBoeDD1VRuArSZ+xFG/ZP12OpoyPO X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(366004)(39850400004)(346002)(136003)(376002)(189003)(199004)(76176011)(5660300001)(54906003)(8936002)(66066001)(50226002)(386003)(118296001)(50466002)(97736004)(51416003)(476003)(7416002)(16586007)(186003)(42186006)(316002)(26005)(52116002)(90966002)(446003)(486006)(11346002)(52956003)(2616005)(6116002)(81156014)(7736002)(305945005)(3846002)(48376002)(478600001)(81166006)(8676002)(47776003)(105586002)(106356001)(122856001)(6666003)(68736007)(4326008)(36756003)(6266002)(2906002)(53936002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR04MB0965;H:jcartwri.amer.corp.natinst.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: ni.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR04MB0965;23:SWRH5271bgNNyeOTNPIw30Exd4IHSCtp49kcVdr8U?= =?us-ascii?Q?rMBEGJsTqY8ijsYtWE8+uRYQ9OGIEv++wzLQBb7zAZp4UFca9V9z8Bb8g04S?= =?us-ascii?Q?i5EWuC/tltV8wpfLXW+y6aeMb05r00avo5XwCIQL30I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bMoN9dUPVgLSHq0BE/6TXzvnNLbg==;5:0e4A6c5M4z9whZ6YvFQKYyLGTcWN0EvLFNjreJ5PUiwEt0ICzc7+/KS6p+F4zEWG9ENrbf6d+JZfL2Wyq8MqA6SDZnTzusaH2kCuO7mPlYbwk/S1FNz+pDPGRkH13Yz4raVwZ7OMAF0Xmr1VWmlM9Pg13++ZHGBhVUfcKqaAoWc=;7:5+gg4bDy8taOqYQWyYmIR1F5EWw7bYvCvoeM0hfpdKBQEUjG5ne8VSUn9RFtB4JUrtJtYMjEUJTIZwzO2KrWBi583Km2nRLUoLfXj/54Y+N74HUPCqd5E1oPjEIleN98XfelXKZLi1kZ5cAH90dZnFVm90XVHmJ+yrRAU1fr2BYnXN6z+iRxAjFH/FIBVRojVwcLH0iDX6ok13Dek15wUIt5xCOzdYIFP8R49vWa6K++nRlhgPfY9SwiFYQJI9+p SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ni.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2018 09:17:46.8835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 567d7c88-efe0-4f96-7b93-08d5fb7d7976 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 87ba1f9a-44cd-43a6-b008-6fdb45a5204e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR04MB0965 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-06_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=inbound_policy_notspam policy=inbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=944 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808060100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior 4.9.115-rt94-rc1 stable review patch. If you have any objection to the inclusion of this patch, let me know. --- 8< --- 8< --- 8< --- Under certain circumstances we could leak elements which were moved to the local "to_free" list. The damage is limited since I can't find any users here. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior (cherry picked from commit 5022166d3b225bf5e343efb3ea01b3c5a41d69ba) Signed-off-by: Julia Cartwright --- mm/slub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/slub.c b/mm/slub.c index 67eb368b9314..738b2bccbd5f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3209,6 +3209,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, return i; error: local_irq_enable(); + free_delayed(&to_free); slab_post_alloc_hook(s, flags, i, p); __kmem_cache_free_bulk(s, i, p); return 0; -- 2.18.0