This is the start of the stable review cycle for the 4.19.163 release.
There are 39 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Sat, 12 Dec 2020 14:25:47 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.163-r…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.19.163-rc1
Masami Hiramatsu <mhiramat(a)kernel.org>
x86/insn-eval: Use new for_each_insn_prefix() macro to loop over prefixes bytes
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: avoid false-postive lockdep splat
Luo Meng <luomeng12(a)huawei.com>
Input: i8042 - fix error return code in i8042_setup_aux()
Mike Snitzer <snitzer(a)redhat.com>
dm writecache: remove BUG() and fail gracefully instead
Zhihao Cheng <chengzhihao1(a)huawei.com>
i2c: qup: Fix error return code in qup_i2c_bam_schedule_desc()
Bob Peterson <rpeterso(a)redhat.com>
gfs2: check for empty rgrp tree in gfs2_ri_update
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracing: Fix userstacktrace option for instances
Peter Ujfalusi <peter.ujfalusi(a)ti.com>
spi: bcm2835: Release the DMA channel if probe fails after dma_init
Lukas Wunner <lukas(a)wunner.de>
spi: bcm2835: Fix use-after-free on unbind
Lukas Wunner <lukas(a)wunner.de>
spi: bcm-qspi: Fix use-after-free on unbind
Lukas Wunner <lukas(a)wunner.de>
spi: Introduce device-managed SPI controller allocation
Suravee Suthikulpanit <suravee.suthikulpanit(a)amd.com>
iommu/amd: Set DTE[IntTabLen] to represent 512 IRTEs
Samuel Thibault <samuel.thibault(a)ens-lyon.org>
speakup: Reject setting the speakup line discipline outside of speakup
Christian Eggers <ceggers(a)arri.de>
i2c: imx: Check for I2SR_IAL after every byte
Christian Eggers <ceggers(a)arri.de>
i2c: imx: Fix reset of I2SR_IAL flag
Masami Hiramatsu <mhiramat(a)kernel.org>
x86/uprobes: Do not use prefixes.nbytes when looping over prefixes.bytes
Qian Cai <qcai(a)redhat.com>
mm/swapfile: do not sleep with a spin lock held
Yang Shi <shy828301(a)gmail.com>
mm: list_lru: set shrinker map bit when child nr_items is not zero
Mike Snitzer <snitzer(a)redhat.com>
dm: remove invalid sparse __acquires and __releases annotations
Mikulas Patocka <mpatocka(a)redhat.com>
dm writecache: fix the maximum number of arguments
Suganath Prabu S <suganath-prabu.subramani(a)broadcom.com>
scsi: mpt3sas: Fix ioctl timeout
Christian Eggers <ceggers(a)arri.de>
i2c: imx: Don't generate STOP condition if arbitration has been lost
Paulo Alcantara <pc(a)cjr.nz>
cifs: fix potential use-after-free in cifs_echo_request()
Naveen N. Rao <naveen.n.rao(a)linux.vnet.ibm.com>
ftrace: Fix updating FTRACE_FL_TRAMP
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/generic: Add option to enforce preferred_dacs pairs
Kailang Yang <kailang(a)realtek.com>
ALSA: hda/realtek - Add new codec supported for ALC897
Jian-Hong Pan <jhp(a)endlessos.org>
ALSA: hda/realtek: Enable headset of ASUS UX482EG & B9400CEA with ALC294
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/realtek: Add mute LED quirk to yet another HP x360 model
Jann Horn <jannh(a)google.com>
tty: Fix ->session locking
Jann Horn <jannh(a)google.com>
tty: Fix ->pgrp locking in tiocspgrp()
Bjørn Mork <bjorn(a)mork.no>
USB: serial: option: fix Quectel BG96 matching
Giacinto Cifelli <gciofono(a)gmail.com>
USB: serial: option: add support for Thales Cinterion EXS82
Vincent Palatin <vpalatin(a)chromium.org>
USB: serial: option: add Fibocom NL668 variants
Johan Hovold <johan(a)kernel.org>
USB: serial: ch341: sort device-id entries
Jan-Niklas Burfeind <kernel(a)aiyionpri.me>
USB: serial: ch341: add new Product ID for CH341A
Johan Hovold <johan(a)kernel.org>
USB: serial: kl5kusb105: fix memleak on open
Vamsi Krishna Samavedam <vskrishn(a)codeaurora.org>
usb: gadget: f_fs: Use local copy of descriptors for userspace copy
Hans de Goede <hdegoede(a)redhat.com>
pinctrl: baytrail: Fix pin being driven low for a while on gpiod_get(..., GPIOD_OUT_HIGH)
Hans de Goede <hdegoede(a)redhat.com>
pinctrl: baytrail: Replace WARN with dev_info_once when setting direct-irq pin to output
-------------
Diffstat:
Makefile | 4 +-
arch/x86/include/asm/insn.h | 15 +++++++
arch/x86/kernel/uprobes.c | 10 +++--
arch/x86/lib/insn-eval.c | 5 ++-
drivers/i2c/busses/i2c-imx.c | 42 +++++++++++++++----
drivers/i2c/busses/i2c-qup.c | 3 +-
drivers/input/serio/i8042.c | 3 +-
drivers/iommu/amd_iommu_types.h | 2 +-
drivers/md/dm-writecache.c | 4 +-
drivers/md/dm.c | 2 -
drivers/pinctrl/intel/pinctrl-baytrail.c | 67 ++++++++++++++++++++++++-------
drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +-
drivers/spi/spi-bcm-qspi.c | 34 ++++++----------
drivers/spi/spi-bcm2835.c | 22 +++++-----
drivers/spi/spi.c | 58 +++++++++++++++++++++++++-
drivers/staging/speakup/spk_ttyio.c | 37 ++++++++++-------
drivers/tty/tty_io.c | 7 +++-
drivers/tty/tty_jobctrl.c | 44 ++++++++++++++------
drivers/usb/gadget/function/f_fs.c | 6 ++-
drivers/usb/serial/ch341.c | 5 ++-
drivers/usb/serial/kl5kusb105.c | 10 ++---
drivers/usb/serial/option.c | 10 +++--
fs/cifs/connect.c | 2 +
fs/gfs2/rgrp.c | 4 ++
include/linux/spi/spi.h | 19 +++++++++
include/linux/tty.h | 4 ++
kernel/trace/ftrace.c | 22 +++++++++-
kernel/trace/trace.c | 7 ++--
kernel/trace/trace.h | 6 ++-
mm/list_lru.c | 10 ++---
mm/swapfile.c | 4 +-
net/netfilter/nf_tables_api.c | 3 +-
sound/pci/hda/hda_generic.c | 12 ++++--
sound/pci/hda/hda_generic.h | 1 +
sound/pci/hda/patch_realtek.c | 6 +++
tools/objtool/arch/x86/include/asm/insn.h | 15 +++++++
tools/perf/util/intel-pt-decoder/insn.h | 15 +++++++
37 files changed, 390 insertions(+), 132 deletions(-)
From: Arnd Bergmann <arnd(a)arndb.de>
Subject: kbuild: avoid static_assert for genksyms
genksyms does not know or care about the _Static_assert() built-in,
and sometimes falls back to ignoring the later symbols, which causes
undefined behavior such as
WARNING: modpost: EXPORT symbol "ethtool_set_ethtool_phy_ops" [vmlinux] version generation failed, symbol will not be versioned.
ld: net/ethtool/common.o: relocation R_AARCH64_ABS32 against `__crc_ethtool_set_ethtool_phy_ops' can not be used when making a shared object
net/ethtool/common.o:(_ftrace_annotated_branch+0x0): dangerous relocation: unsupported relocation
Redefine static_assert for genksyms to avoid that.
Link: https://lkml.kernel.org/r/20201203230955.1482058-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
Suggested-by: Ard Biesheuvel <ardb(a)kernel.org>
Cc: Masahiro Yamada <masahiroy(a)kernel.org>
Cc: Michal Marek <michal.lkml(a)markovi.net>
Cc: Kees Cook <keescook(a)chromium.org>
Cc: Rikard Falkeborn <rikard.falkeborn(a)gmail.com>
Cc: Marco Elver <elver(a)google.com>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
include/linux/build_bug.h | 5 +++++
1 file changed, 5 insertions(+)
--- a/include/linux/build_bug.h~kbuild-avoid-static_assert-for-genksyms
+++ a/include/linux/build_bug.h
@@ -77,4 +77,9 @@
#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
#define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
+#ifdef __GENKSYMS__
+/* genksyms gets confused by _Static_assert */
+#define _Static_assert(expr, ...)
+#endif
+
#endif /* _LINUX_BUILD_BUG_H */
_
From: Miles Chen <miles.chen(a)mediatek.com>
Subject: proc: use untagged_addr() for pagemap_read addresses
When we try to visit the pagemap of a tagged userspace pointer, we find
that the start_vaddr is not correct because of the tag.
To fix it, we should untag the userspace pointers in pagemap_read().
I tested with 5.10-rc4 and the issue remains.
Explanation from Catalin in [1]:
:Arguably, that's a user-space bug since tagged file offsets were never
:supported. In this case it's not even a tag at bit 56 as per the arm64
:tagged address ABI but rather down to bit 47. You could say that the
:problem is caused by the C library (malloc()) or whoever created the
:tagged vaddr and passed it to this function. It's not a kernel
:regression as we've never supported it.
:
:Now, pagemap is a special case where the offset is usually not generated
:as a classic file offset but rather derived by shifting a user virtual
:address. I guess we can make a concession for pagemap (only) and allow
:such offset with the tag at bit (56 - PAGE_SHIFT + 3).
My test code is based on [2]:
A userspace pointer which has been tagged by 0xb4: 0xb400007662f541c8
=== userspace program ===
uint64 OsLayer::VirtualToPhysical(void *vaddr) {
uint64 frame, paddr, pfnmask, pagemask;
int pagesize = sysconf(_SC_PAGESIZE);
off64_t off = ((uintptr_t)vaddr) / pagesize * 8; // off = 0xb400007662f541c8 / pagesize * 8 = 0x5a00003b317aa0
int fd = open(kPagemapPath, O_RDONLY);
...
if (lseek64(fd, off, SEEK_SET) != off || read(fd, &frame, 8) != 8) {
int err = errno;
string errtxt = ErrorString(err);
if (fd >= 0)
close(fd);
return 0;
}
...
}
=== kernel fs/proc/task_mmu.c ===
static ssize_t pagemap_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
...
src = *ppos;
svpfn = src / PM_ENTRY_BYTES; // svpfn == 0xb400007662f54
start_vaddr = svpfn << PAGE_SHIFT; // start_vaddr == 0xb400007662f54000
end_vaddr = mm->task_size;
/* watch out for wraparound */
// svpfn == 0xb400007662f54
// (mm->task_size >> PAGE) == 0x8000000
if (svpfn > mm->task_size >> PAGE_SHIFT) // the condition is true because of the tag 0xb4
start_vaddr = end_vaddr;
ret = 0;
while (count && (start_vaddr < end_vaddr)) { // we cannot visit correct entry because start_vaddr is set to end_vaddr
int len;
unsigned long end;
...
}
...
}
[1] https://lore.kernel.org/patchwork/patch/1343258/
[2] https://github.com/stressapptest/stressapptest/blob/master/src/os.cc#L158
Link: https://lkml.kernel.org/r/20201204024347.8295-1-miles.chen@mediatek.com
Signed-off-by: Miles Chen <miles.chen(a)mediatek.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino(a)arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Alexey Dobriyan <adobriyan(a)gmail.com>
Cc: Andrey Konovalov <andreyknvl(a)google.com>
Cc: Alexander Potapenko <glider(a)google.com>
Cc: Vincenzo Frascino <vincenzo.frascino(a)arm.com>
Cc: Andrey Ryabinin <aryabinin(a)virtuozzo.com>
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Dmitry Vyukov <dvyukov(a)google.com>
Cc: Marco Elver <elver(a)google.com>
Cc: Will Deacon <will(a)kernel.org>
Cc: Eric W. Biederman <ebiederm(a)xmission.com>
Cc: Song Bao Hua (Barry Song) <song.bao.hua(a)hisilicon.com>
Cc: <stable(a)vger.kernel.org> [5.4-]
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---
fs/proc/task_mmu.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/fs/proc/task_mmu.c~proc-use-untagged_addr-for-pagemap_read-addresses
+++ a/fs/proc/task_mmu.c
@@ -1599,11 +1599,15 @@ static ssize_t pagemap_read(struct file
src = *ppos;
svpfn = src / PM_ENTRY_BYTES;
- start_vaddr = svpfn << PAGE_SHIFT;
end_vaddr = mm->task_size;
/* watch out for wraparound */
- if (svpfn > mm->task_size >> PAGE_SHIFT)
+ start_vaddr = end_vaddr;
+ if (svpfn <= (ULONG_MAX >> PAGE_SHIFT))
+ start_vaddr = untagged_addr(svpfn << PAGE_SHIFT);
+
+ /* Ensure the address is inside the task */
+ if (start_vaddr > mm->task_size)
start_vaddr = end_vaddr;
/*
_