Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750847Ab2BVFA5 (ORCPT ); Wed, 22 Feb 2012 00:00:57 -0500 Received: from sr-smtp.usish.com ([210.5.144.203]:45591 "EHLO sr-smtp.usish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714Ab2BVFA4 (ORCPT ); Wed, 22 Feb 2012 00:00:56 -0500 From: "Jack Wang" To: "'Tejun Heo'" , "'Jun'ichi Nomura'" Cc: "'Jens Axboe'" , , "'linux-scsi'" , "'Naveen Goswamy'" , "'James Bottomley'" , "'Stefan Richter'" , "'Dave Jones'" , , "'Huajun Li'" References: <4F443E81.2060402@ce.jp.nec.com> <20120222010435.GI12236@google.com> Subject: RE: [PATCH] Fix NULL pointer dereference in sd_revalidate_disk Date: Wed, 22 Feb 2012 12:58:08 +0800 Message-ID: <95E22EAF20104309BF3938E7820F36D6@usish.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Aczw/dBc/x1ta7RXQkyCWJ+VInORHgAIG6kg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 In-Reply-To: <20120222010435.GI12236@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 52 Should this need pick up into stable too? Jack Re: [PATCH] Fix NULL pointer dereference in sd_revalidate_disk > > On Wed, Feb 22, 2012 at 10:01:53AM +0900, Jun'ichi Nomura wrote: > > Since 2.6.39 (1196f8b), when a driver returns -ENOMEDIUM for open(), > > __blkdev_get() calls rescan_partitions() to remove > > in-kernel partition structures and raise KOBJ_CHANGE uevent. > > > > However it ends up calling driver's revalidate_disk without open > > and could cause oops. > > > > In the case of SCSI: > > > > process A process B > > ---------------------------------------------- > > sys_open > > __blkdev_get > > sd_open > > returns -ENOMEDIUM > > scsi_remove_device > > > > rescan_partitions > > sd_revalidate_disk > > > > > > Oopses are reported here: > > http://marc.info/?l=linux-scsi&m=132388619710052 > > > > This patch separates the partition invalidation from rescan_partitions() > > and use it for -ENOMEDIUM case. > > > > Reported-by: Huajun Li > > Signed-off-by: Jun'ichi Nomura > > Acked-by: Tejun Heo > > Thank you! > > -- > tejun > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/