It turns out that our polling of RWP is totally wrong when checking
for it in the redistributors, as we test the *distributor* bit index,
whereas it is a different bit number in the RDs... Oopsie boo.
This is embarassing. Not only because it is wrong, but also because
it took *8 years* to notice the blunder...
Just fix the damn thing.
Fixes: 021f653791ad ("irqchip: gic-v3: Initial support for GICv3")
Signed-off-by: Marc Zyngier <maz(a)kernel.org>
Cc: stable(a)vger.kernel.org
---
drivers/irqchip/irq-gic-v3.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index 5e935d97207d..736163d36b13 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -206,11 +206,11 @@ static inline void __iomem *gic_dist_base(struct irq_data *d)
}
}
-static void gic_do_wait_for_rwp(void __iomem *base)
+static void gic_do_wait_for_rwp(void __iomem *base, u32 bit)
{
u32 count = 1000000; /* 1s! */
- while (readl_relaxed(base + GICD_CTLR) & GICD_CTLR_RWP) {
+ while (readl_relaxed(base + GICD_CTLR) & bit) {
count--;
if (!count) {
pr_err_ratelimited("RWP timeout, gone fishing\n");
@@ -224,13 +224,13 @@ static void gic_do_wait_for_rwp(void __iomem *base)
/* Wait for completion of a distributor change */
static void gic_dist_wait_for_rwp(void)
{
- gic_do_wait_for_rwp(gic_data.dist_base);
+ gic_do_wait_for_rwp(gic_data.dist_base, GICD_CTLR_RWP);
}
/* Wait for completion of a redistributor change */
static void gic_redist_wait_for_rwp(void)
{
- gic_do_wait_for_rwp(gic_data_rdist_rd_base());
+ gic_do_wait_for_rwp(gic_data_rdist_rd_base(), GICR_CTLR_RWP);
}
#ifdef CONFIG_ARM64
--
2.34.1
OF framebuffers do not have an underlying device in the Linux
device hierarchy. Do a regular unregister call instead of hot
unplugging such a non-existing device. Fixes a NULL dereference.
An example error message on ppc64le is shown below.
BUG: Kernel NULL pointer dereference on read at 0x00000060
Faulting instruction address: 0xc00000000080dfa4
Oops: Kernel access of bad area, sig: 11 [#1]
LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[...]
CPU: 2 PID: 139 Comm: systemd-udevd Not tainted 5.17.0-ae085d7f9365 #1
NIP: c00000000080dfa4 LR: c00000000080df9c CTR: c000000000797430
REGS: c000000004132fe0 TRAP: 0300 Not tainted (5.17.0-ae085d7f9365)
MSR: 8000000002009033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 28228282 XER: 20000000
CFAR: c00000000000c80c DAR: 0000000000000060 DSISR: 40000000 IRQMASK: 0
GPR00: c00000000080df9c c000000004133280 c00000000169d200 0000000000000029
GPR04: 00000000ffffefff c000000004132f90 c000000004132f88 0000000000000000
GPR08: c0000000015658f8 c0000000015cd200 c0000000014f57d0 0000000048228283
GPR12: 0000000000000000 c00000003fffe300 0000000020000000 0000000000000000
GPR16: 0000000000000000 0000000113fc4a40 0000000000000005 0000000113fcfb80
GPR20: 000001000f7283b0 0000000000000000 c000000000e4a588 c000000000e4a5b0
GPR24: 0000000000000001 00000000000a0000 c008000000db0168 c0000000021f6ec0
GPR28: c0000000016d65a8 c000000004b36460 0000000000000000 c0000000016d64b0
NIP [c00000000080dfa4] do_remove_conflicting_framebuffers+0x184/0x1d0
[c000000004133280] [c00000000080df9c] do_remove_conflicting_framebuffers+0x17c/0x1d0 (unreliable)
[c000000004133350] [c00000000080e4d0] remove_conflicting_framebuffers+0x60/0x150
[c0000000041333a0] [c00000000080e6f4] remove_conflicting_pci_framebuffers+0x134/0x1b0
[c000000004133450] [c008000000e70438] drm_aperture_remove_conflicting_pci_framebuffers+0x90/0x100 [drm]
[c000000004133490] [c008000000da0ce4] bochs_pci_probe+0x6c/0xa64 [bochs]
[...]
[c000000004133db0] [c00000000002aaa0] system_call_exception+0x170/0x2d0
[c000000004133e10] [c00000000000c3cc] system_call_common+0xec/0x250
The bug [1] was introduced by commit 27599aacbaef ("fbdev: Hot-unplug
firmware fb devices on forced removal"). Most firmware framebuffers
have an underlying platform device, which can be hot-unplugged
before loading the native graphics driver. OF framebuffers do not
(yet) have that device. Fix the code by unregistering the framebuffer
as before without a hot unplug.
Tested with 5.17 on qemu ppc64le emulation.
Signed-off-by: Thomas Zimmermann <tzimmermann(a)suse.de>
Fixes: 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal")
Reported-by: Sudip Mukherjee <sudipm.mukherjee(a)gmail.com>
Cc: Zack Rusin <zackr(a)vmware.com>
Cc: Javier Martinez Canillas <javierm(a)redhat.com>
Cc: Hans de Goede <hdegoede(a)redhat.com>
Cc: stable(a)vger.kernel.org # v5.11+
Cc: Helge Deller <deller(a)gmx.de>
Cc: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Cc: Sam Ravnborg <sam(a)ravnborg.org>
Cc: Zheyu Ma <zheyuma97(a)gmail.com>
Cc: Xiyu Yang <xiyuyang19(a)fudan.edu.cn>
Cc: Zhen Lei <thunder.leizhen(a)huawei.com>
Cc: Matthew Wilcox <willy(a)infradead.org>
Cc: Alex Deucher <alexander.deucher(a)amd.com>
Cc: Tetsuo Handa <penguin-kernel(a)i-love.sakura.ne.jp>
Cc: Guenter Roeck <linux(a)roeck-us.net>
Cc: linux-fbdev(a)vger.kernel.org
Cc: dri-devel(a)lists.freedesktop.org
Link: https://lore.kernel.org/all/YkHXO6LGHAN0p1pq@debian/ # [1]
---
drivers/video/fbdev/core/fbmem.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index 34d6bb1bf82e..a6bb0e438216 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -1579,7 +1579,14 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
* If it's not a platform device, at least print a warning. A
* fix would add code to remove the device from the system.
*/
- if (dev_is_platform(device)) {
+ if (!device) {
+ /* TODO: Represent each OF framebuffer as its own
+ * device in the device hierarchy. For now, offb
+ * doesn't have such a device, so unregister the
+ * framebuffer as before without warning.
+ */
+ do_unregister_framebuffer(registered_fb[i]);
+ } else if (dev_is_platform(device)) {
registered_fb[i]->forced_out = true;
platform_device_unregister(to_platform_device(device));
} else {
--
2.35.1
This patchset is the remaining patches (part2) of the series
'Fix mmap + page fault deadlocks' sent earlier [1].
[1] https://patchwork.kernel.org/project/linux-btrfs/list/?series=628427
These patches apply on the top of the above series.
Filipe Manana (1):
btrfs: fallback to blocking mode when doing async dio over multiple
extents
Linus Torvalds (1):
mm: gup: make fault_in_safe_writeable() use fixup_user_fault()
fs/btrfs/inode.c | 28 ++++++++++++++++++++++++
mm/gup.c | 57 ++++++++++++++++--------------------------------
2 files changed, 47 insertions(+), 38 deletions(-)
--
2.33.1
stable-rc/linux-4.19.y build: 198 builds: 20 failed, 178 passed, 527 errors, 56 warnings (v4.19.237-258-g1376b0e9d2319)
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.19.y/kernel/v4.19.237-2…
Tree: stable-rc
Branch: linux-4.19.y
Git Describe: v4.19.237-258-g1376b0e9d2319
Git Commit: 1376b0e9d23193f0dff6107fba4c042b338b5676
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Built: 7 unique architectures
Build Failures Detected:
arc:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm:
allnoconfig: (gcc-10) FAIL
mps2_defconfig: (gcc-10) FAIL
rpc_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
xcep_defconfig: (gcc-10) FAIL
i386:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
mips:
allnoconfig: (gcc-10) FAIL
ip27_defconfig: (gcc-10) FAIL
ip28_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
riscv:
allnoconfig: (gcc-10) FAIL
defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
x86_64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
Errors and Warnings Detected:
arc:
allnoconfig (gcc-10): 18 errors
tinyconfig (gcc-10): 18 errors
arm64:
allnoconfig (gcc-10): 22 errors
defconfig (gcc-10): 3 warnings
defconfig+arm64-chromebook (gcc-10): 3 warnings
tinyconfig (gcc-10): 22 errors
arm:
allnoconfig (gcc-10): 40 errors
mps2_defconfig (gcc-10): 26 errors
omap1_defconfig (gcc-10): 1 warning
rpc_defconfig (gcc-10): 2 errors
tinyconfig (gcc-10): 26 errors
xcep_defconfig (gcc-10): 20 errors
i386:
allnoconfig (gcc-10): 57 errors, 4 warnings
i386_defconfig (gcc-10): 2 warnings
tinyconfig (gcc-10): 43 errors, 3 warnings
mips:
allnoconfig (gcc-10): 26 errors
lemote2f_defconfig (gcc-10): 1 warning
loongson3_defconfig (gcc-10): 1 warning
malta_qemu_32r6_defconfig (gcc-10): 1 warning
mtx1_defconfig (gcc-10): 3 warnings
nlm_xlp_defconfig (gcc-10): 1 warning
tinyconfig (gcc-10): 26 errors
riscv:
allnoconfig (gcc-10): 54 errors
tinyconfig (gcc-10): 54 errors
x86_64:
allnoconfig (gcc-10): 29 errors, 11 warnings
tinyconfig (gcc-10): 44 errors, 16 warnings
x86_64_defconfig (gcc-10): 3 warnings
x86_64_defconfig+x86-chromebook (gcc-10): 3 warnings
Errors summary:
166 include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
35 include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
35 include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
34 include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
12 include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
8 include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
6 include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
6 arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
6 arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
4 include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
4 include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
4 include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
4 include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
1 include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function); did you mean ‘COMPACT_COMPLETE’?
1 arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
1 arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
Warnings summary:
12 include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
6 aarch64-linux-gnu-ld: warning: -z norelro ignored
5 arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
3 ld: warning: creating DT_TEXTREL in a PIE
2 sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
2 net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
2 ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
1 {standard input}:132: Warning: macro instruction expanded into multiple instructions
1 sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
1 net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
1 drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_tiny_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
allnoconfig (arm, gcc-10) — FAIL, 40 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (x86_64, gcc-10) — FAIL, 29 errors, 11 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
allnoconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (mips, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (arm64, gcc-10) — FAIL, 22 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (i386, gcc-10) — FAIL, 57 errors, 4 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function); did you mean ‘COMPACT_COMPLETE’?
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
allnoconfig (arc, gcc-10) — FAIL, 18 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
am200epdkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ar7_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
at91_dt_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath25_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath79_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axm55xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
badge4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm47xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm63xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bigsur_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_be_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_stb_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
capcella_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cavium_octeon_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cerfcube_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ci20_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x2xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cobalt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
collie_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
corgi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
davinci_all_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
db1xxx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
decstation_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (riscv, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
defconfig+arm64-chromebook (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
dove_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
e55_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ebsa110_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
efm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
em_x270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ep93xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
eseries_pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
exynos_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ezx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
footbridge_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
fuloong2e_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gcw0_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gemini_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gpr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h3600_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h5000_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hackkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hisi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hsdk_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
i386_defconfig (i386, gcc-10) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
imote2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v4_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
integrator_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop32x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop33x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip22_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip27_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip28_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip32_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ixp4xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jazz_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jmr3927_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jornada720_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
keystone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ks8695_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lasat_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lemote2f_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
loongson1b_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson1c_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson3_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
lpc18xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpc32xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpd270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lubbock_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
magician_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mainstone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_guest_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_qemu_32r6_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
{standard input}:132: Warning: macro instruction expanded into multiple instructions
--------------------------------------------------------------------------------
maltaaprp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_eva_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_xpa_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
markeins_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mini2440_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mips_paravirt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mmp2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
moxart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mpc30x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mps2_defconfig (arm, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
msp71xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mtx1_defconfig (mips, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
--------------------------------------------------------------------------------
multi_v4t_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netwinder_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nlm_xlp_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
nlm_xlr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc950_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omap1_defconfig (arm, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
--------------------------------------------------------------------------------
omap2plus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omega2p_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
orion5x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
oxnas_v6_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
palmz72_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pcm027_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pic32mzda_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pistachio_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pleb_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pnx8335_stb225_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
prima2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa168_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa255-idp_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qcom_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qi_lb60_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
raumfeld_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rb532_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rbtx49xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
realview_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rm200_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rpc_defconfig (arm, gcc-10) — FAIL, 2 errors, 0 warnings, 0 section mismatches
Errors:
arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
--------------------------------------------------------------------------------
rt305x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c2410_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c6400_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s5pv210_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sama5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sb1250_swarm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shannon_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shmobile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
simpad_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
socfpga_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear6xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spitz_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
stm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sunxi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tango4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0219_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0226_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0287_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tct_hammer_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tegra_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tinyconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (mips, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (arm64, gcc-10) — FAIL, 22 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (arc, gcc-10) — FAIL, 18 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
tinyconfig (i386, gcc-10) — FAIL, 43 errors, 3 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
tinyconfig (x86_64, gcc-10) — FAIL, 44 errors, 16 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
tinyconfig (arm, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
trizeps4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u8500_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
versatile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vexpress_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vf610m4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
viper_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vocore2_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vt8500_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
workpad_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
x86_64_defconfig+x86-chromebook (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
xcep_defconfig (arm, gcc-10) — FAIL, 20 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
zeus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
zx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info(a)kernelci.org>
This reverts commit 37ef4c19b4c659926ce65a7ac709ceaefb211c40.
The touchpad present in the Dell Precision 7550 and 7750 laptops
reports a HID_DG_BUTTONTYPE of type MT_BUTTONTYPE_CLICKPAD. However,
the device is not a clickpad, it is a touchpad with physical buttons.
In order to fix this issue, a quirk for the device was introduced in
libinput [1] [2] to disable the INPUT_PROP_BUTTONPAD property:
[Precision 7x50 Touchpad]
MatchBus=i2c
MatchUdevType=touchpad
MatchDMIModalias=dmi:*svnDellInc.:pnPrecision7?50*
AttrInputPropDisable=INPUT_PROP_BUTTONPAD
However, because of the change introduced in 37ef4c19b4 ("Input: clear
BTN_RIGHT/MIDDLE on buttonpads") the BTN_RIGHT key bit is not mapped
anymore breaking the device right click button and making impossible to
workaround it in user space.
In order to avoid breakage on other present or future devices, revert
the patch causing the issue.
Cc: stable(a)vger.kernel.org
Link: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/481 [1]
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1868789 [2]
Signed-off-by: José Expósito <jose.exposito89(a)gmail.com>
---
drivers/input/input.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c3139bc2aa0d..ccaeb2426385 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -2285,12 +2285,6 @@ int input_register_device(struct input_dev *dev)
/* KEY_RESERVED is not supposed to be transmitted to userspace. */
__clear_bit(KEY_RESERVED, dev->keybit);
- /* Buttonpads should not map BTN_RIGHT and/or BTN_MIDDLE. */
- if (test_bit(INPUT_PROP_BUTTONPAD, dev->propbit)) {
- __clear_bit(BTN_RIGHT, dev->keybit);
- __clear_bit(BTN_MIDDLE, dev->keybit);
- }
-
/* Make sure that bitmasks not mentioned in dev->evbit are clean. */
input_cleanse_bitmasks(dev);
--
2.25.1
These two bug are here:
list_for_each_entry_safe_continue(w, n, list,
power_list);
list_for_each_entry_safe_continue(w, n, list,
power_list);
After the list_for_each_entry_safe_continue() exits, the list iterator
will always be a bogus pointer which point to an invalid struct objdect
containing HEAD member. The funciton poniter 'w->event' will be a
invalid value which can lead to a control-flow hijack if the 'w' can be
controlled.
The original intention was to continue the outer list_for_each_entry_safe()
loop with the same entry if w->event is NULL, but misunderstanding the
meaning of list_for_each_entry_safe_continue().
So just add a 'continue;' to fix the bug.
Cc: stable(a)vger.kernel.org
Fixes: 163cac061c973 ("ASoC: Factor out DAPM sequence execution")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
changes since v1:
- use continue statement instead (Mark Brown)
v1:https://lore.kernel.org/lkml/20220327082138.13696-1-xiam0nd.tong@gmail.c…
---
sound/soc/soc-dapm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b06c5682445c..fb43b331a36e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1687,8 +1687,7 @@ static void dapm_seq_run(struct snd_soc_card *card,
switch (w->id) {
case snd_soc_dapm_pre:
if (!w->event)
- list_for_each_entry_safe_continue(w, n, list,
- power_list);
+ continue;
if (event == SND_SOC_DAPM_STREAM_START)
ret = w->event(w,
@@ -1700,8 +1699,7 @@ static void dapm_seq_run(struct snd_soc_card *card,
case snd_soc_dapm_post:
if (!w->event)
- list_for_each_entry_safe_continue(w, n, list,
- power_list);
+ continue;
if (event == SND_SOC_DAPM_STREAM_START)
ret = w->event(w,
--
2.17.1
The bug is here:
if (!dai) {
The list iterator value 'dai' will *always* be set and non-NULL
by for_each_component_dais(), so it is incorrect to assume that
the iterator value will be NULL if the list is empty or no element
is found (In fact, it will be a bogus pointer to an invalid struct
object containing the HEAD). Otherwise it will bypass the check
'if (!dai) {' (never call dev_err() and never return -ENODEV;)
and lead to invalid memory access lately when calling
'rt5682s_set_bclk1_ratio(dai, factor);'.
To fix the bug, just return rt5682s_set_bclk1_ratio(dai, factor);
when found the 'dai', otherwise dev_err() and return -ENODEV;
Cc: stable(a)vger.kernel.org
Fixes: bdd229ab26be9 ("ASoC: rt5682s: Add driver for ALC5682I-VS codec")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
sound/soc/codecs/rt5682s.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c
index 1e662d1be2b3..c890e51ff953 100644
--- a/sound/soc/codecs/rt5682s.c
+++ b/sound/soc/codecs/rt5682s.c
@@ -2686,14 +2686,11 @@ static int rt5682s_bclk_set_rate(struct clk_hw *hw, unsigned long rate,
for_each_component_dais(component, dai)
if (dai->id == RT5682S_AIF1)
- break;
- if (!dai) {
- dev_err(component->dev, "dai %d not found in component\n",
- RT5682S_AIF1);
- return -ENODEV;
- }
+ return rt5682s_set_bclk1_ratio(dai, factor);
- return rt5682s_set_bclk1_ratio(dai, factor);
+ dev_err(component->dev, "dai %d not found in component\n",
+ RT5682S_AIF1);
+ return -ENODEV;
}
static const struct clk_ops rt5682s_dai_clk_ops[RT5682S_DAI_NUM_CLKS] = {
--
2.17.1
The bug is here:
if (!dai) {
The list iterator value 'dai' will *always* be set and non-NULL
by for_each_component_dais(), so it is incorrect to assume that
the iterator value will be NULL if the list is empty or no element
is found (In fact, it will be a bogus pointer to an invalid struct
object containing the HEAD). Otherwise it will bypass the check
'if (!dai) {' (never call dev_err() and never return -ENODEV;)
and lead to invalid memory access lately when calling
'rt5682_set_bclk1_ratio(dai, factor);'.
To fix the bug, just return rt5682_set_bclk1_ratio(dai, factor);
when found the 'dai', otherwise dev_err() and return -ENODEV;
Cc: stable(a)vger.kernel.org
Fixes: ebbfabc16d23d ("ASoC: rt5682: Add CCF usage for providing I2S clks")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
sound/soc/codecs/rt5682.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index be68d573a490..c9ff9c89adf7 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -2822,14 +2822,11 @@ static int rt5682_bclk_set_rate(struct clk_hw *hw, unsigned long rate,
for_each_component_dais(component, dai)
if (dai->id == RT5682_AIF1)
- break;
- if (!dai) {
- dev_err(rt5682->i2c_dev, "dai %d not found in component\n",
- RT5682_AIF1);
- return -ENODEV;
- }
+ return rt5682_set_bclk1_ratio(dai, factor);
- return rt5682_set_bclk1_ratio(dai, factor);
+ dev_err(rt5682->i2c_dev, "dai %d not found in component\n",
+ RT5682_AIF1);
+ return -ENODEV;
}
static const struct clk_ops rt5682_dai_clk_ops[RT5682_DAI_NUM_CLKS] = {
--
2.17.1
It was reported that some perf event setup can make fork failed on
ARM64. It was the case of a group of mixed hw and sw events and it
failed in perf_event_init_task() due to armpmu_event_init().
The ARM PMU code checks if all the events in a group belong to the
same PMU except for software events. But it didn't set the event_caps
of inherited events and no longer identify them as software events.
Therefore the test failed in a child process.
A simple reproducer is:
$ perf stat -e '{cycles,cs,instructions}' perf bench sched messaging
# Running 'sched/messaging' benchmark:
perf: fork(): Invalid argument
The perf stat was fine but the perf bench failed in fork(). Let's
inherit the event caps from the parent.
Cc: Will Deacon <will(a)kernel.org>
Cc: Mark Rutland <mark.rutland(a)arm.com>
Cc: Marco Elver <elver(a)google.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Namhyung Kim <namhyung(a)kernel.org>
---
kernel/events/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index afbf388a5176..5baf7f981f23 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -11622,6 +11622,9 @@ perf_event_alloc(struct perf_event_attr *attr, int cpu,
event->state = PERF_EVENT_STATE_INACTIVE;
+ if (parent_event)
+ event->event_caps = parent_event->event_caps;
+
if (event->attr.sigtrap)
atomic_set(&event->event_limit, 1);
--
2.35.1.1021.g381101b075-goog
From: Kan Liang <kan.liang(a)linux.intel.com>
The INST_RETIRED.PREC_DIST event (0x0100) doesn't count on SPR.
perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0
Performance counter stats for 'CPU(s) 0':
607,246 cpu/event=0xc0,umask=0x0/
0 cpu/event=0x0,umask=0x1/
The encoding for INST_RETIRED.PREC_DIST is pseudo-encoding, which
doesn't work on the generic counters. However, current perf extends its
mask to the generic counters.
The pseudo event-code for a fixed counter must be 0x00. Check and avoid
extending the mask for the fixed counter event which using the
pseudo-encoding, e.g., ref-cycles and PREC_DIST event.
With the patch,
perf stat -e cpu/event=0xc0,umask=0x0/,cpu/event=0x0,umask=0x1/ -C0
Performance counter stats for 'CPU(s) 0':
583,184 cpu/event=0xc0,umask=0x0/
583,048 cpu/event=0x0,umask=0x1/
Fixes: 2de71ee153ef ("perf/x86/intel: Fix ICL/SPR INST_RETIRED.PREC_DIST encodings")
Signed-off-by: Kan Liang <kan.liang(a)linux.intel.com>
Cc: stable(a)vger.kernel.org
---
arch/x86/events/intel/core.c | 6 +++++-
arch/x86/include/asm/perf_event.h | 5 +++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index db32ef6..1d2e49d 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -5668,7 +5668,11 @@ static void intel_pmu_check_event_constraints(struct event_constraint *event_con
/* Disabled fixed counters which are not in CPUID */
c->idxmsk64 &= intel_ctrl;
- if (c->idxmsk64 != INTEL_PMC_MSK_FIXED_REF_CYCLES)
+ /*
+ * Don't extend the pseudo-encoding to the
+ * generic counters
+ */
+ if (!use_fixed_pseudo_encoding(c->code))
c->idxmsk64 |= (1ULL << num_counters) - 1;
}
c->idxmsk64 &=
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h
index 48e6ef56..cd85f03 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -242,6 +242,11 @@ struct x86_pmu_capability {
#define INTEL_PMC_IDX_FIXED_SLOTS (INTEL_PMC_IDX_FIXED + 3)
#define INTEL_PMC_MSK_FIXED_SLOTS (1ULL << INTEL_PMC_IDX_FIXED_SLOTS)
+static inline bool use_fixed_pseudo_encoding(u64 code)
+{
+ return !(code & 0xff);
+}
+
/*
* We model BTS tracing as another fixed-mode PMC.
*
--
2.7.4
stable-rc/queue/4.19 build: 204 builds: 20 failed, 184 passed, 576 errors, 56 warnings (v4.19.237-256-g0886c3c931bb)
Full Build Summary: https://kernelci.org/build/stable-rc/branch/queue%2F4.19/kernel/v4.19.237-2…
Tree: stable-rc
Branch: queue/4.19
Git Describe: v4.19.237-256-g0886c3c931bb
Git Commit: 0886c3c931bb98ce9cc0eb841c6f234b4f29459d
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Built: 7 unique architectures
Build Failures Detected:
arc:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm:
allnoconfig: (gcc-10) FAIL
mps2_defconfig: (gcc-10) FAIL
rpc_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
xcep_defconfig: (gcc-10) FAIL
i386:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
mips:
allnoconfig: (gcc-10) FAIL
ip27_defconfig: (gcc-10) FAIL
ip28_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
riscv:
allnoconfig: (gcc-10) FAIL
defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
x86_64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
Errors and Warnings Detected:
arc:
allnoconfig (gcc-10): 18 errors
tinyconfig (gcc-10): 27 errors
arm64:
allnoconfig (gcc-10): 22 errors
defconfig (gcc-10): 3 warnings
defconfig+arm64-chromebook (gcc-10): 3 warnings
tinyconfig (gcc-10): 34 errors
arm:
allnoconfig (gcc-10): 26 errors
mps2_defconfig (gcc-10): 40 errors
omap1_defconfig (gcc-10): 1 warning
rpc_defconfig (gcc-10): 2 errors
tinyconfig (gcc-10): 40 errors
xcep_defconfig (gcc-10): 20 errors
i386:
allnoconfig (gcc-10): 44 errors, 3 warnings
i386_defconfig (gcc-10): 2 warnings
tinyconfig (gcc-10): 57 errors, 4 warnings
mips:
allnoconfig (gcc-10): 39 errors
lemote2f_defconfig (gcc-10): 1 warning
loongson3_defconfig (gcc-10): 1 warning
malta_qemu_32r6_defconfig (gcc-10): 1 warning
mtx1_defconfig (gcc-10): 3 warnings
nlm_xlp_defconfig (gcc-10): 1 warning
tinyconfig (gcc-10): 26 errors
riscv:
allnoconfig (gcc-10): 54 errors
tinyconfig (gcc-10): 54 errors
x86_64:
allnoconfig (gcc-10): 29 errors, 11 warnings
tinyconfig (gcc-10): 44 errors, 16 warnings
x86_64_defconfig (gcc-10): 3 warnings
x86_64_defconfig+x86-chromebook (gcc-10): 3 warnings
Errors summary:
182 include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
38 include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
38 include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
38 include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
38 include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
38 include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
38 include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
37 include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
12 include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
12 arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
10 include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
9 include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
6 arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
6 arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
5 include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
5 include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
5 include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
5 include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
5 include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
5 include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
5 include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
1 include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function); did you mean ‘COMPACT_COMPLETE’?
1 arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
1 arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
Warnings summary:
12 include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
6 aarch64-linux-gnu-ld: warning: -z norelro ignored
5 arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
5 arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
3 ld: warning: creating DT_TEXTREL in a PIE
2 sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
2 net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
2 ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
1 {standard input}:132: Warning: macro instruction expanded into multiple instructions
1 sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
1 net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
1 drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_tiny_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
allnoconfig (mips, gcc-10) — FAIL, 39 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (arm64, gcc-10) — FAIL, 22 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (arm, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (x86_64, gcc-10) — FAIL, 29 errors, 11 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
allnoconfig (i386, gcc-10) — FAIL, 44 errors, 3 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
allnoconfig (arc, gcc-10) — FAIL, 18 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
am200epdkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ar7_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
assabet_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
at91_dt_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath25_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath79_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axm55xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
badge4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm2835_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm47xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm63xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bigsur_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_be_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_stb_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
capcella_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cavium_octeon_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cerfcube_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ci20_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x2xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cobalt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
collie_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
corgi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
davinci_all_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
db1xxx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
decstation_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (riscv, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
defconfig+arm64-chromebook (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
dove_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
e55_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ebsa110_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
efm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
em_x270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ep93xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
eseries_pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
exynos_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ezx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
footbridge_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
fuloong2e_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gcw0_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gemini_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gpr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h3600_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h5000_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hackkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hisi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hsdk_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
i386_defconfig (i386, gcc-10) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
imote2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v4_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
integrator_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop32x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop33x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip22_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip27_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip28_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip32_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ixp4xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jazz_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jmr3927_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jornada720_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
keystone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ks8695_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lasat_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lemote2f_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
loongson1b_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson1c_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson3_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
lpc18xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpc32xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpd270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lubbock_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
magician_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mainstone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_guest_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_qemu_32r6_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
{standard input}:132: Warning: macro instruction expanded into multiple instructions
--------------------------------------------------------------------------------
maltaaprp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_eva_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_xpa_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
markeins_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mini2440_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mips_paravirt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mmp2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
moxart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mpc30x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mps2_defconfig (arm, gcc-10) — FAIL, 40 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
msp71xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mtx1_defconfig (mips, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
--------------------------------------------------------------------------------
multi_v4t_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mxs_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
neponset_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netwinder_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nhk8815_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nlm_xlp_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
nlm_xlr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc950_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc960_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omap1_defconfig (arm, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
--------------------------------------------------------------------------------
omap2plus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omega2p_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
orion5x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
oxnas_v6_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
palmz72_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pcm027_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pic32mzda_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pistachio_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pleb_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pnx8335_stb225_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
prima2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa168_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa255-idp_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qcom_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qi_lb60_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
raumfeld_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rb532_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rbtx49xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
realview_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rm200_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rpc_defconfig (arm, gcc-10) — FAIL, 2 errors, 0 warnings, 0 section mismatches
Errors:
arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
--------------------------------------------------------------------------------
rt305x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c2410_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c6400_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s5pv210_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sama5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sb1250_swarm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shannon_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shmobile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
simpad_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
socfpga_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear6xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spitz_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
stm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sunxi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tango4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0219_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0226_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0287_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tct_hammer_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tegra_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tinyconfig (arc, gcc-10) — FAIL, 27 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
tinyconfig (i386, gcc-10) — FAIL, 57 errors, 4 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function); did you mean ‘COMPACT_COMPLETE’?
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
tinyconfig (arm64, gcc-10) — FAIL, 34 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (arm, gcc-10) — FAIL, 40 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (mips, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (x86_64, gcc-10) — FAIL, 44 errors, 16 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
trizeps4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u8500_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
versatile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vexpress_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vf610m4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
viper_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vocore2_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vt8500_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
workpad_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
x86_64_defconfig+x86-chromebook (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
xcep_defconfig (arm, gcc-10) — FAIL, 20 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
zeus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
zx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info(a)kernelci.org>
commit 031495635b4668f94e964e037ca93d0d38bfde58 upstream.
The following patches resulted in deferring crash kernel reservation to
mem_init(), mainly aimed at platforms with DMA memory zones (no IOMMU),
in particular Raspberry Pi 4.
commit 1a8e1cef7603 ("arm64: use both ZONE_DMA and ZONE_DMA32")
commit 8424ecdde7df ("arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges")
commit 0a30c53573b0 ("arm64: mm: Move reserve_crashkernel() into mem_init()")
commit 2687275a5843 ("arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required")
Above changes introduced boot slowdown due to linear map creation for
all the memory banks with NO_BLOCK_MAPPINGS, see discussion[1]. The proposed
changes restore crash kernel reservation to earlier behavior thus avoids
slow boot, particularly for platforms with IOMMU (no DMA memory zones).
Tested changes to confirm no ~150ms boot slowdown on our SoC with IOMMU
and 8GB memory. Also tested with ZONE_DMA and/or ZONE_DMA32 configs to confirm
no regression to deferring scheme of crash kernel memory reservation.
In both cases successfully collected kernel crash dump.
[1] https://lore.kernel.org/all/9436d033-579b-55fa-9b00-6f4b661c2dd7@linux.micr…
Signed-off-by: Vijay Balakrishna <vijayb(a)linux.microsoft.com>
Cc: stable(a)vger.kernel.org
Reviewed-by: Pasha Tatashin <pasha.tatashin(a)soleen.com>
Link: https://lore.kernel.org/r/1646242689-20744-1-git-send-email-vijayb@linux.mi…
[will: Add #ifdef CONFIG_KEXEC_CORE guards to fix 'crashk_res' references in allnoconfig build]
Signed-off-by: Will Deacon <will(a)kernel.org>
---
arch/arm64/mm/init.c | 36 ++++++++++++++++++++++++++++++++----
arch/arm64/mm/mmu.c | 32 +++++++++++++++++++++++++++++++-
2 files changed, 63 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index c0a7f0d90b39..80cc79760e8e 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -58,8 +58,34 @@ EXPORT_SYMBOL(memstart_addr);
* unless restricted on specific platforms (e.g. 30-bit on Raspberry Pi 4).
* In such case, ZONE_DMA32 covers the rest of the 32-bit addressable memory,
* otherwise it is empty.
+ *
+ * Memory reservation for crash kernel either done early or deferred
+ * depending on DMA memory zones configs (ZONE_DMA) --
+ *
+ * In absence of ZONE_DMA configs arm64_dma_phys_limit initialized
+ * here instead of max_zone_phys(). This lets early reservation of
+ * crash kernel memory which has a dependency on arm64_dma_phys_limit.
+ * Reserving memory early for crash kernel allows linear creation of block
+ * mappings (greater than page-granularity) for all the memory bank rangs.
+ * In this scheme a comparatively quicker boot is observed.
+ *
+ * If ZONE_DMA configs are defined, crash kernel memory reservation
+ * is delayed until DMA zone memory range size initilazation performed in
+ * zone_sizes_init(). The defer is necessary to steer clear of DMA zone
+ * memory range to avoid overlap allocation. So crash kernel memory boundaries
+ * are not known when mapping all bank memory ranges, which otherwise means
+ * not possible to exclude crash kernel range from creating block mappings
+ * so page-granularity mappings are created for the entire memory range.
+ * Hence a slightly slower boot is observed.
+ *
+ * Note: Page-granularity mapppings are necessary for crash kernel memory
+ * range for shrinking its size via /sys/kernel/kexec_crash_size interface.
*/
-phys_addr_t arm64_dma_phys_limit __ro_after_init;
+#if IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32)
+phys_addr_t __ro_after_init arm64_dma_phys_limit;
+#else
+phys_addr_t __ro_after_init arm64_dma_phys_limit = PHYS_MASK + 1;
+#endif
#ifdef CONFIG_KEXEC_CORE
/*
@@ -210,8 +236,6 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
if (!arm64_dma_phys_limit)
arm64_dma_phys_limit = dma32_phys_limit;
#endif
- if (!arm64_dma_phys_limit)
- arm64_dma_phys_limit = PHYS_MASK + 1;
max_zone_pfns[ZONE_NORMAL] = max;
free_area_init(max_zone_pfns);
@@ -407,6 +431,9 @@ void __init arm64_memblock_init(void)
reserve_elfcorehdr();
+ if (!IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32))
+ reserve_crashkernel();
+
high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
}
@@ -451,7 +478,8 @@ void __init bootmem_init(void)
* request_standard_resources() depends on crashkernel's memory being
* reserved, so do it here.
*/
- reserve_crashkernel();
+ if (IS_ENABLED(CONFIG_ZONE_DMA) || IS_ENABLED(CONFIG_ZONE_DMA32))
+ reserve_crashkernel();
memblock_dump_all();
}
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 991e599f7057..993be1e31c49 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -492,7 +492,7 @@ static void __init map_mem(pgd_t *pgdp)
int flags = 0;
u64 i;
- if (rodata_full || crash_mem_map || debug_pagealloc_enabled())
+ if (rodata_full || debug_pagealloc_enabled())
flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
/*
@@ -503,6 +503,17 @@ static void __init map_mem(pgd_t *pgdp)
*/
memblock_mark_nomap(kernel_start, kernel_end - kernel_start);
+#ifdef CONFIG_KEXEC_CORE
+ if (crash_mem_map) {
+ if (IS_ENABLED(CONFIG_ZONE_DMA) ||
+ IS_ENABLED(CONFIG_ZONE_DMA32))
+ flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
+ else if (crashk_res.end)
+ memblock_mark_nomap(crashk_res.start,
+ resource_size(&crashk_res));
+ }
+#endif
+
/* map all the memory banks */
for_each_mem_range(i, &start, &end) {
if (start >= end)
@@ -529,6 +540,25 @@ static void __init map_mem(pgd_t *pgdp)
__map_memblock(pgdp, kernel_start, kernel_end,
PAGE_KERNEL, NO_CONT_MAPPINGS);
memblock_clear_nomap(kernel_start, kernel_end - kernel_start);
+
+ /*
+ * Use page-level mappings here so that we can shrink the region
+ * in page granularity and put back unused memory to buddy system
+ * through /sys/kernel/kexec_crash_size interface.
+ */
+#ifdef CONFIG_KEXEC_CORE
+ if (crash_mem_map &&
+ !IS_ENABLED(CONFIG_ZONE_DMA) && !IS_ENABLED(CONFIG_ZONE_DMA32)) {
+ if (crashk_res.end) {
+ __map_memblock(pgdp, crashk_res.start,
+ crashk_res.end + 1,
+ PAGE_KERNEL,
+ NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS);
+ memblock_clear_nomap(crashk_res.start,
+ resource_size(&crashk_res));
+ }
+ }
+#endif
}
void mark_rodata_ro(void)
--
2.35.1
commit 2a8859f373b0a86f0ece8ec8312607eacf12485d upstream.
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle any exception correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/paging_tmpl.h | 77 ++++++++++++++++++--------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 97b21e7fd013..13b5c424adb2 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,8 +64,10 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 4
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#else
#error Invalid PTTYPE value
#endif
@@ -132,43 +133,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- down_read(¤t->mm->mmap_sem);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- up_read(¤t->mm->mmap_sem);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- up_read(¤t->mm->mmap_sem);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- up_read(¤t->mm->mmap_sem);
- }
+ int r = -EFAULT;
+
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "mov $0, %[r]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "+q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "movl $0, %[r]\n"
+ "jz 2f\n"
+ "incl %[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "+rm" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
- return (ret != orig_pte);
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
--
2.31.1
[Public]
Hi,
A patch series of 7 swiotlb fixes was accepted into 5.16.
This series is needed to prevent warnings from swiotlb when hotplugging untrusted NVME devices on 5.15.y.
The first 2 commits are already applied in 5.15.y.
The last 5 are still needed. Can you please backport these to 5.15.y as well?
commit ee9d4097cc145dcaebedf6b113d17c91c21333a0
commit 9b49bbc2c4dfd0431bf7ff4e862171189cf94b7e
commit 2e727bffbe93750a13d2414f3ce43de2f21600d2
commit e81e99bacc9f9347bda7808a949c1ce9fcc2bbf4
commit 2cbc61a1b1665c84282dbf2b1747ffa0b6248639
With the whole series the warnings are gone.
Thanks,
If an application uses direct open or accept, it knows in advance what
direct descriptor value it will get as it picks it itself. This allows
combined requests such as:
sqe = io_uring_get_sqe(ring);
io_uring_prep_openat_direct(sqe, ..., file_slot);
sqe->flags |= IOSQE_IO_LINK | IOSQE_CQE_SKIP_SUCCESS;
sqe = io_uring_get_sqe(ring);
io_uring_prep_read(sqe,file_slot, buf, buf_size, 0);
sqe->flags |= IOSQE_FIXED_FILE;
io_uring_submit(ring);
where we prepare both a file open and read, and only get a completion
event for the read when both have completed successfully.
Currently links are fully prepared before the head is issued, but that
fails if the dependent link needs a file assigned that isn't valid until
the head has completed.
Conversely, if the same chain is performed but the fixed file slot is
already valid, then we would be unexpectedly returning data from the
old file slot rather than the newly opened one. Make sure we're
consistent here.
Allow deferral of file setup, which makes this documented case work.
Cc: stable(a)vger.kernel.org # v5.15+
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
---
fs/io-wq.h | 1 +
fs/io_uring.c | 35 +++++++++++++++++++++++++++--------
2 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/fs/io-wq.h b/fs/io-wq.h
index dbecd27656c7..04d374e65e54 100644
--- a/fs/io-wq.h
+++ b/fs/io-wq.h
@@ -155,6 +155,7 @@ struct io_wq_work_node *wq_stack_extract(struct io_wq_work_node *stack)
struct io_wq_work {
struct io_wq_work_node list;
unsigned flags;
+ int fd;
};
static inline struct io_wq_work *wq_next_work(struct io_wq_work *work)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d9b4b3a71a0f..c2118b07640b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7237,6 +7237,21 @@ static void io_clean_op(struct io_kiocb *req)
req->flags &= ~IO_REQ_CLEAN_FLAGS;
}
+static bool io_assign_file(struct io_kiocb *req, bool locked)
+{
+ if (req->file || !io_op_defs[req->opcode].needs_file)
+ return true;
+
+ req->file = io_file_get(req->ctx, req, req->work.fd,
+ req->flags & REQ_F_FIXED_FILE, locked);
+ if (req->file)
+ return true;
+
+ req_set_fail(req);
+ req->result = -EBADF;
+ return false;
+}
+
static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
{
const struct cred *creds = NULL;
@@ -7247,6 +7262,8 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
if (!io_op_defs[req->opcode].audit_skip)
audit_uring_entry(req->opcode);
+ if (unlikely(!io_assign_file(req, !(issue_flags & IO_URING_F_UNLOCKED))))
+ return -EBADF;
switch (req->opcode) {
case IORING_OP_NOP:
@@ -7391,10 +7408,11 @@ static struct io_wq_work *io_wq_free_work(struct io_wq_work *work)
static void io_wq_submit_work(struct io_wq_work *work)
{
struct io_kiocb *req = container_of(work, struct io_kiocb, work);
+ const struct io_op_def *def = &io_op_defs[req->opcode];
unsigned int issue_flags = IO_URING_F_UNLOCKED;
bool needs_poll = false;
struct io_kiocb *timeout;
- int ret = 0;
+ int ret = 0, err = -ECANCELED;
/* one will be dropped by ->io_free_work() after returning to io-wq */
if (!(req->flags & REQ_F_REFCOUNT))
@@ -7406,14 +7424,18 @@ static void io_wq_submit_work(struct io_wq_work *work)
if (timeout)
io_queue_linked_timeout(timeout);
+ if (!io_assign_file(req, false)) {
+ err = -EBADF;
+ work->flags |= IO_WQ_WORK_CANCEL;
+ }
+
/* either cancelled or io-wq is dying, so don't touch tctx->iowq */
if (work->flags & IO_WQ_WORK_CANCEL) {
- io_req_task_queue_fail(req, -ECANCELED);
+ io_req_task_queue_fail(req, err);
return;
}
if (req->flags & REQ_F_FORCE_ASYNC) {
- const struct io_op_def *def = &io_op_defs[req->opcode];
bool opcode_poll = def->pollin || def->pollout;
if (opcode_poll && file_can_poll(req->file)) {
@@ -7751,6 +7773,8 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
if (io_op_defs[opcode].needs_file) {
struct io_submit_state *state = &ctx->submit_state;
+ req->work.fd = READ_ONCE(sqe->fd);
+
/*
* Plug now if we have more than 2 IO left after this, and the
* target is potentially a read/write to block based storage.
@@ -7760,11 +7784,6 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
state->need_plug = false;
blk_start_plug_nr_ios(&state->plug, state->submit_nr);
}
-
- req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
- (sqe_flags & IOSQE_FIXED_FILE), true);
- if (unlikely(!req->file))
- return -EBADF;
}
personality = READ_ONCE(sqe->personality);
--
2.35.1
This is a leftover from the really old days where we weren't able to
track and error early if we need a file and it wasn't assigned. Kill
the check.
Cc: stable(a)vger.kernel.org # v5.15+
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
---
fs/io_uring.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index a8413f006417..9108c56bff5b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4513,9 +4513,6 @@ static int io_fsync_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
{
struct io_ring_ctx *ctx = req->ctx;
- if (!req->file)
- return -EBADF;
-
if (unlikely(ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;
if (unlikely(sqe->addr || sqe->ioprio || sqe->buf_index ||
--
2.35.1
When config pernode, the behavior of 1G hugepage is different
from 2M hugepage, patch 1 will fix this. To avoid printing
useless information, __setup() is modified to always return'1'.
v1->v2:
Split "return 1" into a single patch as suggested by Mike.
Peng Liu (2):
hugetlb: Fix hugepages_setup when deal with pernode
hugetlb: Fix return value of __setup handlers
mm/hugetlb.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
--
2.18.0.huawei.25
The bug is here:
if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
return cstate;
The list iterator value 'cstate' will *always* be set and non-NULL
by list_for_each_entry_from_reverse(), so it is incorrect to assume
that the iterator value will be unchanged if the list is empty or no
element is found (In fact, it will be a bogus pointer to an invalid
structure object containing the HEAD). Also it missed a NULL check
at callsite and may lead to invalid memory access after that.
To fix this bug, just return 'encoder' when found, otherwise return
NULL. And add the NULL check.
Cc: stable(a)vger.kernel.org
Fixes: 1f7f3d91ad38a ("drm/nouveau/clk: Respect voltage limits in nvkm_cstate_prog")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
index 57199be082fd..c2b5cc5f97ed 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c
@@ -135,10 +135,10 @@ nvkm_cstate_find_best(struct nvkm_clk *clk, struct nvkm_pstate *pstate,
list_for_each_entry_from_reverse(cstate, &pstate->list, head) {
if (nvkm_cstate_valid(clk, cstate, max_volt, clk->temp))
- break;
+ return cstate;
}
- return cstate;
+ return NULL;
}
static struct nvkm_cstate *
@@ -169,6 +169,8 @@ nvkm_cstate_prog(struct nvkm_clk *clk, struct nvkm_pstate *pstate, int cstatei)
if (!list_empty(&pstate->list)) {
cstate = nvkm_cstate_get(clk, pstate, cstatei);
cstate = nvkm_cstate_find_best(clk, pstate, cstate);
+ if (!cstate)
+ return -EINVAL;
} else {
cstate = &pstate->base;
}
--
2.17.1
From: Toke Høiland-Jørgensen <toke(a)redhat.com>
The ieee80211_tx_info_clear_status() helper also clears the rate counts and
the driver-private part of struct ieee80211_tx_info, so using it breaks
quite a few other things. So back out of using it, and instead define a
ath-internal helper that only clears the area between the
status_driver_data and the rates info. Combined with moving the
ath_frame_info struct to status_driver_data, this avoids clearing anything
we shouldn't be, and so we can keep the existing code for handling the rate
information.
While fixing this I also noticed that the setting of
tx_info->status.rates[tx_rateindex].count on hardware underrun errors was
always immediately overridden by the normal setting of the same fields, so
rearrange the code so that the underrun detection actually takes effect.
The new helper could be generalised to a 'memset_between()' helper, but
leave it as a driver-internal helper for now since this needs to go to
stable.
Cc: stable(a)vger.kernel.org
Reported-by: Peter Seiderer <ps.report(a)gmx.net>
Fixes: 037250f0a45c ("ath9k: Properly clear TX status area before reporting to mac80211")
Signed-off-by: Toke Høiland-Jørgensen <toke(a)redhat.com>
---
drivers/net/wireless/ath/ath9k/xmit.c | 30 ++++++++++++++++++---------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index cbcf96ac303e..db83cc4ba810 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -141,8 +141,8 @@ static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
{
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
BUILD_BUG_ON(sizeof(struct ath_frame_info) >
- sizeof(tx_info->rate_driver_data));
- return (struct ath_frame_info *) &tx_info->rate_driver_data[0];
+ sizeof(tx_info->status.status_driver_data));
+ return (struct ath_frame_info *) &tx_info->status.status_driver_data[0];
}
static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno)
@@ -2542,6 +2542,16 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
spin_unlock_irqrestore(&sc->tx.txbuflock, flags);
}
+static void ath_clear_tx_status(struct ieee80211_tx_info *tx_info)
+{
+ void *ptr = &tx_info->status;
+
+ memset(ptr + sizeof(tx_info->status.rates), 0,
+ sizeof(tx_info->status) -
+ sizeof(tx_info->status.rates) -
+ sizeof(tx_info->status.status_driver_data));
+}
+
static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
struct ath_tx_status *ts, int nframes, int nbad,
int txok)
@@ -2553,7 +2563,7 @@ static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
struct ath_hw *ah = sc->sc_ah;
u8 i, tx_rateindex;
- ieee80211_tx_info_clear_status(tx_info);
+ ath_clear_tx_status(tx_info);
if (txok)
tx_info->status.ack_signal = ts->ts_rssi;
@@ -2569,6 +2579,13 @@ static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
tx_info->status.ampdu_len = nframes;
tx_info->status.ampdu_ack_len = nframes - nbad;
+ tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
+
+ for (i = tx_rateindex + 1; i < hw->max_rates; i++) {
+ tx_info->status.rates[i].count = 0;
+ tx_info->status.rates[i].idx = -1;
+ }
+
if ((ts->ts_status & ATH9K_TXERR_FILT) == 0 &&
(tx_info->flags & IEEE80211_TX_CTL_NO_ACK) == 0) {
/*
@@ -2590,13 +2607,6 @@ static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
tx_info->status.rates[tx_rateindex].count =
hw->max_rate_tries;
}
-
- for (i = tx_rateindex + 1; i < hw->max_rates; i++) {
- tx_info->status.rates[i].count = 0;
- tx_info->status.rates[i].idx = -1;
- }
-
- tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
}
static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
--
2.35.1
The patch titled
Subject: highmem: fix checks in __kmap_local_sched_{in,out}
has been added to the -mm tree. Its filename is
highmem-fix-checks-in-__kmap_local_sched_inout.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/highmem-fix-checks-in-__kmap_loca…
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/highmem-fix-checks-in-__kmap_loca…
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Max Filippov <jcmvbkbc(a)gmail.com>
Subject: highmem: fix checks in __kmap_local_sched_{in,out}
When CONFIG_DEBUG_KMAP_LOCAL is enabled __kmap_local_sched_{in,out} check
that even slots in the tsk->kmap_ctrl.pteval are unmapped. The slots are
initialized with 0 value, but the check is done with pte_none. 0 pte
however does not necessarily mean that pte_none will return true. e.g.
on xtensa it returns false, resulting in the following runtime warnings:
WARNING: CPU: 0 PID: 101 at mm/highmem.c:627 __kmap_local_sched_out+0x51/0x108
CPU: 0 PID: 101 Comm: touch Not tainted 5.17.0-rc7-00010-gd3a1cdde80d2-dirty #13
Call Trace:
dump_stack+0xc/0x40
__warn+0x8f/0x174
warn_slowpath_fmt+0x48/0xac
__kmap_local_sched_out+0x51/0x108
__schedule+0x71a/0x9c4
preempt_schedule_irq+0xa0/0xe0
common_exception_return+0x5c/0x93
do_wp_page+0x30e/0x330
handle_mm_fault+0xa70/0xc3c
do_page_fault+0x1d8/0x3c4
common_exception+0x7f/0x7f
WARNING: CPU: 0 PID: 101 at mm/highmem.c:664 __kmap_local_sched_in+0x50/0xe0
CPU: 0 PID: 101 Comm: touch Tainted: G W 5.17.0-rc7-00010-gd3a1cdde80d2-dirty #13
Call Trace:
dump_stack+0xc/0x40
__warn+0x8f/0x174
warn_slowpath_fmt+0x48/0xac
__kmap_local_sched_in+0x50/0xe0
finish_task_switch$isra$0+0x1ce/0x2f8
__schedule+0x86e/0x9c4
preempt_schedule_irq+0xa0/0xe0
common_exception_return+0x5c/0x93
do_wp_page+0x30e/0x330
handle_mm_fault+0xa70/0xc3c
do_page_fault+0x1d8/0x3c4
common_exception+0x7f/0x7f
Fix it by replacing !pte_none(pteval) with pte_val(pteval) != 0.
Link: https://lkml.kernel.org/r/20220403235159.3498065-1-jcmvbkbc@gmail.com
Fixes: 5fbda3ecd14a ("sched: highmem: Store local kmaps in task struct")
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
Reviewed-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: "Peter Zijlstra (Intel)" <peterz(a)infradead.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
mm/highmem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/highmem.c~highmem-fix-checks-in-__kmap_local_sched_inout
+++ a/mm/highmem.c
@@ -624,7 +624,7 @@ void __kmap_local_sched_out(void)
/* With debug all even slots are unmapped and act as guard */
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
- WARN_ON_ONCE(!pte_none(pteval));
+ WARN_ON_ONCE(pte_val(pteval) != 0);
continue;
}
if (WARN_ON_ONCE(pte_none(pteval)))
@@ -661,7 +661,7 @@ void __kmap_local_sched_in(void)
/* With debug all even slots are unmapped and act as guard */
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
- WARN_ON_ONCE(!pte_none(pteval));
+ WARN_ON_ONCE(pte_val(pteval) != 0);
continue;
}
if (WARN_ON_ONCE(pte_none(pteval)))
_
Patches currently in -mm which might be from jcmvbkbc(a)gmail.com are
highmem-fix-checks-in-__kmap_local_sched_inout.patch
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2e8e79c416aae1de224c0f1860f2e3350fa171f8 Mon Sep 17 00:00:00 2001
From: Marc Kleine-Budde <mkl(a)pengutronix.de>
Date: Thu, 17 Mar 2022 08:57:35 +0100
Subject: [PATCH] can: m_can: m_can_tx_handler(): fix use after free of skb
can_put_echo_skb() will clone skb then free the skb. Move the
can_put_echo_skb() for the m_can version 3.0.x directly before the
start of the xmit in hardware, similar to the 3.1.x branch.
Fixes: 80646733f11c ("can: m_can: update to support CAN FD features")
Link: https://lore.kernel.org/all/20220317081305.739554-1-mkl@pengutronix.de
Cc: stable(a)vger.kernel.org
Reported-by: Hangyu Hua <hbh25y(a)gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl(a)pengutronix.de>
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 1a4b56f6fa8c..b3b5bc1c803b 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1637,8 +1637,6 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
if (err)
goto out_fail;
- can_put_echo_skb(skb, dev, 0, 0);
-
if (cdev->can.ctrlmode & CAN_CTRLMODE_FD) {
cccr = m_can_read(cdev, M_CAN_CCCR);
cccr &= ~CCCR_CMR_MASK;
@@ -1655,6 +1653,9 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
m_can_write(cdev, M_CAN_CCCR, cccr);
}
m_can_write(cdev, M_CAN_TXBTIE, 0x1);
+
+ can_put_echo_skb(skb, dev, 0, 0);
+
m_can_write(cdev, M_CAN_TXBAR, 0x1);
/* End of xmit function for version 3.0.x */
} else {
Hi, this is your Linux kernel regression tracker.
On 03.04.22 13:22, Michele Ballabio wrote:
>
> I think I hit a regression in 5.16-stable.
> It is difficult to reproduce, and I'm not sure if it's
> still present in 5.17 and/or if it's caused by flaky hardware.
>
> The machine is a Ryzen 5 1600 with AMD graphics (RX 560).
>
> Kernels 5.16.10 do not have the following regression, 5.16.11-16
5.16.11-16 sounds like this is a distro kernel that might or might not
be patched. Or is 11-16 just meant as a range. Could you clarify?
> do. My machine would freeze completely about once a week, no oops in
> the logs, sysrq won't work either. I managed to log only the
> following (and only once) with netconsole, while running kernel 5.16.16.
> I could not reproduce the problem since.
Hmmm. Of course ideally all regressions get fixed, but that beeing said:
5.16 will likely be EOL in round about two weeks anway and getting to
the root of this problem might take some time and effort. That's why I'm
not sure myself what's the best way forward here. Maybe testing 5.17 to
see if the problem still shows up would be good; bisection would help,
but I guess that will be hard here. But I guess there is one thing that
could help: could you maybe decode the panic you have as described in
this document:
https://www.kernel.org/doc/html/latest/admin-guide/reporting-issues.html
Ciao, Thorsten
> ----------
> 4,1490,11865947234,-;ieee80211 phy0: rt2x00usb_watchdog_tx_dma: Warning - TX queue 2 DMA timed out, invoke forced reset
> SUBSYSTEM=ieee80211
> DEVICE=+ieee80211:phy0
> 4,1491,11872348272,-;ieee80211 phy0: rt2x00usb_watchdog_tx_dma: Warning - TX queue 2 DMA timed out, invoke forced reset
> SUBSYSTEM=ieee80211
> DEVICE=+ieee80211:phy0
> 0,1493,12767657117,-;traps: PANIC: double fault, error_code: 0x0
> 4,1494,12767657121,-;double fault: 0000 [#1] PREEMPT SMP NOPTI
> 4,1495,12767657123,-;CPU: 4 PID: 16786 Comm: MediaPD~der #12 Not tainted 5.16.16 #1
> 4,1496,12767657126,-;Hardware name: System manufacturer System Product Name/PRIME B350-PLUS, BIOS 4011 04/19/2018
> 4,1497,12767657127,-;RIP: 0010:entry_SYSCALL_64+0x3/0x29
> 4,1498,12767657133,-;Code: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 0f 01 f8 <65> 48 89 24 25 14 60 00 00 eb 12 0f 20 dc 0f 1f 44 00 00 48 81 e4
> 4,1499,12767657134,-;RSP: 0018:00007f2a8bcbd438 EFLAGS: 00010002
> 4,1500,12767657136,-;RAX: 00000000000000ca RBX: 000000000000005d RCX: 00007f2aa45e8aab
> 4,1501,12767657138,-;RDX: 0000000000000002 RSI: 0000000000000080 RDI: 00007f2aa4400018
> 4,1502,12767657139,-;RBP: 00007f2aa4400018 R08: 0000000000000000 R09: 00007f2a8ed00000
> 4,1503,12767657140,-;R10: 0000000000000000 R11: 0000000000000282 R12: 00000000000000a8
> 4,1504,12767657141,-;R13: 0000000000000003 R14: 0000000000000030 R15: 00007f2aa4400000
> 4,1505,12767657142,-;FS: 00007f2a8bcbe640(0000) GS:ffff8b110ed00000(0000) knlGS:0000000000000000
> 4,1506,12767657143,-;CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> 4,1507,12767657144,-;CR2: 00007f2a8bcbd428 CR3: 00000002953f2000 CR4: 00000000003506e0
> 4,1508,12767657146,-;Call Trace:
> 4,1509,12767657146,-,ncfrag=0/986;Modules linked in: nfnetlink_queue nfnetlink_log nfnetlink bluetooth ecdh_generic ecc netconsole uas usb_storage snd_seq_dummy snd_hrtimer snd_seq snd_seq_device iptable_filter xt_tcpudp ip_tables
> x_tables hwmon_vid 8021q garp mrp stp llc ipv6 fuse rt73usb rt2x00usb rt2x00lib mac80211 hid_logitech cfg80211 joydev hid_generic usbhid hid amdgpu intel_rapl_msr iommu_v2 intel_rapl_common gpu_sched eeepc_wmi asus_wmi drm_ttm_helper
> ttm platform_profile battery drm_kms_helper sparse_keymap edac_mce_amd rfkill drm kvm_amd snd_hda_codec_realtek video snd_hda_codec_generic ledtrig_audio kvm snd_hda_codec_hdmi snd_hda_intel agpgart snd_intel_dspcfg snd_intel_sdw_acpi
> wmi_bmof snd_hda_codec evdev i2c_algo_bit snd_hda_core fb_sys_fops syscopyarea sysfillrect sysimgblt snd_hwdep mfd_core snd_pcm r8169 irqbypass snd_timer realtek snd xhci_pci xhci_pci_renesas xhci_hcd mdio_devres crct10dif_pclmul
> crc32_pclmul i2c_piix4 soundcore ccp libphy ghash_clmulni_intel i2c_co4,1509,12767657146,-,ncfrag=966/986;re rapl k10temp wmi
> 4,1510,12767657189,c; acpi_cpufreq gpio_amdpt button gpio_generic loop [last unloaded: netconsole]
> 4,1511,12767657207,-;------------[ cut here ]------------
> 4,1512,12767657207,-;WARNING: CPU: 4 PID: 16786 at kernel/softirq.c:362 __local_bh_enable_ip+0x43/0x70
> 4,1513,12767657212,-,ncfrag=0/986;Modules linked in: nfnetlink_queue nfnetlink_log nfnetlink bluetooth ecdh_generic ecc netconsole uas usb_storage snd_seq_dummy snd_hrtimer snd_seq snd_seq_device iptable_filter xt_tcpudp ip_tables
> x_tables hwmon_vid 8021q garp mrp stp llc ipv6 fuse rt73usb rt2x00usb rt2x00lib mac80211 hid_logitech cfg80211 joydev hid_generic usbhid hid amdgpu intel_rapl_msr iommu_v2 intel_rapl_common gpu_sched eeepc_wmi asus_wmi drm_ttm_helper
> ttm platform_profile battery drm_kms_helper sparse_keymap edac_mce_amd rfkill drm kvm_amd snd_hda_codec_realtek video snd_hda_codec_generic ledtrig_audio kvm snd_hda_codec_hdmi snd_hda_intel agpgart snd_intel_dspcfg snd_intel_sdw_acpi
> wmi_bmof snd_hda_codec evdev i2c_algo_bit snd_hda_core fb_sys_fops syscopyarea sysfillrect sysimgblt snd_hwdep mfd_core snd_pcm r8169 irqbypass snd_timer realtek snd xhci_pci xhci_pci_renesas xhci_hcd mdio_devres crct10dif_pclmul
> crc32_pclmul i2c_piix4 soundcore ccp libphy ghash_clmulni_intel i2c_co4,1513,12767657212,-,ncfrag=966/986;re rapl k10temp wmi
> 4,1514,12767657248,c; acpi_cpufreq gpio_amdpt button gpio_generic loop [last unloaded: netconsole]
> 4,1515,12767657252,-;CPU: 4 PID: 16786 Comm: MediaPD~der #12 Not tainted 5.16.16 #1
> 4,1516,12767657254,-;Hardware name: System manufacturer System Product Name/PRIME B350-PLUS, BIOS 4011 04/19/2018
> 4,1517,12767657255,-;RIP: 0010:__local_bh_enable_ip+0x43/0x70
> 4,1518,12767657257,-;Code: 01 35 61 1d f3 7d 65 8b 05 5a 1d f3 7d a9 00 ff ff 00 74 1a bf 01 00 00 00 e8 99 b5 02 00 65 8b 05 42 1d f3 7d 85 c0 74 25 c3 <0f> 0b eb cc 48 c7 c7 d9 53 42 83 e8 4d ec a6 00 65 66 8b 05 25 19
> 4,1519,12767657259,-;RSP: 0018:fffffe00000f69a0 EFLAGS: 00010006
> 4,1520,12767657260,-;RAX: 0000000080110203 RBX: ffff8b0e05bd2000 RCX: ffff8b0e05bd2000
> 4,1521,12767657261,-;RDX: ffff8b0e0ac28000 RSI: 0000000000000201 RDI: ffffffffc12f12c3
> 4,1522,12767657262,-;RBP: ffff8b0e0c977a30 R08: fffffe00000f69e8 R09: ffff8b0e0d085000
> 4,1523,12767657263,-;R10: ffff8b0e03234300 R11: 0000000000000fff R12: ffff8b0e0d0850d0
> 4,1524,12767657264,-;R13: fffffe00000f69e8 R14: ffff8b0e0ddfc980 R15: ffff8b0e0d085a58
> 4,1525,12767657265,-;FS: 00007f2a8bcbe640(0000) GS:ffff8b110ed00000(0000) knlGS:0000000000000000
> 4,1526,12767657266,-;CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> ----------
>
>
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: d39268ad24c0fd0665d0c5cf55a7c1a0ebf94766
Gitweb: https://git.kernel.org/tip/d39268ad24c0fd0665d0c5cf55a7c1a0ebf94766
Author: Dave Hansen <dave.hansen(a)linux.intel.com>
AuthorDate: Fri, 18 Mar 2022 06:52:59 -07:00
Committer: Borislav Petkov <bp(a)suse.de>
CommitterDate: Mon, 04 Apr 2022 19:41:36 +02:00
x86/mm/tlb: Revert retpoline avoidance approach
0day reported a regression on a microbenchmark which is intended to
stress the TLB flushing path:
https://lore.kernel.org/all/20220317090415.GE735@xsang-OptiPlex-9020/
It pointed at a commit from Nadav which intended to remove retpoline
overhead in the TLB flushing path by taking the 'cond'-ition in
on_each_cpu_cond_mask(), pre-calculating it, and incorporating it into
'cpumask'. That allowed the code to use a bunch of earlier direct
calls instead of later indirect calls that need a retpoline.
But, in practice, threads can go idle (and into lazy TLB mode where
they don't need to flush their TLB) between the early and late calls.
It works in this direction and not in the other because TLB-flushing
threads tend to hold mmap_lock for write. Contention on that lock
causes threads to _go_ idle right in this early/late window.
There was not any performance data in the original commit specific
to the retpoline overhead. I did a few tests on a system with
retpolines:
https://lore.kernel.org/all/dd8be93c-ded6-b962-50d4-96b1c3afb2b7@intel.com/
which showed a possible small win. But, that small win pales in
comparison with the bigger loss induced on non-retpoline systems.
Revert the patch that removed the retpolines. This was not a
clean revert, but it was self-contained enough not to be too painful.
Fixes: 6035152d8eeb ("x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()")
Reported-by: kernel test robot <oliver.sang(a)intel.com>
Signed-off-by: Dave Hansen <dave.hansen(a)linux.intel.com>
Signed-off-by: Borislav Petkov <bp(a)suse.de>
Acked-by: Nadav Amit <namit(a)vmware.com>
Cc: <stable(a)vger.kernel.org>
Link: https://lkml.kernel.org/r/164874672286.389.7021457716635788197.tip-bot2@tip…
---
arch/x86/mm/tlb.c | 37 +++++--------------------------------
1 file changed, 5 insertions(+), 32 deletions(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 6eb4d91..d400b6d 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -855,13 +855,11 @@ done:
nr_invalidate);
}
-static bool tlb_is_not_lazy(int cpu)
+static bool tlb_is_not_lazy(int cpu, void *data)
{
return !per_cpu(cpu_tlbstate_shared.is_lazy, cpu);
}
-static DEFINE_PER_CPU(cpumask_t, flush_tlb_mask);
-
DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state_shared, cpu_tlbstate_shared);
EXPORT_PER_CPU_SYMBOL(cpu_tlbstate_shared);
@@ -890,36 +888,11 @@ STATIC_NOPV void native_flush_tlb_multi(const struct cpumask *cpumask,
* up on the new contents of what used to be page tables, while
* doing a speculative memory access.
*/
- if (info->freed_tables) {
+ if (info->freed_tables)
on_each_cpu_mask(cpumask, flush_tlb_func, (void *)info, true);
- } else {
- /*
- * Although we could have used on_each_cpu_cond_mask(),
- * open-coding it has performance advantages, as it eliminates
- * the need for indirect calls or retpolines. In addition, it
- * allows to use a designated cpumask for evaluating the
- * condition, instead of allocating one.
- *
- * This code works under the assumption that there are no nested
- * TLB flushes, an assumption that is already made in
- * flush_tlb_mm_range().
- *
- * cond_cpumask is logically a stack-local variable, but it is
- * more efficient to have it off the stack and not to allocate
- * it on demand. Preemption is disabled and this code is
- * non-reentrant.
- */
- struct cpumask *cond_cpumask = this_cpu_ptr(&flush_tlb_mask);
- int cpu;
-
- cpumask_clear(cond_cpumask);
-
- for_each_cpu(cpu, cpumask) {
- if (tlb_is_not_lazy(cpu))
- __cpumask_set_cpu(cpu, cond_cpumask);
- }
- on_each_cpu_mask(cond_cpumask, flush_tlb_func, (void *)info, true);
- }
+ else
+ on_each_cpu_cond_mask(tlb_is_not_lazy, flush_tlb_func,
+ (void *)info, 1, cpumask);
}
void flush_tlb_multi(const struct cpumask *cpumask,
stable-rc/linux-4.19.y build: 204 builds: 20 failed, 184 passed, 525 errors, 50 warnings (v4.19.237-257-g4e89415127311)
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.19.y/kernel/v4.19.237-2…
Tree: stable-rc
Branch: linux-4.19.y
Git Describe: v4.19.237-257-g4e89415127311
Git Commit: 4e89415127311b78dfd058c48dd87e92ab4e2c0c
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Built: 7 unique architectures
Build Failures Detected:
arc:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
arm:
allnoconfig: (gcc-10) FAIL
mps2_defconfig: (gcc-10) FAIL
rpc_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
xcep_defconfig: (gcc-10) FAIL
i386:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
mips:
allnoconfig: (gcc-10) FAIL
ip27_defconfig: (gcc-10) FAIL
ip28_defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
riscv:
allnoconfig: (gcc-10) FAIL
defconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
x86_64:
allnoconfig: (gcc-10) FAIL
tinyconfig: (gcc-10) FAIL
Errors and Warnings Detected:
arc:
allnoconfig (gcc-10): 18 errors
tinyconfig (gcc-10): 18 errors
arm64:
allnoconfig (gcc-10): 22 errors
defconfig (gcc-10): 3 warnings
defconfig+arm64-chromebook (gcc-10): 3 warnings
tinyconfig (gcc-10): 34 errors
arm:
allnoconfig (gcc-10): 26 errors
mps2_defconfig (gcc-10): 40 errors
omap1_defconfig (gcc-10): 1 warning
rpc_defconfig (gcc-10): 2 errors
tinyconfig (gcc-10): 40 errors
xcep_defconfig (gcc-10): 20 errors
i386:
allnoconfig (gcc-10): 44 errors, 3 warnings
i386_defconfig (gcc-10): 2 warnings
tinyconfig (gcc-10): 43 errors, 3 warnings
mips:
allnoconfig (gcc-10): 26 errors
lemote2f_defconfig (gcc-10): 1 warning
loongson3_defconfig (gcc-10): 1 warning
malta_qemu_32r6_defconfig (gcc-10): 1 warning
mtx1_defconfig (gcc-10): 3 warnings
nlm_xlp_defconfig (gcc-10): 1 warning
tinyconfig (gcc-10): 26 errors
riscv:
allnoconfig (gcc-10): 54 errors
tinyconfig (gcc-10): 54 errors
x86_64:
allnoconfig (gcc-10): 29 errors, 11 warnings
tinyconfig (gcc-10): 29 errors, 11 warnings
x86_64_defconfig (gcc-10): 3 warnings
x86_64_defconfig+x86-chromebook (gcc-10): 3 warnings
Errors summary:
172 include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
35 include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
35 include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
35 include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
35 include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
10 include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
10 arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
10 arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
10 arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
10 arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
8 include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
8 include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
6 arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
6 arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
4 include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
4 include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
4 include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
4 include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
4 include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
1 arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
1 arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
Warnings summary:
10 include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
6 aarch64-linux-gnu-ld: warning: -z norelro ignored
4 arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
4 arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
3 ld: warning: creating DT_TEXTREL in a PIE
2 sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
2 net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
2 ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
1 {standard input}:132: Warning: macro instruction expanded into multiple instructions
1 sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
1 net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
1 drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
================================================================================
Detailed per-defconfig build reports:
--------------------------------------------------------------------------------
32r2el_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
acs5k_tiny_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
allnoconfig (arm, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (arm64, gcc-10) — FAIL, 22 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
allnoconfig (arc, gcc-10) — FAIL, 18 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
allnoconfig (x86_64, gcc-10) — FAIL, 29 errors, 11 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
allnoconfig (i386, gcc-10) — FAIL, 44 errors, 3 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
allnoconfig (mips, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
am200epdkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ar7_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
aspeed_g5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
assabet_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
at91_dt_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath25_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ath79_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axm55xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
axs103_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
badge4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm2835_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm47xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bcm63xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bigsur_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_be_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
bmips_stb_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
capcella_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cavium_octeon_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cerfcube_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ci20_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x2xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cm_x300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
cobalt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
colibri_pxa300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
collie_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
corgi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
davinci_all_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
db1xxx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
decstation_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
defconfig (riscv, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
defconfig+arm64-chromebook (arm64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
aarch64-linux-gnu-ld: warning: -z norelro ignored
--------------------------------------------------------------------------------
dove_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
e55_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ebsa110_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
efm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
em_x270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ep93xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
eseries_pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
exynos_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ezx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
footbridge_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
fuloong2e_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gcw0_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gemini_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
gpr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h3600_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
h5000_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hackkit_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
haps_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hisi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
hsdk_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
i386_defconfig (i386, gcc-10) — PASS, 0 errors, 2 warnings, 0 section mismatches
Warnings:
ld: arch/x86/boot/compressed/head_32.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
imote2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v4_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
imx_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
integrator_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop32x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
iop33x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip22_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip27_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip28_defconfig (mips, gcc-10) — FAIL, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ip32_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ixp4xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jazz_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jmr3927_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
jornada720_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
keystone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
ks8695_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lasat_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lemote2f_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
loongson1b_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson1c_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
loongson3_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1328 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
lpc18xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpc32xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lpd270_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
lubbock_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
magician_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mainstone_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_kvm_guest_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
malta_qemu_32r6_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
{standard input}:132: Warning: macro instruction expanded into multiple instructions
--------------------------------------------------------------------------------
maltaaprp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltasmvp_eva_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
maltaup_xpa_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
markeins_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mini2440_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mips_paravirt_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mmp2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
moxart_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mpc30x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mps2_defconfig (arm, gcc-10) — FAIL, 40 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
msp71xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mtx1_defconfig (mips, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:658:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
sound/pci/echoaudio/echoaudio_dsp.c:647:9: warning: iteration 1073741824 invokes undefined behavior [-Waggressive-loop-optimizations]
--------------------------------------------------------------------------------
multi_v4t_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
multi_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mvebu_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
mxs_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
neponset_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netwinder_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
netx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nhk8815_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nlm_xlp_defconfig (mips, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
net/core/rtnetlink.c:3199:1: warning: the frame size of 1344 bytes is larger than 1024 bytes [-Wframe-larger-than=]
--------------------------------------------------------------------------------
nlm_xlr_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsim_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nsimosci_hs_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc950_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
nuc960_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omap1_defconfig (arm, gcc-10) — PASS, 0 errors, 1 warning, 0 section mismatches
Warnings:
drivers/gpio/gpio-omap.c:1233:34: warning: array ‘omap_gpio_match’ assumed to have one element
--------------------------------------------------------------------------------
omap2plus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
omega2p_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
orion5x_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
oxnas_v6_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
palmz72_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pcm027_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pic32mzda_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pistachio_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pleb_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pnx8335_stb225_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
prima2_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa168_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa255-idp_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa910_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
pxa_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qcom_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
qi_lb60_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
raumfeld_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rb532_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rbtx49xx_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
realview_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rm200_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
rpc_defconfig (arm, gcc-10) — FAIL, 2 errors, 0 warnings, 0 section mismatches
Errors:
arm-linux-gnueabihf-gcc: error: unrecognized -march target: armv3
arm-linux-gnueabihf-gcc: error: missing argument to ‘-march=’
--------------------------------------------------------------------------------
rt305x_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c2410_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s3c6400_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
s5pv210_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sama5_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sb1250_swarm_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shannon_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
shmobile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
simpad_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
socfpga_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear13xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear3xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spear6xx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
spitz_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
stm32_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
sunxi_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tango4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0219_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0226_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tb0287_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tct_hammer_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tegra_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
tinyconfig (i386, gcc-10) — FAIL, 43 errors, 3 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
--------------------------------------------------------------------------------
tinyconfig (arc, gcc-10) — FAIL, 18 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:145:2: error: unknown type name 'softirq_done_fn'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:20: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:309:29: error: 'MQ_RQ_IN_FLIGHT' undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: 'MQ_RQ_COMPLETE' undeclared (first use in this function)
include/linux/blk-mq.h:319:22: error: invalid application of 'sizeof' to incomplete type 'struct request'
include/linux/blk-mq.h:323:12: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:336:8: error: invalid use of undefined type 'struct request'
include/linux/blk-mq.h:337:5: error: invalid use of undefined type 'struct request'
--------------------------------------------------------------------------------
tinyconfig (arm, gcc-10) — FAIL, 40 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (arm64, gcc-10) — FAIL, 34 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (mips, gcc-10) — FAIL, 26 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
tinyconfig (x86_64, gcc-10) — FAIL, 29 errors, 11 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:62:18: error: field ‘kobj’ has incomplete type
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/asm-generic/atomic-instrumented.h:421:37: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:87:13: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/x86/include/asm/cmpxchg.h:88:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:89:13: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
arch/x86/include/asm/cmpxchg.h:149:34: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
Warnings:
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
include/asm-generic/atomic-instrumented.h:421:20: warning: passing argument 1 of ‘kasan_check_write’ makes pointer from integer without a cast [-Wint-conversion]
arch/x86/include/asm/cmpxchg.h:93:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:102:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:111:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
arch/x86/include/asm/cmpxchg.h:120:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
--------------------------------------------------------------------------------
tinyconfig (riscv, gcc-10) — FAIL, 54 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
arch/riscv/include/asm/cmpxchg.h:326:41: error: invalid type argument of unary ‘*’ (have ‘int’)
arch/riscv/include/asm/cmpxchg.h:338:41: error: invalid type argument of unary ‘*’ (have ‘int’)
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
trizeps4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u300_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
u8500_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vdk_hs38_smp_defconfig (arc, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
versatile_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vexpress_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vf610m4_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
viper_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vocore2_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
vt8500_v6_v7_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
workpad_defconfig (mips, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
x86_64_defconfig (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
x86_64_defconfig+x86-chromebook (x86_64, gcc-10) — PASS, 0 errors, 3 warnings, 0 section mismatches
Warnings:
arch/x86/entry/entry_64.S:1738: Warning: no instruction mnemonic suffix given and no register operands; using default for `sysret'
ld: arch/x86/boot/compressed/head_64.o: warning: relocation in read-only section `.head.text'
ld: warning: creating DT_TEXTREL in a PIE
--------------------------------------------------------------------------------
xcep_defconfig (arm, gcc-10) — FAIL, 20 errors, 0 warnings, 0 section mismatches
Errors:
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:145:2: error: unknown type name ‘softirq_done_fn’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:309:29: error: ‘MQ_RQ_IN_FLIGHT’ undeclared (first use in this function)
include/linux/blk-mq.h:309:46: error: ‘MQ_RQ_COMPLETE’ undeclared (first use in this function)
include/linux/blk-mq.h:309:20: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:319:22: error: invalid application of ‘sizeof’ to incomplete type ‘struct request’
include/linux/blk-mq.h:323:12: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:336:8: error: invalid use of undefined type ‘struct request’
include/linux/blk-mq.h:337:5: error: invalid use of undefined type ‘struct request’
--------------------------------------------------------------------------------
zeus_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
--------------------------------------------------------------------------------
zx_defconfig (arm, gcc-10) — PASS, 0 errors, 0 warnings, 0 section mismatches
---
For more info write to <info(a)kernelci.org>
commit 2a8859f373b0a86f0ece8ec8312607eacf12485d upstream.
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle any exception correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/mmu/paging_tmpl.h | 77 ++++++++++++++++------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 708a5d297fe1..c005905f2852 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ int r = -EFAULT;
- return (ret != orig_pte);
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "mov $0, %[r]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "+q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "movl $0, %[r]\n"
+ "jz 2f\n"
+ "incl %[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "+rm" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
+
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
--
2.31.1
commit 2a8859f373b0a86f0ece8ec8312607eacf12485d upstream.
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle any exception correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/paging_tmpl.h | 77 ++++++++++++++++++--------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 97b21e7fd013..13b5c424adb2 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS 4
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,8 +64,10 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 4
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#else
#error Invalid PTTYPE value
#endif
@@ -132,43 +133,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- down_read(¤t->mm->mmap_sem);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- up_read(¤t->mm->mmap_sem);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- up_read(¤t->mm->mmap_sem);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- up_read(¤t->mm->mmap_sem);
- }
+ int r = -EFAULT;
+
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "mov $0, %[r]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "+q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "movl $0, %[r]\n"
+ "jz 2f\n"
+ "incl %[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "+rm" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
- return (ret != orig_pte);
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
--
2.31.1
Commit ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe
controller") introduced a clock imbalance by enabling the pipe clock
both in init() and in post_init() but only disabling in post_deinit().
Note that the pipe clock was also never disabled in the init() error
paths and that enabling the clock before powering up the PHY looks
questionable.
Fixes: ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe controller")
Cc: stable(a)vger.kernel.org # 5.6
Cc: Bjorn Andersson <bjorn.andersson(a)linaro.org>
Signed-off-by: Johan Hovold <johan+linaro(a)kernel.org>
---
Changes in v2
- Capitalise "Fix" in subject line according to PCI subsystem
convention
drivers/pci/controller/dwc/pcie-qcom.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index b79d98e5e228..20a0e6533a1c 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1238,12 +1238,6 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
goto err_disable_clocks;
}
- ret = clk_prepare_enable(res->pipe_clk);
- if (ret) {
- dev_err(dev, "cannot prepare/enable pipe clock\n");
- goto err_disable_clocks;
- }
-
/* Wait for reset to complete, required on SM8450 */
usleep_range(1000, 1500);
--
2.35.1
Linux stable-rc 5.4 branch build breaks on all architecture for allnoconfig.
metadata:
git_describe: v5.4.188-369-ga60d79f382c9
git_repo: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
git_sha: a60d79f382c91dcb19578178a5032af6ccbf4c89
kconfig:allnoconfig
kernel_version: 5.4.189-rc1
target_arch: x86_64
toolchain: gcc-11
In file included from include/linux/blk-cgroup.h:25,
from include/linux/writeback.h:14,
from include/linux/memcontrol.h:22,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/x86/kernel/asm-offsets.c:13:
include/linux/blk-mq.h:62:33: error: field 'kobj' has incomplete type
62 | struct kobject kobj;
| ^~~~
include/linux/blk-mq.h: In function 'blk_mq_rq_from_pdu':
include/linux/blk-mq.h:352:29: error: invalid application of 'sizeof'
to incomplete type 'struct request'
352 | return pdu - sizeof(struct request);
| ^~~~~~
include/linux/blk-mq.h: In function 'blk_mq_rq_to_pdu':
include/linux/blk-mq.h:356:19: error: invalid use of undefined type
'struct request'
356 | return rq + 1;
| ^
include/linux/blk-mq.h: In function 'request_to_qc_t':
include/linux/blk-mq.h:370:15: error: invalid use of undefined type
'struct request'
370 | if (rq->tag != -1)
| ^~
include/linux/blk-mq.h:371:26: error: invalid use of undefined type
'struct request'
371 | return rq->tag | (hctx->queue_num << BLK_QC_T_SHIFT);
| ^~
include/linux/blk-mq.h:373:18: error: invalid use of undefined type
'struct request'
373 | return rq->internal_tag | (hctx->queue_num << BLK_QC_T_SHIFT) |
| ^~
include/linux/blk-mq.h: In function 'blk_mq_cleanup_rq':
include/linux/blk-mq.h:379:15: error: invalid use of undefined type
'struct request'
379 | if (rq->q->mq_ops->cleanup_rq)
| ^~
include/linux/blk-mq.h:380:19: error: invalid use of undefined type
'struct request'
380 | rq->q->mq_ops->cleanup_rq(rq);
| ^~
make[2]: *** [scripts/Makefile.build:99: arch/x86/kernel/asm-offsets.s] Error 1
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
--
Linaro LKFT
https://lkft.linaro.org
[1] https://builds.tuxbuild.com/27KejBvVC9gRN1Yk21Nqn51Ptv6/
commit 2a8859f373b0a86f0ece8ec8312607eacf12485d upstream.
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle any exception correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/mmu/paging_tmpl.h | 77 ++++++++++++++++------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 913d52a7923e..a1811f51eda9 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ int r = -EFAULT;
+
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "mov $0, %[r]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "+q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "movl $0, %[r]\n"
+ "jz 2f\n"
+ "incl %[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "+rm" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
- return (ret != orig_pte);
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
--
2.31.1
commit 2a8859f373b0a86f0ece8ec8312607eacf12485d upstream.
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle any exception correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
---
arch/x86/kvm/mmu/paging_tmpl.h | 77 ++++++++++++++++------------------
1 file changed, 37 insertions(+), 40 deletions(-)
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 50e268eb8e1a..5b54247f4de4 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,39 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ int r = -EFAULT;
+
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "mov $0, %[r]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "+q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "movl $0, %[r]\n"
+ "jz 2f\n"
+ "incl %[r]\n"
+ "2:"
+ _ASM_EXTABLE_UA(1b, 2b)
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "+rm" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
- return (ret != orig_pte);
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
--
2.31.1
To fix a coverity complain, commit d5ac07dfbd2b
("qed: Initialize debug string array") removed "sw-platform"
(one of the common global parameters) from the dump as this
was used in the dump with an uninitialized string, however
it did not reduce the number of common global parameters
which caused the incorrect (unable to parse) register dump
this patch fixes it with reducing NUM_COMMON_GLOBAL_PARAMS
bye one.
Cc: stable(a)vger.kernel.org
Cc: Tim Gardner <tim.gardner(a)canonical.com>
Cc: "David S. Miller" <davem(a)davemloft.net>
Fixes: d5ac07dfbd2b ("qed: Initialize debug string array")
Signed-off-by: Prabhakar Kushwaha <pkushwaha(a)marvell.com>
Signed-off-by: Alok Prasad <palok(a)marvell.com>
Signed-off-by: Ariel Elior <aelior(a)marvell.com>
Signed-off-by: Manish Chopra <manishc(a)marvell.com>
---
drivers/net/ethernet/qlogic/qed/qed_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c
index e3edca187ddf..5250d1d1e49c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_debug.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c
@@ -489,7 +489,7 @@ struct split_type_defs {
#define STATIC_DEBUG_LINE_DWORDS 9
-#define NUM_COMMON_GLOBAL_PARAMS 11
+#define NUM_COMMON_GLOBAL_PARAMS 10
#define MAX_RECURSION_DEPTH 10
--
2.35.1.273.ge6ebfd0
Dear Sir/Madam,
My name is Aathif Abdulkhakiq, I am reaching out to you from Oman.
We got your details from one of our suppliers, our company urgently is
in need of your products.
please check our purchase order as attached and quote the price and the
delivery. As the demand from our customers is high.
I await your quotation and proforma invoice.
Thanks & Regards,
Aathif Abdulkhakiq
Assistant Manager / Sales Team
Telephone: (+968) 26884847 | Fax: +968 26880063 | Mobile (+968) 98979008
P.O. Box 614, Al Azaiba P.C. 320, Muscat, Sultanate of Oman
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From ad6dc1daaf29f97f23cc810d60ee01c0e83f4c6b Mon Sep 17 00:00:00 2001
From: Eli Cohen <elic(a)nvidia.com>
Date: Mon, 21 Mar 2022 16:13:03 +0200
Subject: [PATCH] vdpa/mlx5: Avoid processing works if workqueue was destroyed
If mlx5_vdpa gets unloaded while a VM is running, the workqueue will be
destroyed. However, vhost might still have reference to the kick
function and might attempt to push new works. This could lead to null
pointer dereference.
To fix this, set mvdev->wq to NULL just before destroying and verify
that the workqueue is not NULL in mlx5_vdpa_kick_vq before attempting to
push a new work.
Fixes: 5262912ef3cf ("vdpa/mlx5: Add support for control VQ and MAC setting")
Signed-off-by: Eli Cohen <elic(a)nvidia.com>
Link: https://lore.kernel.org/r/20220321141303.9586-1-elic@nvidia.com
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index c0f0ecb82c6f..2f4fb09f1e89 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -1712,7 +1712,7 @@ static void mlx5_vdpa_kick_vq(struct vdpa_device *vdev, u16 idx)
return;
if (unlikely(is_ctrl_vq_idx(mvdev, idx))) {
- if (!mvdev->cvq.ready)
+ if (!mvdev->wq || !mvdev->cvq.ready)
return;
wqent = kzalloc(sizeof(*wqent), GFP_ATOMIC);
@@ -2779,9 +2779,12 @@ static void mlx5_vdpa_dev_del(struct vdpa_mgmt_dev *v_mdev, struct vdpa_device *
struct mlx5_vdpa_mgmtdev *mgtdev = container_of(v_mdev, struct mlx5_vdpa_mgmtdev, mgtdev);
struct mlx5_vdpa_dev *mvdev = to_mvdev(dev);
struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
+ struct workqueue_struct *wq;
mlx5_notifier_unregister(mvdev->mdev, &ndev->nb);
- destroy_workqueue(mvdev->wq);
+ wq = mvdev->wq;
+ mvdev->wq = NULL;
+ destroy_workqueue(wq);
_vdpa_unregister_device(dev);
mgtdev->ndev = NULL;
}
Make the two locations where exportfs helpers check permission to lookup
a given inode idmapped mount aware by switching it to the lookup_one()
helper. This is a bugfix for the open_by_handle_at() system call which
doesn't take idmapped mounts into account currently. It's not tied to a
specific commit so we'll just Cc stable.
In addition this is required to support idmapped base layers in overlay.
The overlay filesystem uses exportfs to encode and decode file handles
for its index=on mount option and when nfs_export=on.
Cc: <stable(a)vger.kernel.org>
Cc: <linux-fsdevel(a)vger.kernel.org>
Tested-by: Giuseppe Scrivano <gscrivan(a)redhat.com>
Reviewed-by: Amir Goldstein <amir73il(a)gmail.com>
Reviewed-by: Christoph Hellwig <hch(a)lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner(a)kernel.org>
---
/* v2 */
unchanged
/* v3 */
unchanged
/* v4 */
unchanged
---
fs/exportfs/expfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index 0106eba46d5a..3ef80d000e13 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -145,7 +145,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
if (err)
goto out_err;
dprintk("%s: found name: %s\n", __func__, nbuf);
- tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf));
+ tmp = lookup_one_unlocked(mnt_user_ns(mnt), nbuf, parent, strlen(nbuf));
if (IS_ERR(tmp)) {
dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
err = PTR_ERR(tmp);
@@ -525,7 +525,8 @@ exportfs_decode_fh_raw(struct vfsmount *mnt, struct fid *fid, int fh_len,
}
inode_lock(target_dir->d_inode);
- nresult = lookup_one_len(nbuf, target_dir, strlen(nbuf));
+ nresult = lookup_one(mnt_user_ns(mnt), nbuf,
+ target_dir, strlen(nbuf));
if (!IS_ERR(nresult)) {
if (unlikely(nresult->d_inode != result->d_inode)) {
dput(nresult);
--
2.32.0
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5039b170369d22613ebc07e81410891f52280a45 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david(a)redhat.com>
Date: Wed, 23 Mar 2022 16:05:23 -0700
Subject: [PATCH] proc/vmcore: fix possible deadlock on concurrent mmap and
read
Lockdep noticed that there is chance for a deadlock if we have concurrent
mmap, concurrent read, and the addition/removal of a callback.
As nicely explained by Boqun:
"Lockdep warned about the above sequences because rw_semaphore is a
fair read-write lock, and the following can cause a deadlock:
TASK 1 TASK 2 TASK 3
====== ====== ======
down_write(mmap_lock);
down_read(vmcore_cb_rwsem)
down_write(vmcore_cb_rwsem); // blocked
down_read(vmcore_cb_rwsem); // cannot get the lock because of the fairness
down_read(mmap_lock); // blocked
IOW, a reader can block another read if there is a writer queued by
the second reader and the lock is fair"
To fix this, convert to srcu to make this deadlock impossible. We need
srcu as our callbacks can sleep. With this change, I cannot trigger any
lockdep warnings.
======================================================
WARNING: possible circular locking dependency detected
5.17.0-0.rc0.20220117git0c947b893d69.68.test.fc36.x86_64 #1 Not tainted
------------------------------------------------------
makedumpfile/542 is trying to acquire lock:
ffffffff832d2eb8 (vmcore_cb_rwsem){.+.+}-{3:3}, at: mmap_vmcore+0x340/0x580
but task is already holding lock:
ffff8880af226438 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x84/0x150
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&mm->mmap_lock#2){++++}-{3:3}:
lock_acquire+0xc3/0x1a0
__might_fault+0x4e/0x70
_copy_to_user+0x1f/0x90
__copy_oldmem_page+0x72/0xc0
read_from_oldmem+0x77/0x1e0
read_vmcore+0x2c2/0x310
proc_reg_read+0x47/0xa0
vfs_read+0x101/0x340
__x64_sys_pread64+0x5d/0xa0
do_syscall_64+0x43/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
-> #0 (vmcore_cb_rwsem){.+.+}-{3:3}:
validate_chain+0x9f4/0x2670
__lock_acquire+0x8f7/0xbc0
lock_acquire+0xc3/0x1a0
down_read+0x4a/0x140
mmap_vmcore+0x340/0x580
proc_reg_mmap+0x3e/0x90
mmap_region+0x504/0x880
do_mmap+0x38a/0x520
vm_mmap_pgoff+0xc1/0x150
ksys_mmap_pgoff+0x178/0x200
do_syscall_64+0x43/0x90
entry_SYSCALL_64_after_hwframe+0x44/0xae
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&mm->mmap_lock#2);
lock(vmcore_cb_rwsem);
lock(&mm->mmap_lock#2);
lock(vmcore_cb_rwsem);
*** DEADLOCK ***
1 lock held by makedumpfile/542:
#0: ffff8880af226438 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x84/0x150
stack backtrace:
CPU: 0 PID: 542 Comm: makedumpfile Not tainted 5.17.0-0.rc0.20220117git0c947b893d69.68.test.fc36.x86_64 #1
Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
Call Trace:
__lock_acquire+0x8f7/0xbc0
lock_acquire+0xc3/0x1a0
down_read+0x4a/0x140
mmap_vmcore+0x340/0x580
proc_reg_mmap+0x3e/0x90
mmap_region+0x504/0x880
do_mmap+0x38a/0x520
vm_mmap_pgoff+0xc1/0x150
ksys_mmap_pgoff+0x178/0x200
do_syscall_64+0x43/0x90
Link: https://lkml.kernel.org/r/20220119193417.100385-1-david@redhat.com
Fixes: cc5f2704c934 ("proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks")
Signed-off-by: David Hildenbrand <david(a)redhat.com>
Reported-by: Baoquan He <bhe(a)redhat.com>
Acked-by: Baoquan He <bhe(a)redhat.com>
Cc: Vivek Goyal <vgoyal(a)redhat.com>
Cc: Dave Young <dyoung(a)redhat.com>
Cc: "Paul E. McKenney" <paulmck(a)kernel.org>
Cc: Josh Triplett <josh(a)joshtriplett.org>
Cc: Peter Zijlstra <peterz(a)infradead.org>
Cc: Boqun Feng <boqun.feng(a)gmail.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
index 702754dd1daf..edeb01dfe05d 100644
--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -62,7 +62,8 @@ core_param(novmcoredd, vmcoredd_disabled, bool, 0);
/* Device Dump Size */
static size_t vmcoredd_orig_sz;
-static DECLARE_RWSEM(vmcore_cb_rwsem);
+static DEFINE_SPINLOCK(vmcore_cb_lock);
+DEFINE_STATIC_SRCU(vmcore_cb_srcu);
/* List of registered vmcore callbacks. */
static LIST_HEAD(vmcore_cb_list);
/* Whether the vmcore has been opened once. */
@@ -70,8 +71,8 @@ static bool vmcore_opened;
void register_vmcore_cb(struct vmcore_cb *cb)
{
- down_write(&vmcore_cb_rwsem);
INIT_LIST_HEAD(&cb->next);
+ spin_lock(&vmcore_cb_lock);
list_add_tail(&cb->next, &vmcore_cb_list);
/*
* Registering a vmcore callback after the vmcore was opened is
@@ -79,14 +80,14 @@ void register_vmcore_cb(struct vmcore_cb *cb)
*/
if (vmcore_opened)
pr_warn_once("Unexpected vmcore callback registration\n");
- up_write(&vmcore_cb_rwsem);
+ spin_unlock(&vmcore_cb_lock);
}
EXPORT_SYMBOL_GPL(register_vmcore_cb);
void unregister_vmcore_cb(struct vmcore_cb *cb)
{
- down_write(&vmcore_cb_rwsem);
- list_del(&cb->next);
+ spin_lock(&vmcore_cb_lock);
+ list_del_rcu(&cb->next);
/*
* Unregistering a vmcore callback after the vmcore was opened is
* very unusual (e.g., forced driver removal), but we cannot stop
@@ -94,7 +95,9 @@ void unregister_vmcore_cb(struct vmcore_cb *cb)
*/
if (vmcore_opened)
pr_warn_once("Unexpected vmcore callback unregistration\n");
- up_write(&vmcore_cb_rwsem);
+ spin_unlock(&vmcore_cb_lock);
+
+ synchronize_srcu(&vmcore_cb_srcu);
}
EXPORT_SYMBOL_GPL(unregister_vmcore_cb);
@@ -103,9 +106,8 @@ static bool pfn_is_ram(unsigned long pfn)
struct vmcore_cb *cb;
bool ret = true;
- lockdep_assert_held_read(&vmcore_cb_rwsem);
-
- list_for_each_entry(cb, &vmcore_cb_list, next) {
+ list_for_each_entry_srcu(cb, &vmcore_cb_list, next,
+ srcu_read_lock_held(&vmcore_cb_srcu)) {
if (unlikely(!cb->pfn_is_ram))
continue;
ret = cb->pfn_is_ram(cb, pfn);
@@ -118,9 +120,9 @@ static bool pfn_is_ram(unsigned long pfn)
static int open_vmcore(struct inode *inode, struct file *file)
{
- down_read(&vmcore_cb_rwsem);
+ spin_lock(&vmcore_cb_lock);
vmcore_opened = true;
- up_read(&vmcore_cb_rwsem);
+ spin_unlock(&vmcore_cb_lock);
return 0;
}
@@ -133,6 +135,7 @@ ssize_t read_from_oldmem(char *buf, size_t count,
unsigned long pfn, offset;
size_t nr_bytes;
ssize_t read = 0, tmp;
+ int idx;
if (!count)
return 0;
@@ -140,7 +143,7 @@ ssize_t read_from_oldmem(char *buf, size_t count,
offset = (unsigned long)(*ppos % PAGE_SIZE);
pfn = (unsigned long)(*ppos / PAGE_SIZE);
- down_read(&vmcore_cb_rwsem);
+ idx = srcu_read_lock(&vmcore_cb_srcu);
do {
if (count > (PAGE_SIZE - offset))
nr_bytes = PAGE_SIZE - offset;
@@ -165,7 +168,7 @@ ssize_t read_from_oldmem(char *buf, size_t count,
offset, userbuf);
}
if (tmp < 0) {
- up_read(&vmcore_cb_rwsem);
+ srcu_read_unlock(&vmcore_cb_srcu, idx);
return tmp;
}
@@ -176,8 +179,8 @@ ssize_t read_from_oldmem(char *buf, size_t count,
++pfn;
offset = 0;
} while (count);
+ srcu_read_unlock(&vmcore_cb_srcu, idx);
- up_read(&vmcore_cb_rwsem);
return read;
}
@@ -568,18 +571,18 @@ static int vmcore_remap_oldmem_pfn(struct vm_area_struct *vma,
unsigned long from, unsigned long pfn,
unsigned long size, pgprot_t prot)
{
- int ret;
+ int ret, idx;
/*
- * Check if oldmem_pfn_is_ram was registered to avoid
- * looping over all pages without a reason.
+ * Check if a callback was registered to avoid looping over all
+ * pages without a reason.
*/
- down_read(&vmcore_cb_rwsem);
+ idx = srcu_read_lock(&vmcore_cb_srcu);
if (!list_empty(&vmcore_cb_list))
ret = remap_oldmem_pfn_checked(vma, from, pfn, size, prot);
else
ret = remap_oldmem_pfn_range(vma, from, pfn, size, prot);
- up_read(&vmcore_cb_rwsem);
+ srcu_read_unlock(&vmcore_cb_srcu, idx);
return ret;
}
On 02.04.22 03:33, liupeng (DM) wrote:
>
> On 2022/4/1 18:46, David Hildenbrand wrote:
>> On 01.04.22 12:12, Peng Liu wrote:
>>> When __setup() return '0', using invalid option values causes the
>>> entire kernel boot option string to be reported as Unknown. Hugetlb
>>> calls __setup() and will return '0' when set invalid parameter
>>> string.
>>>
>>> The following phenomenon is observed:
>>> cmdline:
>>> hugepagesz=1Y hugepages=1
>>> dmesg:
>>> HugeTLB: unsupported hugepagesz=1Y
>>> HugeTLB: hugepages=1 does not follow a valid hugepagesz, ignoring
>>> Unknown kernel command line parameters "hugepagesz=1Y hugepages=1"
>>>
>>> Since hugetlb will print warn or error information before return for
>>> invalid parameter string, just use return '1' to avoid print again.
>>>
>>> Signed-off-by: Peng Liu <liupeng256(a)huawei.com>
>>> ---
>>> mm/hugetlb.c | 18 ++++++++----------
>>> 1 file changed, 8 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
>>> index 9cd746432ca9..6dde34c115c9 100644
>>> --- a/mm/hugetlb.c
>>> +++ b/mm/hugetlb.c
>>> @@ -4131,12 +4131,11 @@ static int __init hugepages_setup(char *s)
>>> int count;
>>> unsigned long tmp;
>>> char *p = s;
>>> - int ret = 1;
>> Adding this in #1 to remove it in #2 is a bit sub-optimal IMHO.
>>
> For #2, which is not necessary for stable, #1 may be needed for stable,
> this is why we split #2 into a single patch.
>
Again, I don't think #1 is stable material, sorry.
--
Thanks,
David / dhildenb
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6d35d04a9e18990040e87d2bbf72689252669d54 Mon Sep 17 00:00:00 2001
From: Zhang Wensheng <zhangwensheng5(a)huawei.com>
Date: Thu, 10 Mar 2022 17:32:24 +0800
Subject: [PATCH] nbd: fix possible overflow on 'first_minor' in nbd_dev_add()
When 'index' is a big numbers, it may become negative which forced
to 'int'. then 'index << part_shift' might overflow to a positive
value that is not greater than '0xfffff', then sysfs might complains
about duplicate creation. Because of this, move the 'index' judgment
to the front will fix it and be better.
Fixes: b0d9111a2d53 ("nbd: use an idr to keep track of nbd devices")
Fixes: 940c264984fd ("nbd: fix possible overflow for 'first_minor' in nbd_dev_add()")
Signed-off-by: Zhang Wensheng <zhangwensheng5(a)huawei.com>
Reviewed-by: Josef Bacik <josef(a)toxicpanda.com>
Link: https://lore.kernel.org/r/20220310093224.4002895-1-zhangwensheng5@huawei.com
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 5a1f98494ddd..b3cdfc0ffb98 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -1800,17 +1800,6 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs)
refcount_set(&nbd->refs, 0);
INIT_LIST_HEAD(&nbd->list);
disk->major = NBD_MAJOR;
-
- /* Too big first_minor can cause duplicate creation of
- * sysfs files/links, since index << part_shift might overflow, or
- * MKDEV() expect that the max bits of first_minor is 20.
- */
- disk->first_minor = index << part_shift;
- if (disk->first_minor < index || disk->first_minor > MINORMASK) {
- err = -EINVAL;
- goto out_free_work;
- }
-
disk->minors = 1 << part_shift;
disk->fops = &nbd_fops;
disk->private_data = nbd;
@@ -1915,8 +1904,19 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
if (!netlink_capable(skb, CAP_SYS_ADMIN))
return -EPERM;
- if (info->attrs[NBD_ATTR_INDEX])
+ if (info->attrs[NBD_ATTR_INDEX]) {
index = nla_get_u32(info->attrs[NBD_ATTR_INDEX]);
+
+ /*
+ * Too big first_minor can cause duplicate creation of
+ * sysfs files/links, since index << part_shift might overflow, or
+ * MKDEV() expect that the max bits of first_minor is 20.
+ */
+ if (index < 0 || index > MINORMASK >> part_shift) {
+ printk(KERN_ERR "nbd: illegal input index %d\n", index);
+ return -EINVAL;
+ }
+ }
if (!info->attrs[NBD_ATTR_SOCKETS]) {
printk(KERN_ERR "nbd: must specify at least one socket\n");
return -EINVAL;
The bug is here:
return cluster;
The list iterator value 'cluster' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.
To fix the bug, return 'cluster' when found, otherwise return NULL.
Cc: stable(a)vger.kernel.org
Fixes: 21bdbb7102ede ("perf: add qcom l2 cache perf events driver")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
drivers/perf/qcom_l2_pmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c
index 7640491aab12..30234c261b05 100644
--- a/drivers/perf/qcom_l2_pmu.c
+++ b/drivers/perf/qcom_l2_pmu.c
@@ -736,7 +736,7 @@ static struct cluster_pmu *l2_cache_associate_cpu_with_cluster(
{
u64 mpidr;
int cpu_cluster_id;
- struct cluster_pmu *cluster = NULL;
+ struct cluster_pmu *cluster;
/*
* This assumes that the cluster_id is in MPIDR[aff1] for
@@ -758,10 +758,10 @@ static struct cluster_pmu *l2_cache_associate_cpu_with_cluster(
cluster->cluster_id);
cpumask_set_cpu(cpu, &cluster->cluster_cpus);
*per_cpu_ptr(l2cache_pmu->pmu_cluster, cpu) = cluster;
- break;
+ return cluster;
}
- return cluster;
+ return NULL;
}
static int l2cache_pmu_online_cpu(unsigned int cpu, struct hlist_node *node)
--
2.17.1
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 655efe5089f077485eec848272bd7e26b1a5a735 Mon Sep 17 00:00:00 2001
From: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Date: Sat, 5 Mar 2022 04:16:39 +0530
Subject: [PATCH] bpf: Fix PTR_TO_BTF_ID var_off check
When kfunc support was added, check_ctx_reg was called for PTR_TO_CTX
register, but no offset checks were made for PTR_TO_BTF_ID. Only
reg->off was taken into account by btf_struct_ids_match, which protected
against type mismatch due to non-zero reg->off, but when reg->off was
zero, a user could set the variable offset of the register and allow it
to be passed to kfunc, leading to bad pointer being passed into the
kernel.
Fix this by reusing the extracted helper check_func_arg_reg_off from
previous commit, and make one call before checking all supported
register types. Since the list is maintained, any future changes will be
taken into account by updating check_func_arg_reg_off. This function
prevents non-zero var_off to be set for PTR_TO_BTF_ID, but still allows
a fixed non-zero reg->off, which is needed for type matching to work
correctly when using pointer arithmetic.
ARG_DONTCARE is passed as arg_type, since kfunc doesn't support
accepting a ARG_PTR_TO_ALLOC_MEM without relying on size of parameter
type from BTF (in case of pointer), or using a mem, len pair. The
forcing of offset check for ARG_PTR_TO_ALLOC_MEM is done because ringbuf
helpers obtain the size from the header located at the beginning of the
memory region, hence any changes to the original pointer shouldn't be
allowed. In case of kfunc, size is always known, either at verification
time, or using the length parameter, hence this forcing is not required.
Since this check will happen once already for PTR_TO_CTX, remove the
check_ptr_off_reg call inside its block.
Fixes: e6ac2450d6de ("bpf: Support bpf program calling kernel function")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Signed-off-by: Alexei Starovoitov <ast(a)kernel.org>
Link: https://lore.kernel.org/bpf/20220304224645.3677453-3-memxor@gmail.com
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index b472cf0c8fdb..7f6a0ae5028b 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -5726,7 +5726,7 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
const char *func_name, *ref_tname;
const struct btf_type *t, *ref_t;
const struct btf_param *args;
- int ref_regno = 0;
+ int ref_regno = 0, ret;
bool rel = false;
t = btf_type_by_id(btf, func_id);
@@ -5776,6 +5776,11 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
ref_t = btf_type_skip_modifiers(btf, t->type, &ref_id);
ref_tname = btf_name_by_offset(btf, ref_t->name_off);
+
+ ret = check_func_arg_reg_off(env, reg, regno, ARG_DONTCARE);
+ if (ret < 0)
+ return ret;
+
if (btf_get_prog_ctx_type(log, btf, t,
env->prog->type, i)) {
/* If function expects ctx type in BTF check that caller
@@ -5787,8 +5792,6 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
i, btf_type_str(t));
return -EINVAL;
}
- if (check_ptr_off_reg(env, reg, regno))
- return -EINVAL;
} else if (is_kfunc && (reg->type == PTR_TO_BTF_ID ||
(reg2btf_ids[base_type(reg->type)] && !type_flag(reg->type)))) {
const struct btf_type *reg_ref_t;
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 655efe5089f077485eec848272bd7e26b1a5a735 Mon Sep 17 00:00:00 2001
From: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Date: Sat, 5 Mar 2022 04:16:39 +0530
Subject: [PATCH] bpf: Fix PTR_TO_BTF_ID var_off check
When kfunc support was added, check_ctx_reg was called for PTR_TO_CTX
register, but no offset checks were made for PTR_TO_BTF_ID. Only
reg->off was taken into account by btf_struct_ids_match, which protected
against type mismatch due to non-zero reg->off, but when reg->off was
zero, a user could set the variable offset of the register and allow it
to be passed to kfunc, leading to bad pointer being passed into the
kernel.
Fix this by reusing the extracted helper check_func_arg_reg_off from
previous commit, and make one call before checking all supported
register types. Since the list is maintained, any future changes will be
taken into account by updating check_func_arg_reg_off. This function
prevents non-zero var_off to be set for PTR_TO_BTF_ID, but still allows
a fixed non-zero reg->off, which is needed for type matching to work
correctly when using pointer arithmetic.
ARG_DONTCARE is passed as arg_type, since kfunc doesn't support
accepting a ARG_PTR_TO_ALLOC_MEM without relying on size of parameter
type from BTF (in case of pointer), or using a mem, len pair. The
forcing of offset check for ARG_PTR_TO_ALLOC_MEM is done because ringbuf
helpers obtain the size from the header located at the beginning of the
memory region, hence any changes to the original pointer shouldn't be
allowed. In case of kfunc, size is always known, either at verification
time, or using the length parameter, hence this forcing is not required.
Since this check will happen once already for PTR_TO_CTX, remove the
check_ptr_off_reg call inside its block.
Fixes: e6ac2450d6de ("bpf: Support bpf program calling kernel function")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Signed-off-by: Alexei Starovoitov <ast(a)kernel.org>
Link: https://lore.kernel.org/bpf/20220304224645.3677453-3-memxor@gmail.com
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index b472cf0c8fdb..7f6a0ae5028b 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -5726,7 +5726,7 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
const char *func_name, *ref_tname;
const struct btf_type *t, *ref_t;
const struct btf_param *args;
- int ref_regno = 0;
+ int ref_regno = 0, ret;
bool rel = false;
t = btf_type_by_id(btf, func_id);
@@ -5776,6 +5776,11 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
ref_t = btf_type_skip_modifiers(btf, t->type, &ref_id);
ref_tname = btf_name_by_offset(btf, ref_t->name_off);
+
+ ret = check_func_arg_reg_off(env, reg, regno, ARG_DONTCARE);
+ if (ret < 0)
+ return ret;
+
if (btf_get_prog_ctx_type(log, btf, t,
env->prog->type, i)) {
/* If function expects ctx type in BTF check that caller
@@ -5787,8 +5792,6 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
i, btf_type_str(t));
return -EINVAL;
}
- if (check_ptr_off_reg(env, reg, regno))
- return -EINVAL;
} else if (is_kfunc && (reg->type == PTR_TO_BTF_ID ||
(reg2btf_ids[base_type(reg->type)] && !type_flag(reg->type)))) {
const struct btf_type *reg_ref_t;
The patch below does not apply to the 5.17-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 655efe5089f077485eec848272bd7e26b1a5a735 Mon Sep 17 00:00:00 2001
From: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Date: Sat, 5 Mar 2022 04:16:39 +0530
Subject: [PATCH] bpf: Fix PTR_TO_BTF_ID var_off check
When kfunc support was added, check_ctx_reg was called for PTR_TO_CTX
register, but no offset checks were made for PTR_TO_BTF_ID. Only
reg->off was taken into account by btf_struct_ids_match, which protected
against type mismatch due to non-zero reg->off, but when reg->off was
zero, a user could set the variable offset of the register and allow it
to be passed to kfunc, leading to bad pointer being passed into the
kernel.
Fix this by reusing the extracted helper check_func_arg_reg_off from
previous commit, and make one call before checking all supported
register types. Since the list is maintained, any future changes will be
taken into account by updating check_func_arg_reg_off. This function
prevents non-zero var_off to be set for PTR_TO_BTF_ID, but still allows
a fixed non-zero reg->off, which is needed for type matching to work
correctly when using pointer arithmetic.
ARG_DONTCARE is passed as arg_type, since kfunc doesn't support
accepting a ARG_PTR_TO_ALLOC_MEM without relying on size of parameter
type from BTF (in case of pointer), or using a mem, len pair. The
forcing of offset check for ARG_PTR_TO_ALLOC_MEM is done because ringbuf
helpers obtain the size from the header located at the beginning of the
memory region, hence any changes to the original pointer shouldn't be
allowed. In case of kfunc, size is always known, either at verification
time, or using the length parameter, hence this forcing is not required.
Since this check will happen once already for PTR_TO_CTX, remove the
check_ptr_off_reg call inside its block.
Fixes: e6ac2450d6de ("bpf: Support bpf program calling kernel function")
Signed-off-by: Kumar Kartikeya Dwivedi <memxor(a)gmail.com>
Signed-off-by: Alexei Starovoitov <ast(a)kernel.org>
Link: https://lore.kernel.org/bpf/20220304224645.3677453-3-memxor@gmail.com
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index b472cf0c8fdb..7f6a0ae5028b 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -5726,7 +5726,7 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
const char *func_name, *ref_tname;
const struct btf_type *t, *ref_t;
const struct btf_param *args;
- int ref_regno = 0;
+ int ref_regno = 0, ret;
bool rel = false;
t = btf_type_by_id(btf, func_id);
@@ -5776,6 +5776,11 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
ref_t = btf_type_skip_modifiers(btf, t->type, &ref_id);
ref_tname = btf_name_by_offset(btf, ref_t->name_off);
+
+ ret = check_func_arg_reg_off(env, reg, regno, ARG_DONTCARE);
+ if (ret < 0)
+ return ret;
+
if (btf_get_prog_ctx_type(log, btf, t,
env->prog->type, i)) {
/* If function expects ctx type in BTF check that caller
@@ -5787,8 +5792,6 @@ static int btf_check_func_arg_match(struct bpf_verifier_env *env,
i, btf_type_str(t));
return -EINVAL;
}
- if (check_ptr_off_reg(env, reg, regno))
- return -EINVAL;
} else if (is_kfunc && (reg->type == PTR_TO_BTF_ID ||
(reg2btf_ids[base_type(reg->type)] && !type_flag(reg->type)))) {
const struct btf_type *reg_ref_t;
Following arm64 tinyconfig builds failed on queue/5.15..5.17.
arm64-gcc-11-tinyconfig - FAILED
arm64-gcc-10-tinyconfig- FAILED
arm64-clang-12-tinyconfig- FAILED
arm64-clang-13-tinyconfig- FAILED
arch/arm64/mm/init.c:90:19: error: conflicting type qualifiers for
'arm64_dma_phys_limit'
90 | const phys_addr_t arm64_dma_phys_limit = PHYS_MASK + 1;
| ^~~~~~~~~~~~~~~~~~~~
In file included from include/asm-generic/qrwlock.h:14,
from ./arch/arm64/include/generated/asm/qrwlock.h:1,
from arch/arm64/include/asm/spinlock.h:9,
from include/linux/spinlock.h:94,
from include/linux/swap.h:5,
from arch/arm64/mm/init.c:12:
arch/arm64/include/asm/processor.h:102:20: note: previous declaration
of 'arm64_dma_phys_limit' with type 'phys_addr_t' {aka 'long long
unsigned int'}
102 | extern phys_addr_t arm64_dma_phys_limit;
| ^~~~~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:277: arch/arm64/mm/init.o] Error 1
Reported-by: Linux Kernel Functional Testing <lkft(a)linaro.org>
Is this the suspected commit ?
arm64: Do not defer reserve_crashkernel() for platforms with no DMA memory zones
commit 031495635b4668f94e964e037ca93d0d38bfde58 upstream.
https://qa-reports.linaro.org/_/comparetest/?project=1019&project=1110&proj…
- Naresh
Hello My Dear Friend,
I am Dr. Nance Terry Lee, the United Nations Representative Washington
-DC - USA.
I hereby inform you that your UN pending compensation funds the sum of
$4.2million has been approved to be released to you through Diplomatic
Courier Service.
In the light of the above, you are advised to send your full receiving
information as below:
1. Your full name
2. Full receiving address
3. Your mobile number
4. Nearest airport
Upon the receipt of the above information, I will proceed with the
delivery process of your compensation funds to your door step through
our special agent, if you have any questions, don't hesitate to ask
me.
Kindly revert back to this office immediately.
Thanks.
Dr. Nance Terry Lee.
United Nations Representative
Washington-DC USA.
Tel: +1-703-9877 5463
Fax: +1-703-9268 5422
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 795301d3c28996219d555023ac6863401b6076bc Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt(a)goodmis.org>
Date: Fri, 18 Mar 2022 15:34:32 -0400
Subject: [PATCH] tracing: Have type enum modifications copy the strings
When an enum is used in the visible parts of a trace event that is
exported to user space, the user space applications like perf and
trace-cmd do not have a way to know what the value of the enum is. To
solve this, at boot up (or module load) the printk formats are modified to
replace the enum with their numeric value in the string output.
Array fields of the event are defined by [<nr-elements>] in the type
portion of the format file so that the user space parsers can correctly
parse the array into the appropriate size chunks. But in some trace
events, an enum is used in defining the size of the array, which once
again breaks the parsing of user space tooling.
This was solved the same way as the print formats were, but it modified
the type strings of the trace event. This caused crashes in some
architectures because, as supposed to the print string, is a const string
value. This was not detected on x86, as it appears that const strings are
still writable (at least in boot up), but other architectures this is not
the case, and writing to a const string will cause a kernel fault.
To fix this, use kstrdup() to copy the type before modifying it. If the
trace event is for the core kernel there's no need to free it because the
string will be in use for the life of the machine being on line. For
modules, create a link list to store all the strings being allocated for
modules and when the module is removed, free them.
Link: https://lore.kernel.org/all/yt9dr1706b4i.fsf@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220318153432.3984b871@gandalf.local.home
Tested-by: Marc Zyngier <maz(a)kernel.org>
Tested-by: Sven Schnelle <svens(a)linux.ibm.com>
Reported-by: Sven Schnelle <svens(a)linux.ibm.com>
Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well")
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ae9a3b8481f5..0d91152172c9 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -40,6 +40,14 @@ static LIST_HEAD(ftrace_generic_fields);
static LIST_HEAD(ftrace_common_fields);
static bool eventdir_initialized;
+static LIST_HEAD(module_strings);
+
+struct module_string {
+ struct list_head next;
+ struct module *module;
+ char *str;
+};
+
#define GFP_TRACE (GFP_KERNEL | __GFP_ZERO)
static struct kmem_cache *field_cachep;
@@ -2633,14 +2641,40 @@ static void update_event_printk(struct trace_event_call *call,
}
}
+static void add_str_to_module(struct module *module, char *str)
+{
+ struct module_string *modstr;
+
+ modstr = kmalloc(sizeof(*modstr), GFP_KERNEL);
+
+ /*
+ * If we failed to allocate memory here, then we'll just
+ * let the str memory leak when the module is removed.
+ * If this fails to allocate, there's worse problems than
+ * a leaked string on module removal.
+ */
+ if (WARN_ON_ONCE(!modstr))
+ return;
+
+ modstr->module = module;
+ modstr->str = str;
+
+ list_add(&modstr->next, &module_strings);
+}
+
static void update_event_fields(struct trace_event_call *call,
struct trace_eval_map *map)
{
struct ftrace_event_field *field;
struct list_head *head;
char *ptr;
+ char *str;
int len = strlen(map->eval_string);
+ /* Dynamic events should never have field maps */
+ if (WARN_ON_ONCE(call->flags & TRACE_EVENT_FL_DYNAMIC))
+ return;
+
head = trace_get_fields(call);
list_for_each_entry(field, head, link) {
ptr = strchr(field->type, '[');
@@ -2654,9 +2688,26 @@ static void update_event_fields(struct trace_event_call *call,
if (strncmp(map->eval_string, ptr, len) != 0)
continue;
+ str = kstrdup(field->type, GFP_KERNEL);
+ if (WARN_ON_ONCE(!str))
+ return;
+ ptr = str + (ptr - field->type);
ptr = eval_replace(ptr, map, len);
/* enum/sizeof string smaller than value */
- WARN_ON_ONCE(!ptr);
+ if (WARN_ON_ONCE(!ptr)) {
+ kfree(str);
+ continue;
+ }
+
+ /*
+ * If the event is part of a module, then we need to free the string
+ * when the module is removed. Otherwise, it will stay allocated
+ * until a reboot.
+ */
+ if (call->module)
+ add_str_to_module(call->module, str);
+
+ field->type = str;
}
}
@@ -2883,6 +2934,7 @@ static void trace_module_add_events(struct module *mod)
static void trace_module_remove_events(struct module *mod)
{
struct trace_event_call *call, *p;
+ struct module_string *modstr, *m;
down_write(&trace_event_sem);
list_for_each_entry_safe(call, p, &ftrace_events, list) {
@@ -2891,6 +2943,14 @@ static void trace_module_remove_events(struct module *mod)
if (call->module == mod)
__trace_remove_event_call(call);
}
+ /* Check for any strings allocade for this module */
+ list_for_each_entry_safe(modstr, m, &module_strings, next) {
+ if (modstr->module != mod)
+ continue;
+ list_del(&modstr->next);
+ kfree(modstr->str);
+ kfree(modstr);
+ }
up_write(&trace_event_sem);
/*
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 795301d3c28996219d555023ac6863401b6076bc Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt(a)goodmis.org>
Date: Fri, 18 Mar 2022 15:34:32 -0400
Subject: [PATCH] tracing: Have type enum modifications copy the strings
When an enum is used in the visible parts of a trace event that is
exported to user space, the user space applications like perf and
trace-cmd do not have a way to know what the value of the enum is. To
solve this, at boot up (or module load) the printk formats are modified to
replace the enum with their numeric value in the string output.
Array fields of the event are defined by [<nr-elements>] in the type
portion of the format file so that the user space parsers can correctly
parse the array into the appropriate size chunks. But in some trace
events, an enum is used in defining the size of the array, which once
again breaks the parsing of user space tooling.
This was solved the same way as the print formats were, but it modified
the type strings of the trace event. This caused crashes in some
architectures because, as supposed to the print string, is a const string
value. This was not detected on x86, as it appears that const strings are
still writable (at least in boot up), but other architectures this is not
the case, and writing to a const string will cause a kernel fault.
To fix this, use kstrdup() to copy the type before modifying it. If the
trace event is for the core kernel there's no need to free it because the
string will be in use for the life of the machine being on line. For
modules, create a link list to store all the strings being allocated for
modules and when the module is removed, free them.
Link: https://lore.kernel.org/all/yt9dr1706b4i.fsf@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220318153432.3984b871@gandalf.local.home
Tested-by: Marc Zyngier <maz(a)kernel.org>
Tested-by: Sven Schnelle <svens(a)linux.ibm.com>
Reported-by: Sven Schnelle <svens(a)linux.ibm.com>
Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well")
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ae9a3b8481f5..0d91152172c9 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -40,6 +40,14 @@ static LIST_HEAD(ftrace_generic_fields);
static LIST_HEAD(ftrace_common_fields);
static bool eventdir_initialized;
+static LIST_HEAD(module_strings);
+
+struct module_string {
+ struct list_head next;
+ struct module *module;
+ char *str;
+};
+
#define GFP_TRACE (GFP_KERNEL | __GFP_ZERO)
static struct kmem_cache *field_cachep;
@@ -2633,14 +2641,40 @@ static void update_event_printk(struct trace_event_call *call,
}
}
+static void add_str_to_module(struct module *module, char *str)
+{
+ struct module_string *modstr;
+
+ modstr = kmalloc(sizeof(*modstr), GFP_KERNEL);
+
+ /*
+ * If we failed to allocate memory here, then we'll just
+ * let the str memory leak when the module is removed.
+ * If this fails to allocate, there's worse problems than
+ * a leaked string on module removal.
+ */
+ if (WARN_ON_ONCE(!modstr))
+ return;
+
+ modstr->module = module;
+ modstr->str = str;
+
+ list_add(&modstr->next, &module_strings);
+}
+
static void update_event_fields(struct trace_event_call *call,
struct trace_eval_map *map)
{
struct ftrace_event_field *field;
struct list_head *head;
char *ptr;
+ char *str;
int len = strlen(map->eval_string);
+ /* Dynamic events should never have field maps */
+ if (WARN_ON_ONCE(call->flags & TRACE_EVENT_FL_DYNAMIC))
+ return;
+
head = trace_get_fields(call);
list_for_each_entry(field, head, link) {
ptr = strchr(field->type, '[');
@@ -2654,9 +2688,26 @@ static void update_event_fields(struct trace_event_call *call,
if (strncmp(map->eval_string, ptr, len) != 0)
continue;
+ str = kstrdup(field->type, GFP_KERNEL);
+ if (WARN_ON_ONCE(!str))
+ return;
+ ptr = str + (ptr - field->type);
ptr = eval_replace(ptr, map, len);
/* enum/sizeof string smaller than value */
- WARN_ON_ONCE(!ptr);
+ if (WARN_ON_ONCE(!ptr)) {
+ kfree(str);
+ continue;
+ }
+
+ /*
+ * If the event is part of a module, then we need to free the string
+ * when the module is removed. Otherwise, it will stay allocated
+ * until a reboot.
+ */
+ if (call->module)
+ add_str_to_module(call->module, str);
+
+ field->type = str;
}
}
@@ -2883,6 +2934,7 @@ static void trace_module_add_events(struct module *mod)
static void trace_module_remove_events(struct module *mod)
{
struct trace_event_call *call, *p;
+ struct module_string *modstr, *m;
down_write(&trace_event_sem);
list_for_each_entry_safe(call, p, &ftrace_events, list) {
@@ -2891,6 +2943,14 @@ static void trace_module_remove_events(struct module *mod)
if (call->module == mod)
__trace_remove_event_call(call);
}
+ /* Check for any strings allocade for this module */
+ list_for_each_entry_safe(modstr, m, &module_strings, next) {
+ if (modstr->module != mod)
+ continue;
+ list_del(&modstr->next);
+ kfree(modstr->str);
+ kfree(modstr);
+ }
up_write(&trace_event_sem);
/*
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 795301d3c28996219d555023ac6863401b6076bc Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt(a)goodmis.org>
Date: Fri, 18 Mar 2022 15:34:32 -0400
Subject: [PATCH] tracing: Have type enum modifications copy the strings
When an enum is used in the visible parts of a trace event that is
exported to user space, the user space applications like perf and
trace-cmd do not have a way to know what the value of the enum is. To
solve this, at boot up (or module load) the printk formats are modified to
replace the enum with their numeric value in the string output.
Array fields of the event are defined by [<nr-elements>] in the type
portion of the format file so that the user space parsers can correctly
parse the array into the appropriate size chunks. But in some trace
events, an enum is used in defining the size of the array, which once
again breaks the parsing of user space tooling.
This was solved the same way as the print formats were, but it modified
the type strings of the trace event. This caused crashes in some
architectures because, as supposed to the print string, is a const string
value. This was not detected on x86, as it appears that const strings are
still writable (at least in boot up), but other architectures this is not
the case, and writing to a const string will cause a kernel fault.
To fix this, use kstrdup() to copy the type before modifying it. If the
trace event is for the core kernel there's no need to free it because the
string will be in use for the life of the machine being on line. For
modules, create a link list to store all the strings being allocated for
modules and when the module is removed, free them.
Link: https://lore.kernel.org/all/yt9dr1706b4i.fsf@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220318153432.3984b871@gandalf.local.home
Tested-by: Marc Zyngier <maz(a)kernel.org>
Tested-by: Sven Schnelle <svens(a)linux.ibm.com>
Reported-by: Sven Schnelle <svens(a)linux.ibm.com>
Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well")
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ae9a3b8481f5..0d91152172c9 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -40,6 +40,14 @@ static LIST_HEAD(ftrace_generic_fields);
static LIST_HEAD(ftrace_common_fields);
static bool eventdir_initialized;
+static LIST_HEAD(module_strings);
+
+struct module_string {
+ struct list_head next;
+ struct module *module;
+ char *str;
+};
+
#define GFP_TRACE (GFP_KERNEL | __GFP_ZERO)
static struct kmem_cache *field_cachep;
@@ -2633,14 +2641,40 @@ static void update_event_printk(struct trace_event_call *call,
}
}
+static void add_str_to_module(struct module *module, char *str)
+{
+ struct module_string *modstr;
+
+ modstr = kmalloc(sizeof(*modstr), GFP_KERNEL);
+
+ /*
+ * If we failed to allocate memory here, then we'll just
+ * let the str memory leak when the module is removed.
+ * If this fails to allocate, there's worse problems than
+ * a leaked string on module removal.
+ */
+ if (WARN_ON_ONCE(!modstr))
+ return;
+
+ modstr->module = module;
+ modstr->str = str;
+
+ list_add(&modstr->next, &module_strings);
+}
+
static void update_event_fields(struct trace_event_call *call,
struct trace_eval_map *map)
{
struct ftrace_event_field *field;
struct list_head *head;
char *ptr;
+ char *str;
int len = strlen(map->eval_string);
+ /* Dynamic events should never have field maps */
+ if (WARN_ON_ONCE(call->flags & TRACE_EVENT_FL_DYNAMIC))
+ return;
+
head = trace_get_fields(call);
list_for_each_entry(field, head, link) {
ptr = strchr(field->type, '[');
@@ -2654,9 +2688,26 @@ static void update_event_fields(struct trace_event_call *call,
if (strncmp(map->eval_string, ptr, len) != 0)
continue;
+ str = kstrdup(field->type, GFP_KERNEL);
+ if (WARN_ON_ONCE(!str))
+ return;
+ ptr = str + (ptr - field->type);
ptr = eval_replace(ptr, map, len);
/* enum/sizeof string smaller than value */
- WARN_ON_ONCE(!ptr);
+ if (WARN_ON_ONCE(!ptr)) {
+ kfree(str);
+ continue;
+ }
+
+ /*
+ * If the event is part of a module, then we need to free the string
+ * when the module is removed. Otherwise, it will stay allocated
+ * until a reboot.
+ */
+ if (call->module)
+ add_str_to_module(call->module, str);
+
+ field->type = str;
}
}
@@ -2883,6 +2934,7 @@ static void trace_module_add_events(struct module *mod)
static void trace_module_remove_events(struct module *mod)
{
struct trace_event_call *call, *p;
+ struct module_string *modstr, *m;
down_write(&trace_event_sem);
list_for_each_entry_safe(call, p, &ftrace_events, list) {
@@ -2891,6 +2943,14 @@ static void trace_module_remove_events(struct module *mod)
if (call->module == mod)
__trace_remove_event_call(call);
}
+ /* Check for any strings allocade for this module */
+ list_for_each_entry_safe(modstr, m, &module_strings, next) {
+ if (modstr->module != mod)
+ continue;
+ list_del(&modstr->next);
+ kfree(modstr->str);
+ kfree(modstr);
+ }
up_write(&trace_event_sem);
/*
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 795301d3c28996219d555023ac6863401b6076bc Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Google)" <rostedt(a)goodmis.org>
Date: Fri, 18 Mar 2022 15:34:32 -0400
Subject: [PATCH] tracing: Have type enum modifications copy the strings
When an enum is used in the visible parts of a trace event that is
exported to user space, the user space applications like perf and
trace-cmd do not have a way to know what the value of the enum is. To
solve this, at boot up (or module load) the printk formats are modified to
replace the enum with their numeric value in the string output.
Array fields of the event are defined by [<nr-elements>] in the type
portion of the format file so that the user space parsers can correctly
parse the array into the appropriate size chunks. But in some trace
events, an enum is used in defining the size of the array, which once
again breaks the parsing of user space tooling.
This was solved the same way as the print formats were, but it modified
the type strings of the trace event. This caused crashes in some
architectures because, as supposed to the print string, is a const string
value. This was not detected on x86, as it appears that const strings are
still writable (at least in boot up), but other architectures this is not
the case, and writing to a const string will cause a kernel fault.
To fix this, use kstrdup() to copy the type before modifying it. If the
trace event is for the core kernel there's no need to free it because the
string will be in use for the life of the machine being on line. For
modules, create a link list to store all the strings being allocated for
modules and when the module is removed, free them.
Link: https://lore.kernel.org/all/yt9dr1706b4i.fsf@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220318153432.3984b871@gandalf.local.home
Tested-by: Marc Zyngier <maz(a)kernel.org>
Tested-by: Sven Schnelle <svens(a)linux.ibm.com>
Reported-by: Sven Schnelle <svens(a)linux.ibm.com>
Fixes: b3bc8547d3be ("tracing: Have TRACE_DEFINE_ENUM affect trace event types as well")
Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org>
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index ae9a3b8481f5..0d91152172c9 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -40,6 +40,14 @@ static LIST_HEAD(ftrace_generic_fields);
static LIST_HEAD(ftrace_common_fields);
static bool eventdir_initialized;
+static LIST_HEAD(module_strings);
+
+struct module_string {
+ struct list_head next;
+ struct module *module;
+ char *str;
+};
+
#define GFP_TRACE (GFP_KERNEL | __GFP_ZERO)
static struct kmem_cache *field_cachep;
@@ -2633,14 +2641,40 @@ static void update_event_printk(struct trace_event_call *call,
}
}
+static void add_str_to_module(struct module *module, char *str)
+{
+ struct module_string *modstr;
+
+ modstr = kmalloc(sizeof(*modstr), GFP_KERNEL);
+
+ /*
+ * If we failed to allocate memory here, then we'll just
+ * let the str memory leak when the module is removed.
+ * If this fails to allocate, there's worse problems than
+ * a leaked string on module removal.
+ */
+ if (WARN_ON_ONCE(!modstr))
+ return;
+
+ modstr->module = module;
+ modstr->str = str;
+
+ list_add(&modstr->next, &module_strings);
+}
+
static void update_event_fields(struct trace_event_call *call,
struct trace_eval_map *map)
{
struct ftrace_event_field *field;
struct list_head *head;
char *ptr;
+ char *str;
int len = strlen(map->eval_string);
+ /* Dynamic events should never have field maps */
+ if (WARN_ON_ONCE(call->flags & TRACE_EVENT_FL_DYNAMIC))
+ return;
+
head = trace_get_fields(call);
list_for_each_entry(field, head, link) {
ptr = strchr(field->type, '[');
@@ -2654,9 +2688,26 @@ static void update_event_fields(struct trace_event_call *call,
if (strncmp(map->eval_string, ptr, len) != 0)
continue;
+ str = kstrdup(field->type, GFP_KERNEL);
+ if (WARN_ON_ONCE(!str))
+ return;
+ ptr = str + (ptr - field->type);
ptr = eval_replace(ptr, map, len);
/* enum/sizeof string smaller than value */
- WARN_ON_ONCE(!ptr);
+ if (WARN_ON_ONCE(!ptr)) {
+ kfree(str);
+ continue;
+ }
+
+ /*
+ * If the event is part of a module, then we need to free the string
+ * when the module is removed. Otherwise, it will stay allocated
+ * until a reboot.
+ */
+ if (call->module)
+ add_str_to_module(call->module, str);
+
+ field->type = str;
}
}
@@ -2883,6 +2934,7 @@ static void trace_module_add_events(struct module *mod)
static void trace_module_remove_events(struct module *mod)
{
struct trace_event_call *call, *p;
+ struct module_string *modstr, *m;
down_write(&trace_event_sem);
list_for_each_entry_safe(call, p, &ftrace_events, list) {
@@ -2891,6 +2943,14 @@ static void trace_module_remove_events(struct module *mod)
if (call->module == mod)
__trace_remove_event_call(call);
}
+ /* Check for any strings allocade for this module */
+ list_for_each_entry_safe(modstr, m, &module_strings, next) {
+ if (modstr->module != mod)
+ continue;
+ list_del(&modstr->next);
+ kfree(modstr->str);
+ kfree(modstr);
+ }
up_write(&trace_event_sem);
/*
Dzień dobry,
dostrzegam możliwość współpracy z Państwa firmą.
Świadczymy kompleksową obsługę inwestycji w fotowoltaikę, która obniża koszty energii elektrycznej nawet o 90%.
Czy są Państwo zainteresowani weryfikacją wstępnych propozycji?
Pozdrawiam,
Przemysław Wróblewski
During hibernation process, once thaw() stage completes, the MHI endpoint
devices will be in M0 state post recovery. After that, the devices will be
powered down so that the system can enter the target sleep state. During
this stage, the PCI core will put the devices in D3hot. But this transition
is allowed by the MHI spec. The devices can only enter D3hot when it is in
M3 state.
So for fixing this issue, let's add the poweroff() callback that will get
executed before putting the system in target sleep state during
hibernation. This callback will put the device in M3 state and that would
allow it to receive the D3hot afterwards.
Cc: stable(a)vger.kernel.org
Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation")
Reported-by: Hemant Kumar <quic_hemantk(a)quicinc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam(a)linaro.org>
---
drivers/bus/mhi/host/pci_generic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
index 9527b7d63840..b1c0a8887496 100644
--- a/drivers/bus/mhi/host/pci_generic.c
+++ b/drivers/bus/mhi/host/pci_generic.c
@@ -1085,6 +1085,7 @@ static const struct dev_pm_ops mhi_pci_pm_ops = {
.resume = mhi_pci_resume,
.freeze = mhi_pci_freeze,
.thaw = mhi_pci_restore,
+ .poweroff = mhi_pci_suspend,
.restore = mhi_pci_restore,
#endif
};
--
2.25.1
The patch below does not apply to the 5.17-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3fd07aecb75003fbcb0b7c3124d12f71ffd360d8 Mon Sep 17 00:00:00 2001
From: Damien Le Moal <damien.lemoal(a)opensource.wdc.com>
Date: Tue, 1 Mar 2022 20:30:09 +0900
Subject: [PATCH] scsi: scsi_debug: Fix qc_lock use in sdebug_blk_mq_poll()
The use of the 'locked' boolean variable to control locking and unlocking
of the qc_lock spinlock of struct sdebug_queue confuses sparse, leading to
a warning about an unexpected unlock. Simplify the qc_lock lock/unlock
handling code of this function to avoid this warning by removing the
'locked' boolean variable. This change also fixes unlocked access to the
in_use_bm bitmap with the find_first_bit() function.
Link: https://lore.kernel.org/r/20220301113009.595857-3-damien.lemoal@opensource.…
Fixes: b05d4e481eff ("scsi: scsi_debug: Refine sdebug_blk_mq_poll()")
Cc: stable(a)vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal(a)opensource.wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index f4e97f2224b2..25fa8e93f5a8 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -7509,7 +7509,6 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
{
bool first;
bool retiring = false;
- bool locked = false;
int num_entries = 0;
unsigned int qc_idx = 0;
unsigned long iflags;
@@ -7525,11 +7524,9 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
if (qc_idx >= sdebug_max_queue)
return 0;
+ spin_lock_irqsave(&sqp->qc_lock, iflags);
+
for (first = true; first || qc_idx + 1 < sdebug_max_queue; ) {
- if (!locked) {
- spin_lock_irqsave(&sqp->qc_lock, iflags);
- locked = true;
- }
if (first) {
first = false;
if (!test_bit(qc_idx, sqp->in_use_bm))
@@ -7586,14 +7583,15 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
}
WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
- locked = false;
scsi_done(scp); /* callback to mid level */
num_entries++;
+ spin_lock_irqsave(&sqp->qc_lock, iflags);
if (find_first_bit(sqp->in_use_bm, sdebug_max_queue) >= sdebug_max_queue)
- break; /* if no more then exit without retaking spinlock */
+ break;
}
- if (locked)
- spin_unlock_irqrestore(&sqp->qc_lock, iflags);
+
+ spin_unlock_irqrestore(&sqp->qc_lock, iflags);
+
if (num_entries > 0)
atomic_add(num_entries, &sdeb_mq_poll_count);
return num_entries;
We might have RISC-V systems (such as QEMU) where VMID is not part
of the TLB entry tag so these systems will have to flush all TLB
enteries upon any change in hgatp.VMID.
Currently, we zero-out hgatp CSR in kvm_arch_vcpu_put() and we
re-program hgatp CSR in kvm_arch_vcpu_load(). For above described
systems, this will flush all TLB enteries whenever VCPU exits to
user-space hence reducing performance.
This patch fixes above described performance issue by not clearing
hgatp CSR in kvm_arch_vcpu_put().
Fixes: 34bde9d8b9e6 ("RISC-V: KVM: Implement VCPU world-switch")
Cc: stable(a)vger.kernel.org
Signed-off-by: Anup Patel <apatel(a)ventanamicro.com>
---
arch/riscv/kvm/vcpu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c
index 624166004e36..6785aef4cbd4 100644
--- a/arch/riscv/kvm/vcpu.c
+++ b/arch/riscv/kvm/vcpu.c
@@ -653,8 +653,6 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
vcpu->arch.isa);
kvm_riscv_vcpu_host_fp_restore(&vcpu->arch.host_context);
- csr_write(CSR_HGATP, 0);
-
csr->vsstatus = csr_read(CSR_VSSTATUS);
csr->vsie = csr_read(CSR_VSIE);
csr->vstvec = csr_read(CSR_VSTVEC);
--
2.25.1
Syzbot found an issue [1] in ext4_fallocate().
The C reproducer [2] calls fallocate(), passing size 0xffeffeff000ul,
and offset 0x1000000ul, which, when added together exceed the
bitmap_maxbytes for the inode. This triggers a BUG in
ext4_ind_remove_space(). According to the comments in this function
the 'end' parameter needs to be one block after the last block to be
removed. In the case when the BUG is triggered it points to the last
block. Modify the ext4_punch_hole() function and add constraint that
caps the length to satisfy the one before laster block requirement.
LINK: [1] https://syzkaller.appspot.com/bug?id=b80bd9cf348aac724a4f4dff251800106d7213…
LINK: [2] https://syzkaller.appspot.com/text?tag=ReproC&x=14ba0238700000
Cc: Theodore Ts'o <tytso(a)mit.edu>
Cc: Andreas Dilger <adilger.kernel(a)dilger.ca>
Cc: Ritesh Harjani <riteshh(a)linux.ibm.com>
Cc: <linux-ext4(a)vger.kernel.org>
Cc: <stable(a)vger.kernel.org>
Cc: <linux-kernel(a)vger.kernel.org>
Fixes: a4bb6b64e39a ("ext4: enable "punch hole" functionality")
Reported-by: syzbot+7a806094edd5d07ba029(a)syzkaller.appspotmail.com
Signed-off-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
--
v3: Modify the length instead of returning an error.
v2: Change sbi->s_blocksize to inode->i_sb->s_blocksize in maxlength
computation.
---
fs/ext4/inode.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 1ce13f69fbec..60bf31765d07 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3958,7 +3958,8 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
struct super_block *sb = inode->i_sb;
ext4_lblk_t first_block, stop_block;
struct address_space *mapping = inode->i_mapping;
- loff_t first_block_offset, last_block_offset;
+ loff_t first_block_offset, last_block_offset, max_length;
+ struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
handle_t *handle;
unsigned int credits;
int ret = 0, ret2 = 0;
@@ -4001,6 +4002,14 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
offset;
}
+ /*
+ * For punch hole the length + offset needs to be within one block
+ * before last range. Adjust the length if it goes beyond that limit.
+ */
+ max_length = sbi->s_bitmap_maxbytes - inode->i_sb->s_blocksize;
+ if (offset + length > max_length)
+ length = max_length - offset;
+
if (offset & (sb->s_blocksize - 1) ||
(offset + length) & (sb->s_blocksize - 1)) {
/*
--
2.35.1
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3cbf0e392f173ba0ce425968c8374a6aa3e90f2e Mon Sep 17 00:00:00 2001
From: Baokun Li <libaokun1(a)huawei.com>
Date: Fri, 5 Nov 2021 17:30:22 +0800
Subject: [PATCH] ubi: Fix race condition between ctrl_cdev_ioctl and
ubi_cdev_ioctl
Hulk Robot reported a KASAN report about use-after-free:
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0x13d/0x160
Read of size 8 at addr ffff888035e37d98 by task ubiattach/1385
[...]
Call Trace:
klist_dec_and_del+0xa7/0x4a0
klist_put+0xc7/0x1a0
device_del+0x4d4/0xed0
cdev_device_del+0x1a/0x80
ubi_attach_mtd_dev+0x2951/0x34b0 [ubi]
ctrl_cdev_ioctl+0x286/0x2f0 [ubi]
Allocated by task 1414:
device_add+0x60a/0x18b0
cdev_device_add+0x103/0x170
ubi_create_volume+0x1118/0x1a10 [ubi]
ubi_cdev_ioctl+0xb7f/0x1ba0 [ubi]
Freed by task 1385:
cdev_device_del+0x1a/0x80
ubi_remove_volume+0x438/0x6c0 [ubi]
ubi_cdev_ioctl+0xbf4/0x1ba0 [ubi]
[...]
==================================================================
The lock held by ctrl_cdev_ioctl is ubi_devices_mutex, but the lock held
by ubi_cdev_ioctl is ubi->device_mutex. Therefore, the two locks can be
concurrent.
ctrl_cdev_ioctl contains two operations: ubi_attach and ubi_detach.
ubi_detach is bug-free because it uses reference counting to prevent
concurrency. However, uif_init and uif_close in ubi_attach may race with
ubi_cdev_ioctl.
uif_init will race with ubi_cdev_ioctl as in the following stack.
cpu1 cpu2 cpu3
_______________________|________________________|______________________
ctrl_cdev_ioctl
ubi_attach_mtd_dev
uif_init
ubi_cdev_ioctl
ubi_create_volume
cdev_device_add
ubi_add_volume
// sysfs exist
kill_volumes
ubi_cdev_ioctl
ubi_remove_volume
cdev_device_del
// first free
ubi_free_volume
cdev_del
// double free
cdev_device_del
And uif_close will race with ubi_cdev_ioctl as in the following stack.
cpu1 cpu2 cpu3
_______________________|________________________|______________________
ctrl_cdev_ioctl
ubi_attach_mtd_dev
uif_init
ubi_cdev_ioctl
ubi_create_volume
cdev_device_add
ubi_debugfs_init_dev
//error goto out_uif;
uif_close
kill_volumes
ubi_cdev_ioctl
ubi_remove_volume
cdev_device_del
// first free
ubi_free_volume
// double free
The cause of this problem is that commit 714fb87e8bc0 make device
"available" before it becomes accessible via sysfs. Therefore, we
roll back the modification. We will fix the race condition between
ubi device creation and udev by removing ubi_get_device in
vol_attribute_show and dev_attribute_show.This avoids accessing
uninitialized ubi_devices[ubi_num].
ubi_get_device is used to prevent devices from being deleted during
sysfs execution. However, now kernfs ensures that devices will not
be deleted before all reference counting are released.
The key process is shown in the following stack.
device_del
device_remove_attrs
device_remove_groups
sysfs_remove_groups
sysfs_remove_group
remove_files
kernfs_remove_by_name
kernfs_remove_by_name_ns
__kernfs_remove
kernfs_drain
Fixes: 714fb87e8bc0 ("ubi: Fix race condition between ubi device creation and udev")
Reported-by: Hulk Robot <hulkci(a)huawei.com>
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index a7e3eb9befb6..a32050fecabf 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -351,9 +351,6 @@ static ssize_t dev_attribute_show(struct device *dev,
* we still can use 'ubi->ubi_num'.
*/
ubi = container_of(dev, struct ubi_device, dev);
- ubi = ubi_get_device(ubi->ubi_num);
- if (!ubi)
- return -ENODEV;
if (attr == &dev_eraseblock_size)
ret = sprintf(buf, "%d\n", ubi->leb_size);
@@ -382,7 +379,6 @@ static ssize_t dev_attribute_show(struct device *dev,
else
ret = -EINVAL;
- ubi_put_device(ubi);
return ret;
}
@@ -979,9 +975,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
goto out_detach;
}
- /* Make device "available" before it becomes accessible via sysfs */
- ubi_devices[ubi_num] = ubi;
-
err = uif_init(ubi);
if (err)
goto out_detach;
@@ -1026,6 +1019,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
wake_up_process(ubi->bgt_thread);
spin_unlock(&ubi->wl_lock);
+ ubi_devices[ubi_num] = ubi;
ubi_notify_all(ubi, UBI_VOLUME_ADDED, NULL);
return ubi_num;
@@ -1034,7 +1028,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
out_uif:
uif_close(ubi);
out_detach:
- ubi_devices[ubi_num] = NULL;
ubi_wl_close(ubi);
ubi_free_all_volumes(ubi);
vfree(ubi->vtbl);
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 139ee132bfbc..1bc7b3a05604 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -56,16 +56,11 @@ static ssize_t vol_attribute_show(struct device *dev,
{
int ret;
struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev);
- struct ubi_device *ubi;
-
- ubi = ubi_get_device(vol->ubi->ubi_num);
- if (!ubi)
- return -ENODEV;
+ struct ubi_device *ubi = vol->ubi;
spin_lock(&ubi->volumes_lock);
if (!ubi->volumes[vol->vol_id]) {
spin_unlock(&ubi->volumes_lock);
- ubi_put_device(ubi);
return -ENODEV;
}
/* Take a reference to prevent volume removal */
@@ -103,7 +98,6 @@ static ssize_t vol_attribute_show(struct device *dev,
vol->ref_count -= 1;
ubi_assert(vol->ref_count >= 0);
spin_unlock(&ubi->volumes_lock);
- ubi_put_device(ubi);
return ret;
}
The patch below does not apply to the 5.17-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 85643396c71241aa8b5afc4e23e1099b170f6517 Mon Sep 17 00:00:00 2001
From: Abhishek Naik <abhishek.naik(a)intel.com>
Date: Sun, 30 Jan 2022 11:53:06 +0200
Subject: [PATCH] iwlwifi: nvm: Correct HE capability
The HE PHY capability - Tx 1024-QAM < 242-tone RU support
was not handled for Ms RFs, add the relevant code for it.
Signed-off-by: Abhishek Naik <abhishek.naik(a)intel.com>
Fixes: 1381eb5c8ed5 ("iwlwifi: correct HE capabilities")
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220130115024.01e232ce98ca.I765d26e9eb6a…
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 0693dfda43a3..0dfd69fcd5d7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -784,6 +784,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
case IWL_CFG_RF_TYPE_GF:
case IWL_CFG_RF_TYPE_MR:
+ case IWL_CFG_RF_TYPE_MS:
iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |=
IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU;
if (!is_ap)
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 85643396c71241aa8b5afc4e23e1099b170f6517 Mon Sep 17 00:00:00 2001
From: Abhishek Naik <abhishek.naik(a)intel.com>
Date: Sun, 30 Jan 2022 11:53:06 +0200
Subject: [PATCH] iwlwifi: nvm: Correct HE capability
The HE PHY capability - Tx 1024-QAM < 242-tone RU support
was not handled for Ms RFs, add the relevant code for it.
Signed-off-by: Abhishek Naik <abhishek.naik(a)intel.com>
Fixes: 1381eb5c8ed5 ("iwlwifi: correct HE capabilities")
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220130115024.01e232ce98ca.I765d26e9eb6a…
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 0693dfda43a3..0dfd69fcd5d7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -784,6 +784,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
case IWL_CFG_RF_TYPE_GF:
case IWL_CFG_RF_TYPE_MR:
+ case IWL_CFG_RF_TYPE_MS:
iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |=
IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU;
if (!is_ap)
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 85643396c71241aa8b5afc4e23e1099b170f6517 Mon Sep 17 00:00:00 2001
From: Abhishek Naik <abhishek.naik(a)intel.com>
Date: Sun, 30 Jan 2022 11:53:06 +0200
Subject: [PATCH] iwlwifi: nvm: Correct HE capability
The HE PHY capability - Tx 1024-QAM < 242-tone RU support
was not handled for Ms RFs, add the relevant code for it.
Signed-off-by: Abhishek Naik <abhishek.naik(a)intel.com>
Fixes: 1381eb5c8ed5 ("iwlwifi: correct HE capabilities")
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220130115024.01e232ce98ca.I765d26e9eb6a…
Signed-off-by: Luca Coelho <luciano.coelho(a)intel.com>
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 0693dfda43a3..0dfd69fcd5d7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -784,6 +784,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
case IWL_CFG_RF_TYPE_GF:
case IWL_CFG_RF_TYPE_MR:
+ case IWL_CFG_RF_TYPE_MS:
iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |=
IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU;
if (!is_ap)
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b88cba55883eaafbc9b7cbff0b2c7cdba71ed01 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet(a)google.com>
Date: Mon, 21 Feb 2022 19:21:13 -0800
Subject: [PATCH] net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len)
in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx;
void *ptr1 = kmalloc(size, gfp);
void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2)
ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot
that TCP was possibly shifting data after skb_unclone_keeptruesize()
has been used, notably from tcp_retrans_try_collapse().
So we not only need to keep same skb->truesize value,
we also need to make sure TCP wont fill new tailroom
that pskb_expand_head() was able to get from a
addr = kmalloc(...) followed by ksize(addr)
Split skb_unclone_keeptruesize() into two parts:
1) Inline skb_unclone_keeptruesize() for the common case,
when skb is not cloned.
2) Out of line __skb_unclone_keeptruesize() for the 'slow path'.
WARNING: CPU: 1 PID: 6490 at net/core/skbuff.c:5295 skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Modules linked in:
CPU: 1 PID: 6490 Comm: syz-executor161 Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Code: bf 01 00 00 00 0f b7 c0 89 c6 89 44 24 20 e8 62 24 4e fa 8b 44 24 20 83 e8 01 0f 85 e5 f0 ff ff e9 87 f4 ff ff e8 cb 20 4e fa <0f> 0b e9 06 f9 ff ff e8 af b2 95 fa e9 69 f0 ff ff e8 95 b2 95 fa
RSP: 0018:ffffc900063af268 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000ffffffd5 RCX: 0000000000000000
RDX: ffff88806fc05700 RSI: ffffffff872abd55 RDI: 0000000000000003
RBP: ffff88806e675500 R08: 00000000ffffffd5 R09: 0000000000000000
R10: ffffffff872ab659 R11: 0000000000000000 R12: ffff88806dd554e8
R13: ffff88806dd9bac0 R14: ffff88806dd9a2c0 R15: 0000000000000155
FS: 00007f18014f9700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000006be7a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tcp_try_coalesce net/ipv4/tcp_input.c:4651 [inline]
tcp_try_coalesce+0x393/0x920 net/ipv4/tcp_input.c:4630
tcp_queue_rcv+0x8a/0x6e0 net/ipv4/tcp_input.c:4914
tcp_data_queue+0x11fd/0x4bb0 net/ipv4/tcp_input.c:5025
tcp_rcv_established+0x81e/0x1ff0 net/ipv4/tcp_input.c:5947
tcp_v4_do_rcv+0x65e/0x980 net/ipv4/tcp_ipv4.c:1719
sk_backlog_rcv include/net/sock.h:1037 [inline]
__release_sock+0x134/0x3b0 net/core/sock.c:2779
release_sock+0x54/0x1b0 net/core/sock.c:3311
sk_wait_data+0x177/0x450 net/core/sock.c:2821
tcp_recvmsg_locked+0xe28/0x1fd0 net/ipv4/tcp.c:2457
tcp_recvmsg+0x137/0x610 net/ipv4/tcp.c:2572
inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:850
sock_recvmsg_nosec net/socket.c:948 [inline]
sock_recvmsg net/socket.c:966 [inline]
sock_recvmsg net/socket.c:962 [inline]
____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
___sys_recvmsg+0x127/0x200 net/socket.c:2674
__sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: c4777efa751d ("net: add and use skb_unclone_keeptruesize() helper")
Fixes: 097b9146c0e2 ("net: fix up truesize of cloned skb in skb_prepare_for_shift()")
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 115be7f73487..31be38078918 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1795,19 +1795,19 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
return 0;
}
-/* This variant of skb_unclone() makes sure skb->truesize is not changed */
+/* This variant of skb_unclone() makes sure skb->truesize
+ * and skb_end_offset() are not changed, whenever a new skb->head is needed.
+ *
+ * Indeed there is no guarantee that ksize(kmalloc(X)) == ksize(kmalloc(X))
+ * when various debugging features are in place.
+ */
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri);
static inline int skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(gfpflags_allow_blocking(pri));
- if (skb_cloned(skb)) {
- unsigned int save = skb->truesize;
- int res;
-
- res = pskb_expand_head(skb, 0, 0, pri);
- skb->truesize = save;
- return res;
- }
+ if (skb_cloned(skb))
+ return __skb_unclone_keeptruesize(skb, pri);
return 0;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 27a2296241c9..725f2b356769 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1787,6 +1787,38 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
}
EXPORT_SYMBOL(skb_realloc_headroom);
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
+{
+ unsigned int saved_end_offset, saved_truesize;
+ struct skb_shared_info *shinfo;
+ int res;
+
+ saved_end_offset = skb_end_offset(skb);
+ saved_truesize = skb->truesize;
+
+ res = pskb_expand_head(skb, 0, 0, pri);
+ if (res)
+ return res;
+
+ skb->truesize = saved_truesize;
+
+ if (likely(skb_end_offset(skb) == saved_end_offset))
+ return 0;
+
+ shinfo = skb_shinfo(skb);
+
+ /* We are about to change back skb->end,
+ * we need to move skb_shinfo() to its new location.
+ */
+ memmove(skb->head + saved_end_offset,
+ shinfo,
+ offsetof(struct skb_shared_info, frags[shinfo->nr_frags]));
+
+ skb_set_end_offset(skb, saved_end_offset);
+
+ return 0;
+}
+
/**
* skb_expand_head - reallocate header of &sk_buff
* @skb: buffer to reallocate
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b88cba55883eaafbc9b7cbff0b2c7cdba71ed01 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet(a)google.com>
Date: Mon, 21 Feb 2022 19:21:13 -0800
Subject: [PATCH] net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len)
in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx;
void *ptr1 = kmalloc(size, gfp);
void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2)
ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot
that TCP was possibly shifting data after skb_unclone_keeptruesize()
has been used, notably from tcp_retrans_try_collapse().
So we not only need to keep same skb->truesize value,
we also need to make sure TCP wont fill new tailroom
that pskb_expand_head() was able to get from a
addr = kmalloc(...) followed by ksize(addr)
Split skb_unclone_keeptruesize() into two parts:
1) Inline skb_unclone_keeptruesize() for the common case,
when skb is not cloned.
2) Out of line __skb_unclone_keeptruesize() for the 'slow path'.
WARNING: CPU: 1 PID: 6490 at net/core/skbuff.c:5295 skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Modules linked in:
CPU: 1 PID: 6490 Comm: syz-executor161 Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Code: bf 01 00 00 00 0f b7 c0 89 c6 89 44 24 20 e8 62 24 4e fa 8b 44 24 20 83 e8 01 0f 85 e5 f0 ff ff e9 87 f4 ff ff e8 cb 20 4e fa <0f> 0b e9 06 f9 ff ff e8 af b2 95 fa e9 69 f0 ff ff e8 95 b2 95 fa
RSP: 0018:ffffc900063af268 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000ffffffd5 RCX: 0000000000000000
RDX: ffff88806fc05700 RSI: ffffffff872abd55 RDI: 0000000000000003
RBP: ffff88806e675500 R08: 00000000ffffffd5 R09: 0000000000000000
R10: ffffffff872ab659 R11: 0000000000000000 R12: ffff88806dd554e8
R13: ffff88806dd9bac0 R14: ffff88806dd9a2c0 R15: 0000000000000155
FS: 00007f18014f9700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000006be7a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tcp_try_coalesce net/ipv4/tcp_input.c:4651 [inline]
tcp_try_coalesce+0x393/0x920 net/ipv4/tcp_input.c:4630
tcp_queue_rcv+0x8a/0x6e0 net/ipv4/tcp_input.c:4914
tcp_data_queue+0x11fd/0x4bb0 net/ipv4/tcp_input.c:5025
tcp_rcv_established+0x81e/0x1ff0 net/ipv4/tcp_input.c:5947
tcp_v4_do_rcv+0x65e/0x980 net/ipv4/tcp_ipv4.c:1719
sk_backlog_rcv include/net/sock.h:1037 [inline]
__release_sock+0x134/0x3b0 net/core/sock.c:2779
release_sock+0x54/0x1b0 net/core/sock.c:3311
sk_wait_data+0x177/0x450 net/core/sock.c:2821
tcp_recvmsg_locked+0xe28/0x1fd0 net/ipv4/tcp.c:2457
tcp_recvmsg+0x137/0x610 net/ipv4/tcp.c:2572
inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:850
sock_recvmsg_nosec net/socket.c:948 [inline]
sock_recvmsg net/socket.c:966 [inline]
sock_recvmsg net/socket.c:962 [inline]
____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
___sys_recvmsg+0x127/0x200 net/socket.c:2674
__sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: c4777efa751d ("net: add and use skb_unclone_keeptruesize() helper")
Fixes: 097b9146c0e2 ("net: fix up truesize of cloned skb in skb_prepare_for_shift()")
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 115be7f73487..31be38078918 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1795,19 +1795,19 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
return 0;
}
-/* This variant of skb_unclone() makes sure skb->truesize is not changed */
+/* This variant of skb_unclone() makes sure skb->truesize
+ * and skb_end_offset() are not changed, whenever a new skb->head is needed.
+ *
+ * Indeed there is no guarantee that ksize(kmalloc(X)) == ksize(kmalloc(X))
+ * when various debugging features are in place.
+ */
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri);
static inline int skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(gfpflags_allow_blocking(pri));
- if (skb_cloned(skb)) {
- unsigned int save = skb->truesize;
- int res;
-
- res = pskb_expand_head(skb, 0, 0, pri);
- skb->truesize = save;
- return res;
- }
+ if (skb_cloned(skb))
+ return __skb_unclone_keeptruesize(skb, pri);
return 0;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 27a2296241c9..725f2b356769 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1787,6 +1787,38 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
}
EXPORT_SYMBOL(skb_realloc_headroom);
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
+{
+ unsigned int saved_end_offset, saved_truesize;
+ struct skb_shared_info *shinfo;
+ int res;
+
+ saved_end_offset = skb_end_offset(skb);
+ saved_truesize = skb->truesize;
+
+ res = pskb_expand_head(skb, 0, 0, pri);
+ if (res)
+ return res;
+
+ skb->truesize = saved_truesize;
+
+ if (likely(skb_end_offset(skb) == saved_end_offset))
+ return 0;
+
+ shinfo = skb_shinfo(skb);
+
+ /* We are about to change back skb->end,
+ * we need to move skb_shinfo() to its new location.
+ */
+ memmove(skb->head + saved_end_offset,
+ shinfo,
+ offsetof(struct skb_shared_info, frags[shinfo->nr_frags]));
+
+ skb_set_end_offset(skb, saved_end_offset);
+
+ return 0;
+}
+
/**
* skb_expand_head - reallocate header of &sk_buff
* @skb: buffer to reallocate
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b88cba55883eaafbc9b7cbff0b2c7cdba71ed01 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet(a)google.com>
Date: Mon, 21 Feb 2022 19:21:13 -0800
Subject: [PATCH] net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len)
in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx;
void *ptr1 = kmalloc(size, gfp);
void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2)
ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot
that TCP was possibly shifting data after skb_unclone_keeptruesize()
has been used, notably from tcp_retrans_try_collapse().
So we not only need to keep same skb->truesize value,
we also need to make sure TCP wont fill new tailroom
that pskb_expand_head() was able to get from a
addr = kmalloc(...) followed by ksize(addr)
Split skb_unclone_keeptruesize() into two parts:
1) Inline skb_unclone_keeptruesize() for the common case,
when skb is not cloned.
2) Out of line __skb_unclone_keeptruesize() for the 'slow path'.
WARNING: CPU: 1 PID: 6490 at net/core/skbuff.c:5295 skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Modules linked in:
CPU: 1 PID: 6490 Comm: syz-executor161 Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Code: bf 01 00 00 00 0f b7 c0 89 c6 89 44 24 20 e8 62 24 4e fa 8b 44 24 20 83 e8 01 0f 85 e5 f0 ff ff e9 87 f4 ff ff e8 cb 20 4e fa <0f> 0b e9 06 f9 ff ff e8 af b2 95 fa e9 69 f0 ff ff e8 95 b2 95 fa
RSP: 0018:ffffc900063af268 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000ffffffd5 RCX: 0000000000000000
RDX: ffff88806fc05700 RSI: ffffffff872abd55 RDI: 0000000000000003
RBP: ffff88806e675500 R08: 00000000ffffffd5 R09: 0000000000000000
R10: ffffffff872ab659 R11: 0000000000000000 R12: ffff88806dd554e8
R13: ffff88806dd9bac0 R14: ffff88806dd9a2c0 R15: 0000000000000155
FS: 00007f18014f9700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000006be7a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tcp_try_coalesce net/ipv4/tcp_input.c:4651 [inline]
tcp_try_coalesce+0x393/0x920 net/ipv4/tcp_input.c:4630
tcp_queue_rcv+0x8a/0x6e0 net/ipv4/tcp_input.c:4914
tcp_data_queue+0x11fd/0x4bb0 net/ipv4/tcp_input.c:5025
tcp_rcv_established+0x81e/0x1ff0 net/ipv4/tcp_input.c:5947
tcp_v4_do_rcv+0x65e/0x980 net/ipv4/tcp_ipv4.c:1719
sk_backlog_rcv include/net/sock.h:1037 [inline]
__release_sock+0x134/0x3b0 net/core/sock.c:2779
release_sock+0x54/0x1b0 net/core/sock.c:3311
sk_wait_data+0x177/0x450 net/core/sock.c:2821
tcp_recvmsg_locked+0xe28/0x1fd0 net/ipv4/tcp.c:2457
tcp_recvmsg+0x137/0x610 net/ipv4/tcp.c:2572
inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:850
sock_recvmsg_nosec net/socket.c:948 [inline]
sock_recvmsg net/socket.c:966 [inline]
sock_recvmsg net/socket.c:962 [inline]
____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
___sys_recvmsg+0x127/0x200 net/socket.c:2674
__sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: c4777efa751d ("net: add and use skb_unclone_keeptruesize() helper")
Fixes: 097b9146c0e2 ("net: fix up truesize of cloned skb in skb_prepare_for_shift()")
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 115be7f73487..31be38078918 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1795,19 +1795,19 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
return 0;
}
-/* This variant of skb_unclone() makes sure skb->truesize is not changed */
+/* This variant of skb_unclone() makes sure skb->truesize
+ * and skb_end_offset() are not changed, whenever a new skb->head is needed.
+ *
+ * Indeed there is no guarantee that ksize(kmalloc(X)) == ksize(kmalloc(X))
+ * when various debugging features are in place.
+ */
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri);
static inline int skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(gfpflags_allow_blocking(pri));
- if (skb_cloned(skb)) {
- unsigned int save = skb->truesize;
- int res;
-
- res = pskb_expand_head(skb, 0, 0, pri);
- skb->truesize = save;
- return res;
- }
+ if (skb_cloned(skb))
+ return __skb_unclone_keeptruesize(skb, pri);
return 0;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 27a2296241c9..725f2b356769 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1787,6 +1787,38 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
}
EXPORT_SYMBOL(skb_realloc_headroom);
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
+{
+ unsigned int saved_end_offset, saved_truesize;
+ struct skb_shared_info *shinfo;
+ int res;
+
+ saved_end_offset = skb_end_offset(skb);
+ saved_truesize = skb->truesize;
+
+ res = pskb_expand_head(skb, 0, 0, pri);
+ if (res)
+ return res;
+
+ skb->truesize = saved_truesize;
+
+ if (likely(skb_end_offset(skb) == saved_end_offset))
+ return 0;
+
+ shinfo = skb_shinfo(skb);
+
+ /* We are about to change back skb->end,
+ * we need to move skb_shinfo() to its new location.
+ */
+ memmove(skb->head + saved_end_offset,
+ shinfo,
+ offsetof(struct skb_shared_info, frags[shinfo->nr_frags]));
+
+ skb_set_end_offset(skb, saved_end_offset);
+
+ return 0;
+}
+
/**
* skb_expand_head - reallocate header of &sk_buff
* @skb: buffer to reallocate
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b88cba55883eaafbc9b7cbff0b2c7cdba71ed01 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet(a)google.com>
Date: Mon, 21 Feb 2022 19:21:13 -0800
Subject: [PATCH] net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len)
in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx;
void *ptr1 = kmalloc(size, gfp);
void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2)
ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot
that TCP was possibly shifting data after skb_unclone_keeptruesize()
has been used, notably from tcp_retrans_try_collapse().
So we not only need to keep same skb->truesize value,
we also need to make sure TCP wont fill new tailroom
that pskb_expand_head() was able to get from a
addr = kmalloc(...) followed by ksize(addr)
Split skb_unclone_keeptruesize() into two parts:
1) Inline skb_unclone_keeptruesize() for the common case,
when skb is not cloned.
2) Out of line __skb_unclone_keeptruesize() for the 'slow path'.
WARNING: CPU: 1 PID: 6490 at net/core/skbuff.c:5295 skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Modules linked in:
CPU: 1 PID: 6490 Comm: syz-executor161 Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Code: bf 01 00 00 00 0f b7 c0 89 c6 89 44 24 20 e8 62 24 4e fa 8b 44 24 20 83 e8 01 0f 85 e5 f0 ff ff e9 87 f4 ff ff e8 cb 20 4e fa <0f> 0b e9 06 f9 ff ff e8 af b2 95 fa e9 69 f0 ff ff e8 95 b2 95 fa
RSP: 0018:ffffc900063af268 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000ffffffd5 RCX: 0000000000000000
RDX: ffff88806fc05700 RSI: ffffffff872abd55 RDI: 0000000000000003
RBP: ffff88806e675500 R08: 00000000ffffffd5 R09: 0000000000000000
R10: ffffffff872ab659 R11: 0000000000000000 R12: ffff88806dd554e8
R13: ffff88806dd9bac0 R14: ffff88806dd9a2c0 R15: 0000000000000155
FS: 00007f18014f9700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000006be7a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tcp_try_coalesce net/ipv4/tcp_input.c:4651 [inline]
tcp_try_coalesce+0x393/0x920 net/ipv4/tcp_input.c:4630
tcp_queue_rcv+0x8a/0x6e0 net/ipv4/tcp_input.c:4914
tcp_data_queue+0x11fd/0x4bb0 net/ipv4/tcp_input.c:5025
tcp_rcv_established+0x81e/0x1ff0 net/ipv4/tcp_input.c:5947
tcp_v4_do_rcv+0x65e/0x980 net/ipv4/tcp_ipv4.c:1719
sk_backlog_rcv include/net/sock.h:1037 [inline]
__release_sock+0x134/0x3b0 net/core/sock.c:2779
release_sock+0x54/0x1b0 net/core/sock.c:3311
sk_wait_data+0x177/0x450 net/core/sock.c:2821
tcp_recvmsg_locked+0xe28/0x1fd0 net/ipv4/tcp.c:2457
tcp_recvmsg+0x137/0x610 net/ipv4/tcp.c:2572
inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:850
sock_recvmsg_nosec net/socket.c:948 [inline]
sock_recvmsg net/socket.c:966 [inline]
sock_recvmsg net/socket.c:962 [inline]
____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
___sys_recvmsg+0x127/0x200 net/socket.c:2674
__sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: c4777efa751d ("net: add and use skb_unclone_keeptruesize() helper")
Fixes: 097b9146c0e2 ("net: fix up truesize of cloned skb in skb_prepare_for_shift()")
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 115be7f73487..31be38078918 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1795,19 +1795,19 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
return 0;
}
-/* This variant of skb_unclone() makes sure skb->truesize is not changed */
+/* This variant of skb_unclone() makes sure skb->truesize
+ * and skb_end_offset() are not changed, whenever a new skb->head is needed.
+ *
+ * Indeed there is no guarantee that ksize(kmalloc(X)) == ksize(kmalloc(X))
+ * when various debugging features are in place.
+ */
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri);
static inline int skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(gfpflags_allow_blocking(pri));
- if (skb_cloned(skb)) {
- unsigned int save = skb->truesize;
- int res;
-
- res = pskb_expand_head(skb, 0, 0, pri);
- skb->truesize = save;
- return res;
- }
+ if (skb_cloned(skb))
+ return __skb_unclone_keeptruesize(skb, pri);
return 0;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 27a2296241c9..725f2b356769 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1787,6 +1787,38 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
}
EXPORT_SYMBOL(skb_realloc_headroom);
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
+{
+ unsigned int saved_end_offset, saved_truesize;
+ struct skb_shared_info *shinfo;
+ int res;
+
+ saved_end_offset = skb_end_offset(skb);
+ saved_truesize = skb->truesize;
+
+ res = pskb_expand_head(skb, 0, 0, pri);
+ if (res)
+ return res;
+
+ skb->truesize = saved_truesize;
+
+ if (likely(skb_end_offset(skb) == saved_end_offset))
+ return 0;
+
+ shinfo = skb_shinfo(skb);
+
+ /* We are about to change back skb->end,
+ * we need to move skb_shinfo() to its new location.
+ */
+ memmove(skb->head + saved_end_offset,
+ shinfo,
+ offsetof(struct skb_shared_info, frags[shinfo->nr_frags]));
+
+ skb_set_end_offset(skb, saved_end_offset);
+
+ return 0;
+}
+
/**
* skb_expand_head - reallocate header of &sk_buff
* @skb: buffer to reallocate
The patch below does not apply to the 5.17-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2b88cba55883eaafbc9b7cbff0b2c7cdba71ed01 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet(a)google.com>
Date: Mon, 21 Feb 2022 19:21:13 -0800
Subject: [PATCH] net: preserve skb_end_offset() in skb_unclone_keeptruesize()
syzbot found another way to trigger the infamous WARN_ON_ONCE(delta < len)
in skb_try_coalesce() [1]
I was able to root cause the issue to kfence.
When kfence is in action, the following assertion is no longer true:
int size = xxxx;
void *ptr1 = kmalloc(size, gfp);
void *ptr2 = kmalloc(size, gfp);
if (ptr1 && ptr2)
ASSERT(ksize(ptr1) == ksize(ptr2));
We attempted to fix these issues in the blamed commits, but forgot
that TCP was possibly shifting data after skb_unclone_keeptruesize()
has been used, notably from tcp_retrans_try_collapse().
So we not only need to keep same skb->truesize value,
we also need to make sure TCP wont fill new tailroom
that pskb_expand_head() was able to get from a
addr = kmalloc(...) followed by ksize(addr)
Split skb_unclone_keeptruesize() into two parts:
1) Inline skb_unclone_keeptruesize() for the common case,
when skb is not cloned.
2) Out of line __skb_unclone_keeptruesize() for the 'slow path'.
WARNING: CPU: 1 PID: 6490 at net/core/skbuff.c:5295 skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Modules linked in:
CPU: 1 PID: 6490 Comm: syz-executor161 Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:skb_try_coalesce+0x1235/0x1560 net/core/skbuff.c:5295
Code: bf 01 00 00 00 0f b7 c0 89 c6 89 44 24 20 e8 62 24 4e fa 8b 44 24 20 83 e8 01 0f 85 e5 f0 ff ff e9 87 f4 ff ff e8 cb 20 4e fa <0f> 0b e9 06 f9 ff ff e8 af b2 95 fa e9 69 f0 ff ff e8 95 b2 95 fa
RSP: 0018:ffffc900063af268 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 00000000ffffffd5 RCX: 0000000000000000
RDX: ffff88806fc05700 RSI: ffffffff872abd55 RDI: 0000000000000003
RBP: ffff88806e675500 R08: 00000000ffffffd5 R09: 0000000000000000
R10: ffffffff872ab659 R11: 0000000000000000 R12: ffff88806dd554e8
R13: ffff88806dd9bac0 R14: ffff88806dd9a2c0 R15: 0000000000000155
FS: 00007f18014f9700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000006be7a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
tcp_try_coalesce net/ipv4/tcp_input.c:4651 [inline]
tcp_try_coalesce+0x393/0x920 net/ipv4/tcp_input.c:4630
tcp_queue_rcv+0x8a/0x6e0 net/ipv4/tcp_input.c:4914
tcp_data_queue+0x11fd/0x4bb0 net/ipv4/tcp_input.c:5025
tcp_rcv_established+0x81e/0x1ff0 net/ipv4/tcp_input.c:5947
tcp_v4_do_rcv+0x65e/0x980 net/ipv4/tcp_ipv4.c:1719
sk_backlog_rcv include/net/sock.h:1037 [inline]
__release_sock+0x134/0x3b0 net/core/sock.c:2779
release_sock+0x54/0x1b0 net/core/sock.c:3311
sk_wait_data+0x177/0x450 net/core/sock.c:2821
tcp_recvmsg_locked+0xe28/0x1fd0 net/ipv4/tcp.c:2457
tcp_recvmsg+0x137/0x610 net/ipv4/tcp.c:2572
inet_recvmsg+0x11b/0x5e0 net/ipv4/af_inet.c:850
sock_recvmsg_nosec net/socket.c:948 [inline]
sock_recvmsg net/socket.c:966 [inline]
sock_recvmsg net/socket.c:962 [inline]
____sys_recvmsg+0x2c4/0x600 net/socket.c:2632
___sys_recvmsg+0x127/0x200 net/socket.c:2674
__sys_recvmsg+0xe2/0x1a0 net/socket.c:2704
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: c4777efa751d ("net: add and use skb_unclone_keeptruesize() helper")
Fixes: 097b9146c0e2 ("net: fix up truesize of cloned skb in skb_prepare_for_shift()")
Reported-by: syzbot <syzkaller(a)googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 115be7f73487..31be38078918 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1795,19 +1795,19 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
return 0;
}
-/* This variant of skb_unclone() makes sure skb->truesize is not changed */
+/* This variant of skb_unclone() makes sure skb->truesize
+ * and skb_end_offset() are not changed, whenever a new skb->head is needed.
+ *
+ * Indeed there is no guarantee that ksize(kmalloc(X)) == ksize(kmalloc(X))
+ * when various debugging features are in place.
+ */
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri);
static inline int skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
{
might_sleep_if(gfpflags_allow_blocking(pri));
- if (skb_cloned(skb)) {
- unsigned int save = skb->truesize;
- int res;
-
- res = pskb_expand_head(skb, 0, 0, pri);
- skb->truesize = save;
- return res;
- }
+ if (skb_cloned(skb))
+ return __skb_unclone_keeptruesize(skb, pri);
return 0;
}
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 27a2296241c9..725f2b356769 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1787,6 +1787,38 @@ struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, unsigned int headroom)
}
EXPORT_SYMBOL(skb_realloc_headroom);
+int __skb_unclone_keeptruesize(struct sk_buff *skb, gfp_t pri)
+{
+ unsigned int saved_end_offset, saved_truesize;
+ struct skb_shared_info *shinfo;
+ int res;
+
+ saved_end_offset = skb_end_offset(skb);
+ saved_truesize = skb->truesize;
+
+ res = pskb_expand_head(skb, 0, 0, pri);
+ if (res)
+ return res;
+
+ skb->truesize = saved_truesize;
+
+ if (likely(skb_end_offset(skb) == saved_end_offset))
+ return 0;
+
+ shinfo = skb_shinfo(skb);
+
+ /* We are about to change back skb->end,
+ * we need to move skb_shinfo() to its new location.
+ */
+ memmove(skb->head + saved_end_offset,
+ shinfo,
+ offsetof(struct skb_shared_info, frags[shinfo->nr_frags]));
+
+ skb_set_end_offset(skb, saved_end_offset);
+
+ return 0;
+}
+
/**
* skb_expand_head - reallocate header of &sk_buff
* @skb: buffer to reallocate
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7336905a89f19173bf9301cd50a24421162f417c Mon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <agruenba(a)redhat.com>
Date: Fri, 10 Dec 2021 14:43:36 +0100
Subject: [PATCH] gfs2: gfs2_setattr_size error path fix
When gfs2_setattr_size() fails, it calls gfs2_rs_delete(ip, NULL) to get
rid of any reservations the inode may have. Instead, it should pass in
the inode's write count as the second parameter to allow
gfs2_rs_delete() to figure out if the inode has any writers left.
In a next step, there are two instances of gfs2_rs_delete(ip, NULL) left
where we know that there can be no other users of the inode. Replace
those with gfs2_rs_deltree(&ip->i_res) to avoid the unnecessary write
count check.
With that, gfs2_rs_delete() is only called with the inode's actual write
count, so get rid of the second parameter.
Fixes: a097dc7e24cb ("GFS2: Make rgrp reservations part of the gfs2_inode structure")
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index d67108489148..fbdb7a30470a 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2146,7 +2146,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
ret = do_shrink(inode, newsize);
out:
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
return ret;
}
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 8c39a8571b1f..5bac4f6e8e05 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -706,7 +706,7 @@ static int gfs2_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
- gfs2_rs_delete(ip, &inode->i_writecount);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
}
return 0;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 89905f4f29bb..66a123306aec 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
if (free_vfs_inode) /* else evict will do the put for us */
gfs2_glock_put(ip->i_gl);
}
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_qa_put(ip);
fail_free_acls:
posix_acl_release(default_acl);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9b04a570c582..9df8a84f85a6 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -680,13 +680,14 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
/**
* gfs2_rs_delete - delete a multi-block reservation
* @ip: The inode for this reservation
- * @wcount: The inode's write count, or NULL
*
*/
-void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
+void gfs2_rs_delete(struct gfs2_inode *ip)
{
+ struct inode *inode = &ip->i_inode;
+
down_write(&ip->i_rw_mutex);
- if ((wcount == NULL) || (atomic_read(wcount) <= 1))
+ if (atomic_read(&inode->i_writecount) <= 1)
gfs2_rs_deltree(&ip->i_res);
up_write(&ip->i_rw_mutex);
}
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 3e2ca1fb4305..46dd94e9e085 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
bool dinode, u64 *generation);
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
-extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
+extern void gfs2_rs_delete(struct gfs2_inode *ip);
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
u64 bstart, u32 blen, int meta);
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 64c67090f503..143a47359d1b 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1396,7 +1396,7 @@ static void gfs2_evict_inode(struct inode *inode)
truncate_inode_pages_final(&inode->i_data);
if (ip->i_qadata)
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_ordered_del_inode(ip);
clear_inode(inode);
gfs2_dir_hash_inval(ip);
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7336905a89f19173bf9301cd50a24421162f417c Mon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <agruenba(a)redhat.com>
Date: Fri, 10 Dec 2021 14:43:36 +0100
Subject: [PATCH] gfs2: gfs2_setattr_size error path fix
When gfs2_setattr_size() fails, it calls gfs2_rs_delete(ip, NULL) to get
rid of any reservations the inode may have. Instead, it should pass in
the inode's write count as the second parameter to allow
gfs2_rs_delete() to figure out if the inode has any writers left.
In a next step, there are two instances of gfs2_rs_delete(ip, NULL) left
where we know that there can be no other users of the inode. Replace
those with gfs2_rs_deltree(&ip->i_res) to avoid the unnecessary write
count check.
With that, gfs2_rs_delete() is only called with the inode's actual write
count, so get rid of the second parameter.
Fixes: a097dc7e24cb ("GFS2: Make rgrp reservations part of the gfs2_inode structure")
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index d67108489148..fbdb7a30470a 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2146,7 +2146,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
ret = do_shrink(inode, newsize);
out:
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
return ret;
}
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 8c39a8571b1f..5bac4f6e8e05 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -706,7 +706,7 @@ static int gfs2_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
- gfs2_rs_delete(ip, &inode->i_writecount);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
}
return 0;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 89905f4f29bb..66a123306aec 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
if (free_vfs_inode) /* else evict will do the put for us */
gfs2_glock_put(ip->i_gl);
}
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_qa_put(ip);
fail_free_acls:
posix_acl_release(default_acl);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9b04a570c582..9df8a84f85a6 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -680,13 +680,14 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
/**
* gfs2_rs_delete - delete a multi-block reservation
* @ip: The inode for this reservation
- * @wcount: The inode's write count, or NULL
*
*/
-void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
+void gfs2_rs_delete(struct gfs2_inode *ip)
{
+ struct inode *inode = &ip->i_inode;
+
down_write(&ip->i_rw_mutex);
- if ((wcount == NULL) || (atomic_read(wcount) <= 1))
+ if (atomic_read(&inode->i_writecount) <= 1)
gfs2_rs_deltree(&ip->i_res);
up_write(&ip->i_rw_mutex);
}
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 3e2ca1fb4305..46dd94e9e085 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
bool dinode, u64 *generation);
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
-extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
+extern void gfs2_rs_delete(struct gfs2_inode *ip);
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
u64 bstart, u32 blen, int meta);
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 64c67090f503..143a47359d1b 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1396,7 +1396,7 @@ static void gfs2_evict_inode(struct inode *inode)
truncate_inode_pages_final(&inode->i_data);
if (ip->i_qadata)
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_ordered_del_inode(ip);
clear_inode(inode);
gfs2_dir_hash_inval(ip);
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7336905a89f19173bf9301cd50a24421162f417c Mon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <agruenba(a)redhat.com>
Date: Fri, 10 Dec 2021 14:43:36 +0100
Subject: [PATCH] gfs2: gfs2_setattr_size error path fix
When gfs2_setattr_size() fails, it calls gfs2_rs_delete(ip, NULL) to get
rid of any reservations the inode may have. Instead, it should pass in
the inode's write count as the second parameter to allow
gfs2_rs_delete() to figure out if the inode has any writers left.
In a next step, there are two instances of gfs2_rs_delete(ip, NULL) left
where we know that there can be no other users of the inode. Replace
those with gfs2_rs_deltree(&ip->i_res) to avoid the unnecessary write
count check.
With that, gfs2_rs_delete() is only called with the inode's actual write
count, so get rid of the second parameter.
Fixes: a097dc7e24cb ("GFS2: Make rgrp reservations part of the gfs2_inode structure")
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index d67108489148..fbdb7a30470a 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2146,7 +2146,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
ret = do_shrink(inode, newsize);
out:
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
return ret;
}
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 8c39a8571b1f..5bac4f6e8e05 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -706,7 +706,7 @@ static int gfs2_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
- gfs2_rs_delete(ip, &inode->i_writecount);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
}
return 0;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 89905f4f29bb..66a123306aec 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
if (free_vfs_inode) /* else evict will do the put for us */
gfs2_glock_put(ip->i_gl);
}
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_qa_put(ip);
fail_free_acls:
posix_acl_release(default_acl);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9b04a570c582..9df8a84f85a6 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -680,13 +680,14 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
/**
* gfs2_rs_delete - delete a multi-block reservation
* @ip: The inode for this reservation
- * @wcount: The inode's write count, or NULL
*
*/
-void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
+void gfs2_rs_delete(struct gfs2_inode *ip)
{
+ struct inode *inode = &ip->i_inode;
+
down_write(&ip->i_rw_mutex);
- if ((wcount == NULL) || (atomic_read(wcount) <= 1))
+ if (atomic_read(&inode->i_writecount) <= 1)
gfs2_rs_deltree(&ip->i_res);
up_write(&ip->i_rw_mutex);
}
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 3e2ca1fb4305..46dd94e9e085 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
bool dinode, u64 *generation);
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
-extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
+extern void gfs2_rs_delete(struct gfs2_inode *ip);
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
u64 bstart, u32 blen, int meta);
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 64c67090f503..143a47359d1b 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1396,7 +1396,7 @@ static void gfs2_evict_inode(struct inode *inode)
truncate_inode_pages_final(&inode->i_data);
if (ip->i_qadata)
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_ordered_del_inode(ip);
clear_inode(inode);
gfs2_dir_hash_inval(ip);
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7336905a89f19173bf9301cd50a24421162f417c Mon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <agruenba(a)redhat.com>
Date: Fri, 10 Dec 2021 14:43:36 +0100
Subject: [PATCH] gfs2: gfs2_setattr_size error path fix
When gfs2_setattr_size() fails, it calls gfs2_rs_delete(ip, NULL) to get
rid of any reservations the inode may have. Instead, it should pass in
the inode's write count as the second parameter to allow
gfs2_rs_delete() to figure out if the inode has any writers left.
In a next step, there are two instances of gfs2_rs_delete(ip, NULL) left
where we know that there can be no other users of the inode. Replace
those with gfs2_rs_deltree(&ip->i_res) to avoid the unnecessary write
count check.
With that, gfs2_rs_delete() is only called with the inode's actual write
count, so get rid of the second parameter.
Fixes: a097dc7e24cb ("GFS2: Make rgrp reservations part of the gfs2_inode structure")
Signed-off-by: Andreas Gruenbacher <agruenba(a)redhat.com>
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index d67108489148..fbdb7a30470a 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -2146,7 +2146,7 @@ int gfs2_setattr_size(struct inode *inode, u64 newsize)
ret = do_shrink(inode, newsize);
out:
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
return ret;
}
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 8c39a8571b1f..5bac4f6e8e05 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -706,7 +706,7 @@ static int gfs2_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
- gfs2_rs_delete(ip, &inode->i_writecount);
+ gfs2_rs_delete(ip);
gfs2_qa_put(ip);
}
return 0;
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 89905f4f29bb..66a123306aec 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
if (free_vfs_inode) /* else evict will do the put for us */
gfs2_glock_put(ip->i_gl);
}
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_qa_put(ip);
fail_free_acls:
posix_acl_release(default_acl);
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 9b04a570c582..9df8a84f85a6 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -680,13 +680,14 @@ void gfs2_rs_deltree(struct gfs2_blkreserv *rs)
/**
* gfs2_rs_delete - delete a multi-block reservation
* @ip: The inode for this reservation
- * @wcount: The inode's write count, or NULL
*
*/
-void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount)
+void gfs2_rs_delete(struct gfs2_inode *ip)
{
+ struct inode *inode = &ip->i_inode;
+
down_write(&ip->i_rw_mutex);
- if ((wcount == NULL) || (atomic_read(wcount) <= 1))
+ if (atomic_read(&inode->i_writecount) <= 1)
gfs2_rs_deltree(&ip->i_res);
up_write(&ip->i_rw_mutex);
}
diff --git a/fs/gfs2/rgrp.h b/fs/gfs2/rgrp.h
index 3e2ca1fb4305..46dd94e9e085 100644
--- a/fs/gfs2/rgrp.h
+++ b/fs/gfs2/rgrp.h
@@ -45,7 +45,7 @@ extern int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *n,
bool dinode, u64 *generation);
extern void gfs2_rs_deltree(struct gfs2_blkreserv *rs);
-extern void gfs2_rs_delete(struct gfs2_inode *ip, atomic_t *wcount);
+extern void gfs2_rs_delete(struct gfs2_inode *ip);
extern void __gfs2_free_blocks(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
u64 bstart, u32 blen, int meta);
extern void gfs2_free_meta(struct gfs2_inode *ip, struct gfs2_rgrpd *rgd,
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 64c67090f503..143a47359d1b 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -1396,7 +1396,7 @@ static void gfs2_evict_inode(struct inode *inode)
truncate_inode_pages_final(&inode->i_data);
if (ip->i_qadata)
gfs2_assert_warn(sdp, ip->i_qadata->qa_ref == 0);
- gfs2_rs_delete(ip, NULL);
+ gfs2_rs_deltree(&ip->i_res);
gfs2_ordered_del_inode(ip);
clear_inode(inode);
gfs2_dir_hash_inval(ip);
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Mon Sep 17 00:00:00 2001
From: Tom Rix <trix(a)redhat.com>
Date: Sat, 26 Mar 2022 12:42:36 -0700
Subject: [PATCH] rtc: check if __rtc_read_time was successful
Clang static analysis reports this issue
interface.c:810:8: warning: Passed-by-value struct
argument contains uninitialized data
now = rtc_tm_to_ktime(tm);
^~~~~~~~~~~~~~~~~~~
tm is set by a successful call to __rtc_read_time()
but its return status is not checked. Check if
it was successful before setting the enabled flag.
Move the decl of err to function scope.
Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers")
Signed-off-by: Tom Rix <trix(a)redhat.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni(a)bootlin.com>
Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index d8e835798153..9edd662c69ac 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -804,9 +804,13 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);
struct rtc_time tm;
ktime_t now;
+ int err;
+
+ err = __rtc_read_time(rtc, &tm);
+ if (err)
+ return err;
timer->enabled = 1;
- __rtc_read_time(rtc, &tm);
now = rtc_tm_to_ktime(tm);
/* Skip over expired timers */
@@ -820,7 +824,6 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
trace_rtc_timer_enqueue(timer);
if (!next || ktime_before(timer->node.expires, next->expires)) {
struct rtc_wkalrm alarm;
- int err;
alarm.time = rtc_ktime_to_tm(timer->node.expires);
alarm.enabled = 1;
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Mon Sep 17 00:00:00 2001
From: Tom Rix <trix(a)redhat.com>
Date: Sat, 26 Mar 2022 12:42:36 -0700
Subject: [PATCH] rtc: check if __rtc_read_time was successful
Clang static analysis reports this issue
interface.c:810:8: warning: Passed-by-value struct
argument contains uninitialized data
now = rtc_tm_to_ktime(tm);
^~~~~~~~~~~~~~~~~~~
tm is set by a successful call to __rtc_read_time()
but its return status is not checked. Check if
it was successful before setting the enabled flag.
Move the decl of err to function scope.
Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers")
Signed-off-by: Tom Rix <trix(a)redhat.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni(a)bootlin.com>
Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index d8e835798153..9edd662c69ac 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -804,9 +804,13 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);
struct rtc_time tm;
ktime_t now;
+ int err;
+
+ err = __rtc_read_time(rtc, &tm);
+ if (err)
+ return err;
timer->enabled = 1;
- __rtc_read_time(rtc, &tm);
now = rtc_tm_to_ktime(tm);
/* Skip over expired timers */
@@ -820,7 +824,6 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
trace_rtc_timer_enqueue(timer);
if (!next || ktime_before(timer->node.expires, next->expires)) {
struct rtc_wkalrm alarm;
- int err;
alarm.time = rtc_ktime_to_tm(timer->node.expires);
alarm.enabled = 1;
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 915593a7a663b2ad08b895a5f3ba8b19d89d4ebf Mon Sep 17 00:00:00 2001
From: Tom Rix <trix(a)redhat.com>
Date: Sat, 26 Mar 2022 12:42:36 -0700
Subject: [PATCH] rtc: check if __rtc_read_time was successful
Clang static analysis reports this issue
interface.c:810:8: warning: Passed-by-value struct
argument contains uninitialized data
now = rtc_tm_to_ktime(tm);
^~~~~~~~~~~~~~~~~~~
tm is set by a successful call to __rtc_read_time()
but its return status is not checked. Check if
it was successful before setting the enabled flag.
Move the decl of err to function scope.
Fixes: 2b2f5ff00f63 ("rtc: interface: ignore expired timers when enqueuing new timers")
Signed-off-by: Tom Rix <trix(a)redhat.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni(a)bootlin.com>
Link: https://lore.kernel.org/r/20220326194236.2916310-1-trix@redhat.com
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index d8e835798153..9edd662c69ac 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -804,9 +804,13 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
struct timerqueue_node *next = timerqueue_getnext(&rtc->timerqueue);
struct rtc_time tm;
ktime_t now;
+ int err;
+
+ err = __rtc_read_time(rtc, &tm);
+ if (err)
+ return err;
timer->enabled = 1;
- __rtc_read_time(rtc, &tm);
now = rtc_tm_to_ktime(tm);
/* Skip over expired timers */
@@ -820,7 +824,6 @@ static int rtc_timer_enqueue(struct rtc_device *rtc, struct rtc_timer *timer)
trace_rtc_timer_enqueue(timer);
if (!next || ktime_before(timer->node.expires, next->expires)) {
struct rtc_wkalrm alarm;
- int err;
alarm.time = rtc_ktime_to_tm(timer->node.expires);
alarm.enabled = 1;
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3b67db8a6ca83e6ff90b756d3da0c966f61cd37b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:41 +0800
Subject: [PATCH] ubifs: Fix to add refcount once page is set private
MM defined the rule [1] very clearly that once page was set with PG_private
flag, we should increment the refcount in that page, also main flows like
pageout(), migrate_page() will assume there is one additional page
reference count if page_has_private() returns true. Otherwise, we may
get a BUG in page migration:
page:0000000080d05b9d refcount:-1 mapcount:0 mapping:000000005f4d82a8
index:0xe2 pfn:0x14c12
aops:ubifs_file_address_operations [ubifs] ino:8f1 dentry name:"f30e"
flags: 0x1fffff80002405(locked|uptodate|owner_priv_1|private|node=0|
zone=1|lastcpupid=0x1fffff)
page dumped because: VM_BUG_ON_PAGE(page_count(page) != 0)
------------[ cut here ]------------
kernel BUG at include/linux/page_ref.h:184!
invalid opcode: 0000 [#1] SMP
CPU: 3 PID: 38 Comm: kcompactd0 Not tainted 5.15.0-rc5
RIP: 0010:migrate_page_move_mapping+0xac3/0xe70
Call Trace:
ubifs_migrate_page+0x22/0xc0 [ubifs]
move_to_new_page+0xb4/0x600
migrate_pages+0x1523/0x1cc0
compact_zone+0x8c5/0x14b0
kcompactd+0x2bc/0x560
kthread+0x18c/0x1e0
ret_from_fork+0x1f/0x30
Before the time, we should make clean a concept, what does refcount means
in page gotten from grab_cache_page_write_begin(). There are 2 situations:
Situation 1: refcount is 3, page is created by __page_cache_alloc.
TYPE_A - the write process is using this page
TYPE_B - page is assigned to one certain mapping by calling
__add_to_page_cache_locked()
TYPE_C - page is added into pagevec list corresponding current cpu by
calling lru_cache_add()
Situation 2: refcount is 2, page is gotten from the mapping's tree
TYPE_B - page has been assigned to one certain mapping
TYPE_A - the write process is using this page (by calling
page_cache_get_speculative())
Filesystem releases one refcount by calling put_page() in xxx_write_end(),
the released refcount corresponds to TYPE_A (write task is using it). If
there are any processes using a page, page migration process will skip the
page by judging whether expected_page_refs() equals to page refcount.
The BUG is caused by following process:
PA(cpu 0) kcompactd(cpu 1)
compact_zone
ubifs_write_begin
page_a = grab_cache_page_write_begin
add_to_page_cache_lru
lru_cache_add
pagevec_add // put page into cpu 0's pagevec
(refcnf = 3, for page creation process)
ubifs_write_end
SetPagePrivate(page_a) // doesn't increase page count !
unlock_page(page_a)
put_page(page_a) // refcnt = 2
[...]
PB(cpu 0)
filemap_read
filemap_get_pages
add_to_page_cache_lru
lru_cache_add
__pagevec_lru_add // traverse all pages in cpu 0's pagevec
__pagevec_lru_add_fn
SetPageLRU(page_a)
isolate_migratepages
isolate_migratepages_block
get_page_unless_zero(page_a)
// refcnt = 3
list_add(page_a, from_list)
migrate_pages(from_list)
__unmap_and_move
move_to_new_page
ubifs_migrate_page(page_a)
migrate_page_move_mapping
expected_page_refs get 3
(migration[1] + mapping[1] + private[1])
release_pages
put_page_testzero(page_a) // refcnt = 3
page_ref_freeze // refcnt = 0
page_ref_dec_and_test(0 - 1 = -1)
page_ref_unfreeze
VM_BUG_ON_PAGE(-1 != 0, page)
UBIFS doesn't increase the page refcount after setting private flag, which
leads to page migration task believes the page is not used by any other
processes, so the page is migrated. This causes concurrent accessing on
page refcount between put_page() called by other process(eg. read process
calls lru_cache_add) and page_ref_unfreeze() called by migration task.
Actually zhangjun has tried to fix this problem [2] by recalculating page
refcnt in ubifs_migrate_page(). It's better to follow MM rules [1], because
just like Kirill suggested in [2], we need to check all users of
page_has_private() helper. Like f2fs does in [3], fix it by adding/deleting
refcount when setting/clearing private for a page. BTW, according to [4],
we set 'page->private' as 1 because ubifs just simply SetPagePrivate().
And, [5] provided a common helper to set/clear page private, ubifs can
use this helper following the example of iomap, afs, btrfs, etc.
Jump [6] to find a reproducer.
[1] https://lore.kernel.org/lkml/2b19b3c4-2bc4-15fa-15cc-27a13e5c7af1@aol.com
[2] https://www.spinics.net/lists/linux-mtd/msg04018.html
[3] http://lkml.iu.edu/hypermail/linux/kernel/1903.0/03313.html
[4] https://lore.kernel.org/linux-f2fs-devel/20210422154705.GO3596236@casper.in…
[5] https://lore.kernel.org/all/20200517214718.468-1-guoqing.jiang@cloud.ionos.…
[6] https://bugzilla.kernel.org/show_bug.cgi?id=214961
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 5cfa28cd00cd..6b45a037a047 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -570,7 +570,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
}
if (!PagePrivate(page)) {
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
@@ -947,7 +947,7 @@ static int do_writepage(struct page *page, int len)
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
kunmap(page);
@@ -1304,7 +1304,7 @@ static void ubifs_invalidatepage(struct page *page, unsigned int offset,
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
}
@@ -1471,8 +1471,8 @@ static int ubifs_migrate_page(struct address_space *mapping,
return rc;
if (PagePrivate(page)) {
- ClearPagePrivate(page);
- SetPagePrivate(newpage);
+ detach_page_private(page);
+ attach_page_private(newpage, (void *)1);
}
if (mode != MIGRATE_SYNC_NO_COPY)
@@ -1496,7 +1496,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
return 0;
ubifs_assert(c, PagePrivate(page));
ubifs_assert(c, 0);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
return 1;
}
@@ -1567,7 +1567,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
else {
if (!PageChecked(page))
ubifs_convert_page_budget(c);
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3b67db8a6ca83e6ff90b756d3da0c966f61cd37b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:41 +0800
Subject: [PATCH] ubifs: Fix to add refcount once page is set private
MM defined the rule [1] very clearly that once page was set with PG_private
flag, we should increment the refcount in that page, also main flows like
pageout(), migrate_page() will assume there is one additional page
reference count if page_has_private() returns true. Otherwise, we may
get a BUG in page migration:
page:0000000080d05b9d refcount:-1 mapcount:0 mapping:000000005f4d82a8
index:0xe2 pfn:0x14c12
aops:ubifs_file_address_operations [ubifs] ino:8f1 dentry name:"f30e"
flags: 0x1fffff80002405(locked|uptodate|owner_priv_1|private|node=0|
zone=1|lastcpupid=0x1fffff)
page dumped because: VM_BUG_ON_PAGE(page_count(page) != 0)
------------[ cut here ]------------
kernel BUG at include/linux/page_ref.h:184!
invalid opcode: 0000 [#1] SMP
CPU: 3 PID: 38 Comm: kcompactd0 Not tainted 5.15.0-rc5
RIP: 0010:migrate_page_move_mapping+0xac3/0xe70
Call Trace:
ubifs_migrate_page+0x22/0xc0 [ubifs]
move_to_new_page+0xb4/0x600
migrate_pages+0x1523/0x1cc0
compact_zone+0x8c5/0x14b0
kcompactd+0x2bc/0x560
kthread+0x18c/0x1e0
ret_from_fork+0x1f/0x30
Before the time, we should make clean a concept, what does refcount means
in page gotten from grab_cache_page_write_begin(). There are 2 situations:
Situation 1: refcount is 3, page is created by __page_cache_alloc.
TYPE_A - the write process is using this page
TYPE_B - page is assigned to one certain mapping by calling
__add_to_page_cache_locked()
TYPE_C - page is added into pagevec list corresponding current cpu by
calling lru_cache_add()
Situation 2: refcount is 2, page is gotten from the mapping's tree
TYPE_B - page has been assigned to one certain mapping
TYPE_A - the write process is using this page (by calling
page_cache_get_speculative())
Filesystem releases one refcount by calling put_page() in xxx_write_end(),
the released refcount corresponds to TYPE_A (write task is using it). If
there are any processes using a page, page migration process will skip the
page by judging whether expected_page_refs() equals to page refcount.
The BUG is caused by following process:
PA(cpu 0) kcompactd(cpu 1)
compact_zone
ubifs_write_begin
page_a = grab_cache_page_write_begin
add_to_page_cache_lru
lru_cache_add
pagevec_add // put page into cpu 0's pagevec
(refcnf = 3, for page creation process)
ubifs_write_end
SetPagePrivate(page_a) // doesn't increase page count !
unlock_page(page_a)
put_page(page_a) // refcnt = 2
[...]
PB(cpu 0)
filemap_read
filemap_get_pages
add_to_page_cache_lru
lru_cache_add
__pagevec_lru_add // traverse all pages in cpu 0's pagevec
__pagevec_lru_add_fn
SetPageLRU(page_a)
isolate_migratepages
isolate_migratepages_block
get_page_unless_zero(page_a)
// refcnt = 3
list_add(page_a, from_list)
migrate_pages(from_list)
__unmap_and_move
move_to_new_page
ubifs_migrate_page(page_a)
migrate_page_move_mapping
expected_page_refs get 3
(migration[1] + mapping[1] + private[1])
release_pages
put_page_testzero(page_a) // refcnt = 3
page_ref_freeze // refcnt = 0
page_ref_dec_and_test(0 - 1 = -1)
page_ref_unfreeze
VM_BUG_ON_PAGE(-1 != 0, page)
UBIFS doesn't increase the page refcount after setting private flag, which
leads to page migration task believes the page is not used by any other
processes, so the page is migrated. This causes concurrent accessing on
page refcount between put_page() called by other process(eg. read process
calls lru_cache_add) and page_ref_unfreeze() called by migration task.
Actually zhangjun has tried to fix this problem [2] by recalculating page
refcnt in ubifs_migrate_page(). It's better to follow MM rules [1], because
just like Kirill suggested in [2], we need to check all users of
page_has_private() helper. Like f2fs does in [3], fix it by adding/deleting
refcount when setting/clearing private for a page. BTW, according to [4],
we set 'page->private' as 1 because ubifs just simply SetPagePrivate().
And, [5] provided a common helper to set/clear page private, ubifs can
use this helper following the example of iomap, afs, btrfs, etc.
Jump [6] to find a reproducer.
[1] https://lore.kernel.org/lkml/2b19b3c4-2bc4-15fa-15cc-27a13e5c7af1@aol.com
[2] https://www.spinics.net/lists/linux-mtd/msg04018.html
[3] http://lkml.iu.edu/hypermail/linux/kernel/1903.0/03313.html
[4] https://lore.kernel.org/linux-f2fs-devel/20210422154705.GO3596236@casper.in…
[5] https://lore.kernel.org/all/20200517214718.468-1-guoqing.jiang@cloud.ionos.…
[6] https://bugzilla.kernel.org/show_bug.cgi?id=214961
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 5cfa28cd00cd..6b45a037a047 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -570,7 +570,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
}
if (!PagePrivate(page)) {
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
@@ -947,7 +947,7 @@ static int do_writepage(struct page *page, int len)
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
kunmap(page);
@@ -1304,7 +1304,7 @@ static void ubifs_invalidatepage(struct page *page, unsigned int offset,
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
}
@@ -1471,8 +1471,8 @@ static int ubifs_migrate_page(struct address_space *mapping,
return rc;
if (PagePrivate(page)) {
- ClearPagePrivate(page);
- SetPagePrivate(newpage);
+ detach_page_private(page);
+ attach_page_private(newpage, (void *)1);
}
if (mode != MIGRATE_SYNC_NO_COPY)
@@ -1496,7 +1496,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
return 0;
ubifs_assert(c, PagePrivate(page));
ubifs_assert(c, 0);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
return 1;
}
@@ -1567,7 +1567,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
else {
if (!PageChecked(page))
ubifs_convert_page_budget(c);
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 4f2262a334641e05f645364d5ade1f565c85f20b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:40 +0800
Subject: [PATCH] ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
Function ubifs_wbuf_write_nolock() may access buf out of bounds in
following process:
ubifs_wbuf_write_nolock():
aligned_len = ALIGN(len, 8); // Assume len = 4089, aligned_len = 4096
if (aligned_len <= wbuf->avail) ... // Not satisfy
if (wbuf->used) {
ubifs_leb_write() // Fill some data in avail wbuf
len -= wbuf->avail; // len is still not 8-bytes aligned
aligned_len -= wbuf->avail;
}
n = aligned_len >> c->max_write_shift;
if (n) {
n <<= c->max_write_shift;
err = ubifs_leb_write(c, wbuf->lnum, buf + written,
wbuf->offs, n);
// n > len, read out of bounds less than 8(n-len) bytes
}
, which can be catched by KASAN:
=========================================================
BUG: KASAN: slab-out-of-bounds in ecc_sw_hamming_calculate+0x1dc/0x7d0
Read of size 4 at addr ffff888105594ff8 by task kworker/u8:4/128
Workqueue: writeback wb_workfn (flush-ubifs_0_0)
Call Trace:
kasan_report.cold+0x81/0x165
nand_write_page_swecc+0xa9/0x160
ubifs_leb_write+0xf2/0x1b0 [ubifs]
ubifs_wbuf_write_nolock+0x421/0x12c0 [ubifs]
write_head+0xdc/0x1c0 [ubifs]
ubifs_jnl_write_inode+0x627/0x960 [ubifs]
wb_workfn+0x8af/0xb80
Function ubifs_wbuf_write_nolock() accepts that parameter 'len' is not 8
bytes aligned, the 'len' represents the true length of buf (which is
allocated in 'ubifs_jnl_xxx', eg. ubifs_jnl_write_inode), so
ubifs_wbuf_write_nolock() must handle the length read from 'buf' carefully
to write leb safely.
Fetch a reproducer in [Link].
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214785
Reported-by: Chengsong Ke <kechengsong(a)huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
index 789a7813f3fa..1607a3c76681 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -854,16 +854,42 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
*/
n = aligned_len >> c->max_write_shift;
if (n) {
- n <<= c->max_write_shift;
+ int m = n - 1;
+
dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum,
wbuf->offs);
- err = ubifs_leb_write(c, wbuf->lnum, buf + written,
- wbuf->offs, n);
+
+ if (m) {
+ /* '(n-1)<<c->max_write_shift < len' is always true. */
+ m <<= c->max_write_shift;
+ err = ubifs_leb_write(c, wbuf->lnum, buf + written,
+ wbuf->offs, m);
+ if (err)
+ goto out;
+ wbuf->offs += m;
+ aligned_len -= m;
+ len -= m;
+ written += m;
+ }
+
+ /*
+ * The non-written len of buf may be less than 'n' because
+ * parameter 'len' is not 8 bytes aligned, so here we read
+ * min(len, n) bytes from buf.
+ */
+ n = 1 << c->max_write_shift;
+ memcpy(wbuf->buf, buf + written, min(len, n));
+ if (n > len) {
+ ubifs_assert(c, n - len < 8);
+ ubifs_pad(c, wbuf->buf + len, n - len);
+ }
+
+ err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, n);
if (err)
goto out;
wbuf->offs += n;
aligned_len -= n;
- len -= n;
+ len -= min(len, n);
written += n;
}
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 705757274599e2e064dd3054aabc74e8af31a095 Mon Sep 17 00:00:00 2001
From: Baokun Li <libaokun1(a)huawei.com>
Date: Tue, 15 Feb 2022 12:07:36 +0800
Subject: [PATCH] ubifs: rename_whiteout: correct old_dir size computing
When renaming the whiteout file, the old whiteout file is not deleted.
Therefore, we add the old dentry size to the old dir like XFS.
Otherwise, an error may be reported due to `fscki->calc_sz != fscki->size`
in check_indes.
Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT")
Reported-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Baokun Li <libaokun1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index ae082a0be2a3..86151889548e 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -1402,6 +1402,9 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry,
iput(whiteout);
goto out_release;
}
+
+ /* Add the old_dentry size to the old_dir size. */
+ old_sz -= CALC_DENT_SIZE(fname_len(&old_nm));
}
lock_4_inodes(old_dir, new_dir, new_inode, whiteout);
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 4f2262a334641e05f645364d5ade1f565c85f20b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:40 +0800
Subject: [PATCH] ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
Function ubifs_wbuf_write_nolock() may access buf out of bounds in
following process:
ubifs_wbuf_write_nolock():
aligned_len = ALIGN(len, 8); // Assume len = 4089, aligned_len = 4096
if (aligned_len <= wbuf->avail) ... // Not satisfy
if (wbuf->used) {
ubifs_leb_write() // Fill some data in avail wbuf
len -= wbuf->avail; // len is still not 8-bytes aligned
aligned_len -= wbuf->avail;
}
n = aligned_len >> c->max_write_shift;
if (n) {
n <<= c->max_write_shift;
err = ubifs_leb_write(c, wbuf->lnum, buf + written,
wbuf->offs, n);
// n > len, read out of bounds less than 8(n-len) bytes
}
, which can be catched by KASAN:
=========================================================
BUG: KASAN: slab-out-of-bounds in ecc_sw_hamming_calculate+0x1dc/0x7d0
Read of size 4 at addr ffff888105594ff8 by task kworker/u8:4/128
Workqueue: writeback wb_workfn (flush-ubifs_0_0)
Call Trace:
kasan_report.cold+0x81/0x165
nand_write_page_swecc+0xa9/0x160
ubifs_leb_write+0xf2/0x1b0 [ubifs]
ubifs_wbuf_write_nolock+0x421/0x12c0 [ubifs]
write_head+0xdc/0x1c0 [ubifs]
ubifs_jnl_write_inode+0x627/0x960 [ubifs]
wb_workfn+0x8af/0xb80
Function ubifs_wbuf_write_nolock() accepts that parameter 'len' is not 8
bytes aligned, the 'len' represents the true length of buf (which is
allocated in 'ubifs_jnl_xxx', eg. ubifs_jnl_write_inode), so
ubifs_wbuf_write_nolock() must handle the length read from 'buf' carefully
to write leb safely.
Fetch a reproducer in [Link].
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214785
Reported-by: Chengsong Ke <kechengsong(a)huawei.com>
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
index 789a7813f3fa..1607a3c76681 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -854,16 +854,42 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
*/
n = aligned_len >> c->max_write_shift;
if (n) {
- n <<= c->max_write_shift;
+ int m = n - 1;
+
dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum,
wbuf->offs);
- err = ubifs_leb_write(c, wbuf->lnum, buf + written,
- wbuf->offs, n);
+
+ if (m) {
+ /* '(n-1)<<c->max_write_shift < len' is always true. */
+ m <<= c->max_write_shift;
+ err = ubifs_leb_write(c, wbuf->lnum, buf + written,
+ wbuf->offs, m);
+ if (err)
+ goto out;
+ wbuf->offs += m;
+ aligned_len -= m;
+ len -= m;
+ written += m;
+ }
+
+ /*
+ * The non-written len of buf may be less than 'n' because
+ * parameter 'len' is not 8 bytes aligned, so here we read
+ * min(len, n) bytes from buf.
+ */
+ n = 1 << c->max_write_shift;
+ memcpy(wbuf->buf, buf + written, min(len, n));
+ if (n > len) {
+ ubifs_assert(c, n - len < 8);
+ ubifs_pad(c, wbuf->buf + len, n - len);
+ }
+
+ err = ubifs_leb_write(c, wbuf->lnum, wbuf->buf, wbuf->offs, n);
if (err)
goto out;
wbuf->offs += n;
aligned_len -= n;
- len -= n;
+ len -= min(len, n);
written += n;
}
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 5974ea7ce0f9a5987fc8cf5e08ad6e3e70bb542e Mon Sep 17 00:00:00 2001
From: Sungup Moon <sungup.moon(a)samsung.com>
Date: Mon, 14 Mar 2022 20:05:45 +0900
Subject: [PATCH] nvme: allow duplicate NSIDs for private namespaces
A NVMe subsystem with multiple controller can have private namespaces
that use the same NSID under some conditions:
"If Namespace Management, ANA Reporting, or NVM Sets are supported, the
NSIDs shall be unique within the NVM subsystem. If the Namespace
Management, ANA Reporting, and NVM Sets are not supported, then NSIDs:
a) for shared namespace shall be unique; and
b) for private namespace are not required to be unique."
Reference: Section 6.1.6 NSID and Namespace Usage; NVM Express 1.4c spec.
Make sure this specific setup is supported in Linux.
Fixes: 9ad1927a3bc2 ("nvme: always search for namespace head")
Signed-off-by: Sungup Moon <sungup.moon(a)samsung.com>
[hch: refactored and fixed the controller vs subsystem based naming
conflict]
Signed-off-by: Christoph Hellwig <hch(a)lst.de>
Reviewed-by: Sagi Grimberg <sagi(a)grimberg.me>
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index ccc5877d514b..6dc05c1fa7db 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3627,15 +3627,20 @@ static const struct attribute_group *nvme_dev_attr_groups[] = {
NULL,
};
-static struct nvme_ns_head *nvme_find_ns_head(struct nvme_subsystem *subsys,
+static struct nvme_ns_head *nvme_find_ns_head(struct nvme_ctrl *ctrl,
unsigned nsid)
{
struct nvme_ns_head *h;
- lockdep_assert_held(&subsys->lock);
+ lockdep_assert_held(&ctrl->subsys->lock);
- list_for_each_entry(h, &subsys->nsheads, entry) {
- if (h->ns_id != nsid)
+ list_for_each_entry(h, &ctrl->subsys->nsheads, entry) {
+ /*
+ * Private namespaces can share NSIDs under some conditions.
+ * In that case we can't use the same ns_head for namespaces
+ * with the same NSID.
+ */
+ if (h->ns_id != nsid || !nvme_is_unique_nsid(ctrl, h))
continue;
if (!list_empty(&h->list) && nvme_tryget_ns_head(h))
return h;
@@ -3829,7 +3834,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
}
mutex_lock(&ctrl->subsys->lock);
- head = nvme_find_ns_head(ctrl->subsys, nsid);
+ head = nvme_find_ns_head(ctrl, nsid);
if (!head) {
ret = nvme_subsys_check_duplicate_ids(ctrl->subsys, ids);
if (ret) {
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index c97d7f843977..ba90555124c4 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -482,10 +482,11 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
/*
* Add a multipath node if the subsystems supports multiple controllers.
- * We also do this for private namespaces as the namespace sharing data could
- * change after a rescan.
+ * We also do this for private namespaces as the namespace sharing flag
+ * could change after a rescan.
*/
- if (!(ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) || !multipath)
+ if (!(ctrl->subsys->cmic & NVME_CTRL_CMIC_MULTI_CTRL) ||
+ !nvme_is_unique_nsid(ctrl, head) || !multipath)
return 0;
head->disk = blk_alloc_disk(ctrl->numa_node);
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 1ea908d43e17..1552a48719d6 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -722,6 +722,25 @@ static inline bool nvme_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
return queue_live;
return __nvme_check_ready(ctrl, rq, queue_live);
}
+
+/*
+ * NSID shall be unique for all shared namespaces, or if at least one of the
+ * following conditions is met:
+ * 1. Namespace Management is supported by the controller
+ * 2. ANA is supported by the controller
+ * 3. NVM Set are supported by the controller
+ *
+ * In other case, private namespace are not required to report a unique NSID.
+ */
+static inline bool nvme_is_unique_nsid(struct nvme_ctrl *ctrl,
+ struct nvme_ns_head *head)
+{
+ return head->shared ||
+ (ctrl->oacs & NVME_CTRL_OACS_NS_MNGT_SUPP) ||
+ (ctrl->subsys->cmic & NVME_CTRL_CMIC_ANA) ||
+ (ctrl->ctratt & NVME_CTRL_CTRATT_NVM_SETS);
+}
+
int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
void *buf, unsigned bufflen);
int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index 9dbc3ef4daf7..2dcee34d467d 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -345,6 +345,7 @@ enum {
NVME_CTRL_ONCS_TIMESTAMP = 1 << 6,
NVME_CTRL_VWC_PRESENT = 1 << 0,
NVME_CTRL_OACS_SEC_SUPP = 1 << 0,
+ NVME_CTRL_OACS_NS_MNGT_SUPP = 1 << 3,
NVME_CTRL_OACS_DIRECTIVES = 1 << 5,
NVME_CTRL_OACS_DBBUF_SUPP = 1 << 8,
NVME_CTRL_LPA_CMD_EFFECTS_LOG = 1 << 1,
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3b67db8a6ca83e6ff90b756d3da0c966f61cd37b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:41 +0800
Subject: [PATCH] ubifs: Fix to add refcount once page is set private
MM defined the rule [1] very clearly that once page was set with PG_private
flag, we should increment the refcount in that page, also main flows like
pageout(), migrate_page() will assume there is one additional page
reference count if page_has_private() returns true. Otherwise, we may
get a BUG in page migration:
page:0000000080d05b9d refcount:-1 mapcount:0 mapping:000000005f4d82a8
index:0xe2 pfn:0x14c12
aops:ubifs_file_address_operations [ubifs] ino:8f1 dentry name:"f30e"
flags: 0x1fffff80002405(locked|uptodate|owner_priv_1|private|node=0|
zone=1|lastcpupid=0x1fffff)
page dumped because: VM_BUG_ON_PAGE(page_count(page) != 0)
------------[ cut here ]------------
kernel BUG at include/linux/page_ref.h:184!
invalid opcode: 0000 [#1] SMP
CPU: 3 PID: 38 Comm: kcompactd0 Not tainted 5.15.0-rc5
RIP: 0010:migrate_page_move_mapping+0xac3/0xe70
Call Trace:
ubifs_migrate_page+0x22/0xc0 [ubifs]
move_to_new_page+0xb4/0x600
migrate_pages+0x1523/0x1cc0
compact_zone+0x8c5/0x14b0
kcompactd+0x2bc/0x560
kthread+0x18c/0x1e0
ret_from_fork+0x1f/0x30
Before the time, we should make clean a concept, what does refcount means
in page gotten from grab_cache_page_write_begin(). There are 2 situations:
Situation 1: refcount is 3, page is created by __page_cache_alloc.
TYPE_A - the write process is using this page
TYPE_B - page is assigned to one certain mapping by calling
__add_to_page_cache_locked()
TYPE_C - page is added into pagevec list corresponding current cpu by
calling lru_cache_add()
Situation 2: refcount is 2, page is gotten from the mapping's tree
TYPE_B - page has been assigned to one certain mapping
TYPE_A - the write process is using this page (by calling
page_cache_get_speculative())
Filesystem releases one refcount by calling put_page() in xxx_write_end(),
the released refcount corresponds to TYPE_A (write task is using it). If
there are any processes using a page, page migration process will skip the
page by judging whether expected_page_refs() equals to page refcount.
The BUG is caused by following process:
PA(cpu 0) kcompactd(cpu 1)
compact_zone
ubifs_write_begin
page_a = grab_cache_page_write_begin
add_to_page_cache_lru
lru_cache_add
pagevec_add // put page into cpu 0's pagevec
(refcnf = 3, for page creation process)
ubifs_write_end
SetPagePrivate(page_a) // doesn't increase page count !
unlock_page(page_a)
put_page(page_a) // refcnt = 2
[...]
PB(cpu 0)
filemap_read
filemap_get_pages
add_to_page_cache_lru
lru_cache_add
__pagevec_lru_add // traverse all pages in cpu 0's pagevec
__pagevec_lru_add_fn
SetPageLRU(page_a)
isolate_migratepages
isolate_migratepages_block
get_page_unless_zero(page_a)
// refcnt = 3
list_add(page_a, from_list)
migrate_pages(from_list)
__unmap_and_move
move_to_new_page
ubifs_migrate_page(page_a)
migrate_page_move_mapping
expected_page_refs get 3
(migration[1] + mapping[1] + private[1])
release_pages
put_page_testzero(page_a) // refcnt = 3
page_ref_freeze // refcnt = 0
page_ref_dec_and_test(0 - 1 = -1)
page_ref_unfreeze
VM_BUG_ON_PAGE(-1 != 0, page)
UBIFS doesn't increase the page refcount after setting private flag, which
leads to page migration task believes the page is not used by any other
processes, so the page is migrated. This causes concurrent accessing on
page refcount between put_page() called by other process(eg. read process
calls lru_cache_add) and page_ref_unfreeze() called by migration task.
Actually zhangjun has tried to fix this problem [2] by recalculating page
refcnt in ubifs_migrate_page(). It's better to follow MM rules [1], because
just like Kirill suggested in [2], we need to check all users of
page_has_private() helper. Like f2fs does in [3], fix it by adding/deleting
refcount when setting/clearing private for a page. BTW, according to [4],
we set 'page->private' as 1 because ubifs just simply SetPagePrivate().
And, [5] provided a common helper to set/clear page private, ubifs can
use this helper following the example of iomap, afs, btrfs, etc.
Jump [6] to find a reproducer.
[1] https://lore.kernel.org/lkml/2b19b3c4-2bc4-15fa-15cc-27a13e5c7af1@aol.com
[2] https://www.spinics.net/lists/linux-mtd/msg04018.html
[3] http://lkml.iu.edu/hypermail/linux/kernel/1903.0/03313.html
[4] https://lore.kernel.org/linux-f2fs-devel/20210422154705.GO3596236@casper.in…
[5] https://lore.kernel.org/all/20200517214718.468-1-guoqing.jiang@cloud.ionos.…
[6] https://bugzilla.kernel.org/show_bug.cgi?id=214961
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 5cfa28cd00cd..6b45a037a047 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -570,7 +570,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
}
if (!PagePrivate(page)) {
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
@@ -947,7 +947,7 @@ static int do_writepage(struct page *page, int len)
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
kunmap(page);
@@ -1304,7 +1304,7 @@ static void ubifs_invalidatepage(struct page *page, unsigned int offset,
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
}
@@ -1471,8 +1471,8 @@ static int ubifs_migrate_page(struct address_space *mapping,
return rc;
if (PagePrivate(page)) {
- ClearPagePrivate(page);
- SetPagePrivate(newpage);
+ detach_page_private(page);
+ attach_page_private(newpage, (void *)1);
}
if (mode != MIGRATE_SYNC_NO_COPY)
@@ -1496,7 +1496,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
return 0;
ubifs_assert(c, PagePrivate(page));
ubifs_assert(c, 0);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
return 1;
}
@@ -1567,7 +1567,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
else {
if (!PageChecked(page))
ubifs_convert_page_budget(c);
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3b67db8a6ca83e6ff90b756d3da0c966f61cd37b Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:41 +0800
Subject: [PATCH] ubifs: Fix to add refcount once page is set private
MM defined the rule [1] very clearly that once page was set with PG_private
flag, we should increment the refcount in that page, also main flows like
pageout(), migrate_page() will assume there is one additional page
reference count if page_has_private() returns true. Otherwise, we may
get a BUG in page migration:
page:0000000080d05b9d refcount:-1 mapcount:0 mapping:000000005f4d82a8
index:0xe2 pfn:0x14c12
aops:ubifs_file_address_operations [ubifs] ino:8f1 dentry name:"f30e"
flags: 0x1fffff80002405(locked|uptodate|owner_priv_1|private|node=0|
zone=1|lastcpupid=0x1fffff)
page dumped because: VM_BUG_ON_PAGE(page_count(page) != 0)
------------[ cut here ]------------
kernel BUG at include/linux/page_ref.h:184!
invalid opcode: 0000 [#1] SMP
CPU: 3 PID: 38 Comm: kcompactd0 Not tainted 5.15.0-rc5
RIP: 0010:migrate_page_move_mapping+0xac3/0xe70
Call Trace:
ubifs_migrate_page+0x22/0xc0 [ubifs]
move_to_new_page+0xb4/0x600
migrate_pages+0x1523/0x1cc0
compact_zone+0x8c5/0x14b0
kcompactd+0x2bc/0x560
kthread+0x18c/0x1e0
ret_from_fork+0x1f/0x30
Before the time, we should make clean a concept, what does refcount means
in page gotten from grab_cache_page_write_begin(). There are 2 situations:
Situation 1: refcount is 3, page is created by __page_cache_alloc.
TYPE_A - the write process is using this page
TYPE_B - page is assigned to one certain mapping by calling
__add_to_page_cache_locked()
TYPE_C - page is added into pagevec list corresponding current cpu by
calling lru_cache_add()
Situation 2: refcount is 2, page is gotten from the mapping's tree
TYPE_B - page has been assigned to one certain mapping
TYPE_A - the write process is using this page (by calling
page_cache_get_speculative())
Filesystem releases one refcount by calling put_page() in xxx_write_end(),
the released refcount corresponds to TYPE_A (write task is using it). If
there are any processes using a page, page migration process will skip the
page by judging whether expected_page_refs() equals to page refcount.
The BUG is caused by following process:
PA(cpu 0) kcompactd(cpu 1)
compact_zone
ubifs_write_begin
page_a = grab_cache_page_write_begin
add_to_page_cache_lru
lru_cache_add
pagevec_add // put page into cpu 0's pagevec
(refcnf = 3, for page creation process)
ubifs_write_end
SetPagePrivate(page_a) // doesn't increase page count !
unlock_page(page_a)
put_page(page_a) // refcnt = 2
[...]
PB(cpu 0)
filemap_read
filemap_get_pages
add_to_page_cache_lru
lru_cache_add
__pagevec_lru_add // traverse all pages in cpu 0's pagevec
__pagevec_lru_add_fn
SetPageLRU(page_a)
isolate_migratepages
isolate_migratepages_block
get_page_unless_zero(page_a)
// refcnt = 3
list_add(page_a, from_list)
migrate_pages(from_list)
__unmap_and_move
move_to_new_page
ubifs_migrate_page(page_a)
migrate_page_move_mapping
expected_page_refs get 3
(migration[1] + mapping[1] + private[1])
release_pages
put_page_testzero(page_a) // refcnt = 3
page_ref_freeze // refcnt = 0
page_ref_dec_and_test(0 - 1 = -1)
page_ref_unfreeze
VM_BUG_ON_PAGE(-1 != 0, page)
UBIFS doesn't increase the page refcount after setting private flag, which
leads to page migration task believes the page is not used by any other
processes, so the page is migrated. This causes concurrent accessing on
page refcount between put_page() called by other process(eg. read process
calls lru_cache_add) and page_ref_unfreeze() called by migration task.
Actually zhangjun has tried to fix this problem [2] by recalculating page
refcnt in ubifs_migrate_page(). It's better to follow MM rules [1], because
just like Kirill suggested in [2], we need to check all users of
page_has_private() helper. Like f2fs does in [3], fix it by adding/deleting
refcount when setting/clearing private for a page. BTW, according to [4],
we set 'page->private' as 1 because ubifs just simply SetPagePrivate().
And, [5] provided a common helper to set/clear page private, ubifs can
use this helper following the example of iomap, afs, btrfs, etc.
Jump [6] to find a reproducer.
[1] https://lore.kernel.org/lkml/2b19b3c4-2bc4-15fa-15cc-27a13e5c7af1@aol.com
[2] https://www.spinics.net/lists/linux-mtd/msg04018.html
[3] http://lkml.iu.edu/hypermail/linux/kernel/1903.0/03313.html
[4] https://lore.kernel.org/linux-f2fs-devel/20210422154705.GO3596236@casper.in…
[5] https://lore.kernel.org/all/20200517214718.468-1-guoqing.jiang@cloud.ionos.…
[6] https://bugzilla.kernel.org/show_bug.cgi?id=214961
Fixes: 1e51764a3c2ac0 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 5cfa28cd00cd..6b45a037a047 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -570,7 +570,7 @@ static int ubifs_write_end(struct file *file, struct address_space *mapping,
}
if (!PagePrivate(page)) {
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
@@ -947,7 +947,7 @@ static int do_writepage(struct page *page, int len)
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
kunmap(page);
@@ -1304,7 +1304,7 @@ static void ubifs_invalidatepage(struct page *page, unsigned int offset,
release_existing_page_budget(c);
atomic_long_dec(&c->dirty_pg_cnt);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
}
@@ -1471,8 +1471,8 @@ static int ubifs_migrate_page(struct address_space *mapping,
return rc;
if (PagePrivate(page)) {
- ClearPagePrivate(page);
- SetPagePrivate(newpage);
+ detach_page_private(page);
+ attach_page_private(newpage, (void *)1);
}
if (mode != MIGRATE_SYNC_NO_COPY)
@@ -1496,7 +1496,7 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
return 0;
ubifs_assert(c, PagePrivate(page));
ubifs_assert(c, 0);
- ClearPagePrivate(page);
+ detach_page_private(page);
ClearPageChecked(page);
return 1;
}
@@ -1567,7 +1567,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf)
else {
if (!PageChecked(page))
ubifs_convert_page_budget(c);
- SetPagePrivate(page);
+ attach_page_private(page, (void *)1);
atomic_long_inc(&c->dirty_pg_cnt);
__set_page_dirty_nobuffers(page);
}
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a6dab6607d4681d227905d5198710b575dbdb519 Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:38 +0800
Subject: [PATCH] ubifs: Rectify space amount budget for mkdir/tmpfile
operations
UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.
A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.
It's better to report ENOSPC in ubifs_budget_space(), as early as we can.
Fixes: 474b93704f32163 ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c2ac05 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index faca567ef06b..ae082a0be2a3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -428,15 +428,18 @@ static int ubifs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
{
struct inode *inode;
struct ubifs_info *c = dir->i_sb->s_fs_info;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
struct ubifs_inode *ui;
int err, instantiated = 0;
struct fscrypt_name nm;
/*
- * Budget request settings: new dirty inode, new direntry,
- * budget for dirtied inode will be released via writeback.
+ * Budget request settings: new inode, new direntry, changing the
+ * parent directory inode.
+ * Allocate budget separately for new dirtied inode, the budget will
+ * be released via writeback.
*/
dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
@@ -979,7 +982,8 @@ static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_info *c = dir->i_sb->s_fs_info;
int err, sz_change;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct fscrypt_name nm;
/*
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a6dab6607d4681d227905d5198710b575dbdb519 Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:38 +0800
Subject: [PATCH] ubifs: Rectify space amount budget for mkdir/tmpfile
operations
UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.
A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.
It's better to report ENOSPC in ubifs_budget_space(), as early as we can.
Fixes: 474b93704f32163 ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c2ac05 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index faca567ef06b..ae082a0be2a3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -428,15 +428,18 @@ static int ubifs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
{
struct inode *inode;
struct ubifs_info *c = dir->i_sb->s_fs_info;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
struct ubifs_inode *ui;
int err, instantiated = 0;
struct fscrypt_name nm;
/*
- * Budget request settings: new dirty inode, new direntry,
- * budget for dirtied inode will be released via writeback.
+ * Budget request settings: new inode, new direntry, changing the
+ * parent directory inode.
+ * Allocate budget separately for new dirtied inode, the budget will
+ * be released via writeback.
*/
dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
@@ -979,7 +982,8 @@ static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_info *c = dir->i_sb->s_fs_info;
int err, sz_change;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct fscrypt_name nm;
/*
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a6dab6607d4681d227905d5198710b575dbdb519 Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:38 +0800
Subject: [PATCH] ubifs: Rectify space amount budget for mkdir/tmpfile
operations
UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.
A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.
It's better to report ENOSPC in ubifs_budget_space(), as early as we can.
Fixes: 474b93704f32163 ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c2ac05 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index faca567ef06b..ae082a0be2a3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -428,15 +428,18 @@ static int ubifs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
{
struct inode *inode;
struct ubifs_info *c = dir->i_sb->s_fs_info;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
struct ubifs_inode *ui;
int err, instantiated = 0;
struct fscrypt_name nm;
/*
- * Budget request settings: new dirty inode, new direntry,
- * budget for dirtied inode will be released via writeback.
+ * Budget request settings: new inode, new direntry, changing the
+ * parent directory inode.
+ * Allocate budget separately for new dirtied inode, the budget will
+ * be released via writeback.
*/
dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
@@ -979,7 +982,8 @@ static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_info *c = dir->i_sb->s_fs_info;
int err, sz_change;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct fscrypt_name nm;
/*
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a6dab6607d4681d227905d5198710b575dbdb519 Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:38 +0800
Subject: [PATCH] ubifs: Rectify space amount budget for mkdir/tmpfile
operations
UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.
A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.
It's better to report ENOSPC in ubifs_budget_space(), as early as we can.
Fixes: 474b93704f32163 ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c2ac05 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index faca567ef06b..ae082a0be2a3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -428,15 +428,18 @@ static int ubifs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
{
struct inode *inode;
struct ubifs_info *c = dir->i_sb->s_fs_info;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
struct ubifs_inode *ui;
int err, instantiated = 0;
struct fscrypt_name nm;
/*
- * Budget request settings: new dirty inode, new direntry,
- * budget for dirtied inode will be released via writeback.
+ * Budget request settings: new inode, new direntry, changing the
+ * parent directory inode.
+ * Allocate budget separately for new dirtied inode, the budget will
+ * be released via writeback.
*/
dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
@@ -979,7 +982,8 @@ static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_info *c = dir->i_sb->s_fs_info;
int err, sz_change;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct fscrypt_name nm;
/*
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a6dab6607d4681d227905d5198710b575dbdb519 Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:38 +0800
Subject: [PATCH] ubifs: Rectify space amount budget for mkdir/tmpfile
operations
UBIFS should make sure the flash has enough space to store dirty (Data
that is newer than disk) data (in memory), space budget is exactly
designed to do that. If space budget calculates less data than we need,
'make_reservation()' will do more work(return -ENOSPC if no free space
lelf, sometimes we can see "cannot reserve xxx bytes in jhead xxx, error
-28" in ubifs error messages) with ubifs inodes locked, which may effect
other syscalls.
A simple way to decide how much space do we need when make a budget:
See how much space is needed by 'make_reservation()' in ubifs_jnl_xxx()
function according to corresponding operation.
It's better to report ENOSPC in ubifs_budget_space(), as early as we can.
Fixes: 474b93704f32163 ("ubifs: Implement O_TMPFILE")
Fixes: 1e51764a3c2ac05 ("UBIFS: add new flash file system")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index faca567ef06b..ae082a0be2a3 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -428,15 +428,18 @@ static int ubifs_tmpfile(struct user_namespace *mnt_userns, struct inode *dir,
{
struct inode *inode;
struct ubifs_info *c = dir->i_sb->s_fs_info;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1};
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
struct ubifs_inode *ui;
int err, instantiated = 0;
struct fscrypt_name nm;
/*
- * Budget request settings: new dirty inode, new direntry,
- * budget for dirtied inode will be released via writeback.
+ * Budget request settings: new inode, new direntry, changing the
+ * parent directory inode.
+ * Allocate budget separately for new dirtied inode, the budget will
+ * be released via writeback.
*/
dbg_gen("dent '%pd', mode %#hx in dir ino %lu",
@@ -979,7 +982,8 @@ static int ubifs_mkdir(struct user_namespace *mnt_userns, struct inode *dir,
struct ubifs_inode *dir_ui = ubifs_inode(dir);
struct ubifs_info *c = dir->i_sb->s_fs_info;
int err, sz_change;
- struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1 };
+ struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
+ .dirtied_ino = 1};
struct fscrypt_name nm;
/*
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 40a8f0d5e7b3999f096570edab71c345da812e3e Mon Sep 17 00:00:00 2001
From: Zhihao Cheng <chengzhihao1(a)huawei.com>
Date: Mon, 27 Dec 2021 11:22:32 +0800
Subject: [PATCH] ubifs: rename_whiteout: Fix double free for whiteout_ui->data
'whiteout_ui->data' will be freed twice if space budget fail for
rename whiteout operation as following process:
rename_whiteout
dev = kmalloc
whiteout_ui->data = dev
kfree(whiteout_ui->data) // Free first time
iput(whiteout)
ubifs_free_inode
kfree(ui->data) // Double free!
KASAN reports:
==================================================================
BUG: KASAN: double-free or invalid-free in ubifs_free_inode+0x4f/0x70
Call Trace:
kfree+0x117/0x490
ubifs_free_inode+0x4f/0x70 [ubifs]
i_callback+0x30/0x60
rcu_do_batch+0x366/0xac0
__do_softirq+0x133/0x57f
Allocated by task 1506:
kmem_cache_alloc_trace+0x3c2/0x7a0
do_rename+0x9b7/0x1150 [ubifs]
ubifs_rename+0x106/0x1f0 [ubifs]
do_syscall_64+0x35/0x80
Freed by task 1506:
kfree+0x117/0x490
do_rename.cold+0x53/0x8a [ubifs]
ubifs_rename+0x106/0x1f0 [ubifs]
do_syscall_64+0x35/0x80
The buggy address belongs to the object at ffff88810238bed8 which
belongs to the cache kmalloc-8 of size 8
==================================================================
Let ubifs_free_inode() free 'whiteout_ui->data'. BTW, delete unused
assignment 'whiteout_ui->data_len = 0', process 'ubifs_evict_inode()
-> ubifs_jnl_delete_inode() -> ubifs_jnl_write_inode()' doesn't need it
(because 'inc_nlink(whiteout)' won't be excuted by 'goto out_release',
and the nlink of whiteout inode is 0).
Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT")
Signed-off-by: Zhihao Cheng <chengzhihao1(a)huawei.com>
Signed-off-by: Richard Weinberger <richard(a)nod.at>
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index dbe72f664abf..d3ed93d94930 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -1425,8 +1425,6 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry,
err = ubifs_budget_space(c, &wht_req);
if (err) {
- kfree(whiteout_ui->data);
- whiteout_ui->data_len = 0;
iput(whiteout);
goto out_release;
}
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2a8859f373b0a86f0ece8ec8312607eacf12485d Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini(a)redhat.com>
Date: Tue, 29 Mar 2022 12:56:24 -0400
Subject: [PATCH] KVM: x86/mmu: do compare-and-exchange of gPTE via the user
address
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle exceptions correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
(Thanks to Linus for suggesting improvement on the inline assembly).
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 8621188b46df..01fee5f67ac3 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,36 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ signed char r;
- return (ret != orig_pte);
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "=q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "=q" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
+
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2a8859f373b0a86f0ece8ec8312607eacf12485d Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini(a)redhat.com>
Date: Tue, 29 Mar 2022 12:56:24 -0400
Subject: [PATCH] KVM: x86/mmu: do compare-and-exchange of gPTE via the user
address
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle exceptions correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
(Thanks to Linus for suggesting improvement on the inline assembly).
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 8621188b46df..01fee5f67ac3 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,36 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ signed char r;
- return (ret != orig_pte);
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "=q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "=q" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
+
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 00b5f37189d24ac3ed46cb7f11742094778c46ce Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:39 +0100
Subject: [PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in
kvm_irq_delivery_to_apic_fast()
When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF
shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON()
instead of crashing the host.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-3-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 80a2020c4db4..66b0eb0bda94 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1024,6 +1024,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:38 +0100
Subject: [PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a
SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immediate issue being fixed is that kvm_irq_delivery_to_apic()
(kvm_irq_delivery_to_apic_fast()) crashes when called with
'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-2-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index a32f54ab84a2..f715b5a2b0e4 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -449,6 +449,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
struct kvm_lapic_irq irq;
int ret, vector;
+ if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
+ return -EINVAL;
+
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 00b5f37189d24ac3ed46cb7f11742094778c46ce Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:39 +0100
Subject: [PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in
kvm_irq_delivery_to_apic_fast()
When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF
shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON()
instead of crashing the host.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-3-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 80a2020c4db4..66b0eb0bda94 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1024,6 +1024,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 00b5f37189d24ac3ed46cb7f11742094778c46ce Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:39 +0100
Subject: [PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in
kvm_irq_delivery_to_apic_fast()
When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF
shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON()
instead of crashing the host.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-3-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 80a2020c4db4..66b0eb0bda94 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1024,6 +1024,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 00b5f37189d24ac3ed46cb7f11742094778c46ce Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:39 +0100
Subject: [PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in
kvm_irq_delivery_to_apic_fast()
When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF
shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON()
instead of crashing the host.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-3-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 80a2020c4db4..66b0eb0bda94 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1024,6 +1024,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:38 +0100
Subject: [PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a
SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immediate issue being fixed is that kvm_irq_delivery_to_apic()
(kvm_irq_delivery_to_apic_fast()) crashes when called with
'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-2-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index a32f54ab84a2..f715b5a2b0e4 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -449,6 +449,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
struct kvm_lapic_irq irq;
int ret, vector;
+ if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
+ return -EINVAL;
+
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:38 +0100
Subject: [PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a
SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immediate issue being fixed is that kvm_irq_delivery_to_apic()
(kvm_irq_delivery_to_apic_fast()) crashes when called with
'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-2-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index a32f54ab84a2..f715b5a2b0e4 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -449,6 +449,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
struct kvm_lapic_irq irq;
int ret, vector;
+ if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
+ return -EINVAL;
+
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:38 +0100
Subject: [PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a
SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immediate issue being fixed is that kvm_irq_delivery_to_apic()
(kvm_irq_delivery_to_apic_fast()) crashes when called with
'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-2-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index a32f54ab84a2..f715b5a2b0e4 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -449,6 +449,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
struct kvm_lapic_irq irq;
int ret, vector;
+ if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
+ return -EINVAL;
+
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7ec37d1cbe17d8189d9562178d8b29167fe1c31a Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:38 +0100
Subject: [PATCH] KVM: x86: Check lapic_in_kernel() before attempting to set a
SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immediate issue being fixed is that kvm_irq_delivery_to_apic()
(kvm_irq_delivery_to_apic_fast()) crashes when called with
'irq.shorthand = APIC_DEST_SELF' and 'src == NULL'.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-2-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index a32f54ab84a2..f715b5a2b0e4 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -449,6 +449,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
struct kvm_lapic_irq irq;
int ret, vector;
+ if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
+ return -EINVAL;
+
if (sint >= ARRAY_SIZE(synic->sint))
return -EINVAL;
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 00b5f37189d24ac3ed46cb7f11742094778c46ce Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:39 +0100
Subject: [PATCH] KVM: x86: Avoid theoretical NULL pointer dereference in
kvm_irq_delivery_to_apic_fast()
When kvm_irq_delivery_to_apic_fast() is called with APIC_DEST_SELF
shorthand, 'src' must not be NULL. Crash the VM with KVM_BUG_ON()
instead of crashing the host.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-3-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 80a2020c4db4..66b0eb0bda94 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1024,6 +1024,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
*r = -1;
if (irq->shorthand == APIC_DEST_SELF) {
+ if (KVM_BUG_ON(!src, kvm)) {
+ *r = 0;
+ return true;
+ }
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
return true;
}
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 2a8859f373b0a86f0ece8ec8312607eacf12485d Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini(a)redhat.com>
Date: Tue, 29 Mar 2022 12:56:24 -0400
Subject: [PATCH] KVM: x86/mmu: do compare-and-exchange of gPTE via the user
address
FNAME(cmpxchg_gpte) is an inefficient mess. It is at least decent if it
can go through get_user_pages_fast(), but if it cannot then it tries to
use memremap(); that is not just terribly slow, it is also wrong because
it assumes that the VM_PFNMAP VMA is contiguous.
The right way to do it would be to do the same thing as
hva_to_pfn_remapped() does since commit add6a0cd1c5b ("KVM: MMU: try to
fix up page faults before giving up", 2016-07-05), using follow_pte()
and fixup_user_fault() to determine the correct address to use for
memremap(). To do this, one could for example extract hva_to_pfn()
for use outside virt/kvm/kvm_main.c. But really there is no reason to
do that either, because there is already a perfectly valid address to
do the cmpxchg() on, only it is a userspace address. That means doing
user_access_begin()/user_access_end() and writing the code in assembly
to handle exceptions correctly. Worse, the guest PTE can be 8-byte
even on i686 so there is the extra complication of using cmpxchg8b to
account for. But at least it is an efficient mess.
(Thanks to Linus for suggesting improvement on the inline assembly).
Reported-by: Qiuhao Li <qiuhao(a)sysec.org>
Reported-by: Gaoning Pan <pgn(a)zju.edu.cn>
Reported-by: Yongkang Jia <kangel(a)zju.edu.cn>
Reported-by: syzbot+6cde2282daa792c49ab8(a)syzkaller.appspotmail.com
Debugged-by: Tadeusz Struk <tadeusz.struk(a)linaro.org>
Tested-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Fixes: bd53cb35a3e9 ("X86/KVM: Handle PFNs outside of kernel reach when touching GPTEs")
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/mmu/paging_tmpl.h b/arch/x86/kvm/mmu/paging_tmpl.h
index 8621188b46df..01fee5f67ac3 100644
--- a/arch/x86/kvm/mmu/paging_tmpl.h
+++ b/arch/x86/kvm/mmu/paging_tmpl.h
@@ -34,9 +34,8 @@
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
#ifdef CONFIG_X86_64
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgq"
#else
- #define CMPXCHG cmpxchg64
#define PT_MAX_FULL_LEVELS 2
#endif
#elif PTTYPE == 32
@@ -52,7 +51,7 @@
#define PT_GUEST_DIRTY_SHIFT PT_DIRTY_SHIFT
#define PT_GUEST_ACCESSED_SHIFT PT_ACCESSED_SHIFT
#define PT_HAVE_ACCESSED_DIRTY(mmu) true
- #define CMPXCHG cmpxchg
+ #define CMPXCHG "cmpxchgl"
#elif PTTYPE == PTTYPE_EPT
#define pt_element_t u64
#define guest_walker guest_walkerEPT
@@ -65,7 +64,9 @@
#define PT_GUEST_DIRTY_SHIFT 9
#define PT_GUEST_ACCESSED_SHIFT 8
#define PT_HAVE_ACCESSED_DIRTY(mmu) ((mmu)->ept_ad)
- #define CMPXCHG cmpxchg64
+ #ifdef CONFIG_X86_64
+ #define CMPXCHG "cmpxchgq"
+ #endif
#define PT_MAX_FULL_LEVELS PT64_ROOT_MAX_LEVEL
#else
#error Invalid PTTYPE value
@@ -147,43 +148,36 @@ static int FNAME(cmpxchg_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu,
pt_element_t __user *ptep_user, unsigned index,
pt_element_t orig_pte, pt_element_t new_pte)
{
- int npages;
- pt_element_t ret;
- pt_element_t *table;
- struct page *page;
-
- npages = get_user_pages_fast((unsigned long)ptep_user, 1, FOLL_WRITE, &page);
- if (likely(npages == 1)) {
- table = kmap_atomic(page);
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- kunmap_atomic(table);
-
- kvm_release_page_dirty(page);
- } else {
- struct vm_area_struct *vma;
- unsigned long vaddr = (unsigned long)ptep_user & PAGE_MASK;
- unsigned long pfn;
- unsigned long paddr;
-
- mmap_read_lock(current->mm);
- vma = find_vma_intersection(current->mm, vaddr, vaddr + PAGE_SIZE);
- if (!vma || !(vma->vm_flags & VM_PFNMAP)) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- pfn = ((vaddr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;
- paddr = pfn << PAGE_SHIFT;
- table = memremap(paddr, PAGE_SIZE, MEMREMAP_WB);
- if (!table) {
- mmap_read_unlock(current->mm);
- return -EFAULT;
- }
- ret = CMPXCHG(&table[index], orig_pte, new_pte);
- memunmap(table);
- mmap_read_unlock(current->mm);
- }
+ signed char r;
- return (ret != orig_pte);
+ if (!user_access_begin(ptep_user, sizeof(pt_element_t)))
+ return -EFAULT;
+
+#ifdef CMPXCHG
+ asm volatile("1:" LOCK_PREFIX CMPXCHG " %[new], %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+a" (orig_pte),
+ [r] "=q" (r)
+ : [new] "r" (new_pte)
+ : "memory");
+#else
+ asm volatile("1:" LOCK_PREFIX "cmpxchg8b %[ptr]\n"
+ "setnz %b[r]\n"
+ "2:"
+ _ASM_EXTABLE_TYPE_REG(1b, 2b, EX_TYPE_EFAULT_REG, %k[r])
+ : [ptr] "+m" (*ptep_user),
+ [old] "+A" (orig_pte),
+ [r] "=q" (r)
+ : [new_lo] "b" ((u32)new_pte),
+ [new_hi] "c" ((u32)(new_pte >> 32))
+ : "memory");
+#endif
+
+ user_access_end();
+ return r;
}
static bool FNAME(prefetch_invalid_gpte)(struct kvm_vcpu *vcpu,
The patch below does not apply to the 4.19-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b1e34d325397a33d97d845e312d7cf2a8b646b44 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:40 +0100
Subject: [PATCH] KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC
wasn't activated
Setting non-zero values to SYNIC/STIMER MSRs activates certain features,
this should not happen when KVM_CAP_HYPERV_SYNIC{,2} was not activated.
Note, it would've been better to forbid writing anything to SYNIC/STIMER
MSRs, including zeroes, however, at least QEMU tries clearing
HV_X64_MSR_STIMER0_CONFIG without SynIC. HV_X64_MSR_EOM MSR is somewhat
'special' as writing zero there triggers an action, this also should not
happen when SynIC wasn't activated.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-4-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index f715b5a2b0e4..4177c17a26bf 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -239,7 +239,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = hv_synic_to_vcpu(synic);
int ret;
- if (!synic->active && !host)
+ if (!synic->active && (!host || data))
return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@@ -285,6 +285,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: {
int i;
+ if (!synic->active)
+ break;
+
for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i);
break;
@@ -664,7 +667,7 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || config))
return 1;
if (unlikely(!host && hv_vcpu->enforce_cpuid && new_config.direct_mode &&
@@ -693,7 +696,7 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || count))
return 1;
trace_kvm_hv_stimer_set_count(hv_stimer_to_vcpu(stimer)->vcpu_id,
The patch below does not apply to the 4.9-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b1e34d325397a33d97d845e312d7cf2a8b646b44 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:40 +0100
Subject: [PATCH] KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC
wasn't activated
Setting non-zero values to SYNIC/STIMER MSRs activates certain features,
this should not happen when KVM_CAP_HYPERV_SYNIC{,2} was not activated.
Note, it would've been better to forbid writing anything to SYNIC/STIMER
MSRs, including zeroes, however, at least QEMU tries clearing
HV_X64_MSR_STIMER0_CONFIG without SynIC. HV_X64_MSR_EOM MSR is somewhat
'special' as writing zero there triggers an action, this also should not
happen when SynIC wasn't activated.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-4-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index f715b5a2b0e4..4177c17a26bf 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -239,7 +239,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = hv_synic_to_vcpu(synic);
int ret;
- if (!synic->active && !host)
+ if (!synic->active && (!host || data))
return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@@ -285,6 +285,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: {
int i;
+ if (!synic->active)
+ break;
+
for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i);
break;
@@ -664,7 +667,7 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || config))
return 1;
if (unlikely(!host && hv_vcpu->enforce_cpuid && new_config.direct_mode &&
@@ -693,7 +696,7 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || count))
return 1;
trace_kvm_hv_stimer_set_count(hv_stimer_to_vcpu(stimer)->vcpu_id,
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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b1e34d325397a33d97d845e312d7cf2a8b646b44 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:40 +0100
Subject: [PATCH] KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC
wasn't activated
Setting non-zero values to SYNIC/STIMER MSRs activates certain features,
this should not happen when KVM_CAP_HYPERV_SYNIC{,2} was not activated.
Note, it would've been better to forbid writing anything to SYNIC/STIMER
MSRs, including zeroes, however, at least QEMU tries clearing
HV_X64_MSR_STIMER0_CONFIG without SynIC. HV_X64_MSR_EOM MSR is somewhat
'special' as writing zero there triggers an action, this also should not
happen when SynIC wasn't activated.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-4-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index f715b5a2b0e4..4177c17a26bf 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -239,7 +239,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = hv_synic_to_vcpu(synic);
int ret;
- if (!synic->active && !host)
+ if (!synic->active && (!host || data))
return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@@ -285,6 +285,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: {
int i;
+ if (!synic->active)
+ break;
+
for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i);
break;
@@ -664,7 +667,7 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || config))
return 1;
if (unlikely(!host && hv_vcpu->enforce_cpuid && new_config.direct_mode &&
@@ -693,7 +696,7 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || count))
return 1;
trace_kvm_hv_stimer_set_count(hv_stimer_to_vcpu(stimer)->vcpu_id,
The patch below does not apply to the 5.4-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From b1e34d325397a33d97d845e312d7cf2a8b646b44 Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Date: Fri, 25 Mar 2022 14:21:40 +0100
Subject: [PATCH] KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC
wasn't activated
Setting non-zero values to SYNIC/STIMER MSRs activates certain features,
this should not happen when KVM_CAP_HYPERV_SYNIC{,2} was not activated.
Note, it would've been better to forbid writing anything to SYNIC/STIMER
MSRs, including zeroes, however, at least QEMU tries clearing
HV_X64_MSR_STIMER0_CONFIG without SynIC. HV_X64_MSR_EOM MSR is somewhat
'special' as writing zero there triggers an action, this also should not
happen when SynIC wasn't activated.
Signed-off-by: Vitaly Kuznetsov <vkuznets(a)redhat.com>
Message-Id: <20220325132140.25650-4-vkuznets(a)redhat.com>
Cc: stable(a)vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini(a)redhat.com>
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index f715b5a2b0e4..4177c17a26bf 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -239,7 +239,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = hv_synic_to_vcpu(synic);
int ret;
- if (!synic->active && !host)
+ if (!synic->active && (!host || data))
return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@@ -285,6 +285,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: {
int i;
+ if (!synic->active)
+ break;
+
for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i);
break;
@@ -664,7 +667,7 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || config))
return 1;
if (unlikely(!host && hv_vcpu->enforce_cpuid && new_config.direct_mode &&
@@ -693,7 +696,7 @@ static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
struct kvm_vcpu *vcpu = hv_stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = to_hv_synic(vcpu);
- if (!synic->active && !host)
+ if (!synic->active && (!host || count))
return 1;
trace_kvm_hv_stimer_set_count(hv_stimer_to_vcpu(stimer)->vcpu_id,
On Sat, Apr 02, 2022 at 09:03:29AM -0400, Sasha Levin wrote:
> This is a note to let you know that I've just added the patch titled
>
> virtio_blk: eliminate anonymous module_init & module_exit
>
> to the 5.17-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
>
> The filename of the patch is:
> virtio_blk-eliminate-anonymous-module_init-module_ex.patch
> and it can be found in the queue-5.17 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable(a)vger.kernel.org> know about it.
>
I don't see how this patch qualifies for stable.
Yes it's probably harmless but you never know
what kind of script might be parsing e.g. System.map
and changing that in the middle of stable seems
like a bad idea to me.
>
> commit 0c0434a33667dbfedceb984ade0e7e3faeb4bfae
> Author: Randy Dunlap <rdunlap(a)infradead.org>
> Date: Wed Mar 16 12:20:02 2022 -0700
>
> virtio_blk: eliminate anonymous module_init & module_exit
>
> [ Upstream commit bcfe9b6cbb4438b8c1cc4bd475221652c8f9301b ]
>
> Eliminate anonymous module_init() and module_exit(), which can lead to
> confusion or ambiguity when reading System.map, crashes/oops/bugs,
> or an initcall_debug log.
>
> Give each of these init and exit functions unique driver-specific
> names to eliminate the anonymous names.
>
> Example 1: (System.map)
> ffffffff832fc78c t init
> ffffffff832fc79e t init
> ffffffff832fc8f8 t init
>
> Example 2: (initcall_debug log)
> calling init+0x0/0x12 @ 1
> initcall init+0x0/0x12 returned 0 after 15 usecs
> calling init+0x0/0x60 @ 1
> initcall init+0x0/0x60 returned 0 after 2 usecs
> calling init+0x0/0x9a @ 1
> initcall init+0x0/0x9a returned 0 after 74 usecs
>
> Fixes: e467cde23818 ("Block driver using virtio.")
> Signed-off-by: Randy Dunlap <rdunlap(a)infradead.org>
> Cc: "Michael S. Tsirkin" <mst(a)redhat.com>
> Cc: Jason Wang <jasowang(a)redhat.com>
> Cc: Paolo Bonzini <pbonzini(a)redhat.com>
> Cc: Stefan Hajnoczi <stefanha(a)redhat.com>
> Cc: virtualization(a)lists.linux-foundation.org
> Cc: Jens Axboe <axboe(a)kernel.dk>
> Cc: linux-block(a)vger.kernel.org
> Reviewed-by: Stefan Hajnoczi <stefanha(a)redhat.com>
> Acked-by: Jason Wang <jasowang(a)redhat.com>
> Reviewed-by: Ira Weiny <ira.weiny(a)intel.com>
> Link: https://lore.kernel.org/r/20220316192010.19001-2-rdunlap@infradead.org
> Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
> Signed-off-by: Sasha Levin <sashal(a)kernel.org>
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 8c415be86732..bf926426950d 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = {
> #endif
> };
>
> -static int __init init(void)
> +static int __init virtio_blk_init(void)
> {
> int error;
>
> @@ -1084,14 +1084,14 @@ static int __init init(void)
> return error;
> }
>
> -static void __exit fini(void)
> +static void __exit virtio_blk_fini(void)
> {
> unregister_virtio_driver(&virtio_blk);
> unregister_blkdev(major, "virtblk");
> destroy_workqueue(virtblk_wq);
> }
> -module_init(init);
> -module_exit(fini);
> +module_init(virtio_blk_init);
> +module_exit(virtio_blk_fini);
>
> MODULE_DEVICE_TABLE(virtio, id_table);
> MODULE_DESCRIPTION("Virtio block driver");
Commit ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe
controller") introduced a clock imbalance by enabling the pipe clock
both in init() and in post_init() but only disabling in post_deinit().
Note that the pipe clock was also never disabled in the init() error
paths and that enabling the clock before powering up the PHY looks
questionable.
Fixes: ed8cc3b1fc84 ("PCI: qcom: Add support for SDM845 PCIe controller")
Cc: stable(a)vger.kernel.org # 5.6
Cc: Bjorn Andersson <bjorn.andersson(a)linaro.org>
Signed-off-by: Johan Hovold <johan+linaro(a)kernel.org>
---
drivers/pci/controller/dwc/pcie-qcom.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index b79d98e5e228..20a0e6533a1c 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1238,12 +1238,6 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
goto err_disable_clocks;
}
- ret = clk_prepare_enable(res->pipe_clk);
- if (ret) {
- dev_err(dev, "cannot prepare/enable pipe clock\n");
- goto err_disable_clocks;
- }
-
/* Wait for reset to complete, required on SM8450 */
usleep_range(1000, 1500);
--
2.35.1
The bug is here:
bypass_pg(m, pg, bypassed);
The list iterator 'pg' will point to a bogus position containing
HEAD if the list is empty or no element is found. This case must
be checked before any use of the iterator, otherwise it will lead
to a invalid memory access.
To fix this bug, run bypass_pg(m, pg, bypassed); and return 0
when found, otherwise return -EINVAL.
Cc: stable(a)vger.kernel.org
Fixes: ^1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong(a)gmail.com>
---
drivers/md/dm-mpath.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index f4719b65e5e3..6ba8f1133564 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1496,12 +1496,13 @@ static int bypass_pg_num(struct multipath *m, const char *pgstr, bool bypassed)
}
list_for_each_entry(pg, &m->priority_groups, list) {
- if (!--pgnum)
- break;
+ if (!--pgnum) {
+ bypass_pg(m, pg, bypassed);
+ return 0;
+ }
}
- bypass_pg(m, pg, bypassed);
- return 0;
+ return -EINVAL;
}
/*
--
2.17.1
--
Dear Friend,
I warmly greet you.
Please forgive me if my plea sounds a bit strange or embarrassing to
you. I am 63 years old. am suffering from protracted cancer of the
lungs which has also affected part of my brain cells due to
complications,from all indication my condition is really deteriorating
and it is quite obvious according to my doctors that i may not live
for the next few months,because my condition has gotten to a critical
and life threatening stage.
Regards to my situation as well as the doctors report i have decided
to entrust my wealth and treasures to a trust worthy person. Get back
to me if you can be trusted for more details.
Sincerely Your's
Mrs. Susan Raphel
The patch below does not apply to the 5.17-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From db212f2eb3fb7f546366777e93c8f54614d39269 Mon Sep 17 00:00:00 2001
From: Arun Easi <aeasi(a)marvell.com>
Date: Thu, 10 Mar 2022 01:25:54 -0800
Subject: [PATCH] scsi: qla2xxx: Fix loss of NVMe namespaces after driver
reload test
Driver registration of localport can race when it happens at the remote
port discovery time. Fix this by calling the registration under a mutex.
Link: https://lore.kernel.org/r/20220310092604.22950-4-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable(a)vger.kernel.org
Reported-by: Marco Patalano <mpatalan(a)redhat.com>
Tested-by: Marco Patalano <mpatalan(a)redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani(a)oracle.com>
Signed-off-by: Arun Easi <aeasi(a)marvell.com>
Signed-off-by: Nilesh Javali <njavali(a)marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 5723082d94d6..3bf5cbd754a7 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -782,8 +782,6 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
ha = vha->hw;
tmpl = &qla_nvme_fc_transport;
- WARN_ON(vha->nvme_local_port);
-
if (ql2xnvme_queues < MIN_NVME_HW_QUEUES || ql2xnvme_queues > MAX_NVME_HW_QUEUES) {
ql_log(ql_log_warn, vha, 0xfffd,
"ql2xnvme_queues=%d is out of range(MIN:%d - MAX:%d). Resetting ql2xnvme_queues to:%d\n",
@@ -797,7 +795,7 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
(uint8_t)(ha->max_qpairs ? ha->max_qpairs : 1));
ql_log(ql_log_info, vha, 0xfffb,
- "Number of NVME queues used for this port: %d\n",
+ "Number of NVME queues used for this port: %d\n",
qla_nvme_fc_transport.max_hw_queues);
pinfo.node_name = wwn_to_u64(vha->node_name);
@@ -805,13 +803,25 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
pinfo.port_role = FC_PORT_ROLE_NVME_INITIATOR;
pinfo.port_id = vha->d_id.b24;
- ql_log(ql_log_info, vha, 0xffff,
- "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
- pinfo.node_name, pinfo.port_name, pinfo.port_id);
- qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
-
- ret = nvme_fc_register_localport(&pinfo, tmpl,
- get_device(&ha->pdev->dev), &vha->nvme_local_port);
+ mutex_lock(&ha->vport_lock);
+ /*
+ * Check again for nvme_local_port to see if any other thread raced
+ * with this one and finished registration.
+ */
+ if (!vha->nvme_local_port) {
+ ql_log(ql_log_info, vha, 0xffff,
+ "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
+ pinfo.node_name, pinfo.port_name, pinfo.port_id);
+ qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
+
+ ret = nvme_fc_register_localport(&pinfo, tmpl,
+ get_device(&ha->pdev->dev),
+ &vha->nvme_local_port);
+ mutex_unlock(&ha->vport_lock);
+ } else {
+ mutex_unlock(&ha->vport_lock);
+ return 0;
+ }
if (ret) {
ql_log(ql_log_warn, vha, 0xffff,
"register_localport failed: ret=%x\n", ret);
The patch below does not apply to the 5.15-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From db212f2eb3fb7f546366777e93c8f54614d39269 Mon Sep 17 00:00:00 2001
From: Arun Easi <aeasi(a)marvell.com>
Date: Thu, 10 Mar 2022 01:25:54 -0800
Subject: [PATCH] scsi: qla2xxx: Fix loss of NVMe namespaces after driver
reload test
Driver registration of localport can race when it happens at the remote
port discovery time. Fix this by calling the registration under a mutex.
Link: https://lore.kernel.org/r/20220310092604.22950-4-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable(a)vger.kernel.org
Reported-by: Marco Patalano <mpatalan(a)redhat.com>
Tested-by: Marco Patalano <mpatalan(a)redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani(a)oracle.com>
Signed-off-by: Arun Easi <aeasi(a)marvell.com>
Signed-off-by: Nilesh Javali <njavali(a)marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 5723082d94d6..3bf5cbd754a7 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -782,8 +782,6 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
ha = vha->hw;
tmpl = &qla_nvme_fc_transport;
- WARN_ON(vha->nvme_local_port);
-
if (ql2xnvme_queues < MIN_NVME_HW_QUEUES || ql2xnvme_queues > MAX_NVME_HW_QUEUES) {
ql_log(ql_log_warn, vha, 0xfffd,
"ql2xnvme_queues=%d is out of range(MIN:%d - MAX:%d). Resetting ql2xnvme_queues to:%d\n",
@@ -797,7 +795,7 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
(uint8_t)(ha->max_qpairs ? ha->max_qpairs : 1));
ql_log(ql_log_info, vha, 0xfffb,
- "Number of NVME queues used for this port: %d\n",
+ "Number of NVME queues used for this port: %d\n",
qla_nvme_fc_transport.max_hw_queues);
pinfo.node_name = wwn_to_u64(vha->node_name);
@@ -805,13 +803,25 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
pinfo.port_role = FC_PORT_ROLE_NVME_INITIATOR;
pinfo.port_id = vha->d_id.b24;
- ql_log(ql_log_info, vha, 0xffff,
- "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
- pinfo.node_name, pinfo.port_name, pinfo.port_id);
- qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
-
- ret = nvme_fc_register_localport(&pinfo, tmpl,
- get_device(&ha->pdev->dev), &vha->nvme_local_port);
+ mutex_lock(&ha->vport_lock);
+ /*
+ * Check again for nvme_local_port to see if any other thread raced
+ * with this one and finished registration.
+ */
+ if (!vha->nvme_local_port) {
+ ql_log(ql_log_info, vha, 0xffff,
+ "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
+ pinfo.node_name, pinfo.port_name, pinfo.port_id);
+ qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
+
+ ret = nvme_fc_register_localport(&pinfo, tmpl,
+ get_device(&ha->pdev->dev),
+ &vha->nvme_local_port);
+ mutex_unlock(&ha->vport_lock);
+ } else {
+ mutex_unlock(&ha->vport_lock);
+ return 0;
+ }
if (ret) {
ql_log(ql_log_warn, vha, 0xffff,
"register_localport failed: ret=%x\n", ret);
The patch below does not apply to the 5.10-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From db212f2eb3fb7f546366777e93c8f54614d39269 Mon Sep 17 00:00:00 2001
From: Arun Easi <aeasi(a)marvell.com>
Date: Thu, 10 Mar 2022 01:25:54 -0800
Subject: [PATCH] scsi: qla2xxx: Fix loss of NVMe namespaces after driver
reload test
Driver registration of localport can race when it happens at the remote
port discovery time. Fix this by calling the registration under a mutex.
Link: https://lore.kernel.org/r/20220310092604.22950-4-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable(a)vger.kernel.org
Reported-by: Marco Patalano <mpatalan(a)redhat.com>
Tested-by: Marco Patalano <mpatalan(a)redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani(a)oracle.com>
Signed-off-by: Arun Easi <aeasi(a)marvell.com>
Signed-off-by: Nilesh Javali <njavali(a)marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 5723082d94d6..3bf5cbd754a7 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -782,8 +782,6 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
ha = vha->hw;
tmpl = &qla_nvme_fc_transport;
- WARN_ON(vha->nvme_local_port);
-
if (ql2xnvme_queues < MIN_NVME_HW_QUEUES || ql2xnvme_queues > MAX_NVME_HW_QUEUES) {
ql_log(ql_log_warn, vha, 0xfffd,
"ql2xnvme_queues=%d is out of range(MIN:%d - MAX:%d). Resetting ql2xnvme_queues to:%d\n",
@@ -797,7 +795,7 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
(uint8_t)(ha->max_qpairs ? ha->max_qpairs : 1));
ql_log(ql_log_info, vha, 0xfffb,
- "Number of NVME queues used for this port: %d\n",
+ "Number of NVME queues used for this port: %d\n",
qla_nvme_fc_transport.max_hw_queues);
pinfo.node_name = wwn_to_u64(vha->node_name);
@@ -805,13 +803,25 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
pinfo.port_role = FC_PORT_ROLE_NVME_INITIATOR;
pinfo.port_id = vha->d_id.b24;
- ql_log(ql_log_info, vha, 0xffff,
- "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
- pinfo.node_name, pinfo.port_name, pinfo.port_id);
- qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
-
- ret = nvme_fc_register_localport(&pinfo, tmpl,
- get_device(&ha->pdev->dev), &vha->nvme_local_port);
+ mutex_lock(&ha->vport_lock);
+ /*
+ * Check again for nvme_local_port to see if any other thread raced
+ * with this one and finished registration.
+ */
+ if (!vha->nvme_local_port) {
+ ql_log(ql_log_info, vha, 0xffff,
+ "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
+ pinfo.node_name, pinfo.port_name, pinfo.port_id);
+ qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
+
+ ret = nvme_fc_register_localport(&pinfo, tmpl,
+ get_device(&ha->pdev->dev),
+ &vha->nvme_local_port);
+ mutex_unlock(&ha->vport_lock);
+ } else {
+ mutex_unlock(&ha->vport_lock);
+ return 0;
+ }
if (ret) {
ql_log(ql_log_warn, vha, 0xffff,
"register_localport failed: ret=%x\n", ret);
The patch below does not apply to the 5.16-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 <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From db212f2eb3fb7f546366777e93c8f54614d39269 Mon Sep 17 00:00:00 2001
From: Arun Easi <aeasi(a)marvell.com>
Date: Thu, 10 Mar 2022 01:25:54 -0800
Subject: [PATCH] scsi: qla2xxx: Fix loss of NVMe namespaces after driver
reload test
Driver registration of localport can race when it happens at the remote
port discovery time. Fix this by calling the registration under a mutex.
Link: https://lore.kernel.org/r/20220310092604.22950-4-njavali@marvell.com
Fixes: e84067d74301 ("scsi: qla2xxx: Add FC-NVMe F/W initialization and transport registration")
Cc: stable(a)vger.kernel.org
Reported-by: Marco Patalano <mpatalan(a)redhat.com>
Tested-by: Marco Patalano <mpatalan(a)redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani(a)oracle.com>
Signed-off-by: Arun Easi <aeasi(a)marvell.com>
Signed-off-by: Nilesh Javali <njavali(a)marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c
index 5723082d94d6..3bf5cbd754a7 100644
--- a/drivers/scsi/qla2xxx/qla_nvme.c
+++ b/drivers/scsi/qla2xxx/qla_nvme.c
@@ -782,8 +782,6 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
ha = vha->hw;
tmpl = &qla_nvme_fc_transport;
- WARN_ON(vha->nvme_local_port);
-
if (ql2xnvme_queues < MIN_NVME_HW_QUEUES || ql2xnvme_queues > MAX_NVME_HW_QUEUES) {
ql_log(ql_log_warn, vha, 0xfffd,
"ql2xnvme_queues=%d is out of range(MIN:%d - MAX:%d). Resetting ql2xnvme_queues to:%d\n",
@@ -797,7 +795,7 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
(uint8_t)(ha->max_qpairs ? ha->max_qpairs : 1));
ql_log(ql_log_info, vha, 0xfffb,
- "Number of NVME queues used for this port: %d\n",
+ "Number of NVME queues used for this port: %d\n",
qla_nvme_fc_transport.max_hw_queues);
pinfo.node_name = wwn_to_u64(vha->node_name);
@@ -805,13 +803,25 @@ int qla_nvme_register_hba(struct scsi_qla_host *vha)
pinfo.port_role = FC_PORT_ROLE_NVME_INITIATOR;
pinfo.port_id = vha->d_id.b24;
- ql_log(ql_log_info, vha, 0xffff,
- "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
- pinfo.node_name, pinfo.port_name, pinfo.port_id);
- qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
-
- ret = nvme_fc_register_localport(&pinfo, tmpl,
- get_device(&ha->pdev->dev), &vha->nvme_local_port);
+ mutex_lock(&ha->vport_lock);
+ /*
+ * Check again for nvme_local_port to see if any other thread raced
+ * with this one and finished registration.
+ */
+ if (!vha->nvme_local_port) {
+ ql_log(ql_log_info, vha, 0xffff,
+ "register_localport: host-traddr=nn-0x%llx:pn-0x%llx on portID:%x\n",
+ pinfo.node_name, pinfo.port_name, pinfo.port_id);
+ qla_nvme_fc_transport.dma_boundary = vha->host->dma_boundary;
+
+ ret = nvme_fc_register_localport(&pinfo, tmpl,
+ get_device(&ha->pdev->dev),
+ &vha->nvme_local_port);
+ mutex_unlock(&ha->vport_lock);
+ } else {
+ mutex_unlock(&ha->vport_lock);
+ return 0;
+ }
if (ret) {
ql_log(ql_log_warn, vha, 0xffff,
"register_localport failed: ret=%x\n", ret);