Since commit 086d08725d34 ("remoteproc: create vdev subdevice with
specific dma memory pool"), every remoteproc has a DMA subdevice
("remoteprocX#vdevYbuffer") for each virtio device, which inherits
DMA capabilities from the corresponding platform device. This allowed
to associate different DMA pools with each vdev, and required from
virtio drivers to perform DMA operations with the parent device
(vdev->dev.parent) instead of grandparent (vdev->dev.parent->parent).
virtio_rpmsg_bus was already changed in the same merge cycle with
commit d999b622fcfb ("rpmsg: virtio: allocate buffer from parent"),
but virtio_console did not. In fact, operations using the grandparent
worked fine while the grandparent was the platform device, but since
commit c774ad010873 ("remoteproc: Fix and restore the parenting
hierarchy for vdev") this was changed, and now the grandparent device
is the remoteproc device without any DMA capabilities.
So, starting v5.8-rc1 the following warning is observed:
[ 2.483925] ------------[ cut here ]------------
[ 2.489148] WARNING: CPU: 3 PID: 101 at kernel/dma/mapping.c:427 0x80e7eee8
[ 2.489152] Modules linked in: virtio_console(+)
[ 2.503737] virtio_rpmsg_bus rpmsg_core
[ 2.508903]
[ 2.528898] <Other modules, stack and call trace here>
[ 2.913043]
[ 2.914907] ---[ end trace 93ac8746beab612c ]---
[ 2.920102] virtio-ports vport1p0: Error allocating inbufs
kernel/dma/mapping.c:427 is:
WARN_ON_ONCE(!dev->coherent_dma_mask);
obviously because the grandparent now is remoteproc dev without any
DMA caps:
[ 3.104943] Parent: remoteproc0#vdev1buffer, grandparent: remoteproc0
Fix this the same way as it was for virtio_rpmsg_bus, using just the
parent device (vdev->dev.parent, "remoteprocX#vdevYbuffer") for DMA
operations.
This also allows now to reserve DMA pools/buffers for rproc serial
via Device Tree.
Fixes: c774ad010873 ("remoteproc: Fix and restore the parenting hierarchy for vdev")
Cc: stable(a)vger.kernel.org # 5.1+
Signed-off-by: Alexander Lobakin <alobakin(a)pm.me>
---
drivers/char/virtio_console.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index a2da8f768b94..1836cc56e357 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -435,12 +435,12 @@ static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size
/*
* Allocate DMA memory from ancestor. When a virtio
* device is created by remoteproc, the DMA memory is
- * associated with the grandparent device:
- * vdev => rproc => platform-dev.
+ * associated with the parent device:
+ * virtioY => remoteprocX#vdevYbuffer.
*/
- if (!vdev->dev.parent || !vdev->dev.parent->parent)
+ buf->dev = vdev->dev.parent;
+ if (!buf->dev)
goto free_buf;
- buf->dev = vdev->dev.parent->parent;
/* Increase device refcnt to avoid freeing it */
get_device(buf->dev);
--
2.29.2
This is the start of the stable review cycle for the 4.14.207 release.
There are 85 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 Thu, 19 Nov 2020 12:20:51 +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.14.207-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.14.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.14.207-rc1
Boris Protopopov <pboris(a)amazon.com>
Convert trailing spaces and periods in path components
Matteo Croce <mcroce(a)microsoft.com>
reboot: fix overflow parsing reboot cpu number
Matteo Croce <mcroce(a)microsoft.com>
Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
Jiri Olsa <jolsa(a)redhat.com>
perf/core: Fix race in the perf_mmap_close() function
Juergen Gross <jgross(a)suse.com>
xen/events: block rogue events for some time
Juergen Gross <jgross(a)suse.com>
xen/events: defer eoi in case of excessive number of events
Juergen Gross <jgross(a)suse.com>
xen/events: use a common cpu hotplug hook for event channels
Juergen Gross <jgross(a)suse.com>
xen/events: switch user event channels to lateeoi model
Juergen Gross <jgross(a)suse.com>
xen/pciback: use lateeoi irq binding
Juergen Gross <jgross(a)suse.com>
xen/pvcallsback: use lateeoi irq binding
Juergen Gross <jgross(a)suse.com>
xen/scsiback: use lateeoi irq binding
Juergen Gross <jgross(a)suse.com>
xen/netback: use lateeoi irq binding
Juergen Gross <jgross(a)suse.com>
xen/blkback: use lateeoi irq binding
Juergen Gross <jgross(a)suse.com>
xen/events: add a new "late EOI" evtchn framework
Juergen Gross <jgross(a)suse.com>
xen/events: fix race in evtchn_fifo_unmask()
Juergen Gross <jgross(a)suse.com>
xen/events: add a proper barrier to 2-level uevent unmasking
Juergen Gross <jgross(a)suse.com>
xen/events: avoid removing an event channel while handling it
kiyin(尹亮) <kiyin(a)tencent.com>
perf/core: Fix a memory leak in perf_event_parse_addr_filter()
Mathieu Poirier <mathieu.poirier(a)linaro.org>
perf/core: Fix crash when using HW tracing kernel filters
Song Liu <songliubraving(a)fb.com>
perf/core: Fix bad use of igrab()
Anand K Mistry <amistry(a)google.com>
x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
George Spelvin <lkml(a)sdf.org>
random32: make prandom_u32() output unpredictable
Mao Wenan <wenan.mao(a)linux.alibaba.com>
net: Update window_clamp if SOCK_RCVBUF is set
Heiner Kallweit <hkallweit1(a)gmail.com>
r8169: fix potential skb double free in an error path
Martin Willi <martin(a)strongswan.org>
vrf: Fix fast path output packet handling with async Netfilter rules
Martin Schiller <ms(a)dev.tdt.de>
net/x25: Fix null-ptr-deref in x25_connect
Ursula Braun <ubraun(a)linux.ibm.com>
net/af_iucv: fix null pointer dereference on shutdown
Oliver Herms <oliver.peter.herms(a)gmail.com>
IPv6: Set SIT tunnel hard_header_len to zero
Stefano Stabellini <stefano.stabellini(a)xilinx.com>
swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
Coiby Xu <coiby.xu(a)gmail.com>
pinctrl: amd: fix incorrect way to disable debounce filter
Coiby Xu <coiby.xu(a)gmail.com>
pinctrl: amd: use higher precision for 512 RtcClk
Thomas Zimmermann <tzimmermann(a)suse.de>
drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]
Al Viro <viro(a)zeniv.linux.org.uk>
don't dump the threads that had been already exiting when zapped.
Chen Zhou <chenzhou10(a)huawei.com>
selinux: Fix error return code in sel_ib_pkey_sid_slow()
Wengang Wang <wen.gang.wang(a)oracle.com>
ocfs2: initialize ip_next_orphan
Dan Carpenter <dan.carpenter(a)oracle.com>
futex: Don't enable IRQs unconditionally in put_pi_state()
Alexander Usyskin <alexander.usyskin(a)intel.com>
mei: protect mei_cl_mtu from null dereference
Chris Brandt <chris.brandt(a)renesas.com>
usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
Shin'ichiro Kawasaki <shinichiro.kawasaki(a)wdc.com>
uio: Fix use-after-free in uio_unregister_device()
Jing Xiangfeng <jingxiangfeng(a)huawei.com>
thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
Joseph Qi <joseph.qi(a)linux.alibaba.com>
ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
Kaixu Xia <kaixuxia(a)tencent.com>
ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA
Peter Zijlstra <peterz(a)infradead.org>
perf: Fix get_recursion_context()
Wang Hai <wanghai38(a)huawei.com>
cosa: Add missing kfree in error path of cosa_write
Evan Nimmo <evan.nimmo(a)alliedtelesis.co.nz>
of/address: Fix of_node memory leak in of_dma_is_coherent
Christoph Hellwig <hch(a)lst.de>
xfs: fix a missing unlock on error in xfs_fs_map_blocks
Darrick J. Wong <darrick.wong(a)oracle.com>
xfs: fix rmap key and record comparison functions
Darrick J. Wong <darrick.wong(a)oracle.com>
xfs: fix flags argument to rmap lookup when converting shared file rmaps
Christoph Hellwig <hch(a)lst.de>
nbd: fix a block_device refcount leak in nbd_release
Billy Tsai <billy_tsai(a)aspeedtech.com>
pinctrl: aspeed: Fix GPI only function problem.
Andrew Jeffery <andrew(a)aj.id.au>
ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template
Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
pinctrl: intel: Set default bias in case no particular value given
Suravee Suthikulpanit <suravee.suthikulpanit(a)amd.com>
iommu/amd: Increase interrupt remapping table limit to 512 entries
Hannes Reinecke <hare(a)suse.de>
scsi: scsi_dh_alua: Avoid crash during alua_bus_detach()
Ye Bin <yebin10(a)huawei.com>
cfg80211: regulatory: Fix inconsistent format argument
Johannes Berg <johannes.berg(a)intel.com>
mac80211: always wind down STA state
Johannes Berg <johannes.berg(a)intel.com>
mac80211: fix use of skb payload instead of header
Evan Quan <evan.quan(a)amd.com>
drm/amdgpu: perform srbm soft reset always on SDMA resume
Keita Suzuki <keitasuzuki.park(a)sslab.ics.keio.ac.jp>
scsi: hpsa: Fix memory leak in hpsa_init_one()
Bob Peterson <rpeterso(a)redhat.com>
gfs2: check for live vs. read-only file system in gfs2_fitrim
Bob Peterson <rpeterso(a)redhat.com>
gfs2: Add missing truncate_inode_pages_final for sd_aspace
Bob Peterson <rpeterso(a)redhat.com>
gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
Evgeny Novikov <novikov(a)ispras.ru>
usb: gadget: goku_udc: fix potential crashes in probe
Masashi Honma <masashi.honma(a)gmail.com>
ath9k_htc: Use appropriate rs_datalen type
Filipe Manana <fdmanana(a)suse.com>
Btrfs: fix missing error return if writeback for extent buffer never started
Brian Foster <bfoster(a)redhat.com>
xfs: flush new eof page on truncate to avoid post-eof corruption
Stephane Grosjean <s.grosjean(a)peak-system.com>
can: peak_canfd: pucan_handle_can_rx(): fix echo management when loopback is on
Stephane Grosjean <s.grosjean(a)peak-system.com>
can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping
Dan Carpenter <dan.carpenter(a)oracle.com>
can: peak_usb: add range checking in decode operations
Oleksij Rempel <o.rempel(a)pengutronix.de>
can: can_create_echo_skb(): fix echo skb generation: always use skb_clone()
Oliver Hartkopp <socketcan(a)hartkopp.net>
can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames
Vincent Mailhol <mailhol.vincent(a)wanadoo.fr>
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context
Marc Kleine-Budde <mkl(a)pengutronix.de>
can: rx-offload: don't call kfree_skb() from IRQ context
Dan Carpenter <dan.carpenter(a)oracle.com>
ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
Jiri Olsa <jolsa(a)kernel.org>
perf tools: Add missing swap for ino_generation
zhuoliang zhang <zhuoliang.zhang(a)mediatek.com>
net: xfrm: fix a race condition during allocing spi
Olaf Hering <olaf(a)aepfle.de>
hv_balloon: disable warning when floor reached
Marc Zyngier <maz(a)kernel.org>
genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
Johannes Thumshirn <johannes.thumshirn(a)wdc.com>
btrfs: reschedule when cloning lots of extents
Josef Bacik <josef(a)toxicpanda.com>
btrfs: sysfs: init devices outside of the chunk_mutex
Ming Lei <ming.lei(a)redhat.com>
nbd: don't update block size after device is started
Zeng Tao <prime.zeng(a)hisilicon.com>
time: Prevent undefined behaviour in timespec64_to_ns()
Shijie Luo <luoshijie1(a)huawei.com>
mm: mempolicy: fix potential pte_unmap_unlock pte error
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
ring-buffer: Fix recursion protection transitions between interrupt context
Michał Mirosław <mirq-linux(a)rere.qmqm.pl>
regulator: defer probe when trying to get voltage from unresolved supply
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 8 +
Makefile | 4 +-
arch/arm/include/asm/kprobes.h | 22 +-
arch/arm/probes/kprobes/opt-arm.c | 18 +-
arch/x86/events/intel/pt.c | 4 +-
arch/x86/kernel/cpu/bugs.c | 52 ++-
drivers/block/nbd.c | 10 +-
drivers/block/xen-blkback/blkback.c | 22 +-
drivers/block/xen-blkback/xenbus.c | 5 +-
drivers/char/random.c | 1 -
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 27 +-
drivers/gpu/drm/gma500/psb_irq.c | 34 +-
drivers/hv/hv_balloon.c | 2 +-
drivers/iommu/amd_iommu_types.h | 6 +-
drivers/misc/mei/client.h | 4 +-
drivers/net/can/dev.c | 14 +-
drivers/net/can/peak_canfd/peak_canfd.c | 11 +-
drivers/net/can/rx-offload.c | 4 +-
drivers/net/can/usb/peak_usb/pcan_usb_core.c | 51 ++-
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 48 ++-
drivers/net/ethernet/realtek/r8169.c | 3 +-
drivers/net/vrf.c | 92 +++--
drivers/net/wan/cosa.c | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 +-
drivers/net/xen-netback/common.h | 15 +
drivers/net/xen-netback/interface.c | 61 +++-
drivers/net/xen-netback/netback.c | 11 +-
drivers/net/xen-netback/rx.c | 13 +-
drivers/of/address.c | 4 +-
drivers/pinctrl/aspeed/pinctrl-aspeed.c | 7 +-
drivers/pinctrl/intel/pinctrl-intel.c | 8 +
drivers/pinctrl/pinctrl-amd.c | 6 +-
drivers/regulator/core.c | 2 +
drivers/scsi/device_handler/scsi_dh_alua.c | 9 +-
drivers/scsi/hpsa.c | 4 +-
drivers/thunderbolt/nhi.c | 19 +-
drivers/uio/uio.c | 10 +-
drivers/usb/class/cdc-acm.c | 9 +
drivers/usb/gadget/udc/goku_udc.c | 2 +-
drivers/xen/events/events_2l.c | 9 +-
drivers/xen/events/events_base.c | 422 ++++++++++++++++++++--
drivers/xen/events/events_fifo.c | 83 ++---
drivers/xen/events/events_internal.h | 20 +-
drivers/xen/evtchn.c | 7 +-
drivers/xen/pvcalls-back.c | 76 ++--
drivers/xen/xen-pciback/pci_stub.c | 14 +-
drivers/xen/xen-pciback/pciback.h | 12 +-
drivers/xen/xen-pciback/pciback_ops.c | 48 ++-
drivers/xen/xen-pciback/xenbus.c | 2 +-
drivers/xen/xen-scsiback.c | 23 +-
fs/btrfs/extent_io.c | 4 +
fs/btrfs/ioctl.c | 2 +
fs/btrfs/volumes.c | 7 +-
fs/cifs/cifs_unicode.c | 8 +-
fs/ext4/inline.c | 1 +
fs/ext4/super.c | 4 +-
fs/gfs2/rgrp.c | 5 +-
fs/gfs2/super.c | 1 +
fs/ocfs2/super.c | 1 +
fs/xfs/libxfs/xfs_rmap.c | 2 +-
fs/xfs/libxfs/xfs_rmap_btree.c | 16 +-
fs/xfs/xfs_iops.c | 10 +
fs/xfs/xfs_pnfs.c | 2 +-
include/linux/can/skb.h | 20 +-
include/linux/perf_event.h | 2 +-
include/linux/prandom.h | 36 +-
include/linux/time64.h | 4 +
include/xen/events.h | 29 +-
kernel/events/core.c | 44 +--
kernel/events/internal.h | 2 +-
kernel/exit.c | 5 +-
kernel/futex.c | 5 +-
kernel/irq/Kconfig | 1 +
kernel/reboot.c | 28 +-
kernel/time/itimer.c | 4 -
kernel/time/timer.c | 7 -
kernel/trace/ring_buffer.c | 54 ++-
lib/random32.c | 462 +++++++++++++++---------
lib/swiotlb.c | 6 +-
mm/mempolicy.c | 6 +-
net/ipv4/syncookies.c | 9 +-
net/ipv6/sit.c | 2 -
net/ipv6/syncookies.c | 10 +-
net/iucv/af_iucv.c | 3 +-
net/mac80211/sta_info.c | 18 +
net/mac80211/tx.c | 35 +-
net/wireless/reg.c | 2 +-
net/x25/af_x25.c | 2 +-
net/xfrm/xfrm_state.c | 8 +-
security/selinux/ibpkey.c | 4 +-
sound/hda/ext/hdac_ext_controller.c | 2 +
tools/perf/util/session.c | 1 +
92 files changed, 1585 insertions(+), 630 deletions(-)
From: Eric Biggers <ebiggers(a)google.com>
As described in "fscrypt: add fscrypt_is_nokey_name()", it's possible to
create a duplicate filename in an encrypted directory by creating a file
concurrently with adding the directory's encryption key.
Fix this bug on f2fs by rejecting no-key dentries in f2fs_add_link().
Note that the weird check for the current task in f2fs_do_add_link()
seems to make this bug difficult to reproduce on f2fs.
Fixes: 9ea97163c6da ("f2fs crypto: add filename encryption for f2fs_add_link")
Cc: stable(a)vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers(a)google.com>
---
fs/f2fs/f2fs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cb700d797296..9a321c52face 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -3251,6 +3251,8 @@ bool f2fs_empty_dir(struct inode *dir);
static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
{
+ if (fscrypt_is_nokey_name(dentry))
+ return -ENOKEY;
return f2fs_do_add_link(d_inode(dentry->d_parent), &dentry->d_name,
inode, inode->i_ino, inode->i_mode);
}
--
2.29.2
From: Eric Biggers <ebiggers(a)google.com>
As described in "fscrypt: add fscrypt_is_nokey_name()", it's possible to
create a duplicate filename in an encrypted directory by creating a file
concurrently with adding the directory's encryption key.
Fix this bug on ext4 by rejecting no-key dentries in ext4_add_entry().
Note that the duplicate check in ext4_find_dest_de() sometimes prevented
this bug. However in many cases it didn't, since ext4_find_dest_de()
doesn't examine every dentry.
Fixes: 4461471107b7 ("ext4 crypto: enable filename encryption")
Cc: stable(a)vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers(a)google.com>
---
fs/ext4/namei.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 33509266f5a0..793fc7db9d28 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2195,6 +2195,9 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
if (!dentry->d_name.len)
return -EINVAL;
+ if (fscrypt_is_nokey_name(dentry))
+ return -ENOKEY;
+
#ifdef CONFIG_UNICODE
if (sb_has_strict_encoding(sb) && IS_CASEFOLDED(dir) &&
sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
--
2.29.2