Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbdHJJn4 (ORCPT ); Thu, 10 Aug 2017 05:43:56 -0400 Received: from smtp.eu.citrix.com ([185.25.65.24]:53572 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbdHJJny (ORCPT ); Thu, 10 Aug 2017 05:43:54 -0400 X-IronPort-AV: E=Sophos;i="5.41,352,1498521600"; d="scan'208";a="50780858" Date: Thu, 10 Aug 2017 10:43:45 +0100 From: Roger Pau Monne To: Munehisa Kamata CC: , Boris Ostrovsky , Juergen Gross , Konrad Rzeszutek Wilk , , Subject: Re: [PATCH] xen-blkfront: use a right index when checking requests Message-ID: <20170810094345.yptdypf2kzavyteo@dhcp-3-128.uk.xensource.com> References: <20170809223140.14298-1-kamatam@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170809223140.14298-1-kamatam@amazon.com> User-Agent: NeoMutt/20170714 (1.8.3) X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL03.citrite.net (10.69.22.127) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2581 Lines: 50 On Wed, Aug 09, 2017 at 03:31:40PM -0700, Munehisa Kamata wrote: > Since commit d05d7f40791c ("Merge branch 'for-4.8/core' of > git://git.kernel.dk/linux-block") and 3fc9d690936f ("Merge branch > 'for-4.8/drivers' of git://git.kernel.dk/linux-block"), blkfront_resume() > has been using an index for iterating ring_info to check request when > iterating blk_shadow in an inner loop. This seems to have been > accidentally introduced during the massive rewrite of the block layer > macros in the commits. > > This may cause crash like this: > > [11798.057074] BUG: unable to handle kernel NULL pointer dereference at 0000000000000048 > [11798.058832] IP: [] blkfront_resume+0x10a/0x610 > .... > [11798.061063] Call Trace: > [11798.061063] [] xenbus_dev_resume+0x53/0x140 > [11798.061063] [] ? xenbus_dev_probe+0x150/0x150 > [11798.061063] [] dpm_run_callback+0x3e/0x110 > [11798.061063] [] device_resume+0x88/0x190 > [11798.061063] [] dpm_resume+0x100/0x2d0 > [11798.061063] [] dpm_resume_end+0x11/0x20 > [11798.061063] [] do_suspend+0xe8/0x1a0 > [11798.061063] [] shutdown_handler+0xfd/0x130 > [11798.061063] [] ? split+0x110/0x110 > [11798.061063] [] xenwatch_thread+0x86/0x120 > [11798.061063] [] ? prepare_to_wait_event+0x110/0x110 > [11798.061063] [] kthread+0xd7/0xf0 > [11798.061063] [] ? kfree+0x121/0x170 > [11798.061063] [] ? kthread_park+0x60/0x60 > [11798.061063] [] ? call_usermodehelper_exec_work+0xb0/0xb0 > [11798.061063] [] ? call_usermodehelper_exec_async+0x13a/0x140 > [11798.061063] [] ret_from_fork+0x25/0x30 > > Use the right index in the inner loop. > > Fixes: d05d7f40791c ("Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block") > Fixes: 3fc9d690936f ("Merge branch 'for-4.8/drivers' of git://git.kernel.dk/linux-block") > Signed-off-by: Munehisa Kamata > Reviewed-by: Thomas Friebel > Reviewed-by: Eduardo Valentin > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc: Konrad Rzeszutek Wilk > Cc: Roger Pau Monne > Cc: xen-devel@lists.xenproject.org > Cc: stable@vger.kernel.org Reviewed-by: Roger Pau Monn? Thanks, Roger.