From patchwork Fri Apr 9 09:53:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418799 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 8245AC433ED for ; Fri, 9 Apr 2021 09:55:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56D7E611ED for ; Fri, 9 Apr 2021 09:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233550AbhDIJ4I (ORCPT ); Fri, 9 Apr 2021 05:56:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:43670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233558AbhDIJzo (ORCPT ); Fri, 9 Apr 2021 05:55:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F524611BF; Fri, 9 Apr 2021 09:55:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962131; bh=csV+O4VVMuVrkGUZ/ti4kpvsZ4buMMNaChJmXfDC444=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6LMM3TxwdJXQ7zZXwaWSWWaehlTfeXZ8ViojyicYLzfrropSvowHBch857Bs859w MYlf74M2uEkB5i9knqulsAdy8LvCctSC3PyM7AURNaGCqFj498gEjTEohVoCdPNS8Q LzmieIpMKToQuG92Pa3CnkZ84aQHnfqCmxmD2oQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Zhang , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 02/13] mISDN: fix crash in fritzpci Date: Fri, 9 Apr 2021 11:53:22 +0200 Message-Id: <20210409095259.701900820@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tong Zhang [ Upstream commit a9f81244d2e33e6dfcef120fefd30c96b3f7cdb0 ] setup_fritz() in avmfritz.c might fail with -EIO and in this case the isac.type and isac.write_reg is not initialized and remains 0(NULL). A subsequent call to isac_release() will dereference isac->write_reg and crash. [ 1.737444] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 1.737809] #PF: supervisor instruction fetch in kernel mode [ 1.738106] #PF: error_code(0x0010) - not-present page [ 1.738378] PGD 0 P4D 0 [ 1.738515] Oops: 0010 [#1] SMP NOPTI [ 1.738711] CPU: 0 PID: 180 Comm: systemd-udevd Not tainted 5.12.0-rc2+ #78 [ 1.739077] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-48-gd9c812dda519-p rebuilt.qemu.org 04/01/2014 [ 1.739664] RIP: 0010:0x0 [ 1.739807] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [ 1.740200] RSP: 0018:ffffc9000027ba10 EFLAGS: 00010202 [ 1.740478] RAX: 0000000000000000 RBX: ffff888102f41840 RCX: 0000000000000027 [ 1.740853] RDX: 00000000000000ff RSI: 0000000000000020 RDI: ffff888102f41800 [ 1.741226] RBP: ffffc9000027ba20 R08: ffff88817bc18440 R09: ffffc9000027b808 [ 1.741600] R10: 0000000000000001 R11: 0000000000000001 R12: ffff888102f41840 [ 1.741976] R13: 00000000fffffffb R14: ffff888102f41800 R15: ffff8881008b0000 [ 1.742351] FS: 00007fda3a38a8c0(0000) GS:ffff88817bc00000(0000) knlGS:0000000000000000 [ 1.742774] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1.743076] CR2: ffffffffffffffd6 CR3: 00000001021ec000 CR4: 00000000000006f0 [ 1.743452] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1.743828] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1.744206] Call Trace: [ 1.744339] isac_release+0xcc/0xe0 [mISDNipac] [ 1.744582] fritzpci_probe.cold+0x282/0x739 [avmfritz] [ 1.744861] local_pci_probe+0x48/0x80 [ 1.745063] pci_device_probe+0x10f/0x1c0 [ 1.745278] really_probe+0xfb/0x420 [ 1.745471] driver_probe_device+0xe9/0x160 [ 1.745693] device_driver_attach+0x5d/0x70 [ 1.745917] __driver_attach+0x8f/0x150 [ 1.746123] ? device_driver_attach+0x70/0x70 [ 1.746354] bus_for_each_dev+0x7e/0xc0 [ 1.746560] driver_attach+0x1e/0x20 [ 1.746751] bus_add_driver+0x152/0x1f0 [ 1.746957] driver_register+0x74/0xd0 [ 1.747157] ? 0xffffffffc00d8000 [ 1.747334] __pci_register_driver+0x54/0x60 [ 1.747562] AVM_init+0x36/0x1000 [avmfritz] [ 1.747791] do_one_initcall+0x48/0x1d0 [ 1.747997] ? __cond_resched+0x19/0x30 [ 1.748206] ? kmem_cache_alloc_trace+0x390/0x440 [ 1.748458] ? do_init_module+0x28/0x250 [ 1.748669] do_init_module+0x62/0x250 [ 1.748870] load_module+0x23ee/0x26a0 [ 1.749073] __do_sys_finit_module+0xc2/0x120 [ 1.749307] ? __do_sys_finit_module+0xc2/0x120 [ 1.749549] __x64_sys_finit_module+0x1a/0x20 [ 1.749782] do_syscall_64+0x38/0x90 Signed-off-by: Tong Zhang Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/isdn/hardware/mISDN/mISDNipac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index 8d338ba366d0..01a1afde5d3c 100644 --- a/drivers/isdn/hardware/mISDN/mISDNipac.c +++ b/drivers/isdn/hardware/mISDN/mISDNipac.c @@ -711,7 +711,7 @@ isac_release(struct isac_hw *isac) { if (isac->type & IPAC_TYPE_ISACX) WriteISAC(isac, ISACX_MASK, 0xff); - else + else if (isac->type != 0) WriteISAC(isac, ISAC_MASK, 0xff); if (isac->dch.timer.function != NULL) { del_timer(&isac->dch.timer); From patchwork Fri Apr 9 09:53:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418798 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 607A0C43460 for ; Fri, 9 Apr 2021 09:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2ED1B611CA for ; Fri, 9 Apr 2021 09:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233613AbhDIJ4T (ORCPT ); Fri, 9 Apr 2021 05:56:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:43774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233464AbhDIJzu (ORCPT ); Fri, 9 Apr 2021 05:55:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E8F1261181; Fri, 9 Apr 2021 09:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962136; bh=Szysmpw0/D5Cn7QxAttk1NY23HJvZ75cKA4mT2mBYDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BkuczEmI8rmusNxNeB3VlJ0tF109MBQouAaFumTcABlHNnZZyaz7O5M+EQnVGD8cE JBV6IPoEmwnjGX8mkzSOennYLIAlip4dy5wCQSK1EcPnUqBPgdq1DNhqKggAjf9Bm0 KvuOyhe0mtcQI3akDOWRZBRr5X86HCLjWgmSFvDU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Douglas Anderson , Sasha Levin Subject: [PATCH 4.9 04/13] drm/msm: Ratelimit invalid-fence message Date: Fri, 9 Apr 2021 11:53:24 +0200 Message-Id: <20210409095259.772069495@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Clark [ Upstream commit 7ad48d27a2846bfda29214fb454d001c3e02b9e7 ] We have seen a couple cases where low memory situations cause something bad to happen, followed by a flood of these messages obscuring the root cause. Lets ratelimit the dmesg spam so that next time it happens we don't lose the kernel traces leading up to this. Signed-off-by: Rob Clark Reviewed-by: Douglas Anderson Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_fence.c b/drivers/gpu/drm/msm/msm_fence.c index a9b9b1c95a2e..9dbd17be51f7 100644 --- a/drivers/gpu/drm/msm/msm_fence.c +++ b/drivers/gpu/drm/msm/msm_fence.c @@ -56,7 +56,7 @@ int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, int ret; if (fence > fctx->last_fence) { - DRM_ERROR("%s: waiting on invalid fence: %u (of %u)\n", + DRM_ERROR_RATELIMITED("%s: waiting on invalid fence: %u (of %u)\n", fctx->name, fence, fctx->last_fence); return -EINVAL; } From patchwork Fri Apr 9 09:53:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418159 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1421929jai; Fri, 9 Apr 2021 02:56:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1H2IXM2YOHquF4het3DICiE9Aa94aF5BQUB+NCkXD2jUV7SS5W5yoIjWuJn8HP/xT29KM X-Received: by 2002:a17:90b:4d05:: with SMTP id mw5mr12858825pjb.236.1617962171332; Fri, 09 Apr 2021 02:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617962171; cv=none; d=google.com; s=arc-20160816; b=eRAWgN6hqOAyRrUeVyAIvXFu8g3Gy0Oi3ZxqvBb6KCBN7TCsXnftmiSPKRQX+8gFmz oiMiAI4+r/xGvMZ1IbAX/UI1Jf2/IRDWudZOQgjvDUl+jjj1oHNvhfUJDni1HLkym49t oqpixKwADjORFbph1s0Ikngl8HR6QN4CXsA1qBp0XFK6obIObGvqYSeKAJUftaHo986W s0FXlhckGDjMlD2W2Vh37MJymqA0RkH2brQQo1IvKZKZzrqIt63ZcPIEE3x9msUzIxQq rg1UoqQt57aLaqgmdhhwLHDqE86iT/DB+NQZpCW5mNclCE7jjgqe8T/asQ56Efd18A89 Ih1g== 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=O345FFuixjBLekdAXyPjTTprDSwlMIvGMVhinO5dAug=; b=wkXmEKIHtT6nB7FLol3vv+6BvdH8d9QiJ6rTJw65DBmFpAi5aOJIFOs1dDHff2+2Hf BDxfY/8/e+jY9GwqAdIZKURpSTIAekhQySQzcGh6yWPj+A+PAO6DxdbaqOzOfKJyygVs /bpy0ZckYk7h/EsRnDaxkK/zsBe4S6nLO1bkr2Uu8bcFNh5vp/mYrhUyW9jByrwoRN34 /HNQS1tLKbsNdEFlqxaFz3pOn5rfl1/N3/YC8VaS0bEB+h6yXiYAu4+bqizKbwIPGkOM HFh2QQR9EBM8mMkyLo0+aEgfdB+fmvmVdmGjOwrhju2KfWXdiRyl5FmtkQGVALjqf5of 1cmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=M5fWQsg2; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 h2si2281766pfc.321.2021.04.09.02.56.11; Fri, 09 Apr 2021 02:56:11 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=M5fWQsg2; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S233630AbhDIJ4V (ORCPT + 12 others); Fri, 9 Apr 2021 05:56:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:43810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233467AbhDIJzw (ORCPT ); Fri, 9 Apr 2021 05:55:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 959BD611C2; Fri, 9 Apr 2021 09:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962139; bh=Uqml/KA/LDaiQMffdH+X3U5y31CkFL+hRJwvfJ42j8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5fWQsg2ZUvxD7yTlNDabBH+q/C13lKg2JxyJZB6aEFtUvUvbpkNM4060Bv+24TxN HV6Kp0ww+1Esk+ug+Zt/MA+pDXF4GRVXMd0RaRrdpCazZKKNNZwTRpoagt34x8MlIw FHYqJNmHrcMRWrR93RL5EsVm6p5tXiRa0XC8MZpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 05/13] x86/build: Turn off -fcf-protection for realmode targets Date: Fri, 9 Apr 2021 11:53:25 +0200 Message-Id: <20210409095259.801666868@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 9fcb51c14da2953de585c5c6e50697b8a6e91a7b ] The new Ubuntu GCC packages turn on -fcf-protection globally, which causes a build failure in the x86 realmode code: cc1: error: ‘-fcf-protection’ is not compatible with this target Turn it off explicitly on compilers that understand this option. Signed-off-by: Arnd Bergmann Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210323124846.1584944-1-arnd@kernel.org Signed-off-by: Sasha Levin --- arch/x86/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 9f0099c46c88..9ebbd4892557 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -34,7 +34,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \ -DDISABLE_BRANCH_PROFILING \ -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ - -mno-mmx -mno-sse + -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector) From patchwork Fri Apr 9 09:53:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418797 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 77CD0C43460 for ; Fri, 9 Apr 2021 09:56:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5570D611C2 for ; Fri, 9 Apr 2021 09:56:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233635AbhDIJ4W (ORCPT ); Fri, 9 Apr 2021 05:56:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:43822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbhDIJzy (ORCPT ); Fri, 9 Apr 2021 05:55:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5BD8A61178; Fri, 9 Apr 2021 09:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962141; bh=0u5+UMhNptSANNdmaVdBdoEgQtPb4PuhNmHsrUAniS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kx4gdP03QB3hR1ojOojrTDHiWlQdbzo9MPB4y/mD8LboBSOXfIdWvcmmYwIrfoTyD N4ca5vw9oDWEDruliDhPB2c2YPJ58BjTDcRMrHZKI/XBiMpl+hyBL18h0/RcSMnSwC l+QHTs16WzW02bB0+Y+kHnuUJXzi1hmPkIUIdLsY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Lee Duncan , Martin Wilck , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.9 06/13] scsi: target: pscsi: Clean up after failure in pscsi_map_sg() Date: Fri, 9 Apr 2021 11:53:26 +0200 Message-Id: <20210409095259.830909833@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Martin Wilck [ Upstream commit 36fa766faa0c822c860e636fe82b1affcd022974 ] If pscsi_map_sg() fails, make sure to drop references to already allocated bios. Link: https://lore.kernel.org/r/20210323212431.15306-2-mwilck@suse.com Reviewed-by: Christoph Hellwig Reviewed-by: Lee Duncan Signed-off-by: Martin Wilck Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/target/target_core_pscsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index ef1c8c158f66..079db0bd3917 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -951,6 +951,14 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, return 0; fail: + if (bio) + bio_put(bio); + while (req->bio) { + bio = req->bio; + req->bio = bio->bi_next; + bio_put(bio); + } + req->biotail = NULL; return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; } From patchwork Fri Apr 9 09:53:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418796 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 3E1C8C43461 for ; Fri, 9 Apr 2021 09:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06E5F61220 for ; Fri, 9 Apr 2021 09:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232834AbhDIJ4X (ORCPT ); Fri, 9 Apr 2021 05:56:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233367AbhDIJ4B (ORCPT ); Fri, 9 Apr 2021 05:56:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C47BA611C0; Fri, 9 Apr 2021 09:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962147; bh=llLN9xU9vdoxLzdQwQJM2fJmmSdqDdov5+bePIV0doo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sXHw6/DtrL85sZESZSV8RhNzo0c+g2vWuO5I0pTOS2nJlxE3VAuvdDROUQL0txlMb 1jsXV1WQU0epaBBpHW1KDjBrF4Y2AStgvmoD6At39rVma36/Ch7HM507rQ5k/mZn6G 5KGIyPAYkkdTnkLnI43Yci2g8OjOZfd7DFOCQi1c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , "Paulo Alcantara (SUSE)" , Steve French , Sasha Levin Subject: [PATCH 4.9 08/13] cifs: revalidate mapping when we open files for SMB1 POSIX Date: Fri, 9 Apr 2021 11:53:28 +0200 Message-Id: <20210409095259.890571984@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ronnie Sahlberg [ Upstream commit cee8f4f6fcabfdf229542926128e9874d19016d5 ] RHBZ: 1933527 Under SMB1 + POSIX, if an inode is reused on a server after we have read and cached a part of a file, when we then open the new file with the re-cycled inode there is a chance that we may serve the old data out of cache to the application. This only happens for SMB1 (deprecated) and when posix are used. The simplest solution to avoid this race is to force a revalidate on smb1-posix open. Signed-off-by: Ronnie Sahlberg Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/file.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 24508b69e78b..e2ce90fc504e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -163,6 +163,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, goto posix_open_ret; } } else { + cifs_revalidate_mapping(*pinode); cifs_fattr_to_inode(*pinode, &fattr); } From patchwork Fri Apr 9 09:53:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418801 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 9F4F0C43461 for ; Fri, 9 Apr 2021 09:55:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7090C611C9 for ; Fri, 9 Apr 2021 09:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232855AbhDIJ4A (ORCPT ); Fri, 9 Apr 2021 05:56:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:43412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233519AbhDIJze (ORCPT ); Fri, 9 Apr 2021 05:55:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D2A2611C9; Fri, 9 Apr 2021 09:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962120; bh=V+x+2INcOzgnWu+tLDdUCCUQothP++KGc7g0v0HqrGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVDiGwKQ7hlJs1wl28mUzIp6Ek9Z6Gp6evuo7n8pEOGekh1j6kU7FPtFf4x+Yc48i c3/GHcgAjWTLInj5N4ovUO374/l9gJ0JIPHdNAjzrvf8NtNJEbyfyYDcZC4jtFL/HG Dx0E/+Uu+bX3d2doXZIOfDqk4//4Qt6n6+WI6kxw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Piotr Krysiuk , Daniel Borkmann Subject: [PATCH 4.9 10/13] bpf, x86: Validate computation of branch displacements for x86-64 Date: Fri, 9 Apr 2021 11:53:30 +0200 Message-Id: <20210409095259.965251658@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Piotr Krysiuk commit e4d4d456436bfb2fe412ee2cd489f7658449b098 upstream. The branch displacement logic in the BPF JIT compilers for x86 assumes that, for any generated branch instruction, the distance cannot increase between optimization passes. But this assumption can be violated due to how the distances are computed. Specifically, whenever a backward branch is processed in do_jit(), the distance is computed by subtracting the positions in the machine code from different optimization passes. This is because part of addrs[] is already updated for the current optimization pass, before the branch instruction is visited. And so the optimizer can expand blocks of machine code in some cases. This can confuse the optimizer logic, where it assumes that a fixed point has been reached for all machine code blocks once the total program size stops changing. And then the JIT compiler can output abnormal machine code containing incorrect branch displacements. To mitigate this issue, we assert that a fixed point is reached while populating the output image. This rejects any problematic programs. The issue affects both x86-32 and x86-64. We mitigate separately to ease backporting. Signed-off-by: Piotr Krysiuk Reviewed-by: Daniel Borkmann Signed-off-by: Daniel Borkmann Signed-off-by: Greg Kroah-Hartman --- arch/x86/net/bpf_jit_comp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c @@ -1082,7 +1082,16 @@ common_load: } if (image) { - if (unlikely(proglen + ilen > oldproglen)) { + /* + * When populating the image, assert that: + * + * i) We do not write beyond the allocated space, and + * ii) addrs[i] did not change from the prior run, in order + * to validate assumptions made for computing branch + * displacements. + */ + if (unlikely(proglen + ilen > oldproglen || + proglen + ilen != addrs[i])) { pr_err("bpf_jit_compile fatal error\n"); return -EFAULT; } From patchwork Fri Apr 9 09:53:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418800 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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 19EC7C43461 for ; Fri, 9 Apr 2021 09:55:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAF72611CA for ; Fri, 9 Apr 2021 09:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233426AbhDIJ4C (ORCPT ); Fri, 9 Apr 2021 05:56:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233528AbhDIJzi (ORCPT ); Fri, 9 Apr 2021 05:55:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6076A6115C; Fri, 9 Apr 2021 09:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962126; bh=55GvB+ZBPGH92rbkSluyz0cHnOKe5To3V3NJBZFj5zA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kCq10vEJzkogwu5mQCukzBsIvB4PMszpMLbpzhrBXYlxAU3Xw6LhlhJFjnsJtDd6K 87rjdPmXztpzgeCeiuQfTuwDCb6ARdjLJRPaZCim49IQNJKnuId8Pf3OtERC4JwF2G 0GQ86KmSsHfqVa123bLYjXB8soUJuON3QruAOPzI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Arnd Bergmann , Heiko Carstens , Guenter Roeck Subject: [PATCH 4.9 12/13] init/Kconfig: make COMPILE_TEST depend on !S390 Date: Fri, 9 Apr 2021 11:53:32 +0200 Message-Id: <20210409095300.027621195@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095259.624577828@linuxfoundation.org> References: <20210409095259.624577828@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Heiko Carstens commit 334ef6ed06fa1a54e35296b77b693bcf6d63ee9e upstream. While allmodconfig and allyesconfig build for s390 there are also various bots running compile tests with randconfig, where PCI is disabled. This reveals that a lot of drivers should actually depend on HAS_IOMEM. Adding this to each device driver would be a never ending story, therefore just disable COMPILE_TEST for s390. The reasoning is more or less the same as described in commit bc083a64b6c0 ("init/Kconfig: make COMPILE_TEST depend on !UML"). Reported-by: kernel test robot Suggested-by: Arnd Bergmann Signed-off-by: Heiko Carstens Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- init/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/init/Kconfig +++ b/init/Kconfig @@ -65,7 +65,7 @@ config CROSS_COMPILE config COMPILE_TEST bool "Compile also drivers which will not load" - depends on !UML + depends on !UML && !S390 default n help Some drivers can be compiled on a different platform than they are