Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752391AbbGXKwM (ORCPT ); Fri, 24 Jul 2015 06:52:12 -0400 Received: from verein.lst.de ([213.95.11.211]:55040 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052AbbGXKwJ (ORCPT ); Fri, 24 Jul 2015 06:52:09 -0400 Date: Fri, 24 Jul 2015 12:52:06 +0200 From: Christoph Hellwig To: Spencer Baugh Cc: "Nicholas A. Bellinger" , Sagi Grimberg , Christoph Hellwig , Bart Van Assche , Alexei Potashnik , Andy Grover , Christophe Vu-Brugier , Roland Dreier , "open list:TARGET SUBSYSTEM" , "open list:TARGET SUBSYSTEM" , open list , Joern Engel , Spencer Baugh Subject: Re: [PATCH] target: fix crash in cmd tracing when cmd didn't match a LUN Message-ID: <20150724105206.GA25162@lst.de> References: <1437689973-22991-1-git-send-email-sbaugh@catern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437689973-22991-1-git-send-email-sbaugh@catern.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 21 On Thu, Jul 23, 2015 at 03:19:32PM -0700, Spencer Baugh wrote: > From: Alexei Potashnik > > If command didn't match a LUN and we're sending check condition, the > target_cmd_complete ftrace point will crash because it assumes that > cmd->t_task_cdb has been set. > > The fix will temporarily set t_task_cdb to the se_cmd buffer > and copy first 6 bytes of cdb in there as soon as possible. > At a later point t_task_cdb is reset to the correct buffer, > but until then traces and printks don't cause a crash. This is too ugly to live. Just dropping the t_task_cdb dereference from the trace point sounds like the simples quick fix for now, and removing the crazy layering violation in iSCSI that opencode target_submit_cmd is the proper long term fix. -- 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/