re: fsdax: output address in dax_iomap_pfn() and rename it
Hi, Static analysis with clang scan-build found a potential issue with the following commit in linux-next today: commit 1447ac26a96463a05ad9f5cfba7eef43d52913ef Author: Shiyang Ruan Date: Fri Jun 3 13:37:32 2022 +0800 fsdax: output address in dax_iomap_pfn() and rename it The analysis is as follows: static int dax_iomap_direct_access(const struct iomap *iomap, loff_t pos, size_t size, void **kaddr, pfn_t *pfnp) { pgoff_t pgoff = dax_iomap_pgoff(iomap, pos); int id, rc; long length; id = dax_read_lock(); length = dax_direct_access(iomap->dax_dev, pgoff, PHYS_PFN(size), DAX_ACCESS, kaddr, pfnp); if (length < 0) { rc = length; goto out; } if (!pfnp) goto out_check_addr; The above check jumps to out_check_addr, if kaddr is null then rc is not set and a garbage uninitialized value for rc is returned on the out path. rc = -EINVAL; if (PFN_PHYS(length) < size) goto out; if (pfn_t_to_pfn(*pfnp) & (PHYS_PFN(size)-1)) goto out; /* For larger pages we need devmap */ if (length > 1 && !pfn_t_devmap(*pfnp)) goto out; rc = 0; out_check_addr: if (!kaddr) goto out; if (!*kaddr) rc = -EFAULT; out: dax_read_unlock(id); return rc; } Colin
Re: Build regressions/improvements in v5.19-rc1
On Mon, 6 Jun 2022, Geert Uytterhoeven wrote: Below is the list of build error/warning regressions/improvements in v5.19-rc1[1] compared to v5.18[2]. Summarized: - build errors: +9/-10 [1] http://kisskb.ellerman.id.au/kisskb/branch/linus/head/f2906aa863381afb0015a9eb7fefad885d4e5a56/ (all 135 configs) [2] http://kisskb.ellerman.id.au/kisskb/branch/linus/head/4b0986a3613c92f4ec1bdc7f60ec66fea135991f/ (131 out of 135 configs) 9 error regressions: + /kisskb/src/arch/um/include/asm/page.h: error: too few arguments to function 'to_phys': => 105:20 + /kisskb/src/drivers/nvdimm/pmem.c: error: conflicting types for 'to_phys': => 48:20 + /kisskb/src/drivers/nvdimm/pmem.c: error: control reaches end of non-void function [-Werror=return-type]: => 324:1 um-x86_64/um-allyesconfig + /kisskb/src/arch/xtensa/kernel/entry.S: Error: unknown pseudo-op: `.bss': => 2176 xtensa-gcc11/xtensa-allmodconfig + /kisskb/src/drivers/tty/serial/sh-sci.c: error: unused variable 'sport' [-Werror=unused-variable]: => 2655:26 sh4-gcc11/se7619_defconfig sh4-gcc11/sh-allmodconfig Fix available https://lore.kernel.org/all/4ed0a7a0d3fa912a5b44c451884818f2c138ef42.1644914600.git.geert+rene...@glider.be + /kisskb/src/include/linux/fortify-string.h: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]: => 344:25 powerpc-gcc11/ppc64_book3e_allmodconfig + /kisskb/src/include/ufs/ufshci.h: error: initializer element is not constant: => 245:36 mipsel-gcc5/mips-allmodconfig powerpc-gcc5/powerpc-allmodconfig FTR, include/ufs/ufshci.h lacks a MAINTAINERS entry. + error: relocation truncated to fit: R_SPARC_WDISP22 against `.init.text': => (.head.text+0x5100), (.head.text+0x5040) + error: relocation truncated to fit: R_SPARC_WDISP22 against symbol `leon_smp_cpu_startup' defined in .text section in arch/sparc/kernel/trampoline_32.o: => (.init.text+0xa4) sparc64-gcc5/sparc-allmodconfig 3 warning regressions: + arch/m68k/configs/multi_defconfig: warning: symbol value 'm' invalid for ZPOOL: => 61 + arch/m68k/configs/sun3_defconfig: warning: symbol value 'm' invalid for ZPOOL: => 37 Will be fixed by the m68k defconfig update for v5.20. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds