Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp91993pxb; Mon, 13 Sep 2021 13:51:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEPz27NPf/T1eYPcs7+hF6C7k3jvh7bqgUkR8+Z8L7bJazsObHu1raxXMGqNgNLQgS2x+r X-Received: by 2002:a17:907:2642:: with SMTP id ar2mr9204482ejc.175.1631566290533; Mon, 13 Sep 2021 13:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631566290; cv=none; d=google.com; s=arc-20160816; b=tpub5blE0qtZ6PX3SlwVlsLN39A7MXKEiZ9mpyGqz3T/8qiLVQBuwAA7YswcTaBQPL F+jdHPPiVhH+26N+daR+9E2gxypbpFGidp+rbLWu5qxmTCtC4hdojrHAyCcoUQseiStA umdqi2SFILMkE/nkz/QLC3otDEoxjQXbuGiknsKimE0QHmE2E5SHbK8c1HszYs6Sn0de VVftVqH2egRp+9+CchIzjRxx9nrBQY94E29OK9+gaFSePikeCGn5pabetsNTUyCzVudn NK1Zbz56LbjhoveGlILb1UQFDZxVDR06lmTpPZqHIRQ0cT120IjTA4Ok6rKfoRySseNE iKFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tkNG3B6wm8fSgqXy+rb2gIuXpE+rq2lauwvqU7l9cnQ=; b=fXyMNau/hc1zGoeZ2/0JW15PaIoxmqUg2eloZk52vbFS1PNxE3NdfrOU2gmZTQEJkn Nxr0DKuiLW0wO6i8iAUMfhr3WWW4TNwxctb+hsxDJ6DtwV9eykmgnzuP7qhQDo6RaH2n Im/2At1nPACqM9sPq8cYoFfUlVDy1DtysZ2ZnhnX3vl4/p5dCWr6veHXfvyt2josd0N2 QVfNpPBjWJUHhiAM/Pa6ttsiNE+dkGtkDvRcpdMZfJzHVjsvjzCVWPsvXXiEgcysFnhE eVBAktSb3kSb5PAUZiZQGDcDzAazHB30+rLFnVbqph5Ai7e1+J47knSrvQTWfKVFIm8y khKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gcHU9m5T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q5si8843595ejt.588.2021.09.13.13.50.53; Mon, 13 Sep 2021 13:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gcHU9m5T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244640AbhIMNtj (ORCPT + 99 others); Mon, 13 Sep 2021 09:49:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244291AbhIMNpd (ORCPT ); Mon, 13 Sep 2021 09:45:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F32660F25; Mon, 13 Sep 2021 13:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539902; bh=Fawx4chld2JZpyvMRE7kMDYjf/jNi1OZy/CJ95maXLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcHU9m5TV+hOOl7aakDXmMKyaOZsH8c7l8pqadRbOMl3LGvM1BSuFMDnAaq/11Hpz 1UxF3SCJVXTOrDYuAzGSESE0p3vZdkAvDltrR1GwLO6ygKBA+lKmgYOhtGUmV1Plms efpd3hLVXr7/VRBVHU+lDuV2gMWNe5AVGw7Lo6t8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Kevin Mitchell , Sasha Levin Subject: [PATCH 5.10 174/236] lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ Date: Mon, 13 Sep 2021 15:14:39 +0200 Message-Id: <20210913131106.292460294@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kevin Mitchell [ Upstream commit d1f278da6b11585f05b2755adfc8851cbf14a1ec ] When scsi_dispatch_cmd was moved to scsi_lib.c and made static, some compilers (i.e., at least gcc 8.4.0) decided to compile this inline. This is a problem for lkdtm.ko, which inserted a kprobe on this function for the SCSI_DISPATCH_CMD crashpoint. Move this crashpoint one function up the call chain to scsi_queue_rq. Though this is also a static function, it should never be inlined because it is assigned as a structure entry. Therefore, kprobe_register should always be able to find it. Fixes: 82042a2cdb55 ("scsi: move scsi_dispatch_cmd to scsi_lib.c") Acked-by: Kees Cook Signed-off-by: Kevin Mitchell Link: https://lore.kernel.org/r/20210819022940.561875-2-kevmitch@arista.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- Documentation/fault-injection/provoke-crashes.rst | 2 +- drivers/misc/lkdtm/core.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/fault-injection/provoke-crashes.rst b/Documentation/fault-injection/provoke-crashes.rst index a20ba5d93932..18de17354206 100644 --- a/Documentation/fault-injection/provoke-crashes.rst +++ b/Documentation/fault-injection/provoke-crashes.rst @@ -29,7 +29,7 @@ recur_count cpoint_name Where in the kernel to trigger the action. It can be one of INT_HARDWARE_ENTRY, INT_HW_IRQ_EN, INT_TASKLET_ENTRY, - FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_DISPATCH_CMD, + FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_QUEUE_RQ, IDE_CORE_CP, or DIRECT cpoint_type diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c index c802db9aaeb0..32b3d77368e3 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -81,7 +81,7 @@ static struct crashpoint crashpoints[] = { CRASHPOINT("FS_DEVRW", "ll_rw_block"), CRASHPOINT("MEM_SWAPOUT", "shrink_inactive_list"), CRASHPOINT("TIMERADD", "hrtimer_start"), - CRASHPOINT("SCSI_DISPATCH_CMD", "scsi_dispatch_cmd"), + CRASHPOINT("SCSI_QUEUE_RQ", "scsi_queue_rq"), CRASHPOINT("IDE_CORE_CP", "generic_ide_ioctl"), #endif }; -- 2.30.2