From patchwork Thu Aug 19 02:29:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Mitchell X-Patchwork-Id: 500091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 517E4C43214 for ; Thu, 19 Aug 2021 02:30:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3682361101 for ; Thu, 19 Aug 2021 02:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235744AbhHSCa6 (ORCPT ); Wed, 18 Aug 2021 22:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235709AbhHSCa5 (ORCPT ); Wed, 18 Aug 2021 22:30:57 -0400 Received: from mail-pg1-x564.google.com (mail-pg1-x564.google.com [IPv6:2607:f8b0:4864:20::564]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D163C0613D9 for ; Wed, 18 Aug 2021 19:30:21 -0700 (PDT) Received: by mail-pg1-x564.google.com with SMTP id k14so4418087pga.13 for ; Wed, 18 Aug 2021 19:30:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:content-transfer-encoding; bh=NSy0VIbEIz5W7JO0jujV3Q6SFnGtXn+KVAFFJZwMXB4=; b=KeGEY9WgX/xFRdSfUN2U0kleIb3BelRwdWmcg99OCH2ykWEwxhp1K5aseubMHT9SQ7 GcLAbiN8czTJriX+EQOW8yeqUdaglTiQ/Cwz8v9ApQ2dIbtCBPB3bW7IWPYaKWfa0U8U hJ+ml2FB3GhOvU7WH0rPU7jSmaBP40avYyeY+Sgu9MEui60m8+kvgqC/IsD8Fk1L6fv0 Gbxbpfdd7slpVM3Ymw5lss9ImTtQ90/sMDeDGk2UigEXEHm2XgQqwo8HHHrGvJkAyvyp hU4BuR0G7M0VpcDNWknDCdE697WVirtn+YBmJF/W6qx4X2BItpWhM31et/II7DCL7ksA As+A== X-Gm-Message-State: AOAM531t5NH70gwCkDXvC2w9z+QLLMJ0/Cgm00CQ7ckOnvo/gRutbB5D qgD/APOW+aJV/ZkVBJpW8HyWZnVKaE96jOCd6q87sN3PGQAZ X-Google-Smtp-Source: ABdhPJxXc87b5Lb56aujd5toN5v0pdiQ7cFKUaUK3HFa+AhKIy4PUN5WyR9OHHjVvomiLYLyDdnxAYM2OkvO X-Received: by 2002:a63:5f88:: with SMTP id t130mr11884742pgb.6.1629340221059; Wed, 18 Aug 2021 19:30:21 -0700 (PDT) Received: from smtp.aristanetworks.com (smtp.aristanetworks.com. [54.193.82.35]) by smtp-relay.gmail.com with ESMTPS id b13sm444963pjl.9.2021.08.18.19.30.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Aug 2021 19:30:21 -0700 (PDT) X-Relaying-Domain: arista.com Received: from chmeee (unknown [10.95.69.61]) by smtp.aristanetworks.com (Postfix) with ESMTPS id 6ED893019831; Wed, 18 Aug 2021 19:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=Arista-A; t=1629340220; bh=NSy0VIbEIz5W7JO0jujV3Q6SFnGtXn+KVAFFJZwMXB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jGbGjeIq3UuDrnHlp9MOAfM4vGlpBVnZGGZSeCq9dyoLT2oXBZee+y3jqFKknuKXB QQ+pPhQPpwTgxwc4nrydh9S52F8AUw2SmEY80uuAGXAt9sNLBs7kkDvkrsZZbza2Dv ndmyiaSgiH3NGpKnfZze8H2HZF6lAsjvzIf9yKCUuQ71//e4LzABO46J/d5d9R9rbJ eYN9aqBAdH7ubAvyeDvFOYz6DcmJq1MzdjeUh7iOyq54Mu54zGqiwNTyQjBg4KLuEz lLN7YQMKVkMp9mP6p+eqVnMZV3LI01/3qc7S4qEUSWAZqzLZ9K+hukJbSsYVuoKWyu QHlJi+Da/lVtg== Received: from kevmitch by chmeee with local (Exim 4.94.2) (envelope-from ) id 1mGXow-002MCf-LX; Wed, 18 Aug 2021 19:30:18 -0700 From: Kevin Mitchell Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , "James E.J. Bottomley" , "Martin K. Petersen" , Kevin Mitchell , Akinobu Mita , Jonathan Corbet , Kees Cook , Arnd Bergmann , Greg Kroah-Hartman , Hannes Reinecke , Bart Van Assche , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ Date: Wed, 18 Aug 2021 19:29:39 -0700 Message-Id: <20210819022940.561875-2-kevmitch@arista.com> In-Reply-To: <20210819022940.561875-1-kevmitch@arista.com> References: <20210819022940.561875-1-kevmitch@arista.com> To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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") Signed-off-by: Kevin Mitchell Acked-by: Kees Cook Reviewed-by: Christoph Hellwig --- 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 9dda87c6b54a..016cb0b150fc 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -82,7 +82,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 }; From patchwork Thu Aug 19 02:29:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Mitchell X-Patchwork-Id: 500790 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A980C4338F for ; Thu, 19 Aug 2021 02:30:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04E4060551 for ; Thu, 19 Aug 2021 02:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235859AbhHSCbE (ORCPT ); Wed, 18 Aug 2021 22:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235760AbhHSCa7 (ORCPT ); Wed, 18 Aug 2021 22:30:59 -0400 Received: from mail-vs1-xe61.google.com (mail-vs1-xe61.google.com [IPv6:2607:f8b0:4864:20::e61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01701C0613D9 for ; Wed, 18 Aug 2021 19:30:24 -0700 (PDT) Received: by mail-vs1-xe61.google.com with SMTP id l22so3136004vsi.1 for ; Wed, 18 Aug 2021 19:30:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:content-transfer-encoding; bh=hXzPmz8KLvpyfahmOwgomHUNy7g+maz+3agQaePxyqA=; b=jAruuVo+7G/8XfeC4FVX93VDx7gxIRXHDvC8Pors264Jl9RWcxc+9c9+gGMZ9exoaw sHrWRgJ4YLRhL06QUtdx+U3sQHleMjYJsfTIOmouwNtul0WnmaodRGN5+qp74PTt2R7/ qmphy/+SYkungZtwid/SD1RIsD3QKv8H74HceBwTe5n07f7Pr+plKFAjateIOIAb4KeQ W15nh9gTLWeA1z84OP0poO/I5EHq/LRP012KWRCuuAQHbwj2/+BPWD/sVr8t9ftTBrXi i80GscbSl5ITCKSZFGNTCZCn87YPZusINTUfMYGrddQaMqS2+5hQXAJY9+SFAltqbbmq J/hA== X-Gm-Message-State: AOAM530uNWfo9qCaG+613/k2Yb2DlNuFp1E+aev4r8T6i0zEVB3QlRek ftUagmG5hRpnkdWKwtEm+3IK2RGA2jyTHKTvcFclFUkYkAiI X-Google-Smtp-Source: ABdhPJzsT6bfYYc2z+Zg4LsiBGP+To6x/VdfWMyQHDfVetJDkicisEmEOEuZHR6/hkeqxibggYBcpM3IjSOe X-Received: by 2002:a67:ed1a:: with SMTP id l26mr11006950vsp.8.1629340223112; Wed, 18 Aug 2021 19:30:23 -0700 (PDT) Received: from smtp.aristanetworks.com (mx.aristanetworks.com. [162.210.129.12]) by smtp-relay.gmail.com with ESMTPS id t5sm407595vkb.1.2021.08.18.19.30.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Aug 2021 19:30:23 -0700 (PDT) X-Relaying-Domain: arista.com Received: from chmeee (unknown [10.95.69.61]) by smtp.aristanetworks.com (Postfix) with ESMTPS id 3A4BF400D87; Wed, 18 Aug 2021 19:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=Arista-A; t=1629340222; bh=hXzPmz8KLvpyfahmOwgomHUNy7g+maz+3agQaePxyqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=feTcApMsNLy4k5bb/bwmFxszjAJ4rcSxlKbZErEsyuTiw0nzwIUo6aBl4fVGsxJ/f rH+BQg0fHR51UIncdP2IVSt4iBFxln1JQuCAfNu0zz9SvSUDAis6CC9Mn1bUWEx96L JIzRMyxJZCPK6oho1oYp724oG1c821zbE8wB2Vs7LHjrEOkNllbMi2dDE5OBsYucpo zUKStkygyceN1UHhUY5i3TZHcErS3v4+rAXJo/7+BuQhbNCxfaO+VoX1YZcTeyp+qj 3DznBOy7NhP77r6n03RR9KiF9bQFgfZyrF1zXbHmtP1FLYDS5es35Mswb3OLUS9DGN lb1Xtrck+soPw== Received: from kevmitch by chmeee with local (Exim 4.94.2) (envelope-from ) id 1mGXoy-002MCp-DP; Wed, 18 Aug 2021 19:30:20 -0700 From: Kevin Mitchell Cc: linux-scsi@vger.kernel.org, Christoph Hellwig , "James E.J. Bottomley" , "Martin K. Petersen" , Kevin Mitchell , Akinobu Mita , Jonathan Corbet , Kees Cook , Arnd Bergmann , Greg Kroah-Hartman , Hannes Reinecke , Bart Van Assche , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] lkdtm: remove IDE_CORE_CP crashpoint Date: Wed, 18 Aug 2021 19:29:40 -0700 Message-Id: <20210819022940.561875-3-kevmitch@arista.com> In-Reply-To: <20210819022940.561875-1-kevmitch@arista.com> References: <20210819022940.561875-1-kevmitch@arista.com> To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org With the removal of the legacy IDE driver in kb7fb14d3ac63 ("ide: remove the legacy ide driver"), this crashpoint no longer points to a valid function. Signed-off-by: Kevin Mitchell --- Documentation/fault-injection/provoke-crashes.rst | 3 +-- drivers/misc/lkdtm/core.c | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Documentation/fault-injection/provoke-crashes.rst b/Documentation/fault-injection/provoke-crashes.rst index 18de17354206..3abe84225613 100644 --- a/Documentation/fault-injection/provoke-crashes.rst +++ b/Documentation/fault-injection/provoke-crashes.rst @@ -29,8 +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_QUEUE_RQ, - IDE_CORE_CP, or DIRECT + FS_DEVRW, MEM_SWAPOUT, TIMERADD, SCSI_QUEUE_RQ, or DIRECT. cpoint_type Indicates the action to be taken on hitting the crash point. diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c index 016cb0b150fc..e50e7bfc4674 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -83,7 +83,6 @@ static struct crashpoint crashpoints[] = { CRASHPOINT("MEM_SWAPOUT", "shrink_inactive_list"), CRASHPOINT("TIMERADD", "hrtimer_start"), CRASHPOINT("SCSI_QUEUE_RQ", "scsi_queue_rq"), - CRASHPOINT("IDE_CORE_CP", "generic_ide_ioctl"), #endif };