Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933348AbdGSQFj (ORCPT ); Wed, 19 Jul 2017 12:05:39 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:55859 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932661AbdGSQFf (ORCPT ); Wed, 19 Jul 2017 12:05:35 -0400 X-IronPort-AV: E=Sophos;i="5.40,381,1496073600"; d="scan'208";a="34630676" From: Bart Van Assche To: "yagmur.oymak@gmail.com" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" Subject: Re: 4.12 NULL pointer dereference in kmem_cache_free on USB storage removal Thread-Topic: 4.12 NULL pointer dereference in kmem_cache_free on USB storage removal Thread-Index: AQHS/BYEk9a/nBOEYUmJQOnCdrn3XqJSP/EAgAhjZQCAALX6gA== Date: Wed, 19 Jul 2017 16:04:48 +0000 Message-ID: <1500480287.2494.1.camel@wdc.com> References: <1499980058.2740.22.camel@wdc.com> <952856d9-5f6b-98db-98e3-6348d428e894@gmail.com> In-Reply-To: <952856d9-5f6b-98db-98e3-6348d428e894@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=wdc.com; x-originating-ip: [63.163.107.100] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1534;20:UjCrzijTlO1PhguHkSraZ8tna2LTTIZ2yl7UnLG9p8d9OhgQnm1/Go2E3KtzlIjENGjEOLwPCoNCLlrlB7FtDlLXMTmVowKzq9VpC3M1Zt5DObGL6YQUlMaksWhGkIHIhzgfH/AygGnXXvZYXRRjDoZ1bvOOuXBSK1jVHckcnFc= x-ms-office365-filtering-correlation-id: 0b9f7d19-b8e2-4def-259e-08d4cebfe1a2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR0401MB1534; x-ms-traffictypediagnostic: CY1PR0401MB1534: wdcipoutbound: EOP-TRUE x-exchange-antispam-report-test: UriScan:(236129657087228)(48057245064654)(209349559609743); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123564025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0401MB1534;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0401MB1534; x-forefront-prvs: 0373D94D15 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39840400002)(39860400002)(39850400002)(39410400002)(39400400002)(377424004)(377454003)(24454002)(3660700001)(6486002)(2906002)(3280700002)(25786009)(478600001)(103116003)(966005)(36756003)(305945005)(229853002)(7736002)(77096006)(5660300001)(14454004)(345774005)(86362001)(81166006)(53546010)(66066001)(2950100002)(6506006)(72206003)(2501003)(2900100001)(33646002)(6436002)(6512007)(6306002)(3846002)(6116002)(99286003)(2201001)(102836003)(76176999)(39060400002)(50986999)(189998001)(8936002)(54356999)(6246003)(8676002)(53936002)(38730400002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1534;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jul 2017 16:04:48.4126 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1534 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6JG5kTu010283 Content-Length: 1796 Lines: 37 On Wed, 2017-07-19 at 08:13 +0300, Yagmur Oymak wrote: > On 07/14/2017 12:07 AM, Bart Van Assche wrote: > > On Thu, 2017-07-13 at 23:24 +0300, Meelis Roos wrote: > > > [258062.320700] RIP: 0010:kmem_cache_free+0x12/0x160 > > > [258062.320886] Call Trace: > > > [258062.320897] scsi_exit_rq+0x4d/0x60 > > > [258062.320909] free_request_size+0x1c/0x30 > > > [258062.320923] mempool_destroy+0x1d/0x60 > > > [258062.320935] blk_exit_rl+0x1b/0x40 > > > [258062.320946] __blk_release_queue+0x7d/0x120 > > > [258062.320959] process_one_work+0x1af/0x340 > > > [258062.320972] worker_thread+0x43/0x3e0 > > > [258062.320984] kthread+0xfe/0x130 > > > [258062.320995] ? create_worker+0x170/0x170 > > > [258062.321007] ? kthread_create_on_node+0x40/0x40 > > > [258062.321022] ret_from_fork+0x22/0x30 > > > > Thank you for your report. Can you apply commit 8e6882545d8c ("scsi: Avoid > > that scsi_exit_rq() triggers a use-after-free") on top of kernel v4.12 and > > retest? That commit has been tagged "Cc: stable" so I hope that this patch > > will be included in kernel v4.12.1. However, that kernel is not yet available > > unfortunately ... > > That patch fixes the problem, as far as I tested. However, it still is > not included in stable by 4.12.2. The problem persists there, and is > fixed when this patch is applied on top of it. What to to about it? Hello Yagmur, [ Please don't top-post -- this is considered annoying in the Linux community ] Since kernel v4.13-rc1 has been released and since commit 8e6882545d8c is included in v4.13-rc1 I assume that it won't take long before a stable kernel is released that includes that commit. BTW, Greg just announced that that commit will be included in the next v4.11 stable kernel. See also https://lkml.org/lkml/2017/7/19/494. Bart.