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: 418792 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 EB1F9C433B4 for ; Fri, 9 Apr 2021 09:56:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF51861209 for ; Fri, 9 Apr 2021 09:56:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233601AbhDIJ5H (ORCPT ); Fri, 9 Apr 2021 05:57:07 -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 S233586AbhDIJ40 (ORCPT ); Fri, 9 Apr 2021 05:56:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B51A611BF; Fri, 9 Apr 2021 09:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962173; bh=8DRw1WgndKxhi58SgcuQYiRxFEAHXT4LyT3172QVfYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o9jdv3rtjZXvXV0jaGJtBRBkm0DlDcsSvQjkAXehgbKeuwNdIG6ArONgZ+BtRCZVD m7B3bPcwt4pcdAbrbQqn9iv7GoH/E0+R/8ZIimIJtVF14Am8XCd4pOP9Vj4Iu9i2Af cH1G7EfRH4jIGvhHtyVE3HKHi2j9sjjXxz6ZKWpY= 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.14 03/14] mISDN: fix crash in fritzpci Date: Fri, 9 Apr 2021 11:53:28 +0200 Message-Id: <20210409095300.504622651@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@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 e240010b93fa..c87cb193830c 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: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: 418791 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 BC2D1C433ED for ; Fri, 9 Apr 2021 09:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85EBF6103E for ; Fri, 9 Apr 2021 09:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233493AbhDIJ5Y (ORCPT ); Fri, 9 Apr 2021 05:57:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:44726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233655AbhDIJ4c (ORCPT ); Fri, 9 Apr 2021 05:56:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A14016115C; Fri, 9 Apr 2021 09:56:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962179; bh=i9H08rKNPCDFCto/eGhd+dFQRD9tjWlncXUq4Ng5sjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQBULByKRtYOwIlukzvq0URB+Y9p1ldNRviU7HpZgDpkIQqVhVXfCPstkRZo5dijH 17mDhBUEsmExYrl4mDet1d7DA2cdKQkI73an7OMuoA8dLrAQEPFMC9Zf+JCEvOspTj KtjaThyGOYHiE5dc+hrWPUgd7jJH8KUHFjepCBtI= 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.14 05/14] drm/msm: Ratelimit invalid-fence message Date: Fri, 9 Apr 2021 11:53:30 +0200 Message-Id: <20210409095300.567414904@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@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 a2f89bac9c16..4c0ac0360b93 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:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418160 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1422601jai; Fri, 9 Apr 2021 02:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxoHv6EQd7k8YAWzrXaYDJkCf/3cxH8FCKN+qFLQ5HUx2O3ZkBOwS0J6/FZu8DoSMp5/ug X-Received: by 2002:a17:90a:bb86:: with SMTP id v6mr13193956pjr.37.1617962239762; Fri, 09 Apr 2021 02:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617962239; cv=none; d=google.com; s=arc-20160816; b=LpNu5OTzON4h++WRnKc0VmmnUtxYiWoLjS4pXH5Gfhoc6d+CiUoMmAhwamZwVA5EJn Dc5PbU/73FcJgNiFRr7MH3KmB4KusBaZBjrEKxQFSu8tIwBId3lB3w7e6YoEScmUcJ0j jwA0GKUnIRtnim/bEGm5436lhO/OeSJnOriZ+RNROma2aO+oJFtzUhlWD7HygfkoO+8p iApFAojIY2Kf4BpADhmLryudJWa425XU/m45Dt9iZiD9kiShumD2g8jvyFbQ2PZOG0O/ +UspCBHgIQ5KsNpazSYeZkxW/HQEmAzUlAyAqerQI/ucOqllflIfL33yabrvoyiu5dal hz1w== 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=T1+xKO/DvUB8S5U2kDalhHJOS+m5PuiKZIHlnN7E9+I=; b=fygCK5iTCX0i2bzCkkRd6UJLWMQvly+9bSJkC5g8os6KIgEGXAtJcW+219zHyEuVgt df5DRhd0Z/+R6IBxV10pjFR3JFwbmnQTCXe09XXN8HrfHER6cV4pY9YsE/OvTvyVipXv qC5970NPqMQJBxrTkAQ7v/tNnhrK5lGeAA0cgAiYb+J1XQtG2WXf5UCaA4pw+AKCc7hY JV+tTeZh1pJOmnBmKjUWZIOozFL+uKZ4jENC3CsFSX7wzHN/yKO8tDPBUSl/ZT0twV6g f/Vfollf8jANhdYcJt2xIZagC6VEgIHM7SjXwsuG0eSnERAYGJGxF2wK7y8wmN/Q4WTi n7qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iA7XImCu; 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 j13si2929758pjn.73.2021.04.09.02.57.19; Fri, 09 Apr 2021 02:57:19 -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=iA7XImCu; 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 S233445AbhDIJ5a (ORCPT + 12 others); Fri, 9 Apr 2021 05:57:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:44824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233666AbhDIJ4i (ORCPT ); Fri, 9 Apr 2021 05:56:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF1D761182; Fri, 9 Apr 2021 09:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962184; bh=I4X2BwyE5he9AmSsD0uodM8qJTSafLXvfC8PLNLBUk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iA7XImCueKZDUtCa+cyE4Lupoga22w+aTZWbLpLShLHiqXM0bQk0PrZx31Bq3Hltd Cb+3kPvjtHYil/G4f4DizQ2aQoik4TnhNtFNWBAc8u8ae1PWWOCa8zD45jdbNxLI6J ihXdW++v0y5PiR5p4Sh3Vu9bSmSWY+qY7sKroadw= 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.14 07/14] x86/build: Turn off -fcf-protection for realmode targets Date: Fri, 9 Apr 2021 11:53:32 +0200 Message-Id: <20210409095300.627874417@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@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 9f33a69b5605..146aadeb7c8e 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -35,7 +35,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:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418789 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 DE374C43470 for ; Fri, 9 Apr 2021 09:57:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D16561206 for ; Fri, 9 Apr 2021 09:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233032AbhDIJ5b (ORCPT ); Fri, 9 Apr 2021 05:57:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:43734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233310AbhDIJ4m (ORCPT ); Fri, 9 Apr 2021 05:56:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 233A2611C9; Fri, 9 Apr 2021 09:56:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962189; bh=v6jf9yR0q+q45Cfz46wjLTQH4szE4WfWNwHXWOKXtjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GkKbugXs4nUt+XlNkq3j8o7+IlzKBZ9xNCW58gGjalRTqmeSa8KvYC0sW1x3oGpL2 yFzBxElOCCpCU5ojzKyUgPsJj2yA4wq85VZAolScOLzj/hpqJRaj+i2gQpJ9rYsnl6 fz+yNDRrc7kpfm7SrAyfk74ZR4eG45c+4NZ8D6dY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Trofimovich , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 4.14 09/14] ia64: mca: allocate early mca with GFP_ATOMIC Date: Fri, 9 Apr 2021 11:53:34 +0200 Message-Id: <20210409095300.697751636@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sergei Trofimovich [ Upstream commit f2a419cf495f95cac49ea289318b833477e1a0e2 ] The sleep warning happens at early boot right at secondary CPU activation bootup: smp: Bringing up secondary CPUs ... BUG: sleeping function called from invalid context at mm/page_alloc.c:4942 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.12.0-rc2-00007-g79e228d0b611-dirty #99 .. Call Trace: show_stack+0x90/0xc0 dump_stack+0x150/0x1c0 ___might_sleep+0x1c0/0x2a0 __might_sleep+0xa0/0x160 __alloc_pages_nodemask+0x1a0/0x600 alloc_page_interleave+0x30/0x1c0 alloc_pages_current+0x2c0/0x340 __get_free_pages+0x30/0xa0 ia64_mca_cpu_init+0x2d0/0x3a0 cpu_init+0x8b0/0x1440 start_secondary+0x60/0x700 start_ap+0x750/0x780 Fixed BSP b0 value from CPU 1 As I understand interrupts are not enabled yet and system has a lot of memory. There is little chance to sleep and switch to GFP_ATOMIC should be a no-op. Link: https://lkml.kernel.org/r/20210315085045.204414-1-slyfox@gentoo.org Signed-off-by: Sergei Trofimovich Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- arch/ia64/kernel/mca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 555b11180156..16a7dae5f770 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -1860,7 +1860,7 @@ ia64_mca_cpu_init(void *cpu_data) data = mca_bootmem(); first_time = 0; } else - data = (void *)__get_free_pages(GFP_KERNEL, + data = (void *)__get_free_pages(GFP_ATOMIC, get_order(sz)); if (!data) panic("Could not allocate MCA memory for cpu %d\n", From patchwork Fri Apr 9 09:53:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418795 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 82C63C433B4 for ; Fri, 9 Apr 2021 09:56:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B7FA611CA for ; Fri, 9 Apr 2021 09:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233669AbhDIJ4i (ORCPT ); Fri, 9 Apr 2021 05:56:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:44208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233607AbhDIJ4K (ORCPT ); Fri, 9 Apr 2021 05:56:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F025361182; Fri, 9 Apr 2021 09:55:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962157; bh=G05ai1iCMpiL7TwATNWK4zM55eH5vJL+xFkYtTLg+F4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dUnKn/QcM1pFJZfZWXuj3UNGjNYkrOL72tEKCU8Yo0Zbb66lxru/mX52fkGndXQLa RKI2GgHW0HYVyBnCnYm6ioEu/W3tl3yfbvgvm1TE09x5wZ7eb0pwio7SoWf7OETH3s YytKxNj23ELUxvAO+0Mvc9vdMFBAjtxYzrOnPgJg= 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.14 10/14] cifs: revalidate mapping when we open files for SMB1 POSIX Date: Fri, 9 Apr 2021 11:53:35 +0200 Message-Id: <20210409095300.728298239@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@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 6c77a96437e6..46e8e9324b58 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:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418794 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 5C673C433ED for ; Fri, 9 Apr 2021 09:56:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B3FE6125F for ; Fri, 9 Apr 2021 09:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233685AbhDIJ4q (ORCPT ); Fri, 9 Apr 2021 05:56:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:44302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbhDIJ4Q (ORCPT ); Fri, 9 Apr 2021 05:56:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63B3F6103E; Fri, 9 Apr 2021 09:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962162; bh=fQ2B3Sw6KBl8kdpti/WJmy/wUgEyZvTQx5IeAxhDBJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R5wpzssnz6520nbMATMmSo6F927QDxMGV2eGsIsFrmaoMGxC5hIs+wed/DCEcf/21 R4lzyWMmAuZgLgkVUtY3aKMckoERfXEyO1vM1lB66riTzXWzdjUBvtWD/payjG4m+B 8TFJsrFvdF0PRNR0IgI5sLguApKaut7QhFTpA5IU= 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.14 12/14] bpf, x86: Validate computation of branch displacements for x86-64 Date: Fri, 9 Apr 2021 11:53:37 +0200 Message-Id: <20210409095300.792883435@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@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 @@ -1107,7 +1107,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: fatal error\n"); return -EFAULT; } From patchwork Fri Apr 9 09:53:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 418793 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 0A706C433B4 for ; Fri, 9 Apr 2021 09:56:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3F8A61205 for ; Fri, 9 Apr 2021 09:56:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231611AbhDIJ44 (ORCPT ); Fri, 9 Apr 2021 05:56:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:44438 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233528AbhDIJ4U (ORCPT ); Fri, 9 Apr 2021 05:56:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B892E61205; Fri, 9 Apr 2021 09:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962168; bh=aasq1UfykmEKZrVsIOCgwB7zHlTo7HeqhamPExmYheM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qfyqxgXaOFPKyaBJ8AF2POk+4YVNCye0SDIvBcE77Qp7Vk8G8Luxn8fK7pSkvDQ+F id33MMbZYIP+Fpfh21gtXrYRBE7rL8WmZo//GA63RT3y4c4uGtMFoOVr7P4xk/H2tg LQSgUAF3UDfH+WHocfnAp+qLa/WQbDSBSRjNYR/4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Heiko Carstens , Guenter Roeck , Arnd Bergmann , Kees Cook , Daniel Borkmann , Johannes Weiner , KP Singh , Nathan Chancellor , Nick Terrell , Quentin Perret , Valentin Schneider , "Enrico Weigelt, metux IT consult" , Andrew Morton , Linus Torvalds Subject: [PATCH 4.14 14/14] init/Kconfig: make COMPILE_TEST depend on HAS_IOMEM Date: Fri, 9 Apr 2021 11:53:39 +0200 Message-Id: <20210409095300.855935965@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095300.391558233@linuxfoundation.org> References: <20210409095300.391558233@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit ea29b20a828511de3348334e529a3d046a180416 upstream. I read the commit log of the following two: - bc083a64b6c0 ("init/Kconfig: make COMPILE_TEST depend on !UML") - 334ef6ed06fa ("init/Kconfig: make COMPILE_TEST depend on !S390") Both are talking about HAS_IOMEM dependency missing in many drivers. So, 'depends on HAS_IOMEM' seems the direct, sensible solution to me. This does not change the behavior of UML. UML still cannot enable COMPILE_TEST because it does not provide HAS_IOMEM. The current dependency for S390 is too strong. Under the condition of CONFIG_PCI=y, S390 provides HAS_IOMEM, hence can enable COMPILE_TEST. I also removed the meaningless 'default n'. Link: https://lkml.kernel.org/r/20210224140809.1067582-1-masahiroy@kernel.org Signed-off-by: Masahiro Yamada Cc: Heiko Carstens Cc: Guenter Roeck Cc: Arnd Bergmann Cc: Kees Cook Cc: Daniel Borkmann Cc: Johannes Weiner Cc: KP Singh Cc: Nathan Chancellor Cc: Nick Terrell Cc: Quentin Perret Cc: Valentin Schneider Cc: "Enrico Weigelt, metux IT consult" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- init/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/init/Kconfig +++ b/init/Kconfig @@ -65,8 +65,7 @@ config CROSS_COMPILE config COMPILE_TEST bool "Compile also drivers which will not load" - depends on !UML && !S390 - default n + depends on HAS_IOMEM help Some drivers can be compiled on a different platform than they are intended to be run on. Despite they cannot be loaded there (or even