From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 60EA1C2BB86 for ; Tue, 14 Apr 2020 12:18:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C4552076D for ; Tue, 14 Apr 2020 12:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586866697; bh=xwGDmo2Qrw9kCAs7z5MDk3KXlmfJgD2xdFmLeBXh6ow=; h=Subject:To:Cc:From:Date:List-ID:From; b=sGiTkEA0yioJacBATUF4vBnA1+WGD+ROVdl52KRqf5f+Z4Tixrh51kie5ivu1KUry ZrlfZUc4F6k1xjkvL5lEkvH0xFkq09KbDbj+JFGxE8ICNWy3SYR1pG0OPxM8gEIekq //lMXSbmF7SefpGEnfKpuMBRKExCRhV6NaaOiYhk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439990AbgDNMSO (ORCPT ); Tue, 14 Apr 2020 08:18:14 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:56537 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439988AbgDNMSK (ORCPT ); Tue, 14 Apr 2020 08:18:10 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id A7087853; Tue, 14 Apr 2020 08:18:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 14 Apr 2020 08:18:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=6qQWV4 bckEJM0e/Fx2aSz8/zUnOgF8wcwnGy+tpF2SU=; b=ioVhww6ZEip754ui0pZgVz GbRmZZTkxyBLBNXPrzCVNY1aglBxPVmQjQ2M6k5BxfgQp3s6SWut1H6g6YxlwPl4 uaa1Hlfx5BSH7/pP3k88RH5V2hBlMTvB2Q+kpCJ2rgtEe971ZIeYIZHNuRmxqPBV sUSACkILSj9qVOQGUd+YGjYCUK3Eh2o2pZYNl77s7FYgsX4ZQeD5/hwK9uadtxPQ TgtbqKhSx6qqV4q/MJZUNwgdVPCxZ0fmaUpfql2RA9HiTtbTfVPbRzs1vpEmVZzx WmqKrLIgRAPcyZeGExucvYyjLkn+qk4/nGALa82NiSOubZIW5LiLXbJBPVHG0bpQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfedugdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecukfhppeekfedrkeeirdekledrud dtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehg rhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id BE8C13060060; Tue, 14 Apr 2020 08:18:03 -0400 (EDT) Subject: FAILED: patch "[PATCH] genirq/debugfs: Add missing sanity checks to interrupt" failed to apply to 4.14-stable tree To: tglx@linutronix.de, maz@kernel.org Cc: From: Date: Tue, 14 Apr 2020 14:18:02 +0200 Message-ID: <1586866682118208@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.14-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From a740a423c36932695b01a3e920f697bc55b05fec Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 6 Mar 2020 14:03:42 +0100 Subject: [PATCH] genirq/debugfs: Add missing sanity checks to interrupt injection Interrupts cannot be injected when the interrupt is not activated and when a replay is already in progress. Fixes: 536e2e34bd00 ("genirq/debugfs: Triggering of interrupts from userspace") Signed-off-by: Thomas Gleixner Acked-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20200306130623.500019114@linutronix.de diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index a949bd39e343..d44c8fd17609 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -206,8 +206,15 @@ static ssize_t irq_debug_write(struct file *file, const char __user *user_buf, chip_bus_lock(desc); raw_spin_lock_irqsave(&desc->lock, flags); - if (irq_settings_is_level(desc) || desc->istate & IRQS_NMI) { - /* Can't do level nor NMIs, sorry */ + /* + * Don't allow injection when the interrupt is: + * - Level or NMI type + * - not activated + * - replaying already + */ + if (irq_settings_is_level(desc) || + !irqd_is_activated(&desc->irq_data) || + (desc->istate & (IRQS_NMI | IRQS_REPLAY))) { err = -EINVAL; } else { desc->istate |= IRQS_PENDING;