Linux 5.0.11
Greg KH
maintainerI'm announcing the release of the 5.0.11 kernel.
All users of the 5.0 kernel series must upgrade.
The updated 5.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.0.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/networking/ip-sysctl.txt | 1 Documentation/sysctl/vm.txt | 16 - Makefile | 2 arch/arm/boot/compressed/head.S | 16 + arch/arm64/mm/init.c | 2 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 block/bfq-iosched.c | 15 - block/bfq-iosched.h | 2 block/bfq-wf2q.c | 17 + crypto/lrw.c | 6 crypto/xts.c | 6 drivers/android/binder_alloc.c | 18 - drivers/block/loop.c | 5 drivers/block/zram/zram_drv.c | 5 drivers/dma/mediatek/mtk-cqdma.c | 2 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/ttm/ttm_bo.c | 10 drivers/gpu/drm/ttm/ttm_memory.c | 5 drivers/gpu/drm/vc4/vc4_crtc.c | 2 drivers/hwtracing/intel_th/gth.c | 2 drivers/infiniband/core/uverbs.h | 1 drivers/infiniband/core/uverbs_main.c | 52 ++++ drivers/infiniband/hw/mlx5/main.c | 10 drivers/infiniband/sw/rdmavt/mr.c | 17 - drivers/input/rmi4/rmi_f11.c | 2 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 24 ++ drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 3 drivers/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/socionext/netsec.c | 11 - 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/net/wireless/mac80211_hwsim.c | 19 + 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 | 200 ++++++++----------- fs/ceph/dir.c | 6 fs/ceph/mds_client.c | 70 +++++- fs/ceph/snap.c | 7 fs/cifs/file.c | 15 - fs/cifs/inode.c | 4 fs/cifs/misc.c | 23 ++ fs/cifs/smb2pdu.c | 1 fs/ext4/xattr.c | 3 fs/nfs/super.c | 3 fs/nfsd/nfs4callback.c | 8 fs/nfsd/nfs4state.c | 12 - fs/nfsd/state.h | 1 fs/proc/proc_sysctl.c | 6 fs/splice.c | 4 include/drm/ttm/ttm_bo_driver.h | 1 include/linux/etherdevice.h | 12 + include/linux/pipe_fs_i.h | 1 include/net/netfilter/nf_tables.h | 6 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/page_alloc.c | 13 + net/bridge/netfilter/ebtables.c | 3 net/ipv4/route.c | 32 ++- net/ipv4/sysctl_net_ipv4.c | 5 net/ncsi/ncsi-rsp.c | 6 net/netfilter/nf_tables_api.c | 28 ++ net/netfilter/nft_dynset.c | 13 - net/netfilter/nft_lookup.c | 13 - net/netfilter/nft_objref.c | 32 ++- 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 sound/pci/hda/patch_realtek.c | 41 ++- 105 files changed, 873 insertions(+), 395 deletions(-)
Achim Dahlhoff (1):
dmaengine: sh: rcar-dmac: Fix glitch in dmaengine_tx_status
Al Viro (4):
aio: fold lookup_kiocb() into its sole caller
aio: keep io_event in aio_kiocb
aio: store event at final iocb_put() Fix aio_poll() races
Alex Williamson (1):
vfio/type1: Limit DMA mappings per container
Alexander Shishkin (1):
intel_th: gth: Fix an off-by-one in output unassigning
Amit Cohen (1):
mlxsw: spectrum: Fix autoneg status in ethtool
Ard Biesheuvel (1):
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
Aurelien Jarno (1):
MIPS: scall64-o32: Fix indirect syscall number load
Baolin Wang (1):
gpio: eic: sprd: Fix incorrect irq type setting for the sync EIC
Bjorn Andersson (1):
arm64: mm: Ensure tail of unaligned initrd is reserved
Christian König (1):
drm/ttm: fix re-init of global structures
Christophe Leroy (1):
powerpc/vdso32: fix CLOCK_MONOTONIC on PPC64
Dan Carpenter (1):
ext4: fix some error pointer dereferences
Daniel Borkmann (2):
x86, retpolines: Raise limit for generating indirect calls from switch-case x86/retpolines: Disable switch jump tables when retpolines are enabled
Dave Airlie (1):
Revert "drm/i915/fbdev: Actually configure untiled displays"
Dirk Behme (1):
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
Dongli Zhang (1):
loop: do not print warn message if partition scan is successful
Erez Alfasi (1):
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages query
Eric Dumazet (3):
rxrpc: fix race condition in rxrpc_input_packet()
ipv4: add sanity checks in ipv4_link_failure() net/rose: fix unbound loop in rose_loopback_timer()
Florian Westphal (1):
netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
Frank Sorenson (1):
cifs: do not attempt cifs operation on smb2+ rename error
Greg Kroah-Hartman (1):
Linux 5.0.11
Hangbin Liu (1):
team: fix possible recursive locking when add slaves
Harry Pan (1):
perf/x86/intel: Update KBL Package C-state events to also include PC8/PC9/PC10 counters
Herbert Xu (2):
crypto: xts - Fix atomic sleep when walking skcipher
crypto: lrw - Fix atomic sleep when walking skcipher
Ido Schimmel (1):
mlxsw: pci: Reincrease PCI reset timeout
Ilias Apalodimas (1):
net: socionext: replace napi_alloc_frag with the netdev variant on init
Jakub Kicinski (3):
net/tls: fix refcount adjustment in fallback
net/tls: avoid potential deadlock in tls_set_device_offload_rx() net/tls: don't leak IV and record seq when offload fails
Jann Horn (1):
tracing: Fix buffer_ref pipe ops
Jason Gunthorpe (3):
RDMA/mlx5: Do not allow the user to write to the clock page RDMA/mlx5: Use rdma_user_map_io for mapping BAR pages RDMA/ucontext: Fix regression with disassociate
Jeff Layton (4):
ceph: only use d_name directly when parent is locked
ceph: ensure d_name stability in ceph_dentry_hash()
nfsd: wake waiters blocked on file_lock before deleting it
nfsd: wake blocked file lock waiters before sending callback
Johannes Berg (1):
mac80211_hwsim: calculate if_combination.max_interfaces
Josh Collier (1):
IB/rdmavt: Fix frwr memory registration
Jérôme Glisse (2):
cifs: fix page reference leak with readv/writev
zram: pass down the bvec we need to read into in the work struct
Kai-Heng Feng (2):
USB: Add new USB LPM helpers
USB: Consolidate LPM checks to avoid enabling LPM twice
Kailang Yang (1):
ALSA: hda/realtek - Move to ACT_INIT state
Linus Torvalds (3):
slip: make slhc_free() silently accept an error pointer pin iocb through aio.
rdma: fix build errors on s390 and MIPS due to bad ZERO_PAGE use
Lucas Stach (1):
Input: synaptics-rmi4 - write config register values to the right offset
Maarten Lankhorst (2):
drm/vc4: Fix memory leak during gpu reset. drm/vc4: Fix compilation error reported by kbuild test bot
Maxim Mikityanskiy (2):
net/mlx5e: Fix the max MTU check in case of XDP net/mlx5e: Fix use-after-free after xdp_return_frame
Mel Gorman (1):
mm: do not boost watermarks to avoid fragmentation for the DISCONTIG memory model
Michael Ellerman (1):
powerpc/mm/radix: Make Radix require HUGETLB_PAGE
NeilBrown (1):
sunrpc: don't mark uninitialised items as VALID.
Pablo Neira Ayuso (2):
netfilter: nf_tables: bogus EBUSY when deleting set after flush
netfilter: nf_tables: bogus EBUSY in helper removal from transaction
Paolo Valente (1):
block, bfq: fix use after free in bfq_bfqq_expire
Peter Zijlstra (1):
trace: Fix preempt_enable_no_resched() abuse
Petr Machata (1):
mlxsw: spectrum: Put MC TCs into DWRR mode
Ronnie Sahlberg (1):
cifs: fix memory leak in SMB2_read
Shun-Chih Yu (1):
dmaengine: mediatek-cqdma: fix wrong register usage in mtk_cqdma_start
Su Bao Cheng (1):
stmmac: pci: Adjust IOT2000 matching
Tao Ren (1):
net/ncsi: handle overflow when incrementing mac address
Tetsuo Handa (3):
workqueue: Try to catch flush_work() without INIT_WORK().
NFS: Forbid setting AF_INET6 to "struct sockaddr_in"->sin_family. net/rds: Check address length before reading address family
Todd Kjos (1):
binder: fix handling of misaligned binder object
Trond Myklebust (1):
nfsd: Don't release the callback slot unless it was actually held
Vinod Koul (1):
net: stmmac: move stmmac_check_ether_addr() to driver probe
Wenwen Wang (1):
tracing: Fix a memory leak by early error exit in trace_pid_write()
Xie XiuQi (1):
sched/numa: Fix a possible divide-by-zero
Xin Long (3):
tipc: handle the err returned from cmd header function
tipc: check bearer name with right length in tipc_nl_compat_bearer_enable
tipc: check link name with right length in tipc_nl_compat_link_set
Yan, Zheng (1):
ceph: fix ci->i_head_snapc leak
Yue Haibing (1):
fm10k: Fix a potential NULL pointer dereference
YueHaibing (3):
fs/proc/proc_sysctl.c: Fix a NULL pointer dereference lib/Kconfig.debug: fix build error without CONFIG_BLOCK
net: netrom: Fix error cleanup path of nr_proto_init
ZhangXiaoxu (1):
ipv4: set the tcp_min_rtt_wlen range from 0 to one day
Zhu Yanjun (1):
net: rds: exchange of 8K and 1M pool
luca abeni (1):
sched/deadline: Correctly handle active 0-lag timers
Greg KH
maintainerDocumentation/networking/ip-sysctl.txt +1 -0
@@ -422,6 +422,7 @@ tcp_min_rtt_wlen - INTEGER minimum RTT when it is moved to a longer path (e.g., due to traffic engineering). A longer window makes the filter more resistant to RTT inflations such as transient congestion. The unit is seconds. + Possible values: 0 - 86400 (1 day) Default: 300 tcp_moderate_rcvbuf - BOOLEAN
Documentation/sysctl/vm.txt +8 -8
@@ -866,14 +866,14 @@ The intent is that compaction has less work to do in the future and to increase the success rate of future high-order allocations such as SLUB allocations, THP and hugetlbfs pages. -To make it sensible with respect to the watermark_scale_factor parameter, -the unit is in fractions of 10,000. The default value of 15,000 means -that up to 150% of the high watermark will be reclaimed in the event of -a pageblock being mixed due to fragmentation. The level of reclaim is -determined by the number of fragmentation events that occurred in the -recent past. If this value is smaller than a pageblock then a pageblocks -worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor -of 0 will disable the feature. +To make it sensible with respect to the watermark_scale_factor +parameter, the unit is in fractions of 10,000. The default value of +15,000 on !DISCONTIGMEM configurations means that up to 150% of the high +watermark will be reclaimed in the event of a pageblock being mixed due +to fragmentation. The level of reclaim is determined by the number of +fragmentation events that occurred in the recent past. If this value is +smaller than a pageblock then a pageblocks worth of pages will be reclaimed +(e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. =============================================================
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 0 -SUBLEVEL = 10 +SUBLEVEL = 11 EXTRAVERSION = NAME = Shy Crocodile
arch/arm/boot/compressed/head.S +15 -1
@@ -1438,7 +1438,21 @@ ENTRY(efi_stub_entry) @ Preserve return value of efi_entry() in r4 mov r4, r0 - bl cache_clean_flush + + @ our cache maintenance code relies on CP15 barrier instructions + @ but since we arrived here with the MMU and caches configured + @ by UEFI, we must check that the CP15BEN bit is set in SCTLR. + @ Note that this bit is RAO/WI on v6 and earlier, so the ISB in + @ the enable path will be executed on v7+ only. + mrc p15, 0, r1, c1, c0, 0 @ read SCTLR + tst r1, #(1 << 5) @ CP15BEN bit set? + bne 0f + orr r1, r1, #(1 << 5) @ CP15 barrier instructions + mcr p15, 0, r1, c1, c0, 0 @ write SCTLR + ARM( .inst 0xf57ff06f @ v7+ isb ) + THUMB( isb ) + +0: bl cache_clean_flush bl cache_off @ Set parameters for booting zImage according to boot protocol
arch/arm64/mm/init.c +1 -1
@@ -406,7 +406,7 @@ void __init arm64_memblock_init(void)* Otherwise, this is a no-op */ u64 base = phys_initrd_start &PAGE_MASK ; -u64 size =PAGE_ALIGN (phys_initrd_size); +u64 size =PAGE_ALIGN (phys_initrd_start + phys_initrd_size) - base;/* * We can only add back the initrd memory if we don't end up
arch/mips/kernel/scall64-o32.S +1 -1
@@ -125,7 +125,7 @@ trace_a_syscall: subu t1, v0, __NR_O32_Linux move a1, v0 bnez t1, 1f /* __NR_syscall at offset 0 */ - lw a1, PT_R4(sp) /* Arg1 for __NR_syscall case */ + ld a1, PT_R4(sp) /* Arg1 for __NR_syscall case */ .set pop 1: jal syscall_trace_enter
arch/powerpc/configs/skiroot_defconfig +1 -0
@@ -260,6 +260,7 @@ CONFIG_UDF_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_PROC_KCORE=y +CONFIG_HUGETLBFS=y # CONFIG_MISC_FILESYSTEMS is not set # CONFIG_NETWORK_FILESYSTEMS is not set CONFIG_NLS=y
arch/powerpc/kernel/vdso32/gettimeofday.S +1 -1
@@ -98,7 +98,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) * can be used, r7 contains NSEC_PER_SEC. */ - lwz r5,WTOM_CLOCK_SEC(r9) + lwz r5,(WTOM_CLOCK_SEC+LOPART)(r9) lwz r6,WTOM_CLOCK_NSEC(r9) /* We now have our offset in r5,r6. We create a fake dependency
arch/powerpc/platforms/Kconfig.cputype +1 -1
@@ -318,7 +318,7 @@ config ARCH_ENABLE_SPLIT_PMD_PTLOCK config PPC_RADIX_MMU bool "Radix MMU Support" - depends on PPC_BOOK3S_64 + depends on PPC_BOOK3S_64 && HUGETLB_PAGE select ARCH_HAS_GIGANTIC_PAGE if (MEMORY_ISOLATION && COMPACTION) || CMA default y help
arch/x86/Makefile +9 -0
@@ -217,6 +217,15 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables # Avoid indirect branches in kernel to deal with Spectre ifdef CONFIG_RETPOLINE KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) + # Additionally, avoid generating expensive indirect jumps which + # are subject to retpolines for small number of switch cases. + # clang turns off jump table generation by default when under + # retpoline builds, however, gcc does not for x86. This has + # only been fixed starting from gcc stable version 8.4.0 and + # onwards, but not for older ones. See gcc bug #86952. + ifndef CONFIG_CC_IS_CLANG + KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables) + endif endif archscripts: scripts_basic
arch/x86/events/intel/cstate.c +5 -5
@@ -76,15 +76,15 @@* Scope: Package (physical package) * MSR_PKG_C8_RESIDENCY: Package C8 Residency Counter. * perf code: 0x04 -* Available model: HSW ULT,CNL +* Available model: HSW ULT,KBL,CNL * Scope: Package (physical package) * MSR_PKG_C9_RESIDENCY: Package C9 Residency Counter. * perf code: 0x05 -* Available model: HSW ULT,CNL +* Available model: HSW ULT,KBL,CNL * Scope: Package (physical package) * MSR_PKG_C10_RESIDENCY: Package C10 Residency Counter. * perf code: 0x06 -* Available model: HSW ULT,GLM,CNL +* Available model: HSW ULT,KBL,GLM,CNL * Scope: Package (physical package) * */
@@ -572,8 +572,8 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = {X86_CSTATES_MODEL (INTEL_FAM6_SKYLAKE_DESKTOP , snb_cstates),X86_CSTATES_MODEL (INTEL_FAM6_SKYLAKE_X , snb_cstates), -X86_CSTATES_MODEL (INTEL_FAM6_KABYLAKE_MOBILE , snb_cstates), -X86_CSTATES_MODEL (INTEL_FAM6_KABYLAKE_DESKTOP , snb_cstates), +X86_CSTATES_MODEL (INTEL_FAM6_KABYLAKE_MOBILE , hswult_cstates), +X86_CSTATES_MODEL (INTEL_FAM6_KABYLAKE_DESKTOP , hswult_cstates), X86_CSTATES_MODEL(INTEL_FAM6_CANNONLAKE_MOBILE, cnl_cstates),
block/bfq-iosched.c +7 -8
@@ -2804,7 +2804,7 @@ static void bfq_dispatch_remove(struct request_queue *q, struct request *rq)bfq_remove_request (q, rq); } -static void __bfq_bfqq_expire (struct bfq_data *bfqd,struct bfq_queue *bfqq) +static bool __bfq_bfqq_expire (struct bfq_data *bfqd,struct bfq_queue *bfqq) {/* * If this bfqq is shared between multiple processes, check
@@ -2837,9 +2837,11 @@ static void __bfq_bfqq_expire(struct bfq_data *bfqd, struct bfq_queue *bfqq)/* * All in-service entities must have been properly deactivated * or requeued before executing the next function, which -* resets all in-service entites as no more in service. +* resets all in-service entities as no more in service. This +* may cause bfqq to be freed. If this happens, the next +* function returns true. */ -__bfq_bfqd_reset_in_service (bfqd); +return __bfq_bfqd_reset_in_service (bfqd); }/**
@@ -3244,7 +3246,6 @@ void bfq_bfqq_expire(struct bfq_data *bfqd,bool slow;unsigned long delta =0 ;struct bfq_entity *entity = &bfqq->entity; -int ref;/* * Check whether the process is slow (see bfq_bfqq_is_slow).
@@ -3313,10 +3314,8 @@ void bfq_bfqq_expire(struct bfq_data *bfqd,* reason. */ __bfq_bfqq_recalc_budget (bfqd, bfqq, reason); - ref = bfqq->ref; -__bfq_bfqq_expire (bfqd, bfqq); - -if (ref ==1 )/* bfqq is gone, no more actions on it */ +if (__bfq_bfqq_expire (bfqd, bfqq)) +/* bfqq is gone, no more actions on it */ return ; bfqq->injected_service =0 ;
block/bfq-iosched.h +1 -1
@@ -993,7 +993,7 @@ bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree);bool next_queue_may_preempt (struct bfq_data *bfqd);struct bfq_queue *bfq_get_next_queue (struct bfq_data *bfqd); -void __bfq_bfqd_reset_in_service (struct bfq_data *bfqd); +bool __bfq_bfqd_reset_in_service (struct bfq_data *bfqd);void bfq_deactivate_bfqq (struct bfq_data *bfqd,struct bfq_queue *bfqq,bool ins_into_idle_tree,bool expiration);void bfq_activate_bfqq (struct bfq_data *bfqd,struct bfq_queue *bfqq);
block/bfq-wf2q.c +15 -2
@@ -1599,7 +1599,8 @@ struct bfq_queue *bfq_get_next_queue(struct bfq_data *bfqd)return bfqq; } -void __bfq_bfqd_reset_in_service (struct bfq_data *bfqd) +/* returns true if the in-service queue gets freed */ +bool __bfq_bfqd_reset_in_service (struct bfq_data *bfqd) {struct bfq_queue *in_serv_bfqq = bfqd->in_service_queue;struct bfq_entity *in_serv_entity = &in_serv_bfqq->entity;
@@ -1623,8 +1624,20 @@ void __bfq_bfqd_reset_in_service(struct bfq_data *bfqd)* service tree either, then release the service reference to * the queue it represents (taken with bfq_get_entity). */ -if (!in_serv_entity->on_st) +if (!in_serv_entity->on_st) { +/* +* If no process is referencing in_serv_bfqq any +* longer, then the service reference may be the only +* reference to the queue. If this is the case, then +* bfqq gets freed here. +*/ +int ref = in_serv_bfqq->ref;bfq_put_queue (in_serv_bfqq); +if (ref ==1 ) +return true; + } + +return false; } void bfq_deactivate_bfqq(struct bfq_data *bfqd, struct bfq_queue *bfqq,
crypto/lrw.c +5 -1
@@ -212,8 +212,12 @@ static void crypt_done(struct crypto_async_request *areq, int err) {struct skcipher_request *req = areq->data; -if (!err) +if (!err) { +struct rctx *rctx =skcipher_request_ctx (req); + + rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP ; err =xor_tweak_post (req); + }skcipher_request_complete (req, err); }
crypto/xts.c +5 -1
@@ -137,8 +137,12 @@ static void crypt_done(struct crypto_async_request *areq, int err) {struct skcipher_request *req = areq->data; -if (!err) +if (!err) { +struct rctx *rctx =skcipher_request_ctx (req); + + rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP ; err =xor_tweak_post (req); + }skcipher_request_complete (req, err); }
drivers/android/binder_alloc.c +8 -10
@@ -959,14 +959,13 @@ enum lru_status binder_alloc_free_page(struct list_head *item, index = page - alloc->pages; page_addr = (uintptr_t )alloc->buffer + index *PAGE_SIZE ; + + mm = alloc->vma_vm_mm; +if (!mmget_not_zero (mm)) + goto err_mmget; +if (!down_write_trylock (&mm->mmap_sem)) + goto err_down_write_mmap_sem_failed; vma =binder_alloc_get_vma (alloc); -if (vma) { -if (!mmget_not_zero (alloc->vma_vm_mm)) - goto err_mmget; - mm = alloc->vma_vm_mm; -if (!down_write_trylock (&mm->mmap_sem)) - goto err_down_write_mmap_sem_failed; - }list_lru_isolate (lru, item);spin_unlock (lock);
@@ -979,10 +978,9 @@ enum lru_status binder_alloc_free_page(struct list_head *item, PAGE_SIZE);trace_binder_unmap_user_end (alloc, index); - -up_write (&mm->mmap_sem); -mmput (mm); } +up_write (&mm->mmap_sem); +mmput (mm);trace_binder_unmap_kernel_start (alloc, index);
drivers/block/loop.c +3 -2
@@ -1111,8 +1111,9 @@ static int __loop_clr_fd(struct loop_device *lo, bool release) err =__blkdev_reread_part (bdev); else err =blkdev_reread_part (bdev); -pr_warn ("%s: partition scan of loop%d failed (rc=%d)\n" , - __func__, lo_number, err); +if (err) +pr_warn ("%s: partition scan of loop%d failed (rc=%d)\n" , + __func__, lo_number, err);/* Device is gone, no point in returning error */ err =0 ; }
drivers/block/zram/zram_drv.c +3 -2
@@ -774,18 +774,18 @@ struct zram_work {struct zram *zram;unsigned long entry;struct bio *bio; +struct bio_vec bvec; };#if PAGE_SIZE !=4096 static void zram_sync_read (struct work_struct *work) { -struct bio_vec bvec; struct zram_work *zw = container_of(work, struct zram_work, work);struct zram *zram = zw->zram;unsigned long entry = zw->entry;struct bio *bio = zw->bio; -read_from_bdev_async (zram, &bvec, entry, bio); +read_from_bdev_async (zram, &zw->bvec, entry, bio); }/*
@@ -798,6 +798,7 @@ static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, {struct zram_work work; + work.bvec = *bvec; work.zram = zram; work.entry = entry; work.bio = bio;
drivers/dma/mediatek/mtk-cqdma.c +1 -1
@@ -253,7 +253,7 @@ static void mtk_cqdma_start(struct mtk_cqdma_pchan *pc,#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT mtk_dma_set (pc,MTK_CQDMA_DST2 , cvd->dest >>MTK_CQDMA_ADDR2_SHFIT );#else -mtk_dma_set (pc,MTK_CQDMA_SRC2 ,0 ); +mtk_dma_set (pc,MTK_CQDMA_DST2 ,0 );#endif /* setup the length */
drivers/dma/sh/rcar-dmac.c +26 -4
@@ -1282,6 +1282,9 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,enum dma_status status;unsigned int residue =0 ;unsigned int dptr =0 ; +unsigned int chcrb; +unsigned int tcrb; +unsigned int i;if (!desc)return 0 ;
@@ -1329,6 +1332,24 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,return 0 ; } +/* +* We need to read two registers. +* Make sure the control register does not skip to next chunk +* while reading the counter. +* Trying it 3 times should be enough: Initial read, retry, retry +* for the paranoid. +*/ +for (i =0 ; i <3 ; i++) { + chcrb =rcar_dmac_chan_read (chan,RCAR_DMACHCRB ) & +RCAR_DMACHCRB_DPTR_MASK ; + tcrb =rcar_dmac_chan_read (chan,RCAR_DMATCRB ); +/* Still the same? */ +if (chcrb == (rcar_dmac_chan_read (chan,RCAR_DMACHCRB ) & +RCAR_DMACHCRB_DPTR_MASK )) +break ; + } +WARN_ONCE (i >=3 ,"residue might be not continuous!" ); +/* * In descriptor mode the descriptor running pointer is not maintained * by the interrupt handler, find the running descriptor from the
@@ -1336,8 +1357,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan,* mode just use the running descriptor pointer. */ if (desc->hwdescs.use) { - dptr = (rcar_dmac_chan_read (chan,RCAR_DMACHCRB ) & -RCAR_DMACHCRB_DPTR_MASK ) >>RCAR_DMACHCRB_DPTR_SHIFT ; + dptr = chcrb >>RCAR_DMACHCRB_DPTR_SHIFT ;if (dptr ==0 ) dptr = desc->nchunks; dptr--;
@@ -1355,7 +1375,7 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, }/* Add the residue for the current chunk. */ - residue +=rcar_dmac_chan_read (chan,RCAR_DMATCRB ) << desc->xfer_shift; + residue += tcrb << desc->xfer_shift;return residue; }
@@ -1368,6 +1388,7 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,enum dma_status status;unsigned long flags;unsigned int residue; +bool cyclic; status =dma_cookie_status (chan, cookie, txstate);if (status ==DMA_COMPLETE || !txstate)
@@ -1375,10 +1396,11 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,spin_lock_irqsave (&rchan->lock, flags); residue =rcar_dmac_chan_get_residue (rchan, cookie); + cyclic = rchan->desc.running ? rchan->desc.running->cyclic : false;spin_unlock_irqrestore (&rchan->lock, flags);/* if there's no residue, the cookie is complete */ -if (!residue) +if (!residue && !cyclic)return DMA_COMPLETE ;dma_set_residue (txstate, residue);
drivers/gpio/gpio-eic-sprd.c +1 -0
@@ -414,6 +414,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH : +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;
drivers/gpu/drm/i915/intel_fbdev.c +5 -7
@@ -336,8 +336,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, bool *enabled, int width, int height) { struct drm_i915_private *dev_priv = to_i915(fb_helper->dev); +unsigned long conn_configured, conn_seq, mask;unsigned int count =min (fb_helper->connector_count,BITS_PER_LONG ); -unsigned long conn_configured, conn_seq;int i, j;bool *save_enabled;bool fallback = true, ret = true;
@@ -355,9 +355,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,drm_modeset_backoff (&ctx);memcpy (save_enabled, enabled, count); - conn_seq =GENMASK (count -1 ,0 ); + mask =GENMASK (count -1 ,0 ); conn_configured =0 ; retry: + conn_seq = conn_configured;for (i =0 ; i < count; i++) {struct drm_fb_helper_connector *fb_conn;struct drm_connector *connector;
@@ -370,8 +371,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,if (conn_configured &BIT (i))continue ; -/* First pass, only consider tiled connectors */ -if (conn_seq ==GENMASK (count -1 ,0 ) && !connector->has_tile) +if (conn_seq ==0 && !connector->has_tile)continue ;if (connector->status == connector_status_connected)
@@ -475,10 +475,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, conn_configured |=BIT (i); } -if (conn_configured != conn_seq) {/* repeat until no more are found */ - conn_seq = conn_configured; +if ((conn_configured & mask) != mask && conn_configured != conn_seq) goto retry; - }/* * If the BIOS didn't enable everything it could, fall back to have the
drivers/gpu/drm/ttm/ttm_bo.c +5 -5
@@ -49,9 +49,8 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj);* ttm_global_mutex - protecting the global BO state */ DEFINE_MUTEX (ttm_global_mutex); -struct ttm_bo_global ttm_bo_glob = { - .use_count =0 -}; +unsigned ttm_bo_glob_use_count; +struct ttm_bo_global ttm_bo_glob;static struct attribute ttm_bo_count = { .name ="bo_count" ,
@@ -1535,12 +1534,13 @@ static void ttm_bo_global_release(void)struct ttm_bo_global *glob = &ttm_bo_glob;mutex_lock (&ttm_global_mutex); -if (--glob->use_count >0 ) +if (--ttm_bo_glob_use_count >0 ) goto out;kobject_del (&glob->kobj);kobject_put (&glob->kobj);ttm_mem_global_release (&ttm_mem_glob); +memset (glob,0 ,sizeof (*glob)); out:mutex_unlock (&ttm_global_mutex); }
@@ -1552,7 +1552,7 @@ static int ttm_bo_global_init(void)unsigned i;mutex_lock (&ttm_global_mutex); -if (++glob->use_count >1 ) +if (++ttm_bo_glob_use_count >1 ) goto out; ret =ttm_mem_global_init (&ttm_mem_glob);
drivers/gpu/drm/ttm/ttm_memory.c +3 -2
@@ -461,8 +461,8 @@ int ttm_mem_global_init(struct ttm_mem_global *glob)void ttm_mem_global_release (struct ttm_mem_global *glob) { -unsigned int i;struct ttm_mem_zone *zone; +unsigned int i;/* let the page allocator first stop the shrink work. */ ttm_page_alloc_fini ();
@@ -475,9 +475,10 @@ void ttm_mem_global_release(struct ttm_mem_global *glob) zone = glob->zones[i];kobject_del (&zone->kobj);kobject_put (&zone->kobj); - } + }kobject_del (&glob->kobj);kobject_put (&glob->kobj); +memset (glob,0 ,sizeof (*glob)); }static void ttm_check_swapping (struct ttm_mem_global *glob)
drivers/gpu/drm/vc4/vc4_crtc.c +1 -1
@@ -999,7 +999,7 @@ static void vc4_crtc_reset(struct drm_crtc *crtc) {if (crtc->state) -__drm_atomic_helper_crtc_destroy_state (crtc->state); +vc4_crtc_destroy_state (crtc, crtc->state); crtc->state =kzalloc (sizeof (struct vc4_crtc_state ),GFP_KERNEL );if (crtc->state)
drivers/hwtracing/intel_th/gth.c +1 -1
@@ -616,7 +616,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev, othdev->output.port =-1 ; othdev->output.active = false; gth->output[port].output =NULL ; -for (master =0 ; master <TH_CONFIGURABLE_MASTERS ; master++) +for (master =0 ; master <=TH_CONFIGURABLE_MASTERS ; master++)if (gth->master[master] == port) gth->master[master] =-1 ;spin_unlock (>h->gth_lock);
drivers/infiniband/core/uverbs.h +1 -0
@@ -160,6 +160,7 @@ struct ib_uverbs_file {struct mutex umap_lock;struct list_head umaps; +struct page *disassociate_page;struct idr idr;/* spinlock protects write access to idr */
drivers/infiniband/core/uverbs_main.c +49 -3
88 lines not on this page · raw message
drivers/infiniband/hw/mlx5/main.c +5 -5
@@ -1982,6 +1982,7 @@ static int mlx5_ib_mmap_clock_info_page(struct mlx5_ib_dev *dev,if (vma->vm_flags &VM_WRITE )return -EPERM ; + vma->vm_flags &= ~VM_MAYWRITE ;if (!dev->mdev->clock_info_page)return -EOPNOTSUPP ;
@@ -2147,19 +2148,18 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vmif (vma->vm_flags &VM_WRITE )return -EPERM ; + vma->vm_flags &= ~VM_MAYWRITE ;/* Don't expose to user-space information it shouldn't have */ if (PAGE_SIZE >4096 )return -EOPNOTSUPP ; - vma->vm_page_prot =pgprot_noncached (vma->vm_page_prot); pfn = (dev->mdev->iseg_base + offsetof(struct mlx5_init_seg , internal_timer_h)) >>PAGE_SHIFT ; -if (io_remap_pfn_range (vma, vma->vm_start, pfn, -PAGE_SIZE , vma->vm_page_prot)) -return -EAGAIN ; -break ; +return rdma_user_mmap_io (&context->ibucontext, vma, pfn, +PAGE_SIZE , +pgprot_noncached (vma->vm_page_prot));case MLX5_IB_MMAP_CLOCK_INFO :return mlx5_ib_mmap_clock_info_page (dev, vma, context);
drivers/infiniband/sw/rdmavt/mr.c +10 -7
@@ -611,11 +611,6 @@ static int rvt_set_page(struct ib_mr *ibmr, u64 addr)if (unlikely (mapped_segs == mr->mr.max_segs))return -ENOMEM ; -if (mr->mr.length ==0 ) { - mr->mr.user_base = addr; - mr->mr.iova = addr; - } - m = mapped_segs /RVT_SEGSZ ; n = mapped_segs %RVT_SEGSZ ; mr->mr.map[m]->segs[n].vaddr = (void *)addr;
@@ -633,17 +628,24 @@ static int rvt_set_page(struct ib_mr *ibmr, u64 addr)* @sg_nents: number of entries in sg * @sg_offset: offset in bytes into sg * +* Overwrite rvt_mr length with mr length calculated by ib_sg_to_pages. +* * Return: number of sg elements mapped to the memory region */ int rvt_map_mr_sg (struct ib_mr *ibmr,struct scatterlist *sg,int sg_nents,unsigned int *sg_offset) {struct rvt_mr *mr =to_imr (ibmr); +int ret; mr->mr.length =0 ; mr->mr.page_shift =PAGE_SHIFT ; -return ib_sg_to_pages (ibmr, sg, sg_nents, sg_offset, - rvt_set_page); + ret =ib_sg_to_pages (ibmr, sg, sg_nents, sg_offset, rvt_set_page); + mr->mr.user_base = ibmr->iova; + mr->mr.iova = ibmr->iova; + mr->mr.offset = ibmr->iova - (u64 )mr->mr.map[0 ]->segs[0 ].vaddr; + mr->mr.length = (size_t )ibmr->length; +return ret; }/**
@@ -674,6 +676,7 @@ int rvt_fast_reg_mr(struct rvt_qp *qp, struct ib_mr *ibmr, u32 key, ibmr->rkey = key; mr->mr.lkey = key; mr->mr.access_flags = access; + mr->mr.iova = ibmr->iova;atomic_set (&mr->mr.lkey_invalid,0 );return 0 ;
drivers/input/rmi4/rmi_f11.c +1 -1
@@ -1230,7 +1230,7 @@ static int rmi_f11_initialize(struct rmi_function *fn) } rc =f11_write_control_regs (fn, &f11->sens_query, - &f11->dev_controls, fn->fd.query_base_addr); + &f11->dev_controls, fn->fd.control_base_addr);if (rc)dev_warn (&fn->dev,"Failed to write control registers\n" );
drivers/net/ethernet/intel/fm10k/fm10k_main.c +2 -0
@@ -41,6 +41,8 @@ static int __init fm10k_init_module(void)/* create driver workqueue */ fm10k_workqueue =alloc_workqueue ("%s" ,WQ_MEM_RECLAIM ,0 , fm10k_driver_name); +if (!fm10k_workqueue) +return -ENOMEM ;fm10k_dbg_init ();
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +22 -2
@@ -33,6 +33,26 @@#include <linux/bpf_trace.h> #include "en/xdp.h" +int mlx5e_xdp_max_mtu (struct mlx5e_params *params) +{ +int hr =NET_IP_ALIGN +XDP_PACKET_HEADROOM ; + +/* Let S := SKB_DATA_ALIGN(sizeof(struct skb_shared_info)). +* The condition checked in mlx5e_rx_is_linear_skb is: +* SKB_DATA_ALIGN(sw_mtu + hard_mtu + hr) + S <= PAGE_SIZE (1) +* (Note that hw_mtu == sw_mtu + hard_mtu.) +* What is returned from this function is: +* max_mtu = PAGE_SIZE - S - hr - hard_mtu (2) +* After assigning sw_mtu := max_mtu, the left side of (1) turns to +* SKB_DATA_ALIGN(PAGE_SIZE - S) + S, which is equal to PAGE_SIZE, +* because both PAGE_SIZE and S are already aligned. Any number greater +* than max_mtu would make the left side of (1) greater than PAGE_SIZE, +* so max_mtu is the maximum MTU allowed. +*/ + +return MLX5E_HW2SW_MTU (params,SKB_MAX_HEAD (hr)); +} +static inline bool mlx5e_xmit_xdp_buff (struct mlx5e_xdpsq *sq,struct mlx5e_dma_info *di,struct xdp_buff *xdp)
@@ -304,9 +324,9 @@ bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq)mlx5e_xdpi_fifo_pop (xdpi_fifo);if (is_redirect) { -xdp_return_frame (xdpi.xdpf);dma_unmap_single (sq->pdev, xdpi.dma_addr, xdpi.xdpf->len,DMA_TO_DEVICE ); +xdp_return_frame (xdpi.xdpf); }else {/* Recycle RX page */ mlx5e_page_release (rq, &xdpi.di, true);
@@ -345,9 +365,9 @@ void mlx5e_free_xdpsq_descs(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq)mlx5e_xdpi_fifo_pop (xdpi_fifo);if (is_redirect) { -xdp_return_frame (xdpi.xdpf);dma_unmap_single (sq->pdev, xdpi.dma_addr, xdpi.xdpf->len,DMA_TO_DEVICE ); +xdp_return_frame (xdpi.xdpf); }else {/* Recycle RX page */ mlx5e_page_release (rq, &xdpi.di, false);
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +1 -2
@@ -34,13 +34,12 @@#include "en.h" -#define MLX5E_XDP_MAX_MTU ((int)(PAGE_SIZE - \ - MLX5_SKB_FRAG_SZ(XDP_PACKET_HEADROOM)))#define MLX5E_XDP_MIN_INLINE (ETH_HLEN + VLAN_HLEN)#define MLX5E_XDP_TX_EMPTY_DS_COUNT \ (sizeof(struct mlx5e_tx_wqe) / MLX5_SEND_WQE_DS) #define MLX5E_XDP_TX_DS_COUNT (MLX5E_XDP_TX_EMPTY_DS_COUNT + 1 /* SG DS */) +int mlx5e_xdp_max_mtu (struct mlx5e_params *params);bool mlx5e_xdp_handle (struct mlx5e_rq *rq,struct mlx5e_dma_info *di,void *va,u16 *rx_headroom,u32 *len);bool mlx5e_poll_xdpsq_cq (struct mlx5e_cq *cq,struct mlx5e_rq *rq);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +1 -1
@@ -1470,7 +1470,7 @@ static int mlx5e_get_module_info(struct net_device *netdev,break ;case MLX5_MODULE_ID_SFP : modinfo->type =ETH_MODULE_SFF_8472 ; - modinfo->eeprom_len =ETH_MODULE_SFF_8472_LEN ; + modinfo->eeprom_len =MLX5_EEPROM_PAGE_LENGTH ;break ;default : netdev_err(priv->netdev, "%s: cable type not recognized:0x%x\n",
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +3 -2
@@ -3816,7 +3816,7 @@ int mlx5e_change_mtu(struct net_device *netdev, int new_mtu,if (params->xdp_prog && !mlx5e_rx_is_linear_skb (priv->mdev, &new_channels.params)) {netdev_err (netdev,"MTU(%d) > %d is not allowed while XDP enabled\n" , - new_mtu,MLX5E_XDP_MAX_MTU ); + new_mtu,mlx5e_xdp_max_mtu (params)); err = -EINVAL ; goto out; }
@@ -4280,7 +4280,8 @@ static int mlx5e_xdp_allowed(struct mlx5e_priv *priv, struct bpf_prog *prog)if (!mlx5e_rx_is_linear_skb (priv->mdev, &new_channels.params)) {netdev_warn (netdev,"XDP is not allowed with MTU(%d) > %d\n" , - new_channels.params.sw_mtu,MLX5E_XDP_MAX_MTU ); + new_channels.params.sw_mtu, +mlx5e_xdp_max_mtu (&new_channels.params));return -EINVAL ; }
drivers/net/ethernet/mellanox/mlx5/core/port.c +0 -4
@@ -404,10 +404,6 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, size -= offset + size -MLX5_EEPROM_PAGE_LENGTH ; i2c_addr =MLX5_I2C_ADDR_LOW ; -if (offset >=MLX5_EEPROM_PAGE_LENGTH ) { - i2c_addr =MLX5_I2C_ADDR_HIGH ; - offset -=MLX5_EEPROM_PAGE_LENGTH ; - }MLX5_SET (mcia_reg, in, l,0 );MLX5_SET (mcia_reg, in, module, module_num);
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 -1
@@ -27,7 +27,7 @@#define MLXSW_PCI_SW_RESET 0xF0010#define MLXSW_PCI_SW_RESET_RST_BIT BIT(0) -#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 13000 +#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 20000#define MLXSW_PCI_SW_RESET_WAIT_MSECS 100#define MLXSW_PCI_FW_READY 0xA1844#define MLXSW_PCI_FW_READY_MASK 0xFFFF
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +3 -3
@@ -2667,11 +2667,11 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev,if (err)return err; + mlxsw_sp_port->link.autoneg = autoneg; +if (!netif_running (dev))return 0 ; - mlxsw_sp_port->link.autoneg = autoneg; -mlxsw_sp_port_admin_status_set (mlxsw_sp_port, false);mlxsw_sp_port_admin_status_set (mlxsw_sp_port, true);
@@ -2961,7 +2961,7 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port) err =mlxsw_sp_port_ets_set (mlxsw_sp_port,MLXSW_REG_QEEC_HIERARCY_TC , i +8 , i, - false,0 ); + true,100 );if (err)return err; }
drivers/net/ethernet/socionext/netsec.c +7 -4
@@ -673,7 +673,8 @@ static void netsec_process_tx(struct netsec_priv *priv) }static void *netsec_alloc_rx_data (struct netsec_priv *priv, -dma_addr_t *dma_handle,u16 *desc_len) +dma_addr_t *dma_handle,u16 *desc_len, +bool napi) {size_t total_len =SKB_DATA_ALIGN (sizeof (struct skb_shared_info ));size_t payload_len =NETSEC_RX_BUF_SZ ;
@@ -682,7 +683,7 @@ static void *netsec_alloc_rx_data(struct netsec_priv *priv, total_len +=SKB_DATA_ALIGN (payload_len +NETSEC_SKB_PAD ); - buf =napi_alloc_frag (total_len); + buf = napi ?napi_alloc_frag (total_len) :netdev_alloc_frag (total_len);if (!buf)return NULL ;
@@ -765,7 +766,8 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)/* allocate a fresh buffer and map it to the hardware. * This will eventually replace the old buffer in the hardware */ - buf_addr =netsec_alloc_rx_data (priv, &dma_handle, &desc_len); + buf_addr =netsec_alloc_rx_data (priv, &dma_handle, &desc_len, + true);if (unlikely (!buf_addr))break ;
@@ -1069,7 +1071,8 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv)void *buf;u16 len; - buf =netsec_alloc_rx_data (priv, &dma_handle, &len); + buf =netsec_alloc_rx_data (priv, &dma_handle, &len, + false);if (!buf) {netsec_uninit_pkt_dring (priv,NETSEC_RING_RX ); goto err_out;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 -2
@@ -2590,8 +2590,6 @@ static int stmmac_open(struct net_device *dev)u32 chan;int ret; -stmmac_check_ether_addr (priv); -if (priv->hw->pcs !=STMMAC_PCS_RGMII && priv->hw->pcs !=STMMAC_PCS_TBI && priv->hw->pcs !=STMMAC_PCS_RTBI ) {
@@ -4265,6 +4263,8 @@ int stmmac_dvr_probe(struct device *device,if (ret) goto error_hw_init; +stmmac_check_ether_addr (priv); +/* Configure real RX and TX queues */ netif_set_real_num_rx_queues (ndev, priv->plat->rx_queues_to_use);netif_set_real_num_tx_queues (ndev, priv->plat->tx_queues_to_use);
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +6 -2
@@ -159,6 +159,12 @@ static const struct dmi_system_id quark_pci_dmi[] = { }, .driver_data = (void *)&galileo_stmmac_dmi_data, }, +/* +* There are 2 types of SIMATIC IOT2000: IOT20202 and IOT2040. +* The asset tag "6ES7647-0AA00-0YA2" is only for IOT2020 which +* has only one pci network device while other asset tags are +* for IOT2040 which has two. +*/ { .matches = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"),
@@ -170,8 +176,6 @@ static const struct dmi_system_id quark_pci_dmi[] = { { .matches = { DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), - DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG, - "6ES7647-0AA00-1YA2"), }, .driver_data = (void *)&iot2040_stmmac_dmi_data, },
drivers/net/slip/slhc.c +1 -1
@@ -153,7 +153,7 @@ slhc_init(int rslots, int tslots)void slhc_free (struct slcompress *comp) { -if ( comp ==NULLSLCOMPR ) +if (IS_ERR_OR_NULL (comp) )return ;if ( comp->tstate !=NULLSLSTATE )
drivers/net/team/team.c +7 -0
@@ -1157,6 +1157,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev,return -EINVAL ; } +if (netdev_has_upper_dev (dev, port_dev)) { +NL_SET_ERR_MSG (extack,"Device is already an upper device of the team interface" ); +netdev_err (dev,"Device %s is already an upper device of the team interface\n" , + portname); +return -EBUSY ; + } +if (port_dev->features &NETIF_F_VLAN_CHALLENGED &&vlan_uses_dev (dev)) {NL_SET_ERR_MSG (extack,"Device is VLAN challenged and team device has VLAN set up" );
drivers/net/wireless/mac80211_hwsim.c +15 -4
@@ -2642,7 +2642,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,enum nl80211_band band;const struct ieee80211_ops *ops = &mac80211_hwsim_ops;struct net *net; -int idx; +int idx, i;int n_limits =0 ;if (WARN_ON (param->channels >1 && !param->use_chanctx))
@@ -2766,12 +2766,23 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, goto failed_hw; } + data->if_combination.max_interfaces =0 ; +for (i =0 ; i < n_limits; i++) + data->if_combination.max_interfaces += + data->if_limits[i].max; + data->if_combination.n_limits = n_limits; - data->if_combination.max_interfaces =2048 ; data->if_combination.limits = data->if_limits; - hw->wiphy->iface_combinations = &data->if_combination; - hw->wiphy->n_iface_combinations =1 ; +/* +* If we actually were asked to support combinations, +* advertise them - if there's only a single thing like +* only IBSS then don't advertise it as combinations. +*/ +if (data->if_combination.max_interfaces >1 ) { + hw->wiphy->iface_combinations = &data->if_combination; + hw->wiphy->n_iface_combinations =1 ; + }if (param->ciphers) { memcpy(data->ciphers, param->ciphers,
drivers/usb/core/driver.c +19 -4
@@ -1896,14 +1896,11 @@ int usb_runtime_idle(struct device *dev)return -EBUSY ; } -int usb_set_usb2_hardware_lpm (struct usb_device *udev,int enable) +static int usb_set_usb2_hardware_lpm (struct usb_device *udev,int enable) {struct usb_hcd *hcd =bus_to_hcd (udev->bus);int ret = -EPERM ; -if (enable && !udev->usb2_hw_lpm_allowed) -return 0 ; -if (hcd->driver->set_usb2_hw_lpm) { ret = hcd->driver->set_usb2_hw_lpm (hcd, udev, enable);if (!ret)
@@ -1913,6 +1910,24 @@ int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)return ret; } +int usb_enable_usb2_hardware_lpm (struct usb_device *udev) +{ +if (!udev->usb2_hw_lpm_capable || + !udev->usb2_hw_lpm_allowed || + udev->usb2_hw_lpm_enabled) +return 0 ; + +return usb_set_usb2_hardware_lpm (udev,1 ); +} + +int usb_disable_usb2_hardware_lpm (struct usb_device *udev) +{ +if (!udev->usb2_hw_lpm_enabled) +return 0 ; + +return usb_set_usb2_hardware_lpm (udev,0 ); +} +#endif /* CONFIG_PM */ struct bus_type usb_bus_type = {
drivers/usb/core/hub.c +6 -10
@@ -3220,8 +3220,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) }/* disable USB2 hardware LPM */ -if (udev->usb2_hw_lpm_enabled ==1 ) -usb_set_usb2_hardware_lpm (udev,0 ); +usb_disable_usb2_hardware_lpm (udev);if (usb_disable_ltm (udev)) {dev_err (&udev->dev,"Failed to disable LTM before suspend\n" );
@@ -3259,8 +3258,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)usb_enable_ltm (udev); err_ltm:/* Try to enable USB2 hardware LPM again */ -if (udev->usb2_hw_lpm_capable ==1 ) -usb_set_usb2_hardware_lpm (udev,1 ); +usb_enable_usb2_hardware_lpm (udev);if (udev->do_remote_wakeup) (void )usb_disable_remote_wakeup (udev);
@@ -3543,8 +3541,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)hub_port_logical_disconnect (hub, port1); }else {/* Try to enable USB2 hardware LPM */ -if (udev->usb2_hw_lpm_capable ==1 ) -usb_set_usb2_hardware_lpm (udev,1 ); +usb_enable_usb2_hardware_lpm (udev);/* Try to enable USB3 LTM */ usb_enable_ltm (udev);
@@ -4435,7 +4432,7 @@ static void hub_set_initial_usb2_lpm_policy(struct usb_device *udev)if ((udev->bos->ext_cap->bmAttributes &cpu_to_le32 (USB_BESL_SUPPORT )) || connect_type ==USB_PORT_CONNECT_TYPE_HARD_WIRED ) { udev->usb2_hw_lpm_allowed =1 ; -usb_set_usb2_hardware_lpm (udev,1 ); +usb_enable_usb2_hardware_lpm (udev); } }
@@ -5649,8 +5646,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev)/* Disable USB2 hardware LPM. * It will be re-enabled by the enumeration process. */ -if (udev->usb2_hw_lpm_enabled ==1 ) -usb_set_usb2_hardware_lpm (udev,0 ); +usb_disable_usb2_hardware_lpm (udev);/* Disable LPM while we reset the device and reinstall the alt settings. * Device-initiated LPM, and system exit latency settings are cleared
@@ -5753,7 +5749,7 @@ static int usb_reset_and_verify_device(struct usb_device *udev) done:/* Now that the alt settings are re-installed, enable LTM and LPM. */ -usb_set_usb2_hardware_lpm (udev,1 ); +usb_enable_usb2_hardware_lpm (udev);usb_unlocked_enable_lpm (udev);usb_enable_ltm (udev);usb_release_bos_descriptor (udev);
drivers/usb/core/message.c +1 -2
@@ -1243,8 +1243,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) dev->actconfig->interface[i] =NULL ; } -if (dev->usb2_hw_lpm_enabled ==1 ) -usb_set_usb2_hardware_lpm (dev,0 ); +usb_disable_usb2_hardware_lpm (dev);usb_unlocked_disable_lpm (dev);usb_disable_ltm (dev);
drivers/usb/core/sysfs.c +4 -1
@@ -528,7 +528,10 @@ static ssize_t usb2_hardware_lpm_store(struct device *dev,if (!ret) { udev->usb2_hw_lpm_allowed = value; - ret =usb_set_usb2_hardware_lpm (udev, value); +if (value) + ret =usb_enable_usb2_hardware_lpm (udev); +else + ret =usb_disable_usb2_hardware_lpm (udev); }usb_unlock_device (udev);
drivers/usb/core/usb.h +8 -2
@@ -92,7 +92,8 @@ extern int usb_remote_wakeup(struct usb_device *dev);extern int usb_runtime_suspend (struct device *dev);extern int usb_runtime_resume (struct device *dev);extern int usb_runtime_idle (struct device *dev); -extern int usb_set_usb2_hardware_lpm (struct usb_device *udev,int enable); +extern int usb_enable_usb2_hardware_lpm (struct usb_device *udev); +extern int usb_disable_usb2_hardware_lpm (struct usb_device *udev);#else
@@ -112,7 +113,12 @@ static inline int usb_autoresume_device(struct usb_device *udev)return 0 ; } -static inline int usb_set_usb2_hardware_lpm (struct usb_device *udev,int enable) +static inline int usb_enable_usb2_hardware_lpm (struct usb_device *udev) +{ +return 0 ; +} + +static inline int usb_disable_usb2_hardware_lpm (struct usb_device *udev) {return 0 ; }
drivers/vfio/vfio_iommu_type1.c +14 -0
@@ -58,12 +58,18 @@ module_param_named(disable_hugepages,MODULE_PARM_DESC (disable_hugepages,"Disable VFIO IOMMU support for IOMMU hugepages." ); +static unsigned int dma_entry_limit__read_mostly =U16_MAX ; +module_param_named (dma_entry_limit, dma_entry_limit, uint,0644 ); +MODULE_PARM_DESC (dma_entry_limit, +"Maximum number of user DMA mappings per container (65535)." ); +struct vfio_iommu {struct list_head domain_list;struct vfio_domain *external_domain;/* domain for external user */ struct mutex lock;struct rb_root dma_list;struct blocking_notifier_head notifier; +unsigned int dma_avail;bool v2;bool nesting; };
@@ -836,6 +842,7 @@ static void vfio_remove_dma(struct vfio_iommu *iommu, struct vfio_dma *dma)vfio_unlink_dma (iommu, dma);put_task_struct (dma->task);kfree (dma); + iommu->dma_avail++; }static unsigned long vfio_pgsize_bitmap (struct vfio_iommu *iommu)
@@ -1081,12 +1088,18 @@ static int vfio_dma_do_map(struct vfio_iommu *iommu, goto out_unlock; } +if (!iommu->dma_avail) { + ret = -ENOSPC ; + goto out_unlock; + } + dma =kzalloc (sizeof (*dma),GFP_KERNEL );if (!dma) { ret = -ENOMEM ; goto out_unlock; } + iommu->dma_avail--; dma->iova = iova; dma->vaddr = vaddr; dma->prot = prot;
@@ -1583,6 +1596,7 @@ static void *vfio_iommu_type1_open(unsigned long arg)INIT_LIST_HEAD (&iommu->domain_list); iommu->dma_list =RB_ROOT ; + iommu->dma_avail = dma_entry_limit;mutex_init (&iommu->lock);BLOCKING_INIT_NOTIFIER_HEAD (&iommu->notifier);
fs/aio.c +88 -112
356 lines not on this page · raw message
fs/ceph/dir.c +5 -1
@@ -1470,6 +1470,7 @@ void ceph_dentry_lru_del(struct dentry *dn)unsigned ceph_dentry_hash (struct inode *dir,struct dentry *dn) {struct ceph_inode_info *dci =ceph_inode (dir); +unsigned hash;switch (dci->i_dir_layout.dl_dir_hash) {case 0 :/* for backward compat */
@@ -1477,8 +1478,11 @@ unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn)return dn->d_name.hash;default : -return ceph_str_hash (dci->i_dir_layout.dl_dir_hash, +spin_lock (&dn->d_lock); + hash =ceph_str_hash (dci->i_dir_layout.dl_dir_hash, dn->d_name.name, dn->d_name.len); +spin_unlock (&dn->d_lock); +return hash; } }
fs/ceph/mds_client.c +59 -11
140 lines not on this page · raw message
fs/ceph/snap.c +6 -1
@@ -568,7 +568,12 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) old_snapc =NULL ; update_snapc: -if (ci->i_head_snapc) { +if (ci->i_wrbuffer_ref_head ==0 && + ci->i_wr_ref ==0 && + ci->i_dirty_caps ==0 && + ci->i_flushing_caps ==0 ) { + ci->i_head_snapc =NULL ; + }else { ci->i_head_snapc =ceph_get_snap_context (new_snapc);dout (" new snapc is %p\n" , new_snapc); }
fs/cifs/file.c +1 -14
@@ -2796,7 +2796,6 @@ static void collect_uncached_write_data(struct cifs_aio_ctx *ctx)struct cifs_tcon *tcon;struct cifs_sb_info *cifs_sb;struct dentry *dentry = ctx->cfile->dentry; -unsigned int i;int rc; tcon =tlink_tcon (ctx->cfile->tlink);
@@ -2860,10 +2859,6 @@ static void collect_uncached_write_data(struct cifs_aio_ctx *ctx)kref_put (&wdata->refcount, cifs_uncached_writedata_release); } -if (!ctx->direct_io) -for (i =0 ; i < ctx->npages; i++) -put_page (ctx->bv[i].bv_page); -cifs_stats_bytes_written (tcon, ctx->total_len);set_bit (CIFS_INO_INVALID_MAPPING , &CIFS_I (dentry->d_inode)->flags);
@@ -3472,7 +3467,6 @@ collect_uncached_read_data(struct cifs_aio_ctx *ctx)struct iov_iter *to = &ctx->iter;struct cifs_sb_info *cifs_sb;struct cifs_tcon *tcon; -unsigned int i;int rc; tcon =tlink_tcon (ctx->cfile->tlink);
@@ -3556,15 +3550,8 @@ collect_uncached_read_data(struct cifs_aio_ctx *ctx)kref_put (&rdata->refcount, cifs_uncached_readdata_release); } -if (!ctx->direct_io) { -for (i =0 ; i < ctx->npages; i++) { -if (ctx->should_dirty) -set_page_dirty (ctx->bv[i].bv_page); -put_page (ctx->bv[i].bv_page); - } - +if (!ctx->direct_io) ctx->total_len = ctx->len -iov_iter_count (to); - }cifs_stats_bytes_read (tcon, ctx->total_len);
fs/cifs/inode.c +4 -0
@@ -1735,6 +1735,10 @@ cifs_do_rename(const unsigned int xid, struct dentry *from_dentry,if (rc ==0 || rc != -EBUSY ) goto do_rename_exit; +/* Don't fall back to using SMB on SMB 2+ mount */ +if (server->vals->protocol_id !=0 ) + goto do_rename_exit; +/* open-file renames don't work across directories */ if (to_dentry->d_parent != from_dentry->d_parent) goto do_rename_exit;
fs/cifs/misc.c +22 -1
@@ -789,6 +789,11 @@ cifs_aio_ctx_alloc(void) {struct cifs_aio_ctx *ctx; +/* +* Must use kzalloc to initialize ctx->bv to NULL and ctx->direct_io +* to false so that we know when we have to unreference pages within +* cifs_aio_ctx_release() +*/ ctx =kzalloc (sizeof (struct cifs_aio_ctx ),GFP_KERNEL );if (!ctx)return NULL ;
@@ -807,7 +812,23 @@ cifs_aio_ctx_release(struct kref *refcount) struct cifs_aio_ctx, refcount);cifsFileInfo_put (ctx->cfile); -kvfree (ctx->bv); + +/* +* ctx->bv is only set if setup_aio_ctx_iter() was call successfuly +* which means that iov_iter_get_pages() was a success and thus that +* we have taken reference on pages. +*/ +if (ctx->bv) { +unsigned i; + +for (i =0 ; i < ctx->npages; i++) { +if (ctx->should_dirty) +set_page_dirty (ctx->bv[i].bv_page); +put_page (ctx->bv[i].bv_page); + } +kvfree (ctx->bv); + } +kfree (ctx); }
fs/cifs/smb2pdu.c +1 -0
@@ -3402,6 +3402,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, rc); }free_rsp_buf (resp_buftype, rsp_iov.iov_base); +cifs_small_buf_release (req);return rc == -ENODATA ?0 : rc; }else trace_smb3_read_done(xid, req->PersistentFileId,
fs/ext4/xattr.c +3 -0
@@ -829,6 +829,7 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage) bh =ext4_sb_bread (inode->i_sb,EXT4_I (inode)->i_file_acl,REQ_PRIO );if (IS_ERR (bh)) { ret =PTR_ERR (bh); + bh =NULL ; goto out; }
@@ -2903,6 +2904,7 @@ int ext4_xattr_delete_inode(handle_t *handle, struct inode *inode,if (error == -EIO )EXT4_ERROR_INODE (inode,"block %llu read error" ,EXT4_I (inode)->i_file_acl); + bh =NULL ; goto cleanup; } error =ext4_xattr_check_block (inode, bh);
@@ -3059,6 +3061,7 @@ ext4_xattr_block_cache_find(struct inode *inode,if (IS_ERR (bh)) {if (PTR_ERR (bh) == -ENOMEM )return NULL ; + bh =NULL ;EXT4_ERROR_INODE (inode,"block %lu read error" , (unsigned long )ce->e_value); }else if (ext4_xattr_cmp (header,BHDR (bh)) ==0 ) {
fs/nfs/super.c +2 -1
@@ -2041,7 +2041,8 @@ static int nfs23_validate_mount_data(void *options,memcpy (sap, &data->addr,sizeof (data->addr)); args->nfs_server.addrlen =sizeof (data->addr); args->nfs_server.port =ntohs (data->addr.sin_port); -if (!nfs_verify_server_address (sap)) +if (sap->sa_family !=AF_INET || + !nfs_verify_server_address (sap)) goto out_no_address;if (!(data->flags &NFS_MOUNT_TCP ))
fs/nfsd/nfs4callback.c +7 -1
@@ -1023,8 +1023,9 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata) cb->cb_seq_status =1 ; cb->cb_status =0 ;if (minorversion) { -if (!nfsd41_cb_get_slot (clp, task)) +if (!cb->cb_holds_slot && !nfsd41_cb_get_slot (clp, task))return ; + cb->cb_holds_slot = true; }rpc_call_start (task); }
@@ -1051,6 +1052,9 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callbackreturn true; } +if (!cb->cb_holds_slot) + goto need_restart; +switch (cb->cb_seq_status) {case 0 :/*
@@ -1089,6 +1093,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback cb->cb_seq_status); } + cb->cb_holds_slot = false;clear_bit (0 , &clp->cl_cb_slot_busy);rpc_wake_up_next (&clp->cl_cb_waitq); dprintk("%s: freed slot, new seqid=%d\n", __func__,
@@ -1296,6 +1301,7 @@ void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, cb->cb_seq_status =1 ; cb->cb_status =0 ; cb->cb_need_restart = false; + cb->cb_holds_slot = false; }void nfsd4_run_cb (struct nfsd4_callback *cb)
fs/nfsd/nfs4state.c +10 -2
@@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh,static void free_blocked_lock (struct nfsd4_blocked_lock *nbl) { +locks_delete_block (&nbl->nbl_lock);locks_release_private (&nbl->nbl_lock);kfree (nbl); }
@@ -293,11 +294,18 @@ remove_blocked_locks(struct nfs4_lockowner *lo) nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock, nbl_lru);list_del_init (&nbl->nbl_lru); -locks_delete_block (&nbl->nbl_lock);free_blocked_lock (nbl); } } +static void +nfsd4_cb_notify_lock_prepare (struct nfsd4_callback *cb) +{ +struct nfsd4_blocked_lock *nbl =container_of (cb, + struct nfsd4_blocked_lock, nbl_cb); +locks_delete_block (&nbl->nbl_lock); +} +static int nfsd4_cb_notify_lock_done (struct nfsd4_callback *cb,struct rpc_task *task) {
@@ -325,6 +333,7 @@ nfsd4_cb_notify_lock_release(struct nfsd4_callback *cb) }static const struct nfsd4_callback_ops nfsd4_cb_notify_lock_ops = { + .prepare = nfsd4_cb_notify_lock_prepare, .done = nfsd4_cb_notify_lock_done, .release = nfsd4_cb_notify_lock_release, };
@@ -4863,7 +4872,6 @@ nfs4_laundromat(struct nfsd_net *nn) nbl =list_first_entry (&reaplist, struct nfsd4_blocked_lock, nbl_lru);list_del_init (&nbl->nbl_lru); -locks_delete_block (&nbl->nbl_lock);free_blocked_lock (nbl); } out:
fs/nfsd/state.h +1 -0
@@ -70,6 +70,7 @@ struct nfsd4_callback {int cb_seq_status;int cb_status;bool cb_need_restart; +bool cb_holds_slot; };struct nfsd4_callback_ops {
fs/proc/proc_sysctl.c +4 -2
@@ -1626,9 +1626,11 @@ static void drop_sysctl_table(struct ctl_table_header *header)if (--header->nreg)return ; -if (parent) +if (parent) {put_links (header); -start_unregistering (header); +start_unregistering (header); + } +if (!--header->count)kfree_rcu (header, rcu);
fs/splice.c +2 -2
@@ -333,8 +333,8 @@ const struct pipe_buf_operations default_pipe_buf_ops = { .get = generic_pipe_buf_get, }; -static int generic_pipe_buf_nosteal (struct pipe_inode_info *pipe, -struct pipe_buffer *buf) +int generic_pipe_buf_nosteal (struct pipe_inode_info *pipe, +struct pipe_buffer *buf) {return 1 ; }
include/drm/ttm/ttm_bo_driver.h +0 -1
@@ -411,7 +411,6 @@ extern struct ttm_bo_global {/** * Protected by ttm_global_mutex. */ -unsigned int use_count;struct list_head device_list;/**
include/linux/etherdevice.h +12 -0
@@ -447,6 +447,18 @@ static inline void eth_addr_dec(u8 *addr)u64_to_ether_addr (u, addr); } +/** +* eth_addr_inc() - Increment the given MAC address. +* @addr: Pointer to a six-byte array containing Ethernet address to increment. +*/ +static inline void eth_addr_inc (u8 *addr) +{ +u64 u =ether_addr_to_u64 (addr); + + u++; +u64_to_ether_addr (u, addr); +} +/** * is_etherdev_addr - Tell if given Ethernet address belongs to the device. * @dev: Pointer to a device structure
include/linux/pipe_fs_i.h +1 -0
@@ -181,6 +181,7 @@ void free_pipe_info(struct pipe_inode_info *);void generic_pipe_buf_get (struct pipe_inode_info *,struct pipe_buffer *);int generic_pipe_buf_confirm (struct pipe_inode_info *,struct pipe_buffer *);int generic_pipe_buf_steal (struct pipe_inode_info *,struct pipe_buffer *); +int generic_pipe_buf_nosteal (struct pipe_inode_info *,struct pipe_buffer *);void generic_pipe_buf_release (struct pipe_inode_info *,struct pipe_buffer *);void pipe_buf_mark_unmergeable (struct pipe_buffer *buf);
include/net/netfilter/nf_tables.h +6 -0
@@ -382,6 +382,7 @@ void nft_unregister_set(struct nft_set_type *type);* @dtype: data type (verdict or numeric type defined by userspace) * @objtype: object type (see NFT_OBJECT_* definitions) * @size: maximum set size +* @use: number of rules references to this set * @nelems: number of elements * @ndeact: number of deactivated elements queued for removal * @timeout: default timeout value in jiffies
@@ -407,6 +408,7 @@ struct nft_set {u32 dtype;u32 objtype;u32 size; +u32 use;atomic_t nelems;u32 ndeact;u64 timeout;
@@ -467,6 +469,10 @@ struct nft_set_binding {u32 flags; }; +enum nft_trans_phase ; +void nf_tables_deactivate_set (const struct nft_ctx *ctx,struct nft_set *set, +struct nft_set_binding *binding, +enum nft_trans_phase phase);int nf_tables_bind_set (const struct nft_ctx *ctx,struct nft_set *set,struct nft_set_binding *binding); void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set,
include/net/netrom.h +1 -1
@@ -266,7 +266,7 @@ void nr_stop_idletimer(struct sock *);int nr_t1timer_running (struct sock *);/* sysctl_net_netrom.c */ -void nr_register_sysctl (void ); +int nr_register_sysctl (void );void nr_unregister_sysctl (void );#endif
kernel/sched/deadline.c +1 -2
@@ -252,7 +252,6 @@ static void task_non_contending(struct task_struct *p)if (dl_entity_is_special (dl_se))return ; -WARN_ON (hrtimer_active (&dl_se->inactive_timer));WARN_ON (dl_se->dl_non_contending); zerolag_time = dl_se->deadline -
@@ -269,7 +268,7 @@ static void task_non_contending(struct task_struct *p)* If the "0-lag time" already passed, decrease the active * utilization now, instead of starting a timer */ -if (zerolag_time <0 ) { +if ((zerolag_time <0 ) ||hrtimer_active (&dl_se->inactive_timer)) {if (dl_task (p))sub_running_bw (dl_se, dl_rq);if (!dl_task (p) || p->state ==TASK_DEAD ) {
kernel/sched/fair.c +4 -0
@@ -1994,6 +1994,10 @@ static u64 numa_get_avg_runtime(struct task_struct *p, u64 *period)if (p->last_task_numa_placement) { delta = runtime - p->last_sum_exec_runtime; *period = now - p->last_task_numa_placement; + +/* Avoid time going backwards, prevent potential divide error: */ +if (unlikely ((s64)*period <0 )) + *period =0 ; }else { delta = p->se.avg.load_sum; *period =LOAD_AVG_MAX ;
kernel/trace/ring_buffer.c +1 -1
@@ -776,7 +776,7 @@ u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu)preempt_disable_notrace (); time =rb_time_stamp (buffer); -preempt_enable_no_resched_notrace (); +preempt_enable_notrace ();return time; }
kernel/trace/trace.c +18 -15
@@ -496,8 +496,10 @@ int trace_pid_write(struct trace_pid_list *filtered_pids,* not modified. */ pid_list =kmalloc (sizeof (*pid_list),GFP_KERNEL ); -if (!pid_list) +if (!pid_list) { +trace_parser_put (&parser);return -ENOMEM ; + } pid_list->pid_max =READ_ONCE (pid_max);
@@ -507,6 +509,7 @@ int trace_pid_write(struct trace_pid_list *filtered_pids, pid_list->pids =vzalloc ((pid_list->pid_max +7 ) >>3 );if (!pid_list->pids) { +trace_parser_put (&parser);kfree (pid_list);return -ENOMEM ; }
@@ -6820,19 +6823,23 @@ struct buffer_ref {struct ring_buffer *buffer;void *page;int cpu; -int ref; +refcount_t refcount; }; +static void buffer_ref_release (struct buffer_ref *ref) +{ +if (!refcount_dec_and_test (&ref->refcount)) +return ; +ring_buffer_free_read_page (ref->buffer, ref->cpu, ref->page); +kfree (ref); +} +static void buffer_pipe_buf_release (struct pipe_inode_info *pipe,struct pipe_buffer *buf) {struct buffer_ref *ref = (struct buffer_ref *)buf->private; -if (--ref->ref) -return ; - -ring_buffer_free_read_page (ref->buffer, ref->cpu, ref->page); -kfree (ref); +buffer_ref_release (ref); buf->private =0 ; }
@@ -6841,7 +6848,7 @@ static void buffer_pipe_buf_get(struct pipe_inode_info *pipe, {struct buffer_ref *ref = (struct buffer_ref *)buf->private; - ref->ref++; +refcount_inc (&ref->refcount); }/* Pipe buffer operations for a buffer. */
@@ -6849,7 +6856,7 @@ static const struct pipe_buf_operations buffer_pipe_buf_ops = { .can_merge = 0, .confirm = generic_pipe_buf_confirm, .release = buffer_pipe_buf_release, - .steal = generic_pipe_buf_steal, + .steal = generic_pipe_buf_nosteal, .get = buffer_pipe_buf_get, };
@@ -6862,11 +6869,7 @@ static void buffer_spd_release(struct splice_pipe_desc *spd, unsigned int i)struct buffer_ref *ref = (struct buffer_ref *)spd->partial[i].private; -if (--ref->ref) -return ; - -ring_buffer_free_read_page (ref->buffer, ref->cpu, ref->page); -kfree (ref); +buffer_ref_release (ref); spd->partial[i].private =0 ; }
@@ -6921,7 +6924,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos,break ; } - ref->ref =1 ; +refcount_set (&ref->refcount,1 ); ref->buffer = iter->trace_buffer->buffer; ref->page =ring_buffer_alloc_read_page (ref->buffer, iter->cpu_file);if (IS_ERR (ref->page)) {
kernel/workqueue.c +3 -0
@@ -2931,6 +2931,9 @@ static bool __flush_work(struct work_struct *work, bool from_cancel)if (WARN_ON (!wq_online))return false; +if (WARN_ON (!work->func)) +return false; +if (!from_cancel) {lock_map_acquire (&work->lockdep_map);lock_map_release (&work->lockdep_map);
lib/Kconfig.debug +1 -0
@@ -1952,6 +1952,7 @@ config TEST_KMOD depends on m depends on BLOCK && (64BIT || LBDAF) # for XFS, BTRFS depends on NETDEVICES && NET_CORE && INET # for TUN + depends on BLOCK select TEST_LKM select XFS_FS select TUN
mm/page_alloc.c +13 -0
@@ -266,7 +266,20 @@ compound_page_dtor * const compound_page_dtors[] = {int min_free_kbytes =1024 ;int user_min_free_kbytes =-1 ; +#ifdef CONFIG_DISCONTIGMEM +/* +* DiscontigMem defines memory ranges as separate pg_data_t even if the ranges +* are not on separate NUMA nodes. Functionally this works but with +* watermark_boost_factor, it can reclaim prematurely as the ranges can be +* quite small. By default, do not boost watermarks on discontigmem as in +* many cases very high-order allocations like THP are likely to be +* unsupported and the premature reclaim offsets the advantage of long-term +* fragmentation avoidance. +*/ +int watermark_boost_factor__read_mostly ; +#else int watermark_boost_factor__read_mostly =15000 ; +#endif int watermark_scale_factor =10 ;static unsigned long nr_kernel_pages__initdata ;
net/bridge/netfilter/ebtables.c +2 -1
@@ -2032,7 +2032,8 @@ static int ebt_size_mwt(struct compat_ebt_entry_mwt *match32,if (match_kern) match_kern->match_size = ret; -if (WARN_ON (type ==EBT_COMPAT_TARGET && size_left)) +/* rule should have no remaining data after target */ +if (type ==EBT_COMPAT_TARGET && size_left)return -EINVAL ; match32 = (struct compat_ebt_entry_mwt *) buf;
net/ipv4/route.c +23 -9
@@ -1183,25 +1183,39 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie)return dst; } -static void ipv4_link_failure (struct sk_buff *skb) +static void ipv4_send_dest_unreach (struct sk_buff *skb) {struct ip_options opt; -struct rtable *rt;int res;/* Recompile ip options since IPCB may not be valid anymore. +* Also check we have a reasonable ipv4 header. */ -memset (&opt,0 ,sizeof (opt)); - opt.optlen =ip_hdr (skb)->ihl*4 -sizeof (struct iphdr ); +if (!pskb_network_may_pull (skb,sizeof (struct iphdr )) || +ip_hdr (skb)->version !=4 ||ip_hdr (skb)->ihl <5 ) +return ; -rcu_read_lock (); - res =__ip_options_compile (dev_net (skb->dev), &opt, skb,NULL ); -rcu_read_unlock (); +memset (&opt,0 ,sizeof (opt)); +if (ip_hdr (skb)->ihl >5 ) { +if (!pskb_network_may_pull (skb,ip_hdr (skb)->ihl *4 )) +return ; + opt.optlen =ip_hdr (skb)->ihl *4 -sizeof (struct iphdr ); -if (res) -return ; +rcu_read_lock (); + res =__ip_options_compile (dev_net (skb->dev), &opt, skb,NULL ); +rcu_read_unlock (); +if (res) +return ; + }__icmp_send (skb,ICMP_DEST_UNREACH ,ICMP_HOST_UNREACH ,0 , &opt); +} + +static void ipv4_link_failure (struct sk_buff *skb) +{ +struct rtable *rt; + +ipv4_send_dest_unreach (skb); rt =skb_rtable (skb);if (rt)
net/ipv4/sysctl_net_ipv4.c +4 -1
@@ -49,6 +49,7 @@ static int ip_ping_group_range_min[] = { 0, 0 };static int ip_ping_group_range_max[] = {GID_T_MAX ,GID_T_MAX };static int comp_sack_nr_max =255 ;static u32 u32_max_div_HZ =UINT_MAX /HZ ; +static int one_day_secs =24 *3600 ;/* obsolete */ static int sysctl_tcp_low_latency__read_mostly ;
@@ -1151,7 +1152,9 @@ static struct ctl_table ipv4_net_table[] = { .data = &init_net.ipv4.sysctl_tcp_min_rtt_wlen, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &one_day_secs }, { .procname = "tcp_autocorking",
net/ncsi/ncsi-rsp.c +5 -1
@@ -11,6 +11,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/netdevice.h> +#include <linux/etherdevice.h> #include <linux/skbuff.h> #include <net/ncsi.h>
@@ -667,7 +668,10 @@ static int ncsi_rsp_handler_oem_bcm_gma(struct ncsi_request *nr) ndev->priv_flags |=IFF_LIVE_ADDR_CHANGE ;memcpy (saddr.sa_data, &rsp->data[BCM_MAC_ADDR_OFFSET ],ETH_ALEN );/* Increase mac address by 1 for BMC's address */ - saddr.sa_data[ETH_ALEN -1 ]++; +eth_addr_inc ((u8 *)saddr.sa_data); +if (!is_valid_ether_addr ((const u8 *)saddr.sa_data)) +return -ENXIO ; + ret = ops->ndo_set_mac_address (ndev, &saddr);if (ret <0 )netdev_warn (ndev,"NCSI: 'Writing mac address to device failed\n" );
net/netfilter/nf_tables_api.c +27 -1
@@ -3624,6 +3624,9 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,static void nft_set_destroy (struct nft_set *set) { +if (WARN_ON (set->use >0 )) +return ; + set->ops->destroy (set);module_put (to_set_type (set->ops)->owner);kfree (set->name);
@@ -3664,7 +3667,7 @@ static int nf_tables_delset(struct net *net, struct sock *nlsk,NL_SET_BAD_ATTR (extack, attr);return PTR_ERR (set); } -if (!list_empty (&set->bindings) || +if (set->use || (nlh->nlmsg_flags &NLM_F_NONREC &&atomic_read (&set->nelems) >0 )) {NL_SET_BAD_ATTR (extack, attr);return -EBUSY ;
@@ -3694,6 +3697,9 @@ int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,struct nft_set_binding *i;struct nft_set_iter iter; +if (set->use ==UINT_MAX ) +return -EOVERFLOW ; +if (!list_empty (&set->bindings) &&nft_set_is_anonymous (set))return -EBUSY ;
@@ -3721,6 +3727,7 @@ int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set, binding->chain = ctx->chain;list_add_tail_rcu (&binding->list, &set->bindings);nft_set_trans_bind (ctx, set); + set->use++;return 0 ; }
@@ -3740,6 +3747,25 @@ void nf_tables_unbind_set(const struct nft_ctx *ctx, struct nft_set *set, }EXPORT_SYMBOL_GPL (nf_tables_unbind_set); +void nf_tables_deactivate_set (const struct nft_ctx *ctx,struct nft_set *set, +struct nft_set_binding *binding, +enum nft_trans_phase phase) +{ +switch (phase) { +case NFT_TRANS_PREPARE : + set->use--; +return ; +case NFT_TRANS_ABORT : +case NFT_TRANS_RELEASE : + set->use--; +/* fall through */ +default : +nf_tables_unbind_set (ctx, set, binding, + phase ==NFT_TRANS_COMMIT ); + } +} +EXPORT_SYMBOL_GPL (nf_tables_deactivate_set); +void nf_tables_destroy_set (const struct nft_ctx *ctx,struct nft_set *set) {if (list_empty (&set->bindings) &&nft_set_is_anonymous (set))
net/netfilter/nft_dynset.c +9 -4
@@ -241,11 +241,15 @@ static void nft_dynset_deactivate(const struct nft_ctx *ctx, {struct nft_dynset *priv =nft_expr_priv (expr); -if (phase ==NFT_TRANS_PREPARE ) -return ; +nf_tables_deactivate_set (ctx, priv->set, &priv->binding, phase); +} + +static void nft_dynset_activate (const struct nft_ctx *ctx, +const struct nft_expr *expr) +{ +struct nft_dynset *priv =nft_expr_priv (expr); -nf_tables_unbind_set (ctx, priv->set, &priv->binding, - phase ==NFT_TRANS_COMMIT ); + priv->set->use++; } static void nft_dynset_destroy(const struct nft_ctx *ctx,
@@ -293,6 +297,7 @@ static const struct nft_expr_ops nft_dynset_ops = { .eval = nft_dynset_eval, .init = nft_dynset_init, .destroy = nft_dynset_destroy, + .activate = nft_dynset_activate, .deactivate = nft_dynset_deactivate, .dump = nft_dynset_dump, };
net/netfilter/nft_lookup.c +9 -4
@@ -127,11 +127,15 @@ static void nft_lookup_deactivate(const struct nft_ctx *ctx, {struct nft_lookup *priv =nft_expr_priv (expr); -if (phase ==NFT_TRANS_PREPARE ) -return ; +nf_tables_deactivate_set (ctx, priv->set, &priv->binding, phase); +} + +static void nft_lookup_activate (const struct nft_ctx *ctx, +const struct nft_expr *expr) +{ +struct nft_lookup *priv =nft_expr_priv (expr); -nf_tables_unbind_set (ctx, priv->set, &priv->binding, - phase ==NFT_TRANS_COMMIT ); + priv->set->use++; } static void nft_lookup_destroy(const struct nft_ctx *ctx,
@@ -222,6 +226,7 @@ static const struct nft_expr_ops nft_lookup_ops = { .size = NFT_EXPR_SIZE(sizeof(struct nft_lookup)), .eval = nft_lookup_eval, .init = nft_lookup_init, + .activate = nft_lookup_activate, .deactivate = nft_lookup_deactivate, .destroy = nft_lookup_destroy, .dump = nft_lookup_dump,
net/netfilter/nft_objref.c +25 -7
@@ -64,21 +64,34 @@ static int nft_objref_dump(struct sk_buff *skb, const struct nft_expr *expr)return -1 ; } -static void nft_objref_destroy (const struct nft_ctx *ctx, -const struct nft_expr *expr) +static void nft_objref_deactivate (const struct nft_ctx *ctx, +const struct nft_expr *expr, +enum nft_trans_phase phase) {struct nft_object *obj =nft_objref_priv (expr); +if (phase ==NFT_TRANS_COMMIT ) +return ; + obj->use--; } +static void nft_objref_activate (const struct nft_ctx *ctx, +const struct nft_expr *expr) +{ +struct nft_object *obj =nft_objref_priv (expr); + + obj->use++; +} +static struct nft_expr_type nft_objref_type;static const struct nft_expr_ops nft_objref_ops = { .type = &nft_objref_type, .size =NFT_EXPR_SIZE (sizeof (struct nft_object *)), .eval = nft_objref_eval, .init = nft_objref_init, - .destroy = nft_objref_destroy, + .activate = nft_objref_activate, + .deactivate = nft_objref_deactivate, .dump = nft_objref_dump, };
@@ -161,11 +174,15 @@ static void nft_objref_map_deactivate(const struct nft_ctx *ctx, {struct nft_objref_map *priv =nft_expr_priv (expr); -if (phase ==NFT_TRANS_PREPARE ) -return ; +nf_tables_deactivate_set (ctx, priv->set, &priv->binding, phase); +} + +static void nft_objref_map_activate (const struct nft_ctx *ctx, +const struct nft_expr *expr) +{ +struct nft_objref_map *priv =nft_expr_priv (expr); -nf_tables_unbind_set (ctx, priv->set, &priv->binding, - phase ==NFT_TRANS_COMMIT ); + priv->set->use++; } static void nft_objref_map_destroy(const struct nft_ctx *ctx,
@@ -182,6 +199,7 @@ static const struct nft_expr_ops nft_objref_map_ops = { .size = NFT_EXPR_SIZE(sizeof(struct nft_objref_map)), .eval = nft_objref_map_eval, .init = nft_objref_map_init, + .activate = nft_objref_map_activate, .deactivate = nft_objref_map_deactivate, .destroy = nft_objref_map_destroy, .dump = nft_objref_map_dump,
net/netrom/af_netrom.c +54 -22
121 lines not on this page · raw message
net/netrom/nr_loopback.c +1 -1
@@ -70,7 +70,7 @@ static void nr_loopback_timer(struct timer_list *unused) } } -void __exit nr_loopback_clear(void) +void nr_loopback_clear (void ) {del_timer_sync (&loopback_timer);skb_queue_purge (&loopback_queue);
net/netrom/nr_route.c +1 -1
@@ -953,7 +953,7 @@ const struct seq_operations nr_neigh_seqops = {/* * Free all memory associated with the nodes and routes lists. */ -void __exit nr_rt_free(void) +void nr_rt_free (void ) {struct nr_neigh *s =NULL ;struct nr_node *t =NULL ;
net/netrom/sysctl_net_netrom.c +4 -1
@@ -146,9 +146,12 @@ static struct ctl_table nr_table[] = { { } }; -void __init nr_register_sysctl (void ) +int __init nr_register_sysctl (void ) { nr_table_header =register_net_sysctl (&init_net,"net/netrom" , nr_table); +if (!nr_table_header) +return -ENOMEM ; +return 0 ; }void nr_unregister_sysctl (void )
net/rds/af_rds.c +3 -0
@@ -506,6 +506,9 @@ static int rds_connect(struct socket *sock, struct sockaddr *uaddr,struct rds_sock *rs =rds_sk_to_rs (sk);int ret =0 ; + if (addr_len < offsetofend(struct sockaddr, sa_family)) +return -EINVAL ; +lock_sock (sk);switch (uaddr->sa_family) {
net/rds/bind.c +2 -0
@@ -173,6 +173,8 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)/* We allow an RDS socket to be bound to either IPv4 or IPv6 * address. */ + if (addr_len < offsetofend(struct sockaddr, sa_family)) +return -EINVAL ;if (uaddr->sa_family ==AF_INET ) {struct sockaddr_in *sin = (struct sockaddr_in *)uaddr;
net/rds/ib_fmr.c +11 -0
@@ -44,6 +44,17 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages)else pool = rds_ibdev->mr_1m_pool; +if (atomic_read (&pool->dirty_count) >= pool->max_items /10 ) +queue_delayed_work (rds_ib_mr_wq, &pool->flush_worker,10 ); + +/* Switch pools if one of the pool is reaching upper limit */ +if (atomic_read (&pool->dirty_count) >= pool->max_items *9 /10 ) { +if (pool->pool_type ==RDS_IB_MR_8K_POOL ) + pool = rds_ibdev->mr_1m_pool; +else + pool = rds_ibdev->mr_8k_pool; + } + ibmr =rds_ib_try_reuse_ibmr (pool);if (ibmr)return ibmr;
net/rds/ib_rdma.c +0 -3
@@ -454,9 +454,6 @@ struct rds_ib_mr *rds_ib_try_reuse_ibmr(struct rds_ib_mr_pool *pool)struct rds_ib_mr *ibmr =NULL ;int iter =0 ; -if (atomic_read (&pool->dirty_count) >= pool->max_items_soft /10 ) -queue_delayed_work (rds_ib_mr_wq, &pool->flush_worker,10 ); -while (1 ) { ibmr =rds_ib_reuse_mr (pool);if (ibmr)
net/rose/rose_loopback.c +16 -11
@@ -16,6 +16,7 @@#include <linux/init.h> static struct sk_buff_head loopback_queue; +#define ROSE_LOOPBACK_LIMIT 1000static struct timer_list loopback_timer;static void rose_set_loopback_timer (void );
@@ -35,29 +36,27 @@ static int rose_loopback_running(void)int rose_loopback_queue (struct sk_buff *skb,struct rose_neigh *neigh) { -struct sk_buff *skbn; +struct sk_buff *skbn =NULL ; - skbn =skb_clone (skb,GFP_ATOMIC ); +if (skb_queue_len (&loopback_queue) <ROSE_LOOPBACK_LIMIT ) + skbn =skb_clone (skb,GFP_ATOMIC ); -kfree_skb (skb); - -if (skbn !=NULL ) { +if (skbn) { +consume_skb (skb);skb_queue_tail (&loopback_queue, skbn);if (!rose_loopback_running ())rose_set_loopback_timer (); + }else { +kfree_skb (skb); }return 1 ; } -static void rose_set_loopback_timer (void ) { -del_timer (&loopback_timer); - - loopback_timer.expires = jiffies +10 ; -add_timer (&loopback_timer); +mod_timer (&loopback_timer, jiffies +10 ); }static void rose_loopback_timer (struct timer_list *unused)
@@ -68,8 +67,12 @@ static void rose_loopback_timer(struct timer_list *unused)struct sock *sk;unsigned short frametype;unsigned int lci_i, lci_o; +int count; -while ((skb =skb_dequeue (&loopback_queue)) !=NULL ) { +for (count =0 ; count <ROSE_LOOPBACK_LIMIT ; count++) { + skb =skb_dequeue (&loopback_queue); +if (!skb) +return ;if (skb->len <ROSE_MIN_LEN ) {kfree_skb (skb);continue ;
@@ -106,6 +109,8 @@ static void rose_loopback_timer(struct timer_list *unused)kfree_skb (skb); } } +if (!skb_queue_empty (&loopback_queue)) +mod_timer (&loopback_timer, jiffies +1 ); } void __exit rose_loopback_clear(void)
net/rxrpc/input.c +8 -4
@@ -1155,19 +1155,19 @@ int rxrpc_extract_header(struct rxrpc_skb_priv *sp, struct sk_buff *skb)* handle data received on the local endpoint * - may be called in interrupt context * -* The socket is locked by the caller and this prevents the socket from being -* shut down and the local endpoint from going away, thus sk_user_data will not -* be cleared until this function returns. +* [!] Note that as this is called from the encap_rcv hook, the socket is not +* held locked by the caller and nothing prevents sk_user_data on the UDP from +* being cleared in the middle of processing this function. * * Called with the RCU read lock held from the IP layer via UDP. */ int rxrpc_input_packet (struct sock *udp_sk,struct sk_buff *skb) { +struct rxrpc_local *local =rcu_dereference_sk_user_data (udp_sk);struct rxrpc_connection *conn;struct rxrpc_channel *chan;struct rxrpc_call *call =NULL ;struct rxrpc_skb_priv *sp; -struct rxrpc_local *local = udp_sk->sk_user_data;struct rxrpc_peer *peer =NULL ;struct rxrpc_sock *rx =NULL ;unsigned int channel;
@@ -1175,6 +1175,10 @@ int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb)_enter ("%p" , udp_sk); +if (unlikely (!local)) { +kfree_skb (skb); +return 0 ; + }if (skb->tstamp ==0 ) skb->tstamp =ktime_get_real ();
net/rxrpc/local_object.c +2 -1
@@ -304,7 +304,8 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net, ret = -ENOMEM ; sock_error:mutex_unlock (&rxnet->local_mutex); -kfree (local); +if (local) +call_rcu (&local->rcu, rxrpc_local_rcu);_leave (" = %d" , ret);return ERR_PTR (ret);
net/sunrpc/cache.c +3 -0
@@ -54,6 +54,7 @@ static void cache_init(struct cache_head *h, struct cache_detail *detail) h->last_refresh = now; } +static inline int cache_is_valid (struct cache_head *h);static void cache_fresh_locked (struct cache_head *head,time_t expiry,struct cache_detail *detail); static void cache_fresh_unlocked(struct cache_head *head,
@@ -105,6 +106,8 @@ static struct cache_head *sunrpc_cache_add_entry(struct cache_detail *detail,if (cache_is_expired (detail, tmp)) {hlist_del_init_rcu (&tmp->cache_list); detail->entries --; +if (cache_is_valid (tmp) == -EAGAIN ) +set_bit (CACHE_NEGATIVE , &tmp->flags);cache_fresh_locked (tmp,0 , detail); freeme = tmp;break ;
net/tipc/netlink_compat.c +20 -4
@@ -267,8 +267,14 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,if (msg->rep_type)tipc_tlv_init (msg->rep, msg->rep_type); -if (cmd->header) - (*cmd->header)(msg); +if (cmd->header) { + err = (*cmd->header)(msg); +if (err) { +kfree_skb (msg->rep); + msg->rep =NULL ; +return err; + } + } arg =nlmsg_new (0 ,GFP_KERNEL );if (!arg) {
@@ -397,7 +403,12 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd,if (!bearer)return -EMSGSIZE ; - len =min_t (int,TLV_GET_DATA_LEN (msg->req),TIPC_MAX_BEARER_NAME ); + len =TLV_GET_DATA_LEN (msg->req); + len -= offsetof(struct tipc_bearer_config , name); +if (len <=0 ) +return -EINVAL ; + + len =min_t (int, len,TIPC_MAX_BEARER_NAME );if (!string_is_valid (b->name, len))return -EINVAL ;
@@ -766,7 +777,12 @@ static int tipc_nl_compat_link_set(struct tipc_nl_compat_cmd_doit *cmd, lc = (struct tipc_link_config *)TLV_DATA (msg->req); - len =min_t (int,TLV_GET_DATA_LEN (msg->req),TIPC_MAX_LINK_NAME ); + len =TLV_GET_DATA_LEN (msg->req); + len -= offsetof(struct tipc_link_config , name); +if (len <=0 ) +return -EINVAL ; + + len =min_t (int, len,TIPC_MAX_LINK_NAME );if (!string_is_valid (lc->name, len))return -EINVAL ;
net/tls/tls_device.c +2 -2
@@ -884,7 +884,9 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) goto release_netdev; free_sw_resources: +up_read (&device_offload_lock);tls_sw_free_resources_rx (sk); +down_read (&device_offload_lock); release_ctx: ctx->priv_ctx_rx =NULL ; release_netdev:
@@ -919,8 +921,6 @@ void tls_device_offload_cleanup_rx(struct sock *sk) } out:up_read (&device_offload_lock); -kfree (tls_ctx->rx.rec_seq); -kfree (tls_ctx->rx.iv);tls_sw_release_resources_rx (sk); }
net/tls/tls_device_fallback.c +10 -3
@@ -193,6 +193,9 @@ static void update_chksum(struct sk_buff *skb, int headln)static void complete_skb (struct sk_buff *nskb,struct sk_buff *skb,int headln) { +struct sock *sk = skb->sk; +int delta; +skb_copy_header (nskb, skb);skb_put (nskb, skb->len);
@@ -200,11 +203,15 @@ static void complete_skb(struct sk_buff *nskb, struct sk_buff *skb, int headln)update_chksum (nskb, headln); nskb->destructor = skb->destructor; - nskb->sk = skb->sk; + nskb->sk = sk; skb->destructor =NULL ; skb->sk =NULL ; -refcount_add (nskb->truesize - skb->truesize, - &nskb->sk->sk_wmem_alloc); + + delta = nskb->truesize - skb->truesize; +if (likely (delta <0 )) +WARN_ON_ONCE (refcount_sub_and_test (-delta, &sk->sk_wmem_alloc)); +else if (delta) +refcount_add (delta, &sk->sk_wmem_alloc); }/* This function may be called after the user socket is already
net/tls/tls_main.c +1 -4
@@ -304,11 +304,8 @@ static void tls_sk_proto_close(struct sock *sk, long timeout)#endif } -if (ctx->rx_conf ==TLS_SW ) { -kfree (ctx->rx.rec_seq); -kfree (ctx->rx.iv); +if (ctx->rx_conf ==TLS_SW )tls_sw_free_resources_rx (sk); - }#ifdef CONFIG_TLS_DEVICE if (ctx->rx_conf ==TLS_HW )
net/tls/tls_sw.c +3 -0
@@ -1830,6 +1830,9 @@ void tls_sw_release_resources_rx(struct sock *sk)struct tls_context *tls_ctx =tls_get_ctx (sk);struct tls_sw_context_rx *ctx =tls_sw_ctx_rx (tls_ctx); +kfree (tls_ctx->rx.rec_seq); +kfree (tls_ctx->rx.iv); +if (ctx->aead_recv) {kfree_skb (ctx->recv_pkt); ctx->recv_pkt =NULL ;
sound/pci/hda/patch_realtek.c +29 -12
77 lines not on this page · raw message
Thanks, a bunch!
Quoted 338 lines · Greg KH
I'm announcing the release of the 5.0.11 kernel.
All users of the 5.0 kernel series must upgrade.
The updated 5.0.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitlinux-5.0.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summarythanks,
greg k-h
------------
Documentation/networking/ip-sysctl.txt | 1 Documentation/sysctl/vm.txt | 16 - Makefile | 2 arch/arm/boot/compressed/head.S | 16 + arch/arm64/mm/init.c | 2 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 block/bfq-iosched.c | 15 - block/bfq-iosched.h | 2 block/bfq-wf2q.c | 17 + crypto/lrw.c | 6 crypto/xts.c | 6 drivers/android/binder_alloc.c | 18 - drivers/block/loop.c | 5 drivers/block/zram/zram_drv.c | 5 drivers/dma/mediatek/mtk-cqdma.c | 2 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/ttm/ttm_bo.c | 10 drivers/gpu/drm/ttm/ttm_memory.c | 5 drivers/gpu/drm/vc4/vc4_crtc.c | 2 drivers/hwtracing/intel_th/gth.c | 2 drivers/infiniband/core/uverbs.h | 1 drivers/infiniband/core/uverbs_main.c | 52 ++++ drivers/infiniband/hw/mlx5/main.c | 10 drivers/infiniband/sw/rdmavt/mr.c | 17 - drivers/input/rmi4/rmi_f11.c | 2 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c | 24 ++ drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h | 3 drivers/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/socionext/netsec.c | 11 - 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/net/wireless/mac80211_hwsim.c | 19 + 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 | 200 ++++++++----------- fs/ceph/dir.c | 6 fs/ceph/mds_client.c | 70 +++++- fs/ceph/snap.c | 7 fs/cifs/file.c | 15 - fs/cifs/inode.c | 4 fs/cifs/misc.c | 23 ++ fs/cifs/smb2pdu.c | 1 fs/ext4/xattr.c | 3 fs/nfs/super.c | 3 fs/nfsd/nfs4callback.c | 8 fs/nfsd/nfs4state.c | 12 - fs/nfsd/state.h | 1 fs/proc/proc_sysctl.c | 6 fs/splice.c | 4 include/drm/ttm/ttm_bo_driver.h | 1 include/linux/etherdevice.h | 12 + include/linux/pipe_fs_i.h | 1 include/net/netfilter/nf_tables.h | 6 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/page_alloc.c | 13 + net/bridge/netfilter/ebtables.c | 3 net/ipv4/route.c | 32 ++- net/ipv4/sysctl_net_ipv4.c | 5 net/ncsi/ncsi-rsp.c | 6 net/netfilter/nf_tables_api.c | 28 ++ net/netfilter/nft_dynset.c | 13 - net/netfilter/nft_lookup.c | 13 - net/netfilter/nft_objref.c | 32 ++- 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 sound/pci/hda/patch_realtek.c | 41 ++- 105 files changed, 873 insertions(+), 395 deletions(-)Achim Dahlhoff (1):
dmaengine: sh: rcar-dmac: Fix glitch indmaengine_tx_statusAl Viro (4):
aio: foldlookup_kiocb()into its sole caller
aio: keepio_eventinaio_kiocb
aio: store event at finaliocb_put()Fixaio_poll()racesAlex Williamson (1):
vfio/type1: Limit DMA mappings per containerAlexander Shishkin (1):
intel_th: gth: Fix an off-by-one in output unassigningAmit Cohen (1):
mlxsw: spectrum: Fix autoneg status in ethtoolArd Biesheuvel (1):
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cacheAurelien Jarno (1):
MIPS: scall64-o32: Fix indirect syscall number loadBaolin Wang (1):
gpio: eic: sprd: Fix incorrect irq type setting for the sync EICBjorn Andersson (1):
arm64: mm: Ensure tail of unaligned initrd is reservedChristian König (1):
drm/ttm: fix re-init of global structuresChristophe Leroy (1):
powerpc/vdso32: fixCLOCK_MONOTONICon PPC64Dan Carpenter (1):
ext4: fix some error pointer dereferencesDaniel Borkmann (2):
x86, retpolines: Raise limit for generating indirect calls from switch-case x86/retpolines: Disable switch jump tables when retpolines are enabledDave Airlie (1):
Revert "drm/i915/fbdev: Actually configure untiled displays"Dirk Behme (1):
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is validDongli Zhang (1):
loop: do not print warn message if partition scan is successfulErez Alfasi (1):
net/mlx5e: ethtool, Remove unsupported SFP EEPROM high pages queryEric Dumazet (3):
rxrpc: fix race condition inrxrpc_input_packet()
ipv4: add sanity checks inipv4_link_failure()net/rose: fix unbound loop inrose_loopback_timer()Florian Westphal (1):
netfilter: ebtables:CONFIG_COMPAT: drop a bogusWARN_ONFrank Sorenson (1):
cifs: do not attempt cifs operation on smb2+ rename errorGreg Kroah-Hartman (1):
Linux 5.0.11Hangbin Liu (1):
team: fix possible recursive locking when add slavesHarry Pan (1):
perf/x86/intel: Update KBL Package C-state events to also include PC8/PC9/PC10 countersHerbert Xu (2):
crypto: xts - Fix atomic sleep when walking skcipher
crypto: lrw - Fix atomic sleep when walking skcipherIdo Schimmel (1):
mlxsw: pci: Reincrease PCI reset timeoutIlias Apalodimas (1):
net: socionext: replacenapi_alloc_fragwith the netdev variant on initJakub Kicinski (3):
net/tls: fix refcount adjustment in fallback
net/tls: avoid potential deadlock intls_set_device_offload_rx()net/tls: don't leak IV and record seq when offload failsJann Horn (1):
tracing: Fixbuffer_refpipe opsJason Gunthorpe (3):
RDMA/mlx5: Do not allow the user to write to the clock page RDMA/mlx5: Userdma_user_map_iofor mapping BAR pages RDMA/ucontext: Fix regression with disassociateJeff Layton (4):
ceph: only used_namedirectly when parent is locked
ceph: ensured_namestability inceph_dentry_hash()
nfsd: wake waiters blocked onfile_lockbefore deleting it
nfsd: wake blocked file lock waiters before sending callbackJohannes Berg (1):
mac80211_hwsim: calculate if_combination.max_interfacesJosh Collier (1):
IB/rdmavt: Fix frwr memory registrationJérôme Glisse (2):
cifs: fix page reference leak with readv/writev
zram: pass down the bvec we need to read into in the work structKai-Heng Feng (2):
USB: Add new USB LPM helpers
USB: Consolidate LPM checks to avoid enabling LPM twiceKailang Yang (1):
ALSA: hda/realtek - Move toACT_INITstateLinus Torvalds (3):
slip: makeslhc_free()silently accept an error pointer pin iocb through aio.
rdma: fix build errors on s390 and MIPS due to badZERO_PAGEuseLucas Stach (1):
Input: synaptics-rmi4 - write config register values to the right offsetMaarten Lankhorst (2):
drm/vc4: Fix memory leak during gpu reset. drm/vc4: Fix compilation error reported by kbuild test botMaxim Mikityanskiy (2):
net/mlx5e: Fix the max MTU check in case of XDP net/mlx5e: Fix use-after-free afterxdp_return_frameMel Gorman (1):
mm: do not boost watermarks to avoid fragmentation for the DISCONTIG memory modelMichael Ellerman (1):
powerpc/mm/radix: Make Radix requireHUGETLB_PAGENeilBrown (1):
sunrpc: don't mark uninitialised items as VALID.Pablo Neira Ayuso (2):
netfilter:nf_tables: bogus EBUSY when deleting set after flush
netfilter:nf_tables: bogus EBUSY in helper removal from transactionPaolo Valente (1):
block, bfq: fix use after free inbfq_bfqq_expirePeter Zijlstra (1):
trace: Fixpreempt_enable_no_resched()abusePetr Machata (1):
mlxsw: spectrum: Put MC TCs into DWRR modeRonnie Sahlberg (1):
cifs: fix memory leak inSMB2_readShun-Chih Yu (1):
dmaengine: mediatek-cqdma: fix wrong register usage inmtk_cqdma_startSu Bao Cheng (1):
stmmac: pci: Adjust IOT2000 matchingTao Ren (1):
net/ncsi: handle overflow when incrementing mac addressTetsuo Handa (3):
workqueue: Try to catchflush_work()withoutINIT_WORK().
NFS: Forbid settingAF_INET6to "struct sockaddr_in"->sin_family. net/rds: Check address length before reading address familyTodd Kjos (1):
binder: fix handling of misaligned binder objectTrond Myklebust (1):
nfsd: Don't release the callback slot unless it was actually heldVinod Koul (1):
net: stmmac: movestmmac_check_ether_addr()to driver probeWenwen Wang (1):
tracing: Fix a memory leak by early error exit intrace_pid_write()Xie XiuQi (1):
sched/numa: Fix a possible divide-by-zeroXin Long (3):
tipc: handle the err returned from cmd header function
tipc: check bearer name with right length intipc_nl_compat_bearer_enable
tipc: check link name with right length intipc_nl_compat_link_setYan, Zheng (1):
ceph: fix ci->i_head_snapc leakYue Haibing (1):
fm10k: Fix a potential NULL pointer dereferenceYueHaibing (3):
fs/proc/proc_sysctl.c: Fix a NULL pointer dereferencelib/Kconfig.debug: fix build error withoutCONFIG_BLOCK
net: netrom: Fix error cleanup path ofnr_proto_initZhangXiaoxu (1):
ipv4: set thetcp_min_rtt_wlenrange from 0 to one dayZhu Yanjun (1):
net: rds: exchange of 8K and 1M poolluca abeni (1):
sched/deadline: Correctly handle active 0-lag timers