The poll condition should only check response_length,
because reads should only be issued if there is data to read.
The response_read flag only prevents double writes.
The problem was that the write set the response_read to false,
enqued a tpm job, and returned. Then application called poll
which checked the response_read flag and returned EPOLLIN.
Then the application called read, but got nothing.
After all that the async_work kicked in.
Added also mutex_lock around the poll check to prevent
other possible race conditions.
Cc: stable(a)vger.kernel.org
Fixes: 9488585b21bef0df12 ("tpm: add support for partial reads")
Reported-by: Mantas Mikulėnas <grawity(a)gmail.com>
Tested-by: Mantas Mikulėnas <grawity(a)gmail.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk(a)intel.com>
---
drivers/char/tpm/tpm-dev-common.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index 5eecad233ea1..744b0237300a 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -203,12 +203,19 @@ __poll_t tpm_common_poll(struct file *file, poll_table *wait)
__poll_t mask = 0;
poll_wait(file, &priv->async_wait, wait);
+ mutex_lock(&priv->buffer_mutex);
- if (!priv->response_read || priv->response_length)
+ /*
+ * The response_length indicates if there is still response
+ * (or part of it) to be consumed. Partial reads decrease it
+ * by the number of bytes read, and write resets it the zero.
+ */
+ if (priv->response_length)
mask = EPOLLIN | EPOLLRDNORM;
else
mask = EPOLLOUT | EPOLLWRNORM;
+ mutex_unlock(&priv->buffer_mutex);
return mask;
}
Changes since v6 [1]:
- Rebase on next-20190501, no related conflicts or updates
- Fix boot crash due to inaccurate setup of the initial section
->map_active bitmask caused by multiple activations of the same
section. (Jane, Jeff)
- Fix pmem startup crash when devm_memremap_pages() needs to instantiate
a new section. (Jeff)
- Drop mhp_restrictions for the __remove_pages() path in favor of
find_memory_block() to detect cases where section-aligned remove is
required (David)
- Add "[PATCH v7 06/12] mm/hotplug: Kill is_dev_zone() usage in
__remove_pages()"
- Cleanup shrink_{zone,pgdat}_span to remove no longer necessary @ms
section variables. (Oscar)
- Add subsection_check() to the __add_pages() path to prevent
inadvertent sub-section misuse.
[1]: https://lore.kernel.org/lkml/155552633539.2015392.2477781120122237934.stgit…
---
[merge logistics]
Hi Andrew,
I believe this is ready for another spin in -mm now that the boot
regression has been squashed. In a chat with Michal last night at LSF/MM
I submitted to his assertion that the boot regression validates the
general concern that there were/are subtle dependencies on sections
beyond what I found to date by code inspection. Of course I want to
relieve the pain that the section constraint inflicts on libnvdimm and
devm_memremap_pages() as soon as possible (i.e. v5.2), but deferment to
v5.3 to give Michal time to do an in-depth look is also acceptable.
---
[cover letter]
The memory hotplug section is an arbitrary / convenient unit for memory
hotplug. 'Section-size' units have bled into the user interface
('memblock' sysfs) and can not be changed without breaking existing
userspace. The section-size constraint, while mostly benign for typical
memory hotplug, has and continues to wreak havoc with 'device-memory'
use cases, persistent memory (pmem) in particular. Recall that pmem uses
devm_memremap_pages(), and subsequently arch_add_memory(), to allocate a
'struct page' memmap for pmem. However, it does not use the 'bottom
half' of memory hotplug, i.e. never marks pmem pages online and never
exposes the userspace memblock interface for pmem. This leaves an
opening to redress the section-size constraint.
To date, the libnvdimm subsystem has attempted to inject padding to
satisfy the internal constraints of arch_add_memory(). Beyond
complicating the code, leading to bugs [2], wasting memory, and limiting
configuration flexibility, the padding hack is broken when the platform
changes this physical memory alignment of pmem from one boot to the
next. Device failure (intermittent or permanent) and physical
reconfiguration are events that can cause the platform firmware to
change the physical placement of pmem on a subsequent boot, and device
failure is an everyday event in a data-center.
It turns out that sections are only a hard requirement of the
user-facing interface for memory hotplug and with a bit more
infrastructure sub-section arch_add_memory() support can be added for
kernel internal usages like devm_memremap_pages(). Here is an analysis
of the current design assumptions in the current code and how they are
addressed in the new implementation:
Current design assumptions:
- Sections that describe boot memory (early sections) are never
unplugged / removed.
- pfn_valid(), in the CONFIG_SPARSEMEM_VMEMMAP=y, case devolves to a
valid_section() check
- __add_pages() and helper routines assume all operations occur in
PAGES_PER_SECTION units.
- The memblock sysfs interface only comprehends full sections
New design assumptions:
- Sections are instrumented with a sub-section bitmask to track (on x86)
individual 2MB sub-divisions of a 128MB section.
- Partially populated early sections can be extended with additional
sub-sections, and those sub-sections can be removed with
arch_remove_memory(). With this in place we no longer lose usable memory
capacity to padding.
- pfn_valid() is updated to look deeper than valid_section() to also check the
active-sub-section mask. This indication is in the same cacheline as
the valid_section() so the performance impact is expected to be
negligible. So far the lkp robot has not reported any regressions.
- Outside of the core vmemmap population routines which are replaced,
other helper routines like shrink_{zone,pgdat}_span() are updated to
handle the smaller granularity. Core memory hotplug routines that deal
with online memory are not touched.
- The existing memblock sysfs user api guarantees / assumptions are
not touched since this capability is limited to !online
!memblock-sysfs-accessible sections.
Meanwhile the issue reports continue to roll in from users that do not
understand when and how the 128MB constraint will bite them. The current
implementation relied on being able to support at least one misaligned
namespace, but that immediately falls over on any moderately complex
namespace creation attempt. Beyond the initial problem of 'System RAM'
colliding with pmem, and the unsolvable problem of physical alignment
changes, Linux is now being exposed to platforms that collide pmem
ranges with other pmem ranges by default [3]. In short,
devm_memremap_pages() has pushed the venerable section-size constraint
past the breaking point, and the simplicity of section-aligned
arch_add_memory() is no longer tenable.
These patches are exposed to the kbuild robot on my libnvdimm-pending
branch [4], and a preview of the unit test for this functionality is
available on the 'subsection-pending' branch of ndctl [5].
[2]: https://lore.kernel.org/r/155000671719.348031.2347363160141119237.stgit@dwi…
[3]: https://github.com/pmem/ndctl/issues/76
[4]: https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git/log/?h=libn…
[5]: https://github.com/pmem/ndctl/commit/7c59b4867e1c
---
Dan Williams (12):
mm/sparsemem: Introduce struct mem_section_usage
mm/sparsemem: Introduce common definitions for the size and mask of a section
mm/sparsemem: Add helpers track active portions of a section at boot
mm/hotplug: Prepare shrink_{zone,pgdat}_span for sub-section removal
mm/sparsemem: Convert kmalloc_section_memmap() to populate_section_memmap()
mm/hotplug: Kill is_dev_zone() usage in __remove_pages()
mm: Kill is_dev_zone() helper
mm/sparsemem: Prepare for sub-section ranges
mm/sparsemem: Support sub-section hotplug
mm/devm_memremap_pages: Enable sub-section remap
libnvdimm/pfn: Fix fsdax-mode namespace info-block zero-fields
libnvdimm/pfn: Stop padding pmem namespaces to section alignment
arch/x86/mm/init_64.c | 4
drivers/nvdimm/dax_devs.c | 2
drivers/nvdimm/pfn.h | 12 -
drivers/nvdimm/pfn_devs.c | 93 +++-------
include/linux/memory_hotplug.h | 7 -
include/linux/mm.h | 4
include/linux/mmzone.h | 72 ++++++--
kernel/memremap.c | 63 +++----
mm/hmm.c | 2
mm/memory_hotplug.c | 172 ++++++++++---------
mm/page_alloc.c | 8 +
mm/sparse-vmemmap.c | 21 ++
mm/sparse.c | 370 ++++++++++++++++++++++++++++------------
13 files changed, 490 insertions(+), 340 deletions(-)
This is the start of the stable review cycle for the 4.19.38 release.
There are 100 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 02 May 2019 11:34:55 AM UTC.
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.38-rc…
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.38-rc1
Jakub Kicinski <jakub.kicinski(a)netronome.com>
net/tls: don't leak IV and record seq when offload fails
Jakub Kicinski <jakub.kicinski(a)netronome.com>
net/tls: avoid potential deadlock in tls_set_device_offload_rx()
Maxim Mikityanskiy <maximmi(a)mellanox.com>
net/mlx5e: Fix use-after-free after xdp_return_frame
Maxim Mikityanskiy <maximmi(a)mellanox.com>
net/mlx5e: Fix the max MTU check in case of XDP
Petr Machata <petrm(a)mellanox.com>
mlxsw: spectrum: Put MC TCs into DWRR mode
Ido Schimmel <idosch(a)mellanox.com>
mlxsw: pci: Reincrease PCI reset timeout
Jun Xiao <xiaojun2(a)hisilicon.com>
net: hns: Fix WARNING when hns modules installed
Hangbin Liu <liuhangbin(a)gmail.com>
team: fix possible recursive locking when add slaves
Su Bao Cheng <baocheng.su(a)siemens.com>
stmmac: pci: Adjust IOT2000 matching
Jakub Kicinski <jakub.kicinski(a)netronome.com>
net/tls: fix refcount adjustment in fallback
Vinod Koul <vkoul(a)kernel.org>
net: stmmac: move stmmac_check_ether_addr() to driver probe
Eric Dumazet <edumazet(a)google.com>
net/rose: fix unbound loop in rose_loopback_timer()
Zhu Yanjun <yanjun.zhu(a)oracle.com>
net: rds: exchange of 8K and 1M pool
Erez Alfasi <ereza(a)mellanox.com>
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages query
Amit Cohen <amitc(a)mellanox.com>
mlxsw: spectrum: Fix autoneg status in ethtool
ZhangXiaoxu <zhangxiaoxu5(a)huawei.com>
ipv4: set the tcp_min_rtt_wlen range from 0 to one day
Eric Dumazet <edumazet(a)google.com>
ipv4: add sanity checks in ipv4_link_failure()
Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
x86/fpu: Don't export __kernel_fpu_{begin,end}()
Jan Kara <jack(a)suse.cz>
mm: Fix warning in insert_pfn()
Daniel Borkmann <daniel(a)iogearbox.net>
x86/retpolines: Disable switch jump tables when retpolines are enabled
Daniel Borkmann <daniel(a)iogearbox.net>
x86, retpolines: Raise limit for generating indirect calls from switch-case
Al Viro <viro(a)zeniv.linux.org.uk>
Fix aio_poll() races
Al Viro <viro(a)zeniv.linux.org.uk>
aio: store event at final iocb_put()
Al Viro <viro(a)zeniv.linux.org.uk>
aio: keep io_event in aio_kiocb
Al Viro <viro(a)zeniv.linux.org.uk>
aio: fold lookup_kiocb() into its sole caller
Linus Torvalds <torvalds(a)linux-foundation.org>
pin iocb through aio.
Linus Torvalds <torvalds(a)linux-foundation.org>
aio: simplify - and fix - fget/fput for io_submit()
Mike Marshall <hubcap(a)omnibond.com>
aio: initialize kiocb private in case any filesystems expect it.
Jens Axboe <axboe(a)kernel.dk>
aio: abstract out io_event filler helper
Jens Axboe <axboe(a)kernel.dk>
aio: split out iocb copy from io_submit_one()
Jens Axboe <axboe(a)kernel.dk>
aio: use iocb_put() instead of open coding it
Jens Axboe <axboe(a)kernel.dk>
aio: don't zero entire aio_kiocb aio_get_req()
Christoph Hellwig <hch(a)lst.de>
aio: separate out ring reservation from req allocation
Jens Axboe <axboe(a)kernel.dk>
aio: use assigned completion handler
Christoph Hellwig <hch(a)lst.de>
aio: clear IOCB_HIPRI
Eric Dumazet <edumazet(a)google.com>
rxrpc: fix race condition in rxrpc_input_packet()
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
net/rds: Check address length before reading address family
YueHaibing <yuehaibing(a)huawei.com>
net: netrom: Fix error cleanup path of nr_proto_init
Xin Long <lucien.xin(a)gmail.com>
tipc: check link name with right length in tipc_nl_compat_link_set
Xin Long <lucien.xin(a)gmail.com>
tipc: check bearer name with right length in tipc_nl_compat_bearer_enable
Yue Haibing <yuehaibing(a)huawei.com>
fm10k: Fix a potential NULL pointer dereference
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
NFS: Forbid setting AF_INET6 to "struct sockaddr_in"->sin_family.
luca abeni <luca.abeni(a)santannapisa.it>
sched/deadline: Correctly handle active 0-lag timers
Todd Kjos <tkjos(a)android.com>
binder: fix handling of misaligned binder object
Tetsuo Handa <penguin-kernel(a)i-love.sakura.ne.jp>
workqueue: Try to catch flush_work() without INIT_WORK().
YueHaibing <yuehaibing(a)huawei.com>
fs/proc/proc_sysctl.c: Fix a NULL pointer dereference
Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
intel_th: gth: Fix an off-by-one in output unassigning
Linus Torvalds <torvalds(a)linux-foundation.org>
slip: make slhc_free() silently accept an error pointer
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Consolidate LPM checks to avoid enabling LPM twice
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Add new USB LPM helpers
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix compilation error reported by kbuild test bot
Dave Airlie <airlied(a)redhat.com>
Revert "drm/i915/fbdev: Actually configure untiled displays"
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix memory leak during gpu reset.
Michael Ellerman <mpe(a)ellerman.id.au>
powerpc/mm/radix: Make Radix require HUGETLB_PAGE
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
Achim Dahlhoff <Achim.Dahlhoff(a)de.bosch.com>
dmaengine: sh: rcar-dmac: Fix glitch in dmaengine_tx_status
Dirk Behme <dirk.behme(a)de.bosch.com>
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
Alex Williamson <alex.williamson(a)redhat.com>
vfio/type1: Limit DMA mappings per container
Lucas Stach <l.stach(a)pengutronix.de>
Input: synaptics-rmi4 - write config register values to the right offset
Harry Pan <harry.pan(a)intel.com>
perf/x86/intel: Update KBL Package C-state events to also include PC8/PC9/PC10 counters
NeilBrown <neilb(a)suse.com>
sunrpc: don't mark uninitialised items as VALID.
Trond Myklebust <trondmy(a)gmail.com>
nfsd: Don't release the callback slot unless it was actually held
Yan, Zheng <zyan(a)redhat.com>
ceph: fix ci->i_head_snapc leak
Jeff Layton <jlayton(a)kernel.org>
ceph: ensure d_name stability in ceph_dentry_hash()
Jeff Layton <jlayton(a)kernel.org>
ceph: only use d_name directly when parent is locked
Xie XiuQi <xiexiuqi(a)huawei.com>
sched/numa: Fix a possible divide-by-zero
Jason Gunthorpe <jgg(a)ziepe.ca>
RDMA/mlx5: Do not allow the user to write to the clock page
Josh Collier <josh.d.collier(a)intel.com>
IB/rdmavt: Fix frwr memory registration
Peter Zijlstra <peterz(a)infradead.org>
trace: Fix preempt_enable_no_resched() abuse
Aurelien Jarno <aurelien(a)aurel32.net>
MIPS: scall64-o32: Fix indirect syscall number load
YueHaibing <yuehaibing(a)huawei.com>
lib/Kconfig.debug: fix build error without CONFIG_BLOCK
Jérôme Glisse <jglisse(a)redhat.com>
zram: pass down the bvec we need to read into in the work struct
Baolin Wang <baolin.wang(a)linaro.org>
gpio: eic: sprd: Fix incorrect irq type setting for the sync EIC
Jann Horn <jannh(a)google.com>
tracing: Fix buffer_ref pipe ops
Wenwen Wang <wang6495(a)umn.edu>
tracing: Fix a memory leak by early error exit in trace_pid_write()
Frank Sorenson <sorenson(a)redhat.com>
cifs: do not attempt cifs operation on smb2+ rename error
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: fix memory leak in SMB2_read
Heiner Kallweit <hkallweit1(a)gmail.com>
net: dsa: mv88e6xxx: add call to mv88e6xxx_ports_cmode_init to probe for new DSA framework
Takashi Iwai <tiwai(a)suse.de>
ALSA: hda/ca0132 - Fix build error without CONFIG_PCI
Christophe Leroy <christophe.leroy(a)c-s.fr>
powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64
Andrea Claudi <aclaudi(a)redhat.com>
ipvs: fix warning on unused variable
Adalbert Lazăr <alazar(a)bitdefender.com>
vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
Damian Kos <dkos(a)cadence.com>
drm/rockchip: fix for mailbox read validation.
Dongli Zhang <dongli.zhang(a)oracle.com>
loop: do not print warn message if partition scan is successful
Xin Long <lucien.xin(a)gmail.com>
tipc: handle the err returned from cmd header function
Dan Carpenter <dan.carpenter(a)oracle.com>
ext4: fix some error pointer dereferences
Antoine Tenart <antoine.tenart(a)bootlin.com>
net: mvpp2: fix validate for PPv2.1
Thomas Falcon <tlfalcon(a)linux.ibm.com>
net/ibmvnic: Fix RTNL deadlock during device reset
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: bogus EBUSY in helper removal from transaction
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: bogus EBUSY when deleting set after flush
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: fix set double-free in abort path
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nft_compat: use .release_ops and remove list of extension
Florian Westphal <fw(a)strlen.de>
netfilter: nft_compat: don't use refcount_inc on newly allocated entry
Pablo Neira Ayuso <pablo(a)netfilter.org>
netfilter: nf_tables: unbind set in rule from commit path
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: warn when expr implements only one of activate/deactivate
Florian Westphal <fw(a)strlen.de>
netfilter: nft_compat: destroy function must not have side effects
Florian Westphal <fw(a)strlen.de>
netfilter: nf_tables: split set destruction in deactivate and destroy phase
Florian Westphal <fw(a)strlen.de>
netfilter: nft_compat: make lists per netns
Florian Westphal <fw(a)strlen.de>
netfilter: nft_compat: use refcnt_t type for nft_xt reference count
-------------
Diffstat:
Documentation/networking/ip-sysctl.txt | 1 +
Makefile | 4 +-
arch/arm/boot/compressed/head.S | 16 +-
arch/mips/kernel/scall64-o32.S | 2 +-
arch/powerpc/configs/skiroot_defconfig | 1 +
arch/powerpc/kernel/vdso32/gettimeofday.S | 2 +-
arch/powerpc/platforms/Kconfig.cputype | 2 +-
arch/x86/Makefile | 9 +
arch/x86/events/intel/cstate.c | 10 +-
arch/x86/include/asm/efi.h | 6 +-
arch/x86/include/asm/fpu/api.h | 15 +-
arch/x86/kernel/fpu/core.c | 6 +-
drivers/android/binder_alloc.c | 18 +-
drivers/block/loop.c | 5 +-
drivers/block/zram/zram_drv.c | 5 +-
drivers/dma/sh/rcar-dmac.c | 30 +-
drivers/gpio/gpio-eic-sprd.c | 1 +
drivers/gpu/drm/i915/intel_fbdev.c | 12 +-
drivers/gpu/drm/rockchip/cdn-dp-reg.c | 2 +-
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
drivers/hwtracing/intel_th/gth.c | 2 +-
drivers/infiniband/hw/mlx5/main.c | 2 +
drivers/infiniband/sw/rdmavt/mr.c | 17 +-
drivers/input/rmi4/rmi_f11.c | 2 +-
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 15 +-
drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 24 +-
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 3 +-
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +-
drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 -
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h | 2 +-
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 8 +-
drivers/net/slip/slhc.c | 2 +-
drivers/net/team/team.c | 7 +
drivers/usb/core/driver.c | 23 +-
drivers/usb/core/hub.c | 16 +-
drivers/usb/core/message.c | 3 +-
drivers/usb/core/sysfs.c | 5 +-
drivers/usb/core/usb.h | 10 +-
drivers/vfio/vfio_iommu_type1.c | 14 +
fs/aio.c | 366 ++++++++++-----------
fs/ceph/dir.c | 6 +-
fs/ceph/mds_client.c | 70 +++-
fs/ceph/snap.c | 7 +-
fs/cifs/inode.c | 4 +
fs/cifs/smb2pdu.c | 1 +
fs/ext4/xattr.c | 3 +
fs/nfs/super.c | 3 +-
fs/nfsd/nfs4callback.c | 8 +-
fs/nfsd/state.h | 1 +
fs/proc/proc_sysctl.c | 6 +-
fs/splice.c | 4 +-
include/linux/fs.h | 8 +-
include/linux/pipe_fs_i.h | 1 +
include/net/netfilter/nf_tables.h | 29 +-
include/net/netrom.h | 2 +-
kernel/sched/deadline.c | 3 +-
kernel/sched/fair.c | 4 +
kernel/trace/ring_buffer.c | 2 +-
kernel/trace/trace.c | 33 +-
kernel/workqueue.c | 3 +
lib/Kconfig.debug | 1 +
mm/memory.c | 9 +-
net/bridge/netfilter/ebtables.c | 3 +-
net/ipv4/route.c | 32 +-
net/ipv4/sysctl_net_ipv4.c | 5 +-
net/netfilter/ipvs/ip_vs_ctl.c | 3 +-
net/netfilter/nf_tables_api.c | 108 ++++--
net/netfilter/nft_compat.c | 192 +++--------
net/netfilter/nft_dynset.c | 22 +-
net/netfilter/nft_immediate.c | 6 +-
net/netfilter/nft_lookup.c | 21 +-
net/netfilter/nft_objref.c | 40 ++-
net/netrom/af_netrom.c | 76 +++--
net/netrom/nr_loopback.c | 2 +-
net/netrom/nr_route.c | 2 +-
net/netrom/sysctl_net_netrom.c | 5 +-
net/rds/af_rds.c | 3 +
net/rds/bind.c | 2 +
net/rds/ib_fmr.c | 11 +
net/rds/ib_rdma.c | 3 -
net/rose/rose_loopback.c | 27 +-
net/rxrpc/input.c | 12 +-
net/rxrpc/local_object.c | 3 +-
net/sunrpc/cache.c | 3 +
net/tipc/netlink_compat.c | 24 +-
net/tls/tls_device.c | 4 +-
net/tls/tls_device_fallback.c | 13 +-
net/tls/tls_main.c | 5 +-
net/tls/tls_sw.c | 3 +
net/vmw_vsock/virtio_transport_common.c | 22 +-
sound/pci/hda/patch_ca0132.c | 4 +-
98 files changed, 969 insertions(+), 593 deletions(-)
The ACEPC T8 and T11 Cherry Trail Z8350 mini PCs use an AXP288 and as PCs,
rather then portables, they does not have a battery. Still for some
reason the AXP288 not only thinks there is a battery, it actually
thinks it is discharging while the PC is running, slowly going to
0% full, causing userspace to shutdown the system due to the battery
being critically low after a while.
This commit adds the ACEPC T8 and T11 to the axp288 fuel-gauge driver
blacklist, so that we stop reporting bogus battery readings on this device.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1690852
Cc: stable(a)vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
---
drivers/power/supply/axp288_fuel_gauge.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index 9ff2461820d8..368281bc0d2b 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -685,6 +685,26 @@ static void fuel_gauge_init_irq(struct axp288_fg_info *info)
* detection reports one despite it not being there.
*/
static const struct dmi_system_id axp288_fuel_gauge_blacklist[] = {
+ {
+ /* ACEPC T8 Cherry Trail Z8350 mini PC */
+ .matches = {
+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "T8"),
+ /* also match on somewhat unique bios-version */
+ DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
+ },
+ },
+ {
+ /* ACEPC T11 Cherry Trail Z8350 mini PC */
+ .matches = {
+ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "T11"),
+ /* also match on somewhat unique bios-version */
+ DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1.000"),
+ },
+ },
{
/* Intel Cherry Trail Compute Stick, Windows version */
.matches = {
--
2.21.0
From: Peter Zijlstra <peterz(a)infradead.org>
Nicolai Stange discovered[1] that if live kernel patching is enabled, and the
function tracer started tracing the same function that was patched, the
conversion of the fentry call site during the translation of going from
calling the live kernel patch trampoline to the iterator trampoline, would
have as slight window where it didn't call anything.
As live kernel patching depends on ftrace to always call its code (to
prevent the function being traced from being called, as it will redirect
it). This small window would allow the old buggy function to be called, and
this can cause undesirable results.
Nicolai submitted new patches[2] but these were controversial. As this is
similar to the static call emulation issues that came up a while ago[3].
But after some debate[4][5] adding a gap in the stack when entering the
breakpoint handler allows for pushing the return address onto the stack to
easily emulate a call.
[1] http://lkml.kernel.org/r/20180726104029.7736-1-nstange@suse.de
[2] http://lkml.kernel.org/r/20190427100639.15074-1-nstange@suse.de
[3] http://lkml.kernel.org/r/3cf04e113d71c9f8e4be95fb84a510f085aa4afa.154171145…
[4] http://lkml.kernel.org/r/CAHk-=wh5OpheSU8Em_Q3Hg8qw_JtoijxOdPtHru6d+5K8TWM=…
[5] http://lkml.kernel.org/r/CAHk-=wjvQxY4DvPrJ6haPgAa6b906h=MwZXO6G8OtiTGe=N7_…
Cc: Andy Lutomirski <luto(a)kernel.org>
Cc: Nicolai Stange <nstange(a)suse.de>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: Borislav Petkov <bp(a)alien8.de>
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: the arch/x86 maintainers <x86(a)kernel.org>
Cc: Josh Poimboeuf <jpoimboe(a)redhat.com>
Cc: Jiri Kosina <jikos(a)kernel.org>
Cc: Miroslav Benes <mbenes(a)suse.cz>
Cc: Petr Mladek <pmladek(a)suse.com>
Cc: Joe Lawrence <joe.lawrence(a)redhat.com>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk(a)oracle.com>
Cc: Tim Chen <tim.c.chen(a)linux.intel.com>
Cc: Sebastian Andrzej Siewior <bigeasy(a)linutronix.de>
Cc: Mimi Zohar <zohar(a)linux.ibm.com>
Cc: Juergen Gross <jgross(a)suse.com>
Cc: Nick Desaulniers <ndesaulniers(a)google.com>
Cc: Nayna Jain <nayna(a)linux.ibm.com>
Cc: Masahiro Yamada <yamada.masahiro(a)socionext.com>
Cc: Joerg Roedel <jroedel(a)suse.de>
Cc: "open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest(a)vger.kernel.org>
Cc: stable(a)vger.kernel.org
Fixes: b700e7f03df5 ("livepatch: kernel: add support for live patching")
Signed-off-by: *** Need SoB From Peter Zijlstra ***
Signed-off-by: Steven Rostedt (VMware) <rostedt(a)goodmis.org>
---
arch/x86/kernel/ftrace.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index ef49517f6bb2..fd152f5a937b 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -29,6 +29,7 @@
#include <asm/kprobes.h>
#include <asm/ftrace.h>
#include <asm/nops.h>
+#include <asm/text-patching.h>
#ifdef CONFIG_DYNAMIC_FTRACE
@@ -231,6 +232,7 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
}
static unsigned long ftrace_update_func;
+static unsigned long ftrace_update_func_call;
static int update_ftrace_func(unsigned long ip, void *new)
{
@@ -259,6 +261,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
unsigned char *new;
int ret;
+ ftrace_update_func_call = (unsigned long)func;
+
new = ftrace_call_replace(ip, (unsigned long)func);
ret = update_ftrace_func(ip, new);
@@ -294,13 +298,21 @@ int ftrace_int3_handler(struct pt_regs *regs)
if (WARN_ON_ONCE(!regs))
return 0;
- ip = regs->ip - 1;
- if (!ftrace_location(ip) && !is_ftrace_caller(ip))
- return 0;
+ ip = regs->ip - INT3_INSN_SIZE;
- regs->ip += MCOUNT_INSN_SIZE - 1;
+ if (ftrace_location(ip)) {
+ int3_emulate_call(regs, (unsigned long)ftrace_regs_caller);
+ return 1;
+ } else if (is_ftrace_caller(ip)) {
+ if (!ftrace_update_func_call) {
+ int3_emulate_jmp(regs, ip + CALL_INSN_SIZE);
+ return 1;
+ }
+ int3_emulate_call(regs, ftrace_update_func_call);
+ return 1;
+ }
- return 1;
+ return 0;
}
NOKPROBE_SYMBOL(ftrace_int3_handler);
@@ -859,6 +871,8 @@ void arch_ftrace_update_trampoline(struct ftrace_ops *ops)
func = ftrace_ops_get_func(ops);
+ ftrace_update_func_call = (unsigned long)func;
+
/* Do a safe modify in case the trampoline is executing */
new = ftrace_call_replace(ip, (unsigned long)func);
ret = update_ftrace_func(ip, new);
@@ -960,6 +974,7 @@ static int ftrace_mod_jmp(unsigned long ip, void *func)
{
unsigned char *new;
+ ftrace_update_func_call = 0UL;
new = ftrace_jmp_replace(ip, (unsigned long)func);
return update_ftrace_func(ip, new);
--
2.20.1
This is the start of the stable review cycle for the 4.14.115 release.
There are 53 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 02 May 2019 11:34:49 AM UTC.
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.115-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.115-rc1
ZhangXiaoxu <zhangxiaoxu5(a)huawei.com>
ipv4: set the tcp_min_rtt_wlen range from 0 to one day
Eric Dumazet <edumazet(a)google.com>
net/rose: fix unbound loop in rose_loopback_timer()
Kees Cook <keescook(a)chromium.org>
net/rose: Convert timers to use timer_setup()
Hangbin Liu <liuhangbin(a)gmail.com>
team: fix possible recursive locking when add slaves
Su Bao Cheng <baocheng.su(a)siemens.com>
stmmac: pci: Adjust IOT2000 matching
Vinod Koul <vkoul(a)kernel.org>
net: stmmac: move stmmac_check_ether_addr() to driver probe
Zhu Yanjun <yanjun.zhu(a)oracle.com>
net: rds: exchange of 8K and 1M pool
Erez Alfasi <ereza(a)mellanox.com>
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages query
Amit Cohen <amitc(a)mellanox.com>
mlxsw: spectrum: Fix autoneg status in ethtool
Eric Dumazet <edumazet(a)google.com>
ipv4: add sanity checks in ipv4_link_failure()
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "block/loop: Use global lock for ioctl() operation."
Jan Kara <jack(a)suse.cz>
mm: Fix warning in insert_pfn()
Daniel Borkmann <daniel(a)iogearbox.net>
x86/retpolines: Disable switch jump tables when retpolines are enabled
Daniel Borkmann <daniel(a)iogearbox.net>
x86, retpolines: Raise limit for generating indirect calls from switch-case
Mikulas Patocka <mpatocka(a)redhat.com>
dm integrity: change memcmp to strncmp in dm_integrity_ctr
Xin Long <lucien.xin(a)gmail.com>
tipc: check link name with right length in tipc_nl_compat_link_set
Xin Long <lucien.xin(a)gmail.com>
tipc: check bearer name with right length in tipc_nl_compat_bearer_enable
Yue Haibing <yuehaibing(a)huawei.com>
fm10k: Fix a potential NULL pointer dereference
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
NFS: Forbid setting AF_INET6 to "struct sockaddr_in"->sin_family.
luca abeni <luca.abeni(a)santannapisa.it>
sched/deadline: Correctly handle active 0-lag timers
Todd Kjos <tkjos(a)android.com>
binder: fix handling of misaligned binder object
Andrea Claudi <aclaudi(a)redhat.com>
ipvs: fix warning on unused variable
YueHaibing <yuehaibing(a)huawei.com>
fs/proc/proc_sysctl.c: Fix a NULL pointer dereference
Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
intel_th: gth: Fix an off-by-one in output unassigning
Linus Torvalds <torvalds(a)linux-foundation.org>
slip: make slhc_free() silently accept an error pointer
Xin Long <lucien.xin(a)gmail.com>
tipc: handle the err returned from cmd header function
Adalbert Lazăr <alazar(a)bitdefender.com>
vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
Dan Carpenter <dan.carpenter(a)oracle.com>
ext4: fix some error pointer dereferences
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Consolidate LPM checks to avoid enabling LPM twice
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Add new USB LPM helpers
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix compilation error reported by kbuild test bot
Dave Airlie <airlied(a)redhat.com>
Revert "drm/i915/fbdev: Actually configure untiled displays"
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix memory leak during gpu reset.
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
Dirk Behme <dirk.behme(a)de.bosch.com>
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
Alex Williamson <alex.williamson(a)redhat.com>
vfio/type1: Limit DMA mappings per container
Lucas Stach <l.stach(a)pengutronix.de>
Input: synaptics-rmi4 - write config register values to the right offset
NeilBrown <neilb(a)suse.com>
sunrpc: don't mark uninitialised items as VALID.
Trond Myklebust <trondmy(a)gmail.com>
nfsd: Don't release the callback slot unless it was actually held
Yan, Zheng <zyan(a)redhat.com>
ceph: fix ci->i_head_snapc leak
Jeff Layton <jlayton(a)kernel.org>
ceph: ensure d_name stability in ceph_dentry_hash()
Jeff Layton <jlayton(a)kernel.org>
ceph: only use d_name directly when parent is locked
Xie XiuQi <xiexiuqi(a)huawei.com>
sched/numa: Fix a possible divide-by-zero
Josh Collier <josh.d.collier(a)intel.com>
IB/rdmavt: Fix frwr memory registration
Peter Zijlstra <peterz(a)infradead.org>
trace: Fix preempt_enable_no_resched() abuse
Aurelien Jarno <aurelien(a)aurel32.net>
MIPS: scall64-o32: Fix indirect syscall number load
YueHaibing <yuehaibing(a)huawei.com>
lib/Kconfig.debug: fix build error without CONFIG_BLOCK
Jérôme Glisse <jglisse(a)redhat.com>
zram: pass down the bvec we need to read into in the work struct
Jann Horn <jannh(a)google.com>
tracing: Fix buffer_ref pipe ops
Wenwen Wang <wang6495(a)umn.edu>
tracing: Fix a memory leak by early error exit in trace_pid_write()
Frank Sorenson <sorenson(a)redhat.com>
cifs: do not attempt cifs operation on smb2+ rename error
Masahiro Yamada <yamada.masahiro(a)socionext.com>
kbuild: simplify ld-option implementation
-------------
Diffstat:
Documentation/networking/ip-sysctl.txt | 1 +
Makefile | 4 +-
arch/arm/boot/compressed/head.S | 16 ++++-
arch/mips/kernel/scall64-o32.S | 2 +-
arch/x86/Makefile | 9 +++
drivers/android/binder_alloc.c | 18 +++---
drivers/block/loop.c | 58 +++++++++---------
drivers/block/loop.h | 1 +
drivers/block/zram/zram_drv.c | 5 +-
drivers/dma/sh/rcar-dmac.c | 4 +-
drivers/gpu/drm/i915/intel_fbdev.c | 12 ++--
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
drivers/hwtracing/intel_th/gth.c | 2 +-
drivers/infiniband/sw/rdmavt/mr.c | 17 +++---
drivers/input/rmi4/rmi_f11.c | 2 +-
drivers/md/dm-integrity.c | 6 +-
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 --
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 8 ++-
drivers/net/slip/slhc.c | 2 +-
drivers/net/team/team.c | 6 ++
drivers/usb/core/driver.c | 23 +++++--
drivers/usb/core/hub.c | 16 ++---
drivers/usb/core/message.c | 3 +-
drivers/usb/core/sysfs.c | 5 +-
drivers/usb/core/usb.h | 10 +++-
drivers/vfio/vfio_iommu_type1.c | 14 +++++
fs/ceph/dir.c | 6 +-
fs/ceph/mds_client.c | 70 ++++++++++++++++++----
fs/ceph/snap.c | 7 ++-
fs/cifs/inode.c | 4 ++
fs/ext4/xattr.c | 3 +
fs/nfs/super.c | 3 +-
fs/nfsd/nfs4callback.c | 8 ++-
fs/nfsd/state.h | 1 +
fs/proc/proc_sysctl.c | 6 +-
fs/splice.c | 4 +-
include/linux/pipe_fs_i.h | 1 +
kernel/sched/deadline.c | 3 +-
kernel/sched/fair.c | 4 ++
kernel/trace/ring_buffer.c | 2 +-
kernel/trace/trace.c | 33 +++++-----
lib/Kconfig.debug | 1 +
mm/memory.c | 9 ++-
net/bridge/netfilter/ebtables.c | 3 +-
net/ipv4/route.c | 32 +++++++---
net/ipv4/sysctl_net_ipv4.c | 5 +-
net/netfilter/ipvs/ip_vs_ctl.c | 3 +-
net/rds/ib_fmr.c | 11 ++++
net/rds/ib_rdma.c | 3 -
net/rose/af_rose.c | 17 +++---
net/rose/rose_link.c | 16 +++--
net/rose/rose_loopback.c | 36 +++++------
net/rose/rose_route.c | 8 +--
net/rose/rose_timer.c | 30 ++++------
net/sunrpc/cache.c | 3 +
net/tipc/netlink_compat.c | 24 ++++++--
net/vmw_vsock/virtio_transport_common.c | 22 ++++---
scripts/Kbuild.include | 4 +-
62 files changed, 424 insertions(+), 220 deletions(-)
This is the start of the stable review cycle for the 4.9.172 release.
There are 41 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 02 May 2019 11:34:41 AM UTC.
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.9.172-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.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.9.172-rc1
Peter Oskolkov <posk(a)google.com>
net: IP6 defrag: use rbtrees in nf_conntrack_reasm.c
Peter Oskolkov <posk(a)google.com>
net: IP6 defrag: use rbtrees for IPv6 defrag
Florian Westphal <fw(a)strlen.de>
ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module
Peter Oskolkov <posk(a)google.com>
net: IP defrag: encapsulate rbtree defrag code into callable functions
Eric Dumazet <edumazet(a)google.com>
ipv6: frags: fix a lockdep false positive
ZhangXiaoxu <zhangxiaoxu5(a)huawei.com>
ipv4: set the tcp_min_rtt_wlen range from 0 to one day
Vinod Koul <vkoul(a)kernel.org>
net: stmmac: move stmmac_check_ether_addr() to driver probe
Hangbin Liu <liuhangbin(a)gmail.com>
team: fix possible recursive locking when add slaves
Zhu Yanjun <yanjun.zhu(a)oracle.com>
net: rds: exchange of 8K and 1M pool
Erez Alfasi <ereza(a)mellanox.com>
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages query
Amit Cohen <amitc(a)mellanox.com>
mlxsw: spectrum: Fix autoneg status in ethtool
Eric Dumazet <edumazet(a)google.com>
ipv4: add sanity checks in ipv4_link_failure()
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "block/loop: Use global lock for ioctl() operation."
Xin Long <lucien.xin(a)gmail.com>
tipc: check link name with right length in tipc_nl_compat_link_set
Xin Long <lucien.xin(a)gmail.com>
tipc: check bearer name with right length in tipc_nl_compat_bearer_enable
Yue Haibing <yuehaibing(a)huawei.com>
fm10k: Fix a potential NULL pointer dereference
Florian Westphal <fw(a)strlen.de>
netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
NFS: Forbid setting AF_INET6 to "struct sockaddr_in"->sin_family.
YueHaibing <yuehaibing(a)huawei.com>
fs/proc/proc_sysctl.c: Fix a NULL pointer dereference
Alexander Shishkin <alexander.shishkin(a)linux.intel.com>
intel_th: gth: Fix an off-by-one in output unassigning
Linus Torvalds <torvalds(a)linux-foundation.org>
slip: make slhc_free() silently accept an error pointer
Xin Long <lucien.xin(a)gmail.com>
tipc: handle the err returned from cmd header function
Adalbert Lazăr <alazar(a)bitdefender.com>
vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Consolidate LPM checks to avoid enabling LPM twice
Kai-Heng Feng <kai.heng.feng(a)canonical.com>
USB: Add new USB LPM helpers
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix compilation error reported by kbuild test bot
Maarten Lankhorst <maarten.lankhorst(a)linux.intel.com>
drm/vc4: Fix memory leak during gpu reset.
Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
Dirk Behme <dirk.behme(a)de.bosch.com>
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
Lucas Stach <l.stach(a)pengutronix.de>
Input: synaptics-rmi4 - write config register values to the right offset
NeilBrown <neilb(a)suse.com>
sunrpc: don't mark uninitialised items as VALID.
Trond Myklebust <trondmy(a)gmail.com>
nfsd: Don't release the callback slot unless it was actually held
Yan, Zheng <zyan(a)redhat.com>
ceph: fix ci->i_head_snapc leak
Jeff Layton <jlayton(a)kernel.org>
ceph: ensure d_name stability in ceph_dentry_hash()
Xie XiuQi <xiexiuqi(a)huawei.com>
sched/numa: Fix a possible divide-by-zero
Josh Collier <josh.d.collier(a)intel.com>
IB/rdmavt: Fix frwr memory registration
Peter Zijlstra <peterz(a)infradead.org>
trace: Fix preempt_enable_no_resched() abuse
Aurelien Jarno <aurelien(a)aurel32.net>
MIPS: scall64-o32: Fix indirect syscall number load
Wenwen Wang <wang6495(a)umn.edu>
tracing: Fix a memory leak by early error exit in trace_pid_write()
Frank Sorenson <sorenson(a)redhat.com>
cifs: do not attempt cifs operation on smb2+ rename error
Masahiro Yamada <yamada.masahiro(a)socionext.com>
kbuild: simplify ld-option implementation
-------------
Diffstat:
Documentation/networking/ip-sysctl.txt | 1 +
Makefile | 4 +-
arch/arm/boot/compressed/head.S | 16 +-
arch/mips/kernel/scall64-o32.S | 2 +-
drivers/block/loop.c | 42 +--
drivers/block/loop.h | 1 +
drivers/dma/sh/rcar-dmac.c | 4 +-
drivers/gpu/drm/vc4/vc4_crtc.c | 2 +-
drivers/hwtracing/intel_th/gth.c | 2 +-
drivers/infiniband/sw/rdmavt/mr.c | 17 +-
drivers/input/rmi4/rmi_f11.c | 2 +-
drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +
.../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx5/core/port.c | 4 -
drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +-
drivers/net/slip/slhc.c | 2 +-
drivers/net/team/team.c | 6 +
drivers/usb/core/driver.c | 23 +-
drivers/usb/core/hub.c | 16 +-
drivers/usb/core/message.c | 3 +-
drivers/usb/core/sysfs.c | 5 +-
drivers/usb/core/usb.h | 10 +-
fs/ceph/dir.c | 6 +-
fs/ceph/mds_client.c | 9 +
fs/ceph/snap.c | 7 +-
fs/cifs/inode.c | 4 +
fs/nfs/super.c | 3 +-
fs/nfsd/nfs4callback.c | 8 +-
fs/nfsd/state.h | 1 +
fs/proc/proc_sysctl.c | 6 +-
include/net/inet_frag.h | 16 +-
include/net/ipv6.h | 29 --
include/net/ipv6_frag.h | 111 +++++++
kernel/sched/fair.c | 4 +
kernel/trace/ring_buffer.c | 2 +-
kernel/trace/trace.c | 5 +-
net/bridge/netfilter/ebtables.c | 3 +-
net/ieee802154/6lowpan/reassembly.c | 2 +-
net/ipv4/inet_fragment.c | 293 +++++++++++++++++
net/ipv4/ip_fragment.c | 295 ++---------------
net/ipv4/route.c | 32 +-
net/ipv4/sysctl_net_ipv4.c | 5 +-
net/ipv6/netfilter/nf_conntrack_reasm.c | 273 +++++-----------
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c | 3 +-
net/ipv6/reassembly.c | 361 ++++++---------------
net/openvswitch/conntrack.c | 1 +
net/rds/ib_fmr.c | 11 +
net/rds/ib_rdma.c | 3 -
net/sunrpc/cache.c | 3 +
net/tipc/netlink_compat.c | 24 +-
net/vmw_vsock/virtio_transport_common.c | 22 +-
scripts/Kbuild.include | 4 +-
53 files changed, 866 insertions(+), 854 deletions(-)
In linux stable kernel (tested on 4.14), reading memory.stat in case
of tens of thousands of ghost cgroups pinned by lingering page cache
takes up to 100 ms ~ 700 ms to complete the reading.
Repro steps (tested on 4.14 kernel):
$ cat /tmp/make_zombies
mkdir /tmp/fs
mount -t tmpfs nodev /tmp/fs
for i in {1..10000}; do
mkdir /sys/fs/cgroup/memory/z$i
(echo $BASHPID >> /sys/fs/cgroup/memory/z$i/cgroup.procs && echo $i
> /tmp/fs/$i)
done
# establish baseline
$ perf stat -r3 cat /sys/fs/cgroup/memory/memory.stat > /dev/null
0.011642670 seconds time elapsed
$ bash /tmp/make_zombies
$ perf stat -r3 cat /sys/fs/cgroup/memory/memory.stat > /dev/null
0.134939281 seconds time elapsed
$ rmdir /sys/fs/cgroup/memory/z*
$ perf stat -r3 cat /sys/fs/cgroup/memory/memory.stat > /dev/null
0.135323145 seconds time elapsed
# even after rmdir we have zombies, so still slow.
The fix is already present in linux master (since 4.16) by following commits:
c9019e9bf42e66d028d70d2da6206cad4dd9250d mm: memcontrol: eliminate raw
access to stat and event counters
284542656e22c43fdada8c8cc0ca9ede8453eed7 mm: memcontrol: implement
lruvec stat functions on top of each other
a983b5ebee57209c99f68c8327072f25e0e6e3da mm: memcontrol: fix
excessive complexity in memory.stat reporting
c3cc39118c3610eb6ab4711bc624af7fc48a35fe mm: memcontrol: fix
NR_WRITEBACK leak in memcg and system stats
e27be240df53f1a20c659168e722b5d9f16cc7f4 mm: memcg: make sure
memory.events is uptodate when waking pollers
I would like to request cherry-picking the above commits to
linux-stable branch - 4.14.
Thanks,
Vaibhav
This is a note to let you know that I've just added the patch titled
soc: sunxi: Fix missing dependency on REGMAP_MMIO
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-next branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release
during the merge window.
If you have any questions about this process, please let me know.
>From a84014e1db35d8e7af09878d0b4bf30804fb17d5 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel(a)sholland.org>
Date: Tue, 30 Apr 2019 09:59:37 -0500
Subject: soc: sunxi: Fix missing dependency on REGMAP_MMIO
When enabling ARCH_SUNXI from allnoconfig, SUNXI_SRAM is enabled, but
not REGMAP_MMIO, so the kernel fails to link with an undefined reference
to __devm_regmap_init_mmio_clk. Select REGMAP_MMIO, as suggested in
drivers/base/regmap/Kconfig.
This creates the following dependency loop:
drivers/of/Kconfig:68: symbol OF_IRQ depends on IRQ_DOMAIN
kernel/irq/Kconfig:63: symbol IRQ_DOMAIN is selected by REGMAP
drivers/base/regmap/Kconfig:7: symbol REGMAP default is visible depending on REGMAP_MMIO
drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by SUNXI_SRAM
drivers/soc/sunxi/Kconfig:4: symbol SUNXI_SRAM is selected by USB_MUSB_SUNXI
drivers/usb/musb/Kconfig:63: symbol USB_MUSB_SUNXI depends on GENERIC_PHY
drivers/phy/Kconfig:7: symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
drivers/phy/broadcom/Kconfig:29: symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
drivers/net/phy/Kconfig:12: symbol MDIO_BUS default is visible depending on PHYLIB
drivers/net/phy/Kconfig:181: symbol PHYLIB is selected by ARC_EMAC_CORE
drivers/net/ethernet/arc/Kconfig:18: symbol ARC_EMAC_CORE is selected by ARC_EMAC
drivers/net/ethernet/arc/Kconfig:24: symbol ARC_EMAC depends on OF_IRQ
To fix the circular dependency, make USB_MUSB_SUNXI select GENERIC_PHY
instead of depending on it. This matches the use of GENERIC_PHY by all
but two other drivers.
Cc: <stable(a)vger.kernel.org> # 4.19
Fixes: 5828729bebbb ("soc: sunxi: export a regmap for EMAC clock reg on A64")
Signed-off-by: Samuel Holland <samuel(a)sholland.org>
Acked-by: Maxime Ripard <maxime.ripard(a)bootlin.com>
Signed-off-by: Bin Liu <b-liu(a)ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/soc/sunxi/Kconfig | 1 +
drivers/usb/musb/Kconfig | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/sunxi/Kconfig b/drivers/soc/sunxi/Kconfig
index 353b07e40176..e84eb4e59f58 100644
--- a/drivers/soc/sunxi/Kconfig
+++ b/drivers/soc/sunxi/Kconfig
@@ -4,6 +4,7 @@
config SUNXI_SRAM
bool
default ARCH_SUNXI
+ select REGMAP_MMIO
help
Say y here to enable the SRAM controller support. This
device is responsible on mapping the SRAM in the sunXi SoCs
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index f742fddc5e2c..52f8e2b57ad5 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -67,7 +67,7 @@ config USB_MUSB_SUNXI
depends on NOP_USB_XCEIV
depends on PHY_SUN4I_USB
depends on EXTCON
- depends on GENERIC_PHY
+ select GENERIC_PHY
select SUNXI_SRAM
config USB_MUSB_DAVINCI
--
2.21.0