Linux 4.19.158
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.158 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/arm/include/asm/kprobes.h | 22 arch/arm/probes/kprobes/opt-arm.c | 18 arch/arm64/crypto/aes-modes.S | 16 arch/s390/kernel/smp.c | 3 arch/x86/kernel/cpu/bugs.c | 52 + drivers/block/nbd.c | 10 drivers/char/random.c | 1 drivers/char/tpm/eventlog/efi.c | 5 drivers/char/tpm/tpm_tis.c | 29 - drivers/gpio/gpio-pcie-idio-24.c | 62 ++ drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 27 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 drivers/gpu/drm/amd/powerplay/inc/smumgr.h | 2 drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 29 - drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | 8 drivers/gpu/drm/gma500/psb_irq.c | 34 - drivers/hv/hv_balloon.c | 2 drivers/iommu/amd_iommu_types.h | 6 drivers/mfd/sprd-sc27xx-spi.c | 28 - drivers/misc/mei/client.h | 4 drivers/mmc/host/renesas_sdhi_core.c | 1 drivers/net/can/dev.c | 14 drivers/net/can/flexcan.c | 3 drivers/net/can/peak_canfd/peak_canfd.c | 11 drivers/net/can/rx-offload.c | 4 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 51 + drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 48 + drivers/net/ethernet/microchip/lan743x_main.c | 12 drivers/net/ethernet/microchip/lan743x_main.h | 3 drivers/net/ethernet/realtek/r8169.c | 3 drivers/net/vrf.c | 92 ++- drivers/net/wan/cosa.c | 1 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 drivers/of/address.c | 4 drivers/pinctrl/aspeed/pinctrl-aspeed.c | 7 drivers/pinctrl/intel/pinctrl-intel.c | 8 drivers/pinctrl/pinctrl-amd.c | 6 drivers/regulator/core.c | 2 drivers/scsi/device_handler/scsi_dh_alua.c | 9 drivers/scsi/hpsa.c | 4 drivers/staging/erofs/inode.c | 21 drivers/thunderbolt/nhi.c | 19 drivers/thunderbolt/xdomain.c | 1 drivers/uio/uio.c | 10 drivers/usb/class/cdc-acm.c | 9 drivers/usb/dwc3/gadget.c | 32 - drivers/usb/gadget/udc/goku_udc.c | 2 drivers/usb/host/xhci-histb.c | 2 drivers/vfio/platform/vfio_platform_common.c | 3 fs/btrfs/dev-replace.c | 26 fs/btrfs/extent_io.c | 4 fs/btrfs/ioctl.c | 12 fs/btrfs/ref-verify.c | 1 fs/btrfs/volumes.c | 33 - fs/cifs/cifs_unicode.c | 8 fs/ext4/inline.c | 1 fs/ext4/super.c | 4 fs/gfs2/rgrp.c | 5 fs/gfs2/super.c | 1 fs/ocfs2/super.c | 1 fs/xfs/libxfs/xfs_alloc.c | 1 fs/xfs/libxfs/xfs_bmap.h | 2 fs/xfs/libxfs/xfs_rmap.c | 2 fs/xfs/libxfs/xfs_rmap_btree.c | 16 fs/xfs/scrub/bmap.c | 2 fs/xfs/scrub/inode.c | 3 fs/xfs/scrub/refcount.c | 8 fs/xfs/xfs_iops.c | 10 fs/xfs/xfs_pnfs.c | 2 include/linux/can/skb.h | 20 include/linux/netfilter_ipv4.h | 2 include/linux/netfilter_ipv6.h | 2 include/linux/prandom.h | 36 + include/linux/time64.h | 4 kernel/dma/swiotlb.c | 6 kernel/events/core.c | 7 kernel/events/internal.h | 2 kernel/exit.c | 5 kernel/futex.c | 5 kernel/irq/Kconfig | 1 kernel/reboot.c | 28 - kernel/time/itimer.c | 4 kernel/time/tick-common.c | 2 kernel/time/timer.c | 7 lib/random32.c | 462 ++++++++++------- net/ipv4/netfilter.c | 12 net/ipv4/netfilter/ipt_SYNPROXY.c | 2 net/ipv4/netfilter/iptable_mangle.c | 2 net/ipv4/netfilter/nf_nat_l3proto_ipv4.c | 2 net/ipv4/netfilter/nf_reject_ipv4.c | 2 net/ipv4/netfilter/nft_chain_route_ipv4.c | 2 net/ipv4/syncookies.c | 9 net/ipv6/netfilter.c | 6 net/ipv6/netfilter/ip6table_mangle.c | 2 net/ipv6/netfilter/nf_nat_l3proto_ipv6.c | 2 net/ipv6/netfilter/nft_chain_route_ipv6.c | 2 net/ipv6/sit.c | 2 net/ipv6/syncookies.c | 10 net/iucv/af_iucv.c | 3 net/mac80211/tx.c | 37 - net/netfilter/ipset/ip_set_core.c | 3 net/netfilter/ipvs/ip_vs_core.c | 4 net/sched/sch_generic.c | 3 net/tipc/topsrv.c | 10 net/wireless/reg.c | 2 net/x25/af_x25.c | 2 net/xfrm/xfrm_state.c | 8 security/selinux/ibpkey.c | 4 sound/hda/ext/hdac_ext_controller.c | 2 tools/perf/util/scripting-engines/trace-event-python.c | 7 tools/perf/util/session.c | 1 tools/testing/selftests/proc/proc-loadavg-001.c | 1 tools/testing/selftests/proc/proc-self-syscall.c | 1 tools/testing/selftests/proc/proc-uptime-002.c | 1 116 files changed, 1082 insertions(+), 546 deletions(-)
Al Viro (1):
don't dump the threads that had been already exiting when zapped.
Alexander Usyskin (1):
mei: protect mei_cl_mtu from null dereference
Anand Jain (1):
btrfs: dev-replace: fail mount if we don't have replace item with target device
Anand K Mistry (1):
x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
Andrew Jeffery (1):
ARM: 9019/1: kprobes: Avoid fortify_panic() when copying optprobe template
Andy Shevchenko (1):
pinctrl: intel: Set default bias in case no particular value given
Ard Biesheuvel (1):
crypto: arm64/aes-modes - get rid of literal load of addend vector
Arnaldo Carvalho de Melo (1):
perf scripting python: Avoid declaring function pointers with a visibility attribute
Arnaud de Turckheim (3):
gpio: pcie-idio-24: Fix irq mask when masking
gpio: pcie-idio-24: Fix IRQ Enable Register value
gpio: pcie-idio-24: Enable PEX8311 interrupts
Baolin Wang (1):
mfd: sprd: Add wakeup capability for PMIC IRQ
Billy Tsai (1):
pinctrl: aspeed: Fix GPI only function problem.
Bob Peterson (3):
gfs2: Free rd_bits later in gfs2_clear_rgrpd to fix use-after-free
gfs2: Add missing truncate_inode_pages_final for sd_aspace
gfs2: check for live vs. read-only file system in gfs2_fitrim
Boris Protopopov (1):
Convert trailing spaces and periods in path components
Brian Foster (1):
xfs: flush new eof page on truncate to avoid post-eof corruption
Chen Zhou (1):
selinux: Fix error return code in sel_ib_pkey_sid_slow()
Chris Brandt (1):
usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
Christoph Hellwig (2):
nbd: fix a block_device refcount leak in nbd_release
xfs: fix a missing unlock on error in xfs_fs_map_blocks
Chunyan Zhang (1):
tick/common: Touch watchdog in tick_unfreeze() on all CPUs
Coiby Xu (2):
pinctrl: amd: use higher precision for 512 RtcClk
pinctrl: amd: fix incorrect way to disable debounce filter
Dan Carpenter (3):
ALSA: hda: prevent undefined shift in snd_hdac_ext_bus_get_link()
can: peak_usb: add range checking in decode operations
futex: Don't enable IRQs unconditionally in put_pi_state()
Darrick J. Wong (6):
xfs: set xefi_discard when creating a deferred agfl free log intent item
xfs: fix scrub flagging rtinherit even if there is no rt device
xfs: fix flags argument to rmap lookup when converting shared file rmaps
xfs: set the unwritten bit in rmap lookup flags in xchk_bmap_get_rmapextents
xfs: fix rmap key and record comparison functions
xfs: fix brainos in the refcount scrubber's rmap fragment processor
Dinghao Liu (1):
btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod
Evan Nimmo (1):
of/address: Fix of_node memory leak in of_dma_is_coherent
Evan Quan (3):
drm/amdgpu: perform srbm soft reset always on SDMA resume drm/amd/pm: perform SMC reset on suspend/hibernation drm/amd/pm: do not use ixFEATURE_STATUS for checking smc running
Evgeny Novikov (1):
usb: gadget: goku_udc: fix potential crashes in probe
Filipe Manana (1):
Btrfs: fix missing error return if writeback for extent buffer never started
Gao Xiang (1):
erofs: derive atime instead of leaving it empty
George Spelvin (1):
random32: make prandom_u32() output unpredictable
Greg Kroah-Hartman (1):
Linux 4.19.158
Hannes Reinecke (1):
scsi: scsi_dh_alua: Avoid crash during alua_bus_detach()
Heiner Kallweit (1):
r8169: fix potential skb double free in an error path
Jason A. Donenfeld (1):
netfilter: use actual socket sk rather than skb sk when routing harder
Jerry Snitselaar (1):
tpm_tis: Disable interrupts on ThinkPad T490s
Jing Xiangfeng (1):
thunderbolt: Add the missed ida_simple_remove() in ring_request_msix()
Jiri Olsa (2):
perf tools: Add missing swap for ino_generation perf/core: Fix race in the perf_mmap_close() function
Joakim Zhang (1):
can: flexcan: remove FLEXCAN_QUIRK_DISABLE_MECR quirk for LS1021A
Johannes Berg (1):
mac80211: fix use of skb payload instead of header
Johannes Thumshirn (1):
btrfs: reschedule when cloning lots of extents
Josef Bacik (1):
btrfs: sysfs: init devices outside of the chunk_mutex
Joseph Qi (1):
ext4: unlock xattr_sem properly in ext4_inline_data_truncate()
Kaixu Xia (1):
ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA
Keita Suzuki (1):
scsi: hpsa: Fix memory leak in hpsa_init_one()
Mao Wenan (1):
net: Update window_clamp if SOCK_RCVBUF is set
Marc Kleine-Budde (1):
can: rx-offload: don't call kfree_skb() from IRQ context
Marc Zyngier (1):
genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY
Martin Schiller (1):
net/x25: Fix null-ptr-deref in x25_connect
Martin Willi (1):
vrf: Fix fast path output packet handling with async Netfilter rules
Masashi Honma (1):
ath9k_htc: Use appropriate rs_datalen type
Matteo Croce (2):
Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
reboot: fix overflow parsing reboot cpu number
Matthew Wilcox (Oracle) (1):
btrfs: fix potential overflow in cluster_pages_for_defrag on 32bit arch
Michał Mirosław (1):
regulator: defer probe when trying to get voltage from unresolved supply
Mika Westerberg (1):
thunderbolt: Fix memory leak if ida_simple_get() fails in enumerate_services()
Ming Lei (1):
nbd: don't update block size after device is started
Olaf Hering (1):
hv_balloon: disable warning when floor reached
Oleksij Rempel (1):
can: can_create_echo_skb(): fix echo skb generation: always use skb_clone()
Oliver Hartkopp (1):
can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames
Oliver Herms (1):
IPv6: Set SIT tunnel hard_header_len to zero
Peter Zijlstra (1):
perf: Fix get_recursion_context()
Qian Cai (1):
s390/smp: move rcu_cpu_starting() earlier
Shin'ichiro Kawasaki (1):
uio: Fix use-after-free in uio_unregister_device()
Stefano Brivio (1):
netfilter: ipset: Update byte and packet counters regardless of whether they match
Stefano Stabellini (1):
swiotlb: fix "x86: Don't panic if can not alloc buffer for swiotlb"
Stephane Grosjean (2):
can: peak_usb: peak_usb_get_ts_time(): fix timestamp wrapping
can: peak_canfd: pucan_handle_can_rx(): fix echo management when loopback is on
Suravee Suthikulpanit (1):
iommu/amd: Increase interrupt remapping table limit to 512 entries
Sven Van Asbroeck (1):
lan743x: fix "BUG: invalid wait context" when setting rx mode
Thinh Nguyen (2):
usb: dwc3: gadget: Continue to process pending requests
usb: dwc3: gadget: Reclaim extra TRBs after request completion
Thomas Zimmermann (1):
drm/gma500: Fix out-of-bounds access to struct drm_device.vblank[]
Tommi Rantala (1):
selftests: proc: fix warning: _GNU_SOURCE redefined
Tyler Hicks (1):
tpm: efi: Don't create binary_bios_measurements file for an empty log
Ursula Braun (1):
net/af_iucv: fix null pointer dereference on shutdown
Vincent Mailhol (1):
can: dev: can_get_echo_skb(): prevent call to kfree_skb() in hard IRQ context
Wang Hai (2):
cosa: Add missing kfree in error path of cosa_write
tipc: fix memory leak in tipc_topsrv_start()
Wengang Wang (1):
ocfs2: initialize ip_next_orphan
Ye Bin (1):
cfg80211: regulatory: Fix inconsistent format argument
Yoshihiro Shimoda (1):
mmc: renesas_sdhi_core: Add missing tmio_mmc_host_free() at remove
Yunsheng Lin (1):
net: sch_generic: fix the missing new qdisc assignment bug
Zeng Tao (1):
time: Prevent undefined behaviour in timespec64_to_ns()
Zhang Qilong (2):
vfio: platform: fix reference leak in vfio_platform_open
xhci: hisilicon: fix refercence leak in xhci_histb_probe
zhuoliang zhang (1):
net: xfrm: fix a race condition during allocing spi
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 157 +SUBLEVEL = 158 EXTRAVERSION = NAME = "People's Front"
arch/arm/include/asm/kprobes.h +11 -11
@@ -52,20 +52,20 @@ int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data);/* optinsn template addresses */ -extern __visible kprobe_opcode_t optprobe_template_entry; -extern __visible kprobe_opcode_t optprobe_template_val; -extern __visible kprobe_opcode_t optprobe_template_call; -extern __visible kprobe_opcode_t optprobe_template_end; -extern __visible kprobe_opcode_t optprobe_template_sub_sp; -extern __visible kprobe_opcode_t optprobe_template_add_sp; -extern __visible kprobe_opcode_t optprobe_template_restore_begin; -extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn; -extern __visible kprobe_opcode_t optprobe_template_restore_end; +extern __visible kprobe_opcode_t optprobe_template_entry[]; +extern __visible kprobe_opcode_t optprobe_template_val[]; +extern __visible kprobe_opcode_t optprobe_template_call[]; +extern __visible kprobe_opcode_t optprobe_template_end[]; +extern __visible kprobe_opcode_t optprobe_template_sub_sp[]; +extern __visible kprobe_opcode_t optprobe_template_add_sp[]; +extern __visible kprobe_opcode_t optprobe_template_restore_begin[]; +extern __visible kprobe_opcode_t optprobe_template_restore_orig_insn[]; +extern __visible kprobe_opcode_t optprobe_template_restore_end[];#define MAX_OPTIMIZED_LENGTH 4#define MAX_OPTINSN_SIZE \ - ((unsigned long)&optprobe_template_end - \ - (unsigned long)&optprobe_template_entry) + ((unsigned long)optprobe_template_end - \ + (unsigned long)optprobe_template_entry)#define RELATIVEJUMP_SIZE 4struct arch_optimized_insn {
arch/arm/probes/kprobes/opt-arm.c +9 -9
@@ -98,21 +98,21 @@ asm ( "optprobe_template_end:\n");#define TMPL_VAL_IDX \ - ((unsigned long *)&optprobe_template_val - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_val - (unsigned long *)optprobe_template_entry)#define TMPL_CALL_IDX \ - ((unsigned long *)&optprobe_template_call - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_call - (unsigned long *)optprobe_template_entry)#define TMPL_END_IDX \ - ((unsigned long *)&optprobe_template_end - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_end - (unsigned long *)optprobe_template_entry)#define TMPL_ADD_SP \ - ((unsigned long *)&optprobe_template_add_sp - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_add_sp - (unsigned long *)optprobe_template_entry)#define TMPL_SUB_SP \ - ((unsigned long *)&optprobe_template_sub_sp - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_sub_sp - (unsigned long *)optprobe_template_entry)#define TMPL_RESTORE_BEGIN \ - ((unsigned long *)&optprobe_template_restore_begin - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_restore_begin - (unsigned long *)optprobe_template_entry)#define TMPL_RESTORE_ORIGN_INSN \ - ((unsigned long *)&optprobe_template_restore_orig_insn - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_restore_orig_insn - (unsigned long *)optprobe_template_entry)#define TMPL_RESTORE_END \ - ((unsigned long *)&optprobe_template_restore_end - (unsigned long *)&optprobe_template_entry) + ((unsigned long *)optprobe_template_restore_end - (unsigned long *)optprobe_template_entry)/* * ARM can always optimize an instruction when using ARM ISA, except
@@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or }/* Copy arch-dep-instance from template. */ -memcpy (code, (unsigned long *)&optprobe_template_entry, +memcpy (code, (unsigned long *)optprobe_template_entry,TMPL_END_IDX *sizeof (kprobe_opcode_t));/* Adjust buffer according to instruction. */
arch/arm64/crypto/aes-modes.S +9 -7
@@ -232,17 +232,19 @@ AES_ENTRY(aes_ctr_encrypt) bmi .Lctr1x cmn w6, #4 /* 32 bit overflow? */ bcs .Lctr1x - ldr q8, =0x30000000200000001 /* addends 1,2,3[,0] */ - dup v7.4s, w6 + add w7, w6, #1 mov v0.16b, v4.16b - add v7.4s, v7.4s, v8.4s + add w8, w6, #2 mov v1.16b, v4.16b - rev32 v8.16b, v7.16b + add w9, w6, #3 mov v2.16b, v4.16b + rev w7, w7 mov v3.16b, v4.16b - mov v1.s[3], v8.s[0] - mov v2.s[3], v8.s[1] - mov v3.s[3], v8.s[2] + rev w8, w8 + mov v1.s[3], w7 + rev w9, w9 + mov v2.s[3], w8 + mov v3.s[3], w9 ld1 {v5.16b-v7.16b}, [x20], #48 /* get 3 input blocks */ bl aes_encrypt_block4x eor v0.16b, v5.16b, v0.16b
arch/s390/kernel/smp.c +2 -1
@@ -831,7 +831,7 @@ void __init smp_detect_cpus(void)*/ static void smp_start_secondary (void *cpuvoid) { -int cpu =smp_processor_id (); +int cpu =raw_smp_processor_id (); S390_lowcore.last_update_clock =get_tod_clock (); S390_lowcore.restart_stack = (unsigned long ) restart_stack;
@@ -844,6 +844,7 @@ static void smp_start_secondary(void *cpuvoid)set_cpu_flag (CIF_ASCE_PRIMARY );set_cpu_flag (CIF_ASCE_SECONDARY );cpu_init (); +rcu_cpu_starting (cpu);preempt_disable ();init_cpu_timer ();vtime_init ();
arch/x86/kernel/cpu/bugs.c +33 -19
86 lines not on this page · raw message
drivers/block/nbd.c +6 -4
@@ -276,7 +276,7 @@ static void nbd_size_clear(struct nbd_device *nbd) } } -static void nbd_size_update (struct nbd_device *nbd) +static void nbd_size_update (struct nbd_device *nbd,bool start) {struct nbd_config *config = nbd->config;struct block_device *bdev =bdget_disk (nbd->disk,0 );
@@ -292,7 +292,8 @@ static void nbd_size_update(struct nbd_device *nbd)if (bdev) {if (bdev->bd_disk) {bd_set_size (bdev, config->bytesize); -set_blocksize (bdev, config->blksize); +if (start) +set_blocksize (bdev, config->blksize); }else bdev->bd_invalidated =1 ;bdput (bdev);
@@ -307,7 +308,7 @@ static void nbd_size_set(struct nbd_device *nbd, loff_t blocksize, config->blksize = blocksize; config->bytesize = blocksize * nr_blocks;if (nbd->task_recv !=NULL ) -nbd_size_update (nbd); +nbd_size_update (nbd, false); }static void nbd_complete_rq (struct request *req)
@@ -1244,7 +1245,7 @@ static int nbd_start_device(struct nbd_device *nbd) args->index = i;queue_work (nbd->recv_workq, &args->work); } -nbd_size_update (nbd); +nbd_size_update (nbd, true);return error; }
@@ -1447,6 +1448,7 @@ static void nbd_release(struct gendisk *disk, fmode_t mode)if (test_bit (NBD_DISCONNECT_ON_CLOSE , &nbd->config->runtime_flags) && bdev->bd_openers ==0 )nbd_disconnect_and_put (nbd); +bdput (bdev);nbd_config_put (nbd);nbd_put (nbd);
drivers/char/random.c +0 -1
@@ -1257,7 +1257,6 @@ void add_interrupt_randomness(int irq, int irq_flags)fast_mix (fast_pool);add_interrupt_bench (cycles); -this_cpu_add (net_rand_state.s1, fast_pool->pool[cycles &3 ]);if (unlikely (crng_init ==0 )) { if ((fast_pool->count >= 64) &&
drivers/char/tpm/eventlog/efi.c +5 -0
@@ -43,6 +43,11 @@ int tpm_read_log_efi(struct tpm_chip *chip) log_size = log_tbl->size;memunmap (log_tbl); +if (!log_size) { +pr_warn ("UEFI TPM log area empty\n" ); +return -EIO ; + } + log_tbl =memremap (efi.tpm_log,sizeof (*log_tbl) + log_size,MEMREMAP_WB );if (!log_tbl) {
drivers/char/tpm/tpm_tis.c +27 -2
@@ -31,6 +31,7 @@#include <linux/of.h> #include <linux/of_device.h> #include <linux/kernel.h> +#include <linux/dmi.h> #include "tpm.h" #include "tpm_tis_core.h"
@@ -53,8 +54,8 @@ static inline struct tpm_tis_tcg_phy *to_tpm_tis_tcg_phy(struct tpm_tis_data *da return container_of(data, struct tpm_tis_tcg_phy, priv); } -static bool interrupts = true; -module_param (interrupts, bool,0444 ); +static int interrupts =-1 ; +module_param (interrupts, int,0444 );MODULE_PARM_DESC (interrupts,"Enable interrupts" );static bool itpm;
@@ -67,6 +68,28 @@ module_param(force, bool, 0444);MODULE_PARM_DESC (force,"Force device probe rather than using ACPI entry" );#endif +static int tpm_tis_disable_irq (const struct dmi_system_id *d) +{ +if (interrupts ==-1 ) { +pr_notice ("tpm_tis: %s detected: disabling interrupts.\n" , d->ident); + interrupts =0 ; + } + +return 0 ; +} + +static const struct dmi_system_id tpm_tis_dmi_table[] = { + { + .callback = tpm_tis_disable_irq, + .ident ="ThinkPad T490s" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"ThinkPad T490s" ), + }, + }, + {} +}; +#if defined(CONFIG_PNP ) && defined(CONFIG_ACPI )static int has_hid (struct acpi_device *dev,const char *hid) {
@@ -196,6 +219,8 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info)int irq =-1 ;int rc; +dmi_check_system (tpm_tis_dmi_table); + rc =check_acpi_tpm2 (dev);if (rc)return rc;
drivers/gpio/gpio-pcie-idio-24.c +56 -6
117 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/cik_sdma.c +12 -15
@@ -1086,22 +1086,19 @@ static int cik_sdma_soft_reset(void *handle) {u32 srbm_soft_reset =0 ;struct amdgpu_device *adev = (struct amdgpu_device *)handle; -u32 tmp =RREG32 (mmSRBM_STATUS2); +u32 tmp; -if (tmp &SRBM_STATUS2__SDMA_BUSY_MASK ) { -/* sdma0 */ - tmp =RREG32 (mmSDMA0_F32_CNTL +SDMA0_REGISTER_OFFSET ); - tmp |=SDMA0_F32_CNTL__HALT_MASK ; -WREG32 (mmSDMA0_F32_CNTL +SDMA0_REGISTER_OFFSET , tmp); - srbm_soft_reset |=SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK ; - } -if (tmp &SRBM_STATUS2__SDMA1_BUSY_MASK ) { -/* sdma1 */ - tmp =RREG32 (mmSDMA0_F32_CNTL +SDMA1_REGISTER_OFFSET ); - tmp |=SDMA0_F32_CNTL__HALT_MASK ; -WREG32 (mmSDMA0_F32_CNTL +SDMA1_REGISTER_OFFSET , tmp); - srbm_soft_reset |=SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK ; - } +/* sdma0 */ + tmp =RREG32 (mmSDMA0_F32_CNTL +SDMA0_REGISTER_OFFSET ); + tmp |=SDMA0_F32_CNTL__HALT_MASK ; +WREG32 (mmSDMA0_F32_CNTL +SDMA0_REGISTER_OFFSET , tmp); + srbm_soft_reset |=SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK ; + +/* sdma1 */ + tmp =RREG32 (mmSDMA0_F32_CNTL +SDMA1_REGISTER_OFFSET ); + tmp |=SDMA0_F32_CNTL__HALT_MASK ; +WREG32 (mmSDMA0_F32_CNTL +SDMA1_REGISTER_OFFSET , tmp); + srbm_soft_reset |=SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK ;if (srbm_soft_reset) { tmp =RREG32 (mmSRBM_SOFT_RESET);
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +4 -0
@@ -1531,6 +1531,10 @@ int smu7_disable_dpm_tasks(struct pp_hwmgr *hwmgr)PP_ASSERT_WITH_CODE ((tmp_result ==0 ),"Failed to reset to default!" , result = tmp_result); + tmp_result =smum_stop_smc (hwmgr); +PP_ASSERT_WITH_CODE ((tmp_result ==0 ), +"Failed to stop smc!" , result = tmp_result); + tmp_result =smu7_force_switch_to_arbf0 (hwmgr);PP_ASSERT_WITH_CODE ((tmp_result ==0 ),"Failed to force to switch arbf0!" , result = tmp_result);
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
@@ -216,6 +216,7 @@ struct pp_smumgr_func {bool (*is_hw_avfs_present)(struct pp_hwmgr *hwmgr);int (*update_dpm_settings)(struct pp_hwmgr *hwmgr,void *profile_setting);int (*smc_table_manager)(struct pp_hwmgr *hwmgr,uint8_t *table,uint16_t table_id,bool rw);/*rw: true for read, false for write */ +int (*stop_smc)(struct pp_hwmgr *hwmgr); };struct pp_hwmgr_func {
drivers/gpu/drm/amd/powerplay/inc/smumgr.h +2 -0
@@ -113,4 +113,6 @@ extern int smum_update_dpm_settings(struct pp_hwmgr *hwmgr, void *profile_settinextern int smum_smc_table_manager (struct pp_hwmgr *hwmgr,uint8_t *table,uint16_t table_id,bool rw); +extern int smum_stop_smc (struct pp_hwmgr *hwmgr); +#endif
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c +25 -4
@@ -2723,10 +2723,7 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)static bool ci_is_dpm_running (struct pp_hwmgr *hwmgr) { -return (1 ==PHM_READ_INDIRECT_FIELD (hwmgr->device, -CGS_IND_REG__SMC ,FEATURE_STATUS , -VOLTAGE_CONTROLLER_ON )) - ? true : false; +return ci_is_smc_ram_running (hwmgr); }static int ci_smu_init (struct pp_hwmgr *hwmgr)
@@ -2934,6 +2931,29 @@ static int ci_update_smc_table(struct pp_hwmgr *hwmgr, uint32_t type)return 0 ; } +static void ci_reset_smc (struct pp_hwmgr *hwmgr) +{ +PHM_WRITE_INDIRECT_FIELD (hwmgr->device,CGS_IND_REG__SMC , +SMC_SYSCON_RESET_CNTL , + rst_reg,1 ); +} + + +static void ci_stop_smc_clock (struct pp_hwmgr *hwmgr) +{ +PHM_WRITE_INDIRECT_FIELD (hwmgr->device,CGS_IND_REG__SMC , +SMC_SYSCON_CLOCK_CNTL_0 , + ck_disable,1 ); +} + +static int ci_stop_smc (struct pp_hwmgr *hwmgr) +{ +ci_reset_smc (hwmgr); +ci_stop_smc_clock (hwmgr); + +return 0 ; +} +const struct pp_smumgr_func ci_smu_funcs = { .smu_init = ci_smu_init, .smu_fini = ci_smu_fini,
@@ -2957,4 +2977,5 @@ const struct pp_smumgr_func ci_smu_funcs = { .is_dpm_running = ci_is_dpm_running, .update_dpm_settings = ci_update_dpm_settings, .update_smc_table = ci_update_smc_table, + .stop_smc = ci_stop_smc, };
drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c +8 -0
@@ -213,3 +213,11 @@ int smum_smc_table_manager(struct pp_hwmgr *hwmgr, uint8_t *table, uint16_t tablreturn -EINVAL ; } + +int smum_stop_smc (struct pp_hwmgr *hwmgr) +{ +if (hwmgr->smumgr_funcs->stop_smc) +return hwmgr->smumgr_funcs->stop_smc (hwmgr); + +return 0 ; +}
drivers/gpu/drm/gma500/psb_irq.c +12 -22
@@ -350,6 +350,7 @@ int psb_irq_postinstall(struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;unsigned long irqflags; +unsigned int i;spin_lock_irqsave (&dev_priv->irqmask_lock, irqflags);
@@ -362,20 +363,12 @@ int psb_irq_postinstall(struct drm_device *dev)PSB_WVDC32 (dev_priv->vdc_irq_mask,PSB_INT_ENABLE_R );PSB_WVDC32 (0xFFFFFFFF ,PSB_HWSTAM ); -if (dev->vblank[0 ].enabled) -psb_enable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -else -psb_disable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE ); - -if (dev->vblank[1 ].enabled) -psb_enable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -else -psb_disable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE ); - -if (dev->vblank[2 ].enabled) -psb_enable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE ); -else -psb_disable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE ); +for (i =0 ; i < dev->num_crtcs; ++i) { +if (dev->vblank[i].enabled) +psb_enable_pipestat (dev_priv, i,PIPE_VBLANK_INTERRUPT_ENABLE ); +else +psb_disable_pipestat (dev_priv, i,PIPE_VBLANK_INTERRUPT_ENABLE ); + }if (dev_priv->ops->hotplug_enable) dev_priv->ops->hotplug_enable (dev, true);
@@ -388,6 +381,7 @@ void psb_irq_uninstall(struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;unsigned long irqflags; +unsigned int i;spin_lock_irqsave (&dev_priv->irqmask_lock, irqflags);
@@ -396,14 +390,10 @@ void psb_irq_uninstall(struct drm_device *dev)PSB_WVDC32 (0xFFFFFFFF ,PSB_HWSTAM ); -if (dev->vblank[0 ].enabled) -psb_disable_pipestat (dev_priv,0 ,PIPE_VBLANK_INTERRUPT_ENABLE ); - -if (dev->vblank[1 ].enabled) -psb_disable_pipestat (dev_priv,1 ,PIPE_VBLANK_INTERRUPT_ENABLE ); - -if (dev->vblank[2 ].enabled) -psb_disable_pipestat (dev_priv,2 ,PIPE_VBLANK_INTERRUPT_ENABLE ); +for (i =0 ; i < dev->num_crtcs; ++i) { +if (dev->vblank[i].enabled) +psb_disable_pipestat (dev_priv, i,PIPE_VBLANK_INTERRUPT_ENABLE ); + } dev_priv->vdc_irq_mask &= _PSB_IRQ_SGX_FLAG | _PSB_IRQ_MSVDX_FLAG |
drivers/hv/hv_balloon.c +1 -1
@@ -1275,7 +1275,7 @@ static void balloon_up(struct work_struct *dummy)/* Refuse to balloon below the floor. */ if (avail_pages < num_pages || avail_pages - num_pages < floor) { -pr_warn ("Balloon request will be partially fulfilled. %s\n" , +pr_info ("Balloon request will be partially fulfilled. %s\n" , avail_pages < num_pages ?"Not enough memory." :"Balloon floor reached." );
drivers/iommu/amd_iommu_types.h +5 -1
@@ -410,7 +410,11 @@ extern bool amd_iommu_np_cache;/* Only true if all IOMMUs support device IOTLBs */ extern bool amd_iommu_iotlb_sup; -#define MAX_IRQS_PER_TABLE 256 +/* +* AMD IOMMU hardware only support 512 IRTEs despite +* the architectural limitation of 2048 entries. +*/ +#define MAX_IRQS_PER_TABLE 512#define IRQ_TABLE_ALIGNMENT 128struct irq_remap_table {
drivers/mfd/sprd-sc27xx-spi.c +27 -1
@@ -212,7 +212,7 @@ static int sprd_pmic_probe(struct spi_device *spi) } ret =devm_regmap_add_irq_chip (&spi->dev, ddata->regmap, ddata->irq, -IRQF_ONESHOT |IRQF_NO_SUSPEND ,0 , +IRQF_ONESHOT ,0 , &ddata->irq_chip, &ddata->irq_data);if (ret) {dev_err (&spi->dev,"Failed to add PMIC irq chip %d\n" , ret);
@@ -228,9 +228,34 @@ static int sprd_pmic_probe(struct spi_device *spi)return ret; } +device_init_wakeup (&spi->dev, true);return 0 ; } +#ifdef CONFIG_PM_SLEEP +static int sprd_pmic_suspend (struct device *dev) +{ +struct sprd_pmic *ddata =dev_get_drvdata (dev); + +if (device_may_wakeup (dev)) +enable_irq_wake (ddata->irq); + +return 0 ; +} + +static int sprd_pmic_resume (struct device *dev) +{ +struct sprd_pmic *ddata =dev_get_drvdata (dev); + +if (device_may_wakeup (dev)) +disable_irq_wake (ddata->irq); + +return 0 ; +} +#endif + +static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume); +static const struct of_device_id sprd_pmic_match[] = { { .compatible ="sprd,sc2731" , .data = &sc2731_data }, {},
@@ -242,6 +267,7 @@ static struct spi_driver sprd_pmic_driver = { .name = "sc27xx-pmic", .bus = &spi_bus_type, .of_match_table = sprd_pmic_match, + .pm = &sprd_pmic_pm_ops, }, .probe = sprd_pmic_probe, };
drivers/misc/mei/client.h +2 -2
@@ -138,11 +138,11 @@ static inline u8 mei_cl_me_id(const struct mei_cl *cl)* * @cl: host client * -* Return: mtu +* Return: mtu or 0 if client is not connected */ static inline size_t mei_cl_mtu (const struct mei_cl *cl) { -return cl->me_cl->props.max_msg_length; +return cl->me_cl ? cl->me_cl->props.max_msg_length :0 ; }/**
drivers/mmc/host/renesas_sdhi_core.c +1 -0
@@ -764,6 +764,7 @@ int renesas_sdhi_remove(struct platform_device *pdev)tmio_mmc_host_remove (host);renesas_sdhi_clk_disable (host); +tmio_mmc_host_free (host);return 0 ; }
drivers/net/can/dev.c +11 -3
@@ -493,9 +493,13 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8*/ struct sk_buff *skb = priv->echo_skb[idx];struct canfd_frame *cf = (struct canfd_frame *)skb->data; -u8 len = cf->len; - *len_ptr = len; +/* get the real payload length for netdev statistics */ +if (cf->can_id &CAN_RTR_FLAG ) + *len_ptr =0 ; +else + *len_ptr = cf->len; + priv->echo_skb[idx] =NULL ;return skb;
@@ -520,7 +524,11 @@ unsigned int can_get_echo_skb(struct net_device *dev, unsigned int idx)if (!skb)return 0 ; -netif_rx (skb); +skb_get (skb); +if (netif_rx (skb) ==NET_RX_SUCCESS ) +dev_consume_skb_any (skb); +else +dev_kfree_skb_any (skb);return len; }
drivers/net/can/flexcan.c +1 -2
@@ -301,8 +301,7 @@ static const struct flexcan_devtype_data fsl_vf610_devtype_data = {static const struct flexcan_devtype_data fsl_ls1021a_r2_devtype_data = { .quirks =FLEXCAN_QUIRK_DISABLE_RXFG |FLEXCAN_QUIRK_ENABLE_EACEN_RRS | -FLEXCAN_QUIRK_DISABLE_MECR |FLEXCAN_QUIRK_BROKEN_PERR_STATE | -FLEXCAN_QUIRK_USE_OFF_TIMESTAMP , +FLEXCAN_QUIRK_BROKEN_PERR_STATE |FLEXCAN_QUIRK_USE_OFF_TIMESTAMP , };static const struct can_bittiming_const flexcan_bittiming_const = {
drivers/net/can/peak_canfd/peak_canfd.c +8 -3
@@ -256,8 +256,7 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv, cf_len =get_can_dlc (pucan_msg_get_dlc (msg));/* if this frame is an echo, */ -if ((rx_msg_flags &PUCAN_MSG_LOOPED_BACK ) && - !(rx_msg_flags &PUCAN_MSG_SELF_RECEIVE )) { +if (rx_msg_flags &PUCAN_MSG_LOOPED_BACK ) {unsigned long flags;spin_lock_irqsave (&priv->echo_lock, flags);
@@ -271,7 +270,13 @@ static int pucan_handle_can_rx(struct peak_canfd_priv *priv,netif_wake_queue (priv->ndev);spin_unlock_irqrestore (&priv->echo_lock, flags); -return 0 ; + +/* if this frame is only an echo, stop here. Otherwise, +* continue to push this application self-received frame into +* its own rx queue. +*/ +if (!(rx_msg_flags &PUCAN_MSG_SELF_RECEIVE )) +return 0 ; }/* otherwise, it should be pushed into rx fifo */
drivers/net/can/rx-offload.c +2 -2
@@ -281,7 +281,7 @@ int can_rx_offload_queue_sorted(struct can_rx_offload *offload,if (skb_queue_len (&offload->skb_queue) > offload->skb_queue_len_max) { -kfree_skb (skb); +dev_kfree_skb_any (skb);return -ENOBUFS ; }
@@ -326,7 +326,7 @@ int can_rx_offload_queue_tail(struct can_rx_offload *offload, {if (skb_queue_len (&offload->skb_queue) > offload->skb_queue_len_max) { -kfree_skb (skb); +dev_kfree_skb_any (skb);return -ENOBUFS ; }
drivers/net/can/usb/peak_usb/pcan_usb_core.c +46 -5
60 lines not on this page · raw message
drivers/net/can/usb/peak_usb/pcan_usb_fd.c +37 -11
90 lines not on this page · raw message
drivers/net/ethernet/microchip/lan743x_main.c +3 -9
@@ -672,14 +672,12 @@ static int lan743x_intr_open(struct lan743x_adapter *adapter)static int lan743x_dp_write (struct lan743x_adapter *adapter,u32 select,u32 addr,u32 length,u32 *buf) { -int ret = -EIO ;u32 dp_sel;int i; -mutex_lock (&adapter->dp_lock);if (lan743x_csr_wait_for_bit (adapter,DP_SEL ,DP_SEL_DPRDY_ ,1 ,40 ,100 ,100 )) - goto unlock; +return -EIO ; dp_sel =lan743x_csr_read (adapter,DP_SEL ); dp_sel &= ~DP_SEL_MASK_ ; dp_sel |= select;
@@ -691,13 +689,10 @@ static int lan743x_dp_write(struct lan743x_adapter *adapter,lan743x_csr_write (adapter,DP_CMD ,DP_CMD_WRITE_ );if (lan743x_csr_wait_for_bit (adapter,DP_SEL ,DP_SEL_DPRDY_ ,1 ,40 ,100 ,100 )) - goto unlock; +return -EIO ; } - ret =0 ; -unlock: -mutex_unlock (&adapter->dp_lock); -return ret; +return 0 ; }static u32 lan743x_mac_mii_access (u16 id,u16 index,int read)
@@ -2679,7 +2674,6 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter, adapter->intr.irq = adapter->pdev->irq;lan743x_csr_write (adapter,INT_EN_CLR ,0xFFFFFFFF ); -mutex_init (&adapter->dp_lock); ret =lan743x_gpio_init (adapter);if (ret)
drivers/net/ethernet/microchip/lan743x_main.h +0 -3
@@ -702,9 +702,6 @@ struct lan743x_adapter {struct lan743x_csr csr;struct lan743x_intr intr; -/* lock, used to prevent concurrent access to data port */ -struct mutex dp_lock; -struct lan743x_gpio gpio;struct lan743x_ptp ptp;
drivers/net/ethernet/realtek/r8169.c +2 -1
@@ -6274,7 +6274,8 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, opts[1 ] |= transport_offset <<TCPHO_SHIFT ; }else {if (unlikely (rtl_test_hw_pad_bug (tp, skb))) -return !eth_skb_pad (skb); +/* eth_skb_pad would free the skb on error */ +return !__skb_put_padto (skb,ETH_ZLEN , false); }return true;
drivers/net/vrf.c +69 -23
150 lines not on this page · raw message
drivers/net/wan/cosa.c +1 -0
@@ -902,6 +902,7 @@ static ssize_t cosa_write(struct file *file, chan->tx_status =1 ;spin_unlock_irqrestore (&cosa->lock, flags);up (&chan->wsem); +kfree (kbuf);return -ERESTARTSYS ; } }
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +1 -1
@@ -973,7 +973,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,struct ath_htc_rx_status *rxstatus;struct ath_rx_status rx_stats;bool decrypt_error = false; -__be16 rs_datalen; +u16 rs_datalen;bool is_phyerr;if (skb->len <HTC_RX_FRAME_HEADER_SIZE ) {
drivers/of/address.c +3 -1
@@ -975,11 +975,13 @@ EXPORT_SYMBOL_GPL(of_dma_get_range);*/ bool of_dma_is_coherent (struct device_node *np) { -struct device_node *node =of_node_get (np); +struct device_node *node;if (IS_ENABLED (CONFIG_OF_DMA_DEFAULT_COHERENT ))return true; + node =of_node_get (np); +while (node) {if (of_property_read_bool (node,"dma-coherent" )) {of_node_put (node);
drivers/pinctrl/aspeed/pinctrl-aspeed.c +4 -3
@@ -458,13 +458,14 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,static bool aspeed_expr_is_gpio (const struct aspeed_sig_expr *expr) {/* -* The signal type is GPIO if the signal name has "GPIO" as a prefix. +* The signal type is GPIO if the signal name has "GPI" as a prefix. * strncmp (rather than strcmp) is used to implement the prefix * requirement. * -* expr->signal might look like "GPIOT3" in the GPIO case. +* expr->signal might look like "GPIOB1" in the GPIO case. +* expr->signal might look like "GPIT0" in the GPI case. */ -return strncmp (expr->signal,"GPIO" ,4 ) ==0 ; +return strncmp (expr->signal,"GPI" ,3 ) ==0 ; }static bool aspeed_gpio_in_exprs (const struct aspeed_sig_expr **exprs)
drivers/pinctrl/intel/pinctrl-intel.c +8 -0
@@ -621,6 +621,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin, value |=PADCFG1_TERM_UP ; +/* Set default strength value in case none is given */ +if (arg ==1 ) + arg =5000 ; +switch (arg) {case 20000 : value |=PADCFG1_TERM_20K <<PADCFG1_TERM_SHIFT ;
@@ -643,6 +647,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,case PIN_CONFIG_BIAS_PULL_DOWN : value &= ~(PADCFG1_TERM_UP |PADCFG1_TERM_MASK ); +/* Set default strength value in case none is given */ +if (arg ==1 ) + arg =5000 ; +switch (arg) {case 20000 : value |=PADCFG1_TERM_20K <<PADCFG1_TERM_SHIFT ;
drivers/pinctrl/pinctrl-amd.c +3 -3
@@ -157,7 +157,7 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset, pin_reg |=BIT (DB_TMR_OUT_UNIT_OFF ); pin_reg &= ~BIT (DB_TMR_LARGE_OFF ); }else if (debounce <250000 ) { - time = debounce /15600 ; + time = debounce /15625 ; pin_reg |= time &DB_TMR_OUT_MASK ; pin_reg &= ~BIT (DB_TMR_OUT_UNIT_OFF ); pin_reg |=BIT (DB_TMR_LARGE_OFF );
@@ -167,14 +167,14 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset, pin_reg |=BIT (DB_TMR_OUT_UNIT_OFF ); pin_reg |=BIT (DB_TMR_LARGE_OFF ); }else { - pin_reg &= ~DB_CNTRl_MASK; + pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); ret = -EINVAL ; } }else { pin_reg &= ~BIT (DB_TMR_OUT_UNIT_OFF ); pin_reg &= ~BIT (DB_TMR_LARGE_OFF ); pin_reg &= ~DB_TMR_OUT_MASK ; - pin_reg &= ~DB_CNTRl_MASK; + pin_reg &= ~(DB_CNTRl_MASK <<DB_CNTRL_OFF ); }writel (pin_reg, gpio_dev->base + offset *4 );raw_spin_unlock_irqrestore (&gpio_dev->lock, flags);
drivers/regulator/core.c +2 -0
@@ -3405,6 +3405,8 @@ static int _regulator_get_voltage(struct regulator_dev *rdev) ret = rdev->desc->fixed_uV; }else if (rdev->supply) { ret =_regulator_get_voltage (rdev->supply->rdev); + }else if (rdev->supply_name) { +return -EPROBE_DEFER ; }else {return -EINVAL ; }
drivers/scsi/device_handler/scsi_dh_alua.c +5 -4
@@ -672,8 +672,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)rcu_read_lock ();list_for_each_entry_rcu (h, &tmp_pg->dh_list, node) { -/* h->sdev should always be valid */ -BUG_ON (!h->sdev); +if (!h->sdev) +continue ; h->sdev->access_state = desc[0 ]; }rcu_read_unlock ();
@@ -719,7 +719,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg) pg->expiry =0 ;rcu_read_lock ();list_for_each_entry_rcu (h, &pg->dh_list, node) { -BUG_ON (!h->sdev); +if (!h->sdev) +continue ; h->sdev->access_state = (pg->state &SCSI_ACCESS_STATE_MASK );if (pg->pref)
@@ -1160,7 +1161,6 @@ static void alua_bus_detach(struct scsi_device *sdev)spin_lock (&h->pg_lock); pg =rcu_dereference_protected (h->pg,lockdep_is_held (&h->pg_lock));rcu_assign_pointer (h->pg,NULL ); - h->sdev =NULL ;spin_unlock (&h->pg_lock);if (pg) {spin_lock_irq (&pg->lock);
@@ -1169,6 +1169,7 @@ static void alua_bus_detach(struct scsi_device *sdev)kref_put (&pg->kref, release_port_group); } sdev->handler_data =NULL ; +synchronize_rcu ();kfree (h); }
drivers/scsi/hpsa.c +3 -1
@@ -8781,7 +8781,7 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)/* hook into SCSI subsystem */ rc =hpsa_scsi_add_host (h);if (rc) - goto clean7;/* perf, sg, cmd, irq, shost, pci, lu, aer/h */ + goto clean8;/* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */ /* Monitor the controller for firmware lockups */ h->heartbeat_sample_interval =HEARTBEAT_SAMPLE_INTERVAL ;
@@ -8796,6 +8796,8 @@ static int hpsa_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) HPSA_EVENT_MONITOR_INTERVAL);return 0 ; +clean8:/* lastlogicals, perf, sg, cmd, irq, shost, pci, lu, aer/h */ +kfree (h->lastlogicals); clean7:/* perf, sg, cmd, irq, shost, pci, lu, aer/h */ hpsa_free_performant_mode (h); h->access.set_intr_mask (h,HPSA_INTR_OFF );
drivers/staging/erofs/inode.c +11 -10
@@ -53,11 +53,9 @@ static int read_inode(struct inode *inode, void *data)i_gid_write (inode,le32_to_cpu (v2->i_gid));set_nlink (inode,le32_to_cpu (v2->i_nlink)); -/* ns timestamp */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = -le64_to_cpu (v2->i_ctime); - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = -le32_to_cpu (v2->i_ctime_nsec); +/* extended inode has its own timestamp */ + inode->i_ctime.tv_sec =le64_to_cpu (v2->i_ctime); + inode->i_ctime.tv_nsec =le32_to_cpu (v2->i_ctime_nsec); inode->i_size =le64_to_cpu (v2->i_size); }else if (__inode_version (advise) ==EROFS_INODE_LAYOUT_V1 ) {
@@ -83,11 +81,9 @@ static int read_inode(struct inode *inode, void *data)i_gid_write (inode,le16_to_cpu (v1->i_gid));set_nlink (inode,le16_to_cpu (v1->i_nlink)); -/* use build time to derive all file time */ - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = - sbi->build_time; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = - sbi->build_time_nsec; +/* use build time for compact inodes */ + inode->i_ctime.tv_sec = sbi->build_time; + inode->i_ctime.tv_nsec = sbi->build_time_nsec; inode->i_size =le32_to_cpu (v1->i_size); }else {
@@ -97,6 +93,11 @@ static int read_inode(struct inode *inode, void *data)return -EIO ; } + inode->i_mtime.tv_sec = inode->i_ctime.tv_sec; + inode->i_atime.tv_sec = inode->i_ctime.tv_sec; + inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec; + inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec; +/* measure inode.i_blocks as the generic filesystem */ inode->i_blocks = ((inode->i_size -1 ) >>9 ) +1 ;return 0 ;
drivers/thunderbolt/nhi.c +15 -4
@@ -408,12 +408,23 @@ static int ring_request_msix(struct tb_ring *ring, bool no_suspend) ring->vector = ret; - ring->irq =pci_irq_vector (ring->nhi->pdev, ring->vector); -if (ring->irq <0 ) -return ring->irq; + ret =pci_irq_vector (ring->nhi->pdev, ring->vector); +if (ret <0 ) + goto err_ida_remove; + + ring->irq = ret; irqflags = no_suspend ?IRQF_NO_SUSPEND :0 ; -return request_irq (ring->irq, ring_msix, irqflags,"thunderbolt" , ring); + ret =request_irq (ring->irq, ring_msix, irqflags,"thunderbolt" , ring); +if (ret) + goto err_ida_remove; + +return 0 ; + +err_ida_remove: +ida_simple_remove (&nhi->msix_ida, ring->vector); + +return ret; }static void ring_release_msix (struct tb_ring *ring)
drivers/thunderbolt/xdomain.c +1 -0
@@ -774,6 +774,7 @@ static void enumerate_services(struct tb_xdomain *xd) id =ida_simple_get (&xd->service_ids,0 ,0 ,GFP_KERNEL );if (id <0 ) { +kfree (svc->key);kfree (svc);break ; }
drivers/uio/uio.c +6 -4
@@ -413,10 +413,10 @@ static int uio_get_minor(struct uio_device *idev)return retval; } -static void uio_free_minor (struct uio_device *idev) +static void uio_free_minor (unsigned long minor) {mutex_lock (&minor_lock); -idr_remove (&uio_idr, idev->minor); +idr_remove (&uio_idr, minor);mutex_unlock (&minor_lock); }
@@ -988,7 +988,7 @@ int __uio_register_device(struct module *owner, err_uio_dev_add_attributes:device_del (&idev->dev); err_device_create: -uio_free_minor (idev); +uio_free_minor (idev->minor);put_device (&idev->dev);return ret; }
@@ -1002,11 +1002,13 @@ EXPORT_SYMBOL_GPL(__uio_register_device);void uio_unregister_device (struct uio_info *info) {struct uio_device *idev; +unsigned long minor;if (!info || !info->uio_dev)return ; idev = info->uio_dev; + minor = idev->minor;mutex_lock (&idev->info_lock);uio_dev_del_attributes (idev);
@@ -1019,7 +1021,7 @@ void uio_unregister_device(struct uio_info *info)device_unregister (&idev->dev); -uio_free_minor (idev); +uio_free_minor (minor);return ; }
drivers/usb/class/cdc-acm.c +9 -0
@@ -1738,6 +1738,15 @@ static const struct usb_device_id acm_ids[] = { { USB_DEVICE(0x0870, 0x0001), /* Metricom GS Modem */ .driver_info =NO_UNION_NORMAL ,/* has no union descriptor */ }, + { USB_DEVICE(0x045b, 0x023c), /* Renesas USB Download mode */ + .driver_info = DISABLE_ECHO, /* Don't echo banner */ + }, + { USB_DEVICE(0x045b, 0x0248), /* Renesas USB Download mode */ + .driver_info = DISABLE_ECHO, /* Don't echo banner */ + }, + { USB_DEVICE(0x045b, 0x024D), /* Renesas USB Download mode */ + .driver_info = DISABLE_ECHO, /* Don't echo banner */ + }, { USB_DEVICE(0x0e8d, 0x0003), /* FIREFLY, MediaTek Inc; [email protected] */ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ },
drivers/usb/dwc3/gadget.c +25 -7
@@ -2386,6 +2386,11 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, ret =dwc3_gadget_ep_reclaim_trb_linear (dep, req, event, status); + req->request.actual = req->request.length - req->remaining; + +if (!dwc3_gadget_ep_request_completed (req)) + goto out; +if (req->needs_extra_trb) {unsigned int maxp =usb_endpoint_maxp (dep->endpoint.desc);
@@ -2401,13 +2406,6 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, req->needs_extra_trb = false; } - req->request.actual = req->request.length - req->remaining; - -if (!dwc3_gadget_ep_request_completed (req)) { -__dwc3_gadget_kick_transfer (dep); - goto out; - } -dwc3_gadget_giveback (dep, req, status); out:
@@ -2430,6 +2428,24 @@ static void dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, } } +static bool dwc3_gadget_ep_should_continue (struct dwc3_ep *dep) +{ +struct dwc3_request *req; + +if (!list_empty (&dep->pending_list)) +return true; + +/* +* We only need to check the first entry of the started list. We can +* assume the completed requests are removed from the started list. +*/ + req =next_request (&dep->started_list); +if (!req) +return false; + +return !dwc3_gadget_ep_request_completed (req); +} +static void dwc3_gadget_endpoint_frame_from_event (struct dwc3_ep *dep,const struct dwc3_event_depevt *event) {
@@ -2459,6 +2475,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,if (stop)dwc3_stop_active_transfer (dep, true, true); +else if (dwc3_gadget_ep_should_continue (dep)) +__dwc3_gadget_kick_transfer (dep);/* * WORKAROUND: This is the 2nd half of U1/U2 -> U0 workaround.
drivers/usb/gadget/udc/goku_udc.c +1 -1
@@ -1757,6 +1757,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto err; } +pci_set_drvdata (pdev, dev);spin_lock_init (&dev->lock); dev->pdev = pdev; dev->gadget.ops = &goku_ops;
@@ -1790,7 +1791,6 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) } dev->regs = (struct goku_udc_regs __iomem *) base; -pci_set_drvdata (pdev, dev);INFO (dev,"%s\n" , driver_desc);INFO (dev,"version: " DRIVER_VERSION " %s\n" ,dmastr ());INFO (dev,"irq %d, pci mem %p\n" , pdev->irq, base);
drivers/usb/host/xhci-histb.c +1 -1
@@ -241,7 +241,7 @@ static int xhci_histb_probe(struct platform_device *pdev)/* Initialize dma_mask and coherent_dma_mask to 32-bits */ ret =dma_set_mask_and_coherent (dev,DMA_BIT_MASK (32 ));if (ret) -return ret; + goto disable_pm; hcd =usb_create_hcd (driver, dev,dev_name (dev));if (!hcd) {
drivers/vfio/platform/vfio_platform_common.c +1 -2
@@ -273,7 +273,7 @@ static int vfio_platform_open(void *device_data) ret =pm_runtime_get_sync (vdev->device);if (ret <0 ) - goto err_pm; + goto err_rst; ret =vfio_platform_call_reset (vdev, &extra_dbg);if (ret && vdev->reset_required) {
@@ -290,7 +290,6 @@ static int vfio_platform_open(void *device_data) err_rst:pm_runtime_put (vdev->device); -err_pm:vfio_platform_irq_cleanup (vdev); err_irq:vfio_platform_regions_cleanup (vdev);
fs/btrfs/dev-replace.c +24 -2
@@ -54,6 +54,17 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) ret =btrfs_search_slot (NULL , dev_root, &key, path,0 ,0 );if (ret) { no_valid_dev_replace_entry_found: +/* +* We don't have a replace item or it's corrupted. If there is +* a replace target, fail the mount. +*/ +if (btrfs_find_device (fs_info->fs_devices, +BTRFS_DEV_REPLACE_DEVID ,NULL ,NULL , false)) { +btrfs_err (fs_info, +"found replace target device without a valid replace item" ); + ret = -EUCLEAN ; + goto out; + } ret =0 ; dev_replace->replace_state =BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED ;
@@ -107,8 +118,19 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)case BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED :case BTRFS_IOCTL_DEV_REPLACE_STATE_FINISHED :case BTRFS_IOCTL_DEV_REPLACE_STATE_CANCELED : - dev_replace->srcdev =NULL ; - dev_replace->tgtdev =NULL ; +/* +* We don't have an active replace item but if there is a +* replace target, fail the mount. +*/ +if (btrfs_find_device (fs_info->fs_devices, +BTRFS_DEV_REPLACE_DEVID ,NULL ,NULL , false)) { +btrfs_err (fs_info, +"replace devid present without an active replace item" ); + ret = -EUCLEAN ; + }else { + dev_replace->srcdev =NULL ; + dev_replace->tgtdev =NULL ; + }break ;case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED :case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED :
fs/btrfs/extent_io.c +4 -0
@@ -3913,6 +3913,10 @@ int btree_write_cache_pages(struct address_space *mapping,if (!ret) {free_extent_buffer (eb);continue ; + }else if (ret <0 ) { + done =1 ; +free_extent_buffer (eb); +break ; } ret =write_one_eb (eb, fs_info, wbc, &epd);
fs/btrfs/ioctl.c +6 -6
@@ -1239,6 +1239,7 @@ static int cluster_pages_for_defrag(struct inode *inode,u64 page_start;u64 page_end;u64 page_cnt; +u64 start = (u64 )start_index <<PAGE_SHIFT ;int ret;int i;int i_done;
@@ -1255,8 +1256,7 @@ static int cluster_pages_for_defrag(struct inode *inode, page_cnt =min_t (u64, (u64 )num_pages, (u64 )file_end - start_index +1 ); ret =btrfs_delalloc_reserve_space (inode, &data_reserved, - start_index <<PAGE_SHIFT , - page_cnt <<PAGE_SHIFT ); + start, page_cnt <<PAGE_SHIFT );if (ret)return ret; i_done =0 ;
@@ -1346,8 +1346,7 @@ static int cluster_pages_for_defrag(struct inode *inode,btrfs_mod_outstanding_extents (BTRFS_I (inode),1 );spin_unlock (&BTRFS_I (inode)->lock);btrfs_delalloc_release_space (inode, data_reserved, - start_index <<PAGE_SHIFT , - (page_cnt - i_done) <<PAGE_SHIFT , true); + start, (page_cnt - i_done) <<PAGE_SHIFT , true); }
@@ -1374,8 +1373,7 @@ static int cluster_pages_for_defrag(struct inode *inode,put_page (pages[i]); }btrfs_delalloc_release_space (inode, data_reserved, - start_index <<PAGE_SHIFT , - page_cnt <<PAGE_SHIFT , true); + start, page_cnt <<PAGE_SHIFT , true);btrfs_delalloc_release_extents (BTRFS_I (inode), page_cnt <<PAGE_SHIFT );extent_changeset_free (data_reserved);return ret;
@@ -4217,6 +4215,8 @@ static int btrfs_clone(struct inode *src, struct inode *inode, ret = -EINTR ; goto out; } + +cond_resched (); } ret =0 ;
fs/btrfs/ref-verify.c +1 -0
@@ -854,6 +854,7 @@ int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes, "dropping a ref for a root that doesn't have a ref on the block");dump_block_entry (fs_info, be);dump_ref_action (fs_info, ra); +kfree (ref);kfree (ra); goto out_unlock; }
fs/btrfs/volumes.c +11 -22
@@ -974,22 +974,13 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)continue ; } -if (device->devid ==BTRFS_DEV_REPLACE_DEVID ) { -/* -* In the first step, keep the device which has -* the correct fsid and the devid that is used -* for the dev_replace procedure. -* In the second step, the dev_replace state is -* read from the device tree and it is known -* whether the procedure is really active or -* not, which means whether this device is -* used or whether it should be removed. -*/ -if (step ==0 ||test_bit (BTRFS_DEV_STATE_REPLACE_TGT , - &device->dev_state)) { -continue ; - } - } +/* +* We have already validated the presence of BTRFS_DEV_REPLACE_DEVID, +* in btrfs_init_dev_replace() so just continue. +*/ +if (device->devid ==BTRFS_DEV_REPLACE_DEVID ) +continue ; +if (device->bdev) {blkdev_put (device->bdev, device->mode); device->bdev =NULL ;
@@ -998,9 +989,6 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)if (test_bit (BTRFS_DEV_STATE_WRITEABLE , &device->dev_state)) {list_del_init (&device->dev_alloc_list);clear_bit (BTRFS_DEV_STATE_WRITEABLE , &device->dev_state); -if (!test_bit (BTRFS_DEV_STATE_REPLACE_TGT , - &device->dev_state)) - fs_devices->rw_devices--; }list_del_init (&device->dev_list); fs_devices->num_devices--;
@@ -2459,9 +2447,6 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_pathbtrfs_set_super_num_devices (fs_info->super_copy, orig_super_num_devices +1 ); -/* add sysfs device entry */ -btrfs_sysfs_add_device_link (fs_devices, device); -/* * we've got more storage, clear any full flags on the space * infos
@@ -2469,6 +2454,10 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_pathbtrfs_clear_space_info_full (fs_info);mutex_unlock (&fs_info->chunk_mutex); + +/* Add sysfs device entry */ +btrfs_sysfs_add_device_link (fs_devices, device); +mutex_unlock (&fs_devices->device_list_mutex);if (seeding_dev) {
fs/cifs/cifs_unicode.c +7 -1
@@ -501,7 +501,13 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen,else if (map_chars ==SFM_MAP_UNI_RSVD ) {bool end_of_string; -if (i == srclen -1 ) +/** +* Remap spaces and periods found at the end of every +* component of the path. The special cases of '.' and +* '..' do not need to be dealt with explicitly because +* they are addressed in namei.c:link_path_walk(). +**/ +if ((i == srclen -1 ) || (source[i+1 ] =='\\' )) end_of_string = true;else end_of_string = false;
fs/ext4/inline.c +1 -0
@@ -1921,6 +1921,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline)ext4_write_lock_xattr (inode, &no_expand);if (!ext4_has_inline_data (inode)) { +ext4_write_unlock_xattr (inode, &no_expand); *has_inline =0 ;ext4_journal_stop (handle);return 0 ;
fs/ext4/super.c +2 -2
@@ -1748,8 +1748,8 @@ static const struct mount_opts { {Opt_noquota, (EXT4_MOUNT_QUOTA |EXT4_MOUNT_USRQUOTA |EXT4_MOUNT_GRPQUOTA |EXT4_MOUNT_PRJQUOTA ), MOPT_CLEAR | MOPT_Q}, - {Opt_usrjquota, 0, MOPT_Q}, - {Opt_grpjquota, 0, MOPT_Q}, + {Opt_usrjquota, 0, MOPT_Q | MOPT_STRING}, + {Opt_grpjquota, 0, MOPT_Q | MOPT_STRING}, {Opt_offusrjquota, 0, MOPT_Q}, {Opt_offgrpjquota, 0, MOPT_Q}, {Opt_jqfmt_vfsold, QFMT_VFS_OLD, MOPT_QFMT},
fs/gfs2/rgrp.c +4 -1
@@ -739,9 +739,9 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) }gfs2_free_clones (rgd); +return_all_reservations (rgd);kfree (rgd->rd_bits); rgd->rd_bits =NULL ; -return_all_reservations (rgd);kmem_cache_free (gfs2_rgrpd_cachep, rgd); } }
@@ -1387,6 +1387,9 @@ int gfs2_fitrim(struct file *filp, void __user *argp)if (!capable (CAP_SYS_ADMIN ))return -EPERM ; +if (!test_bit (SDF_JOURNAL_LIVE , &sdp->sd_flags)) +return -EROFS ; +if (!blk_queue_discard (q))return -EOPNOTSUPP ;
fs/gfs2/super.c +1 -0
@@ -934,6 +934,7 @@ static void gfs2_put_super(struct super_block *sb)gfs2_jindex_free (sdp);/* Take apart glock structures and buffer lists */ gfs2_gl_hash_clear (sdp); +truncate_inode_pages_final (&sdp->sd_aspace);gfs2_delete_debugfs_file (sdp);/* Unmount the locking protocol */ gfs2_lm_unmount (sdp);
fs/ocfs2/super.c +1 -0
@@ -1747,6 +1747,7 @@ static void ocfs2_inode_init_once(void *data) oi->ip_blkno =0ULL ; oi->ip_clusters =0 ; + oi->ip_next_orphan =NULL ;ocfs2_resv_init_once (&oi->ip_la_data_resv);
fs/xfs/libxfs/xfs_alloc.c +1 -0
@@ -2213,6 +2213,7 @@ xfs_defer_agfl_block( new->xefi_startblock =XFS_AGB_TO_FSB (mp, agno, agbno); new->xefi_blockcount =1 ; new->xefi_oinfo = *oinfo; + new->xefi_skip_discard = false;trace_xfs_agfl_free_defer (mp, agno,0 , agbno,1 );
fs/xfs/libxfs/xfs_bmap.h +1 -1
@@ -52,9 +52,9 @@ struct xfs_extent_free_item {xfs_fsblock_t xefi_startblock;/* starting fs block number */ xfs_extlen_t xefi_blockcount;/* number of blocks in extent */ +bool xefi_skip_discard;struct list_head xefi_list;struct xfs_owner_info xefi_oinfo;/* extent owner */ -bool xefi_skip_discard; };#define XFS_BMAP_MAX_NMAP 4
fs/xfs/libxfs/xfs_rmap.c +1 -1
@@ -1387,7 +1387,7 @@ xfs_rmap_convert_shared(* record for our insertion point. This will also give us the record for * start block contiguity tests. */ - error =xfs_rmap_lookup_le_range (cur, bno, owner, offset, flags, + error =xfs_rmap_lookup_le_range (cur, bno, owner, offset, oldext, &PREV , &i);if (error) goto done;
fs/xfs/libxfs/xfs_rmap_btree.c +8 -8
@@ -247,8 +247,8 @@ xfs_rmapbt_key_diff(else if (y > x)return -1 ; - x =XFS_RMAP_OFF (be64_to_cpu (kp->rm_offset)); - y = rec->rm_offset; + x =be64_to_cpu (kp->rm_offset); + y =xfs_rmap_irec_offset_pack (rec);if (x > y)return 1 ;else if (y > x)
@@ -279,8 +279,8 @@ xfs_rmapbt_diff_two_keys(else if (y > x)return -1 ; - x =XFS_RMAP_OFF (be64_to_cpu (kp1->rm_offset)); - y =XFS_RMAP_OFF (be64_to_cpu (kp2->rm_offset)); + x =be64_to_cpu (kp1->rm_offset); + y =be64_to_cpu (kp2->rm_offset);if (x > y)return 1 ;else if (y > x)
@@ -393,8 +393,8 @@ xfs_rmapbt_keys_inorder(return 1 ; else if (a > b) return 0; - a =XFS_RMAP_OFF (be64_to_cpu (k1->rmap.rm_offset)); - b =XFS_RMAP_OFF (be64_to_cpu (k2->rmap.rm_offset)); + a =be64_to_cpu (k1->rmap.rm_offset); + b =be64_to_cpu (k2->rmap.rm_offset);if (a <= b)return 1 ;return 0 ;
@@ -423,8 +423,8 @@ xfs_rmapbt_recs_inorder(return 1 ; else if (a > b) return 0; - a =XFS_RMAP_OFF (be64_to_cpu (r1->rmap.rm_offset)); - b =XFS_RMAP_OFF (be64_to_cpu (r2->rmap.rm_offset)); + a =be64_to_cpu (r1->rmap.rm_offset); + b =be64_to_cpu (r2->rmap.rm_offset);if (a <= b)return 1 ;return 0 ;
fs/xfs/scrub/bmap.c +2 -0
@@ -120,6 +120,8 @@ xchk_bmap_get_rmap(if (info->whichfork ==XFS_ATTR_FORK ) rflags |=XFS_RMAP_ATTR_FORK ; +if (irec->br_state ==XFS_EXT_UNWRITTEN ) + rflags |=XFS_RMAP_UNWRITTEN ;/* * CoW staging extents are owned (on disk) by the refcountbt, so
fs/xfs/scrub/inode.c +1 -2
@@ -131,8 +131,7 @@ xchk_inode_flags( goto bad;/* rt flags require rt device */ -if ((flags & (XFS_DIFLAG_REALTIME |XFS_DIFLAG_RTINHERIT )) && - !mp->m_rtdev_targp) +if ((flags &XFS_DIFLAG_REALTIME ) && !mp->m_rtdev_targp) goto bad;/* new rt bitmap flag only valid for rbmino */
fs/xfs/scrub/refcount.c +3 -5
@@ -180,7 +180,6 @@ xchk_refcountbt_process_rmap_fragments(*/ INIT_LIST_HEAD (&worklist); rbno =NULLAGBLOCK ; - nr =1 ;/* Make sure the fragments actually /are/ in agbno order. */ bno =0 ;
@@ -194,15 +193,14 @@ xchk_refcountbt_process_rmap_fragments(* Find all the rmaps that start at or before the refc extent, * and put them on the worklist. */ + nr =0 ;list_for_each_entry_safe (frag, n, &refchk->fragments, list) { -if (frag->rm.rm_startblock > refchk->bno) - goto done; +if (frag->rm.rm_startblock > refchk->bno || nr > target_nr) +break ; bno = frag->rm.rm_startblock + frag->rm.rm_blockcount;if (bno < rbno) rbno = bno;list_move_tail (&frag->list, &worklist); -if (nr == target_nr) -break ; nr++; }
fs/xfs/xfs_iops.c +10 -0
@@ -895,6 +895,16 @@ xfs_setattr_size( error =iomap_zero_range (inode, oldsize, newsize - oldsize, &did_zeroing, &xfs_iomap_ops); }else { +/* +* iomap won't detect a dirty page over an unwritten block (or a +* cow block over a hole) and subsequently skips zeroing the +* newly post-EOF portion of the page. Flush the new EOF to +* convert the block before the pagecache truncate. +*/ + error =filemap_write_and_wait_range (inode->i_mapping, newsize, + newsize); +if (error) +return error; error =iomap_truncate_page (inode, newsize, &did_zeroing, &xfs_iomap_ops); }
fs/xfs/xfs_pnfs.c +1 -1
@@ -141,7 +141,7 @@ xfs_fs_map_blocks( goto out_unlock; error =invalidate_inode_pages2 (inode->i_mapping);if (WARN_ON_ONCE (error)) -return error; + goto out_unlock; end_fsb =XFS_B_TO_FSB (mp, (xfs_ufsize_t )offset + length); offset_fsb =XFS_B_TO_FSBT (mp, offset);
include/linux/can/skb.h +8 -12
@@ -61,21 +61,17 @@ static inline void can_skb_set_owner(struct sk_buff *skb, struct sock *sk)*/ static inline struct sk_buff *can_create_echo_skb (struct sk_buff *skb) { -if (skb_shared (skb)) { -struct sk_buff *nskb =skb_clone (skb,GFP_ATOMIC ); +struct sk_buff *nskb; -if (likely (nskb)) { -can_skb_set_owner (nskb, skb->sk); -consume_skb (skb); -return nskb; - }else { -kfree_skb (skb); -return NULL ; - } + nskb =skb_clone (skb,GFP_ATOMIC ); +if (unlikely (!nskb)) { +kfree_skb (skb); +return NULL ; } -/* we can assume to have an unshared skb with proper owner */ -return skb; +can_skb_set_owner (nskb, skb->sk); +consume_skb (skb); +return nskb; }#endif /* !_CAN_SKB_H */
include/linux/netfilter_ipv4.h +1 -1
@@ -16,7 +16,7 @@ struct ip_rt_info {u_int32_t mark; }; -int ip_route_me_harder (struct net *net,struct sk_buff *skb,unsigned addr_type); +int ip_route_me_harder (struct net *net,struct sock *sk,struct sk_buff *skb,unsigned addr_type);struct nf_queue_entry ;
include/linux/netfilter_ipv6.h +1 -1
@@ -36,7 +36,7 @@ struct nf_ipv6_ops { };#ifdef CONFIG_NETFILTER -int ip6_route_me_harder (struct net *net,struct sk_buff *skb); +int ip6_route_me_harder (struct net *net,struct sock *sk,struct sk_buff *skb);__sum16 nf_ip6_checksum (struct sk_buff *skb,unsigned int hook,unsigned int dataoff,u_int8_t protocol);
include/linux/prandom.h +34 -2
@@ -16,12 +16,44 @@ void prandom_bytes(void *buf, size_t nbytes);void prandom_seed (u32 seed);void prandom_reseed_late (void ); +#if BITS_PER_LONG ==64 +/* +* The core SipHash round function. Each line can be executed in +* parallel given enough CPU resources. +*/ +#define PRND_SIPROUND (v0, v1, v2, v3) ( \ + v0 += v1, v1 = rol64(v1, 13), v2 += v3, v3 = rol64(v3, 16), \ + v1 ^= v0, v0 = rol64(v0, 32), v3 ^= v2, \ + v0 += v3, v3 = rol64(v3, 21), v2 += v1, v1 = rol64(v1, 17), \ + v3 ^= v0, v1 ^= v2, v2 = rol64(v2, 32) \ +) + +#define PRND_K0 (0x736f6d6570736575 ^ 0x6c7967656e657261) +#define PRND_K1 (0x646f72616e646f6d ^ 0x7465646279746573) + +#elif BITS_PER_LONG ==32 +/* +* On 32-bit machines, we use HSipHash, a reduced-width version of SipHash. +* This is weaker, but 32-bit machines are not used for high-traffic +* applications, so there is less output for an attacker to analyze. +*/ +#define PRND_SIPROUND (v0, v1, v2, v3) ( \ + v0 += v1, v1 = rol32(v1, 5), v2 += v3, v3 = rol32(v3, 8), \ + v1 ^= v0, v0 = rol32(v0, 16), v3 ^= v2, \ + v0 += v3, v3 = rol32(v3, 7), v2 += v1, v1 = rol32(v1, 13), \ + v3 ^= v0, v1 ^= v2, v2 = rol32(v2, 16) \ +) +#define PRND_K0 0x6c796765 +#define PRND_K1 0x74656462 + +#else +#error Unsupported BITS_PER_LONG +#endif +struct rnd_state {__u32 s1, s2, s3, s4; }; -DECLARE_PER_CPU(struct rnd_state, net_rand_state); -u32 prandom_u32_state (struct rnd_state *state);void prandom_bytes_state (struct rnd_state *state,void *buf,size_t nbytes);void prandom_seed_full_state (struct rnd_state __percpu *pcpu_state);
include/linux/time64.h +4 -0
@@ -138,6 +138,10 @@ static inline bool timespec64_valid_settod(const struct timespec64 *ts)*/ static inline s64 timespec64_to_ns (const struct timespec64 *ts) { +/* Prevent multiplication overflow */ +if ((unsigned long long )ts->tv_sec >=KTIME_SEC_MAX ) +return KTIME_MAX ; +return ((s64 ) ts->tv_sec *NSEC_PER_SEC ) + ts->tv_nsec; }
kernel/dma/swiotlb.c +5 -1
@@ -239,6 +239,7 @@ int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;if (verbose)swiotlb_print_info ();
@@ -270,9 +271,11 @@ swiotlb_init(int verbose)if (vstart && !swiotlb_init_with_tbl (vstart, io_tlb_nslabs, verbose))return ; -if (io_tlb_start) +if (io_tlb_start) {memblock_free_early (io_tlb_start,PAGE_ALIGN (io_tlb_nslabs <<IO_TLB_SHIFT )); + io_tlb_start =0 ; + }pr_warn ("Cannot allocate buffer" ); no_iotlb_memory = true; }
@@ -376,6 +379,7 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs) io_tlb_orig_addr[i] =INVALID_PHYS_ADDR ; } io_tlb_index =0 ; + no_iotlb_memory = false;swiotlb_print_info ();
kernel/events/core.c +4 -3
@@ -5475,11 +5475,11 @@ static void perf_pmu_output_stop(struct perf_event *event);static void perf_mmap_close (struct vm_area_struct *vma) {struct perf_event *event = vma->vm_file->private_data; -struct ring_buffer *rb =ring_buffer_get (event);struct user_struct *mmap_user = rb->mmap_user;int mmap_locked = rb->mmap_locked;unsigned long size =perf_data_size (rb); +bool detach_rest = false;if (event->pmu->event_unmapped) event->pmu->event_unmapped (event, vma->vm_mm);
@@ -5510,7 +5510,8 @@ static void perf_mmap_close(struct vm_area_struct *vma)mutex_unlock (&event->mmap_mutex); } -atomic_dec (&rb->mmap_count); +if (atomic_dec_and_test (&rb->mmap_count)) + detach_rest = true;if (!atomic_dec_and_mutex_lock (&event->mmap_count, &event->mmap_mutex)) goto out_put;
@@ -5519,7 +5520,7 @@ static void perf_mmap_close(struct vm_area_struct *vma)mutex_unlock (&event->mmap_mutex);/* If there's still other mmap()s of this buffer, we're done. */ -if (atomic_read (&rb->mmap_count)) +if (!detach_rest) goto out_put;/*
kernel/events/internal.h +1 -1
@@ -209,7 +209,7 @@ static inline int get_recursion_context(int *recursion) rctx =3 ; else if (in_irq()) rctx =2 ; - else if (in_softirq()) + else if (in_serving_softirq()) rctx =1 ; else rctx =0 ;
kernel/exit.c +4 -1
@@ -517,7 +517,10 @@ static void exit_mm(void)up_read (&mm->mmap_sem); self.task = current; - self.next =xchg (&core_state->dumper.next, &self); +if (self.task->flags &PF_SIGNALED ) + self.next =xchg (&core_state->dumper.next, &self); +else + self.task =NULL ;/* * Implies mb(), the result of xchg() must be visible * to core_state->dumper.
kernel/futex.c +3 -2
@@ -856,8 +856,9 @@ static void put_pi_state(struct futex_pi_state *pi_state)*/ if (pi_state->owner) {struct task_struct *owner; +unsigned long flags; -raw_spin_lock_irq (&pi_state->pi_mutex.wait_lock); +raw_spin_lock_irqsave (&pi_state->pi_mutex.wait_lock, flags); owner = pi_state->owner;if (owner) {raw_spin_lock (&owner->pi_lock);
@@ -865,7 +866,7 @@ static void put_pi_state(struct futex_pi_state *pi_state)raw_spin_unlock (&owner->pi_lock); }rt_mutex_proxy_unlock (&pi_state->pi_mutex, owner); -raw_spin_unlock_irq (&pi_state->pi_mutex.wait_lock); +raw_spin_unlock_irqrestore (&pi_state->pi_mutex.wait_lock, flags); }if (current->pi_state_cache) {
kernel/irq/Kconfig +1 -0
@@ -80,6 +80,7 @@ config IRQ_FASTEOI_HIERARCHY_HANDLERS # Generic IRQ IPI support config GENERIC_IRQ_IPI bool + select IRQ_DOMAIN_HIERARCHY # Generic MSI interrupt support config GENERIC_MSI_IRQ
kernel/reboot.c +14 -14
@@ -539,22 +539,22 @@ static int __init reboot_setup(char *str)break ;case 's' : - { -int rc; - -if (isdigit (*(str+1 ))) { - rc =kstrtoint (str+1 ,0 , &reboot_cpu); -if (rc) -return rc; - }else if (str[1 ] =='m' && str[2 ] =='p' && -isdigit (*(str+3 ))) { - rc =kstrtoint (str+3 ,0 , &reboot_cpu); -if (rc) -return rc; - }else +if (isdigit (*(str+1 ))) + reboot_cpu =simple_strtoul (str+1 ,NULL ,0 ); +else if (str[1 ] =='m' && str[2 ] =='p' && +isdigit (*(str+3 ))) + reboot_cpu =simple_strtoul (str+3 ,NULL ,0 ); +else reboot_mode =REBOOT_SOFT ; +if (reboot_cpu >=num_possible_cpus ()) { +pr_err ("Ignoring the CPU number in reboot= option. " +"CPU %d exceeds possible cpu number %d\n" , + reboot_cpu,num_possible_cpus ()); + reboot_cpu =0 ; +break ; + }break ; - } +case 'g' : reboot_mode =REBOOT_GPIO ;break ;
kernel/time/itimer.c +0 -4
@@ -154,10 +154,6 @@ static void set_cpu_itimer(struct task_struct *tsk, unsigned int clock_id,u64 oval, nval, ointerval, ninterval;struct cpu_itimer *it = &tsk->signal->it[clock_id]; -/* -* Use the to_ktime conversion because that clamps the maximum -* value to KTIME_MAX and avoid multiplication overflows. -*/ nval =ktime_to_ns (timeval_to_ktime (value->it_value)); ninterval =ktime_to_ns (timeval_to_ktime (value->it_interval));
kernel/time/tick-common.c +2 -0
@@ -15,6 +15,7 @@#include <linux/err.h> #include <linux/hrtimer.h> #include <linux/interrupt.h> +#include <linux/nmi.h> #include <linux/percpu.h> #include <linux/profile.h> #include <linux/sched.h>
@@ -520,6 +521,7 @@ void tick_unfreeze(void)trace_suspend_resume (TPS ("timekeeping_freeze" ),smp_processor_id (), false); }else { +touch_softlockup_watchdog ();tick_resume_local (); }
kernel/time/timer.c +0 -7
@@ -1655,13 +1655,6 @@ void update_process_times(int user_tick)scheduler_tick ();if (IS_ENABLED (CONFIG_POSIX_TIMERS ))run_posix_cpu_timers (p); - -/* The current CPU might make use of net randoms without receiving IRQs -* to renew them often enough. Let's update the net_rand_state from a -* non-constant value that's not affine to the number of calls to make -* sure it's updated when there's some activity (we don't care in idle). -*/ -this_cpu_add (net_rand_state.s1,rol32 (jiffies,24 ) + user_tick); }/**
lib/random32.c +283 -179
503 lines not on this page · raw message
net/ipv4/netfilter.c +7 -5
@@ -17,17 +17,19 @@#include <net/netfilter/nf_queue.h> /* route_me_harder function, used by iptable_nat, iptable_mangle + ip_queue */ -int ip_route_me_harder (struct net *net,struct sk_buff *skb,unsigned int addr_type) +int ip_route_me_harder (struct net *net,struct sock *sk,struct sk_buff *skb,unsigned int addr_type) {const struct iphdr *iph =ip_hdr (skb);struct rtable *rt;struct flowi4 fl4 = {};__be32 saddr = iph->saddr; -const struct sock *sk =skb_to_full_sk (skb); -__u8 flags = sk ?inet_sk_flowi_flags (sk) :0 ; +__u8 flags;struct net_device *dev =skb_dst (skb)->dev;unsigned int hh_len; + sk =sk_to_full_sk (sk); + flags = sk ?inet_sk_flowi_flags (sk) :0 ; +if (addr_type ==RTN_UNSPEC ) addr_type =inet_addr_type_dev_table (net, dev, saddr);if (addr_type ==RTN_LOCAL || addr_type ==RTN_UNICAST )
@@ -91,8 +93,8 @@ int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry) skb->mark == rt_info->mark && iph->daddr == rt_info->daddr && iph->saddr == rt_info->saddr)) -return ip_route_me_harder (entry->state.net, skb, -RTN_UNSPEC ); +return ip_route_me_harder (entry->state.net, entry->state.sk, + skb,RTN_UNSPEC ); }return 0 ; }
net/ipv4/netfilter/ipt_SYNPROXY.c +1 -1
@@ -54,7 +54,7 @@ synproxy_send_tcp(struct net *net,skb_dst_set_noref (nskb,skb_dst (skb)); nskb->protocol =htons (ETH_P_IP ); -if (ip_route_me_harder (net, nskb,RTN_UNSPEC )) +if (ip_route_me_harder (net, nskb->sk, nskb,RTN_UNSPEC )) goto free_nskb;if (nfct) {
net/ipv4/netfilter/iptable_mangle.c +1 -1
@@ -65,7 +65,7 @@ ipt_mangle_out(struct sk_buff *skb, const struct nf_hook_state *state) iph->daddr != daddr || skb->mark != mark || iph->tos != tos) { - err =ip_route_me_harder (state->net, skb,RTN_UNSPEC ); + err =ip_route_me_harder (state->net, state->sk, skb,RTN_UNSPEC );if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv4/netfilter/nf_nat_l3proto_ipv4.c +1 -1
@@ -329,7 +329,7 @@ nf_nat_ipv4_local_fn(void *priv, struct sk_buff *skb,if (ct->tuplehash[dir].tuple.dst.u3.ip != ct->tuplehash[!dir].tuple.src.u3.ip) { - err =ip_route_me_harder (state->net, skb,RTN_UNSPEC ); + err =ip_route_me_harder (state->net, state->sk, skb,RTN_UNSPEC );if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv4/netfilter/nf_reject_ipv4.c +1 -1
@@ -129,7 +129,7 @@ void nf_send_reset(struct net *net, struct sk_buff *oldskb, int hook) ip4_dst_hoplimit(skb_dst(nskb)));nf_reject_ip_tcphdr_put (nskb, oldskb, oth); -if (ip_route_me_harder (net, nskb,RTN_UNSPEC )) +if (ip_route_me_harder (net, nskb->sk, nskb,RTN_UNSPEC )) goto free_nskb; niph =ip_hdr (nskb);
net/ipv4/netfilter/nft_chain_route_ipv4.c +1 -1
@@ -50,7 +50,7 @@ static unsigned int nf_route_table_hook(void *priv, iph->daddr != daddr || skb->mark != mark || iph->tos != tos) { - err =ip_route_me_harder (state->net, skb,RTN_UNSPEC ); + err =ip_route_me_harder (state->net, state->sk, skb,RTN_UNSPEC );if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv4/syncookies.c +7 -2
@@ -296,7 +296,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)__u32 cookie =ntohl (th->ack_seq) -1 ;struct sock *ret = sk;struct request_sock *req; -int mss; +int full_space, mss;struct rtable *rt;__u8 rcv_wscale;struct flowi4 fl4;
@@ -391,8 +391,13 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)/* Try to redo what tcp_v4_send_synack did. */ req->rsk_window_clamp = tp->window_clamp ? :dst_metric (&rt->dst,RTAX_WINDOW ); +/* limit the window selection if the user enforce a smaller rx buffer */ + full_space =tcp_full_space (sk); +if (sk->sk_userlocks &SOCK_RCVBUF_LOCK && + (req->rsk_window_clamp > full_space || req->rsk_window_clamp ==0 )) + req->rsk_window_clamp = full_space; -tcp_select_initial_window (sk,tcp_full_space (sk), req->mss, +tcp_select_initial_window (sk, full_space, req->mss, &req->rsk_rcv_wnd, &req->rsk_window_clamp, ireq->wscale_ok, &rcv_wscale,dst_metric (&rt->dst,RTAX_INITRWND ));
net/ipv6/netfilter.c +3 -3
@@ -17,10 +17,10 @@#include <net/xfrm.h> #include <net/netfilter/nf_queue.h> -int ip6_route_me_harder (struct net *net,struct sk_buff *skb) +int ip6_route_me_harder (struct net *net,struct sock *sk_partial,struct sk_buff *skb) {const struct ipv6hdr *iph =ipv6_hdr (skb); -struct sock *sk =sk_to_full_sk (skb->sk); +struct sock *sk =sk_to_full_sk (sk_partial);unsigned int hh_len;struct dst_entry *dst; int strict = (ipv6_addr_type(&iph->daddr) &
@@ -81,7 +81,7 @@ static int nf_ip6_reroute(struct sk_buff *skb,if (!ipv6_addr_equal (&iph->daddr, &rt_info->daddr) || !ipv6_addr_equal (&iph->saddr, &rt_info->saddr) || skb->mark != rt_info->mark) -return ip6_route_me_harder (entry->state.net, skb); +return ip6_route_me_harder (entry->state.net, entry->state.sk, skb); }return 0 ; }
net/ipv6/netfilter/ip6table_mangle.c +1 -1
@@ -60,7 +60,7 @@ ip6t_mangle_out(struct sk_buff *skb, const struct nf_hook_state *state) skb->mark != mark || ipv6_hdr(skb)->hop_limit != hop_limit || flowlabel != *((u_int32_t *)ipv6_hdr(skb)))) { - err =ip6_route_me_harder (state->net, skb); + err =ip6_route_me_harder (state->net, state->sk, skb);if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv6/netfilter/nf_nat_l3proto_ipv6.c +1 -1
@@ -352,7 +352,7 @@ nf_nat_ipv6_local_fn(void *priv, struct sk_buff *skb,if (!nf_inet_addr_cmp (&ct->tuplehash[dir].tuple.dst.u3, &ct->tuplehash[!dir].tuple.src.u3)) { - err =ip6_route_me_harder (state->net, skb); + err =ip6_route_me_harder (state->net, state->sk, skb);if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv6/netfilter/nft_chain_route_ipv6.c +1 -1
@@ -52,7 +52,7 @@ static unsigned int nf_route_table_hook(void *priv, skb->mark != mark || ipv6_hdr(skb)->hop_limit != hop_limit || flowlabel != *((u_int32_t *)ipv6_hdr(skb)))) { - err =ip6_route_me_harder (state->net, skb); + err =ip6_route_me_harder (state->net, state->sk, skb);if (err <0 ) ret =NF_DROP_ERR (err); }
net/ipv6/sit.c +0 -2
@@ -1087,7 +1087,6 @@ static void ipip6_tunnel_bind_dev(struct net_device *dev)if (tdev && !netif_is_l3_master (tdev)) {int t_hlen = tunnel->hlen +sizeof (struct iphdr ); - dev->hard_header_len = tdev->hard_header_len +sizeof (struct iphdr ); dev->mtu = tdev->mtu - t_hlen;if (dev->mtu <IPV6_MIN_MTU ) dev->mtu =IPV6_MIN_MTU ;
@@ -1377,7 +1376,6 @@ static void ipip6_tunnel_setup(struct net_device *dev) dev->priv_destructor = ipip6_dev_free; dev->type =ARPHRD_SIT ; - dev->hard_header_len =LL_MAX_HEADER + t_hlen; dev->mtu =ETH_DATA_LEN - t_hlen; dev->min_mtu =IPV6_MIN_MTU ; dev->max_mtu =IP6_MAX_MTU - t_hlen;
net/ipv6/syncookies.c +8 -2
@@ -141,7 +141,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)__u32 cookie =ntohl (th->ack_seq) -1 ;struct sock *ret = sk;struct request_sock *req; -int mss; +int full_space, mss;struct dst_entry *dst;__u8 rcv_wscale;u32 tsoff =0 ;
@@ -246,7 +246,13 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) } req->rsk_window_clamp = tp->window_clamp ? :dst_metric (dst,RTAX_WINDOW ); -tcp_select_initial_window (sk,tcp_full_space (sk), req->mss, +/* limit the window selection if the user enforce a smaller rx buffer */ + full_space =tcp_full_space (sk); +if (sk->sk_userlocks &SOCK_RCVBUF_LOCK && + (req->rsk_window_clamp > full_space || req->rsk_window_clamp ==0 )) + req->rsk_window_clamp = full_space; + +tcp_select_initial_window (sk, full_space, req->mss, &req->rsk_rcv_wnd, &req->rsk_window_clamp, ireq->wscale_ok, &rcv_wscale,dst_metric (dst,RTAX_INITRWND ));
net/iucv/af_iucv.c +2 -1
@@ -1571,7 +1571,8 @@ static int iucv_sock_shutdown(struct socket *sock, int how)break ; } -if (how ==SEND_SHUTDOWN || how ==SHUTDOWN_MASK ) { +if ((how ==SEND_SHUTDOWN || how ==SHUTDOWN_MASK ) && + sk->sk_state ==IUCV_CONNECTED ) {if (iucv->transport ==AF_IUCV_TRANS_IUCV ) { txmsg.class =0 ; txmsg.tag =0 ;
net/mac80211/tx.c +24 -13
@@ -1908,19 +1908,24 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,/* device xmit handlers */ +enum ieee80211_encrypt { +ENCRYPT_NO , +ENCRYPT_MGMT , +ENCRYPT_DATA , +}; +static int ieee80211_skb_resize (struct ieee80211_sub_if_data *sdata,struct sk_buff *skb, -int head_need,bool may_encrypt) +int head_need, +enum ieee80211_encrypt encrypt) {struct ieee80211_local *local = sdata->local; -struct ieee80211_hdr *hdr;bool enc_tailroom;int tail_need =0 ; - hdr = (struct ieee80211_hdr *) skb->data; - enc_tailroom = may_encrypt && - (sdata->crypto_tx_tailroom_needed_cnt || -ieee80211_is_mgmt (hdr->frame_control)); + enc_tailroom = encrypt ==ENCRYPT_MGMT || + (encrypt ==ENCRYPT_DATA && + sdata->crypto_tx_tailroom_needed_cnt);if (enc_tailroom) { tail_need =IEEE80211_ENCRYPT_TAILROOM ;
@@ -1952,23 +1957,29 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, {struct ieee80211_local *local = sdata->local;struct ieee80211_tx_info *info =IEEE80211_SKB_CB (skb); -struct ieee80211_hdr *hdr; +struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;int headroom; -bool may_encrypt; +enum ieee80211_encrypt encrypt; - may_encrypt = !(info->flags &IEEE80211_TX_INTFL_DONT_ENCRYPT ); +if (info->flags &IEEE80211_TX_INTFL_DONT_ENCRYPT ) + encrypt =ENCRYPT_NO ; +else if (ieee80211_is_mgmt (hdr->frame_control)) + encrypt =ENCRYPT_MGMT ; +else + encrypt =ENCRYPT_DATA ; headroom = local->tx_headroom; -if (may_encrypt) +if (encrypt !=ENCRYPT_NO ) headroom += sdata->encrypt_headroom; headroom -=skb_headroom (skb); headroom =max_t (int,0 , headroom); -if (ieee80211_skb_resize (sdata, skb, headroom, may_encrypt)) { +if (ieee80211_skb_resize (sdata, skb, headroom, encrypt)) {ieee80211_free_txskb (&local->hw, skb);return ; } +/* reload after potential resize */ hdr = (struct ieee80211_hdr *) skb->data; info->control.vif = &sdata->vif;
@@ -2751,7 +2762,7 @@ static struct sk_buff *ieee80211_build_hdr(struct ieee80211_sub_if_data *sdata, head_need += sdata->encrypt_headroom; head_need += local->tx_headroom; head_need =max_t (int,0 , head_need); -if (ieee80211_skb_resize (sdata, skb, head_need, true)) { +if (ieee80211_skb_resize (sdata, skb, head_need,ENCRYPT_DATA )) {ieee80211_free_txskb (&local->hw, skb); skb =NULL ;return ERR_PTR (-ENOMEM );
@@ -3414,7 +3425,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,if (unlikely (ieee80211_skb_resize (sdata, skb,max_t (int, extra_head + hw_headroom -skb_headroom (skb),0 ), - false))) { +ENCRYPT_NO ))) {kfree_skb (skb);return true; }
net/netfilter/ipset/ip_set_core.c +2 -1
@@ -488,13 +488,14 @@ ip_set_match_extensions(struct ip_set *set, const struct ip_set_ext *ext,if (SET_WITH_COUNTER (set)) {struct ip_set_counter *counter =ext_counter (data, set); +ip_set_update_counter (counter, ext, flags); +if (flags &IPSET_FLAG_MATCH_COUNTERS && !(ip_set_match_counter (ip_set_get_packets (counter), mext->packets, mext->packets_op) &&ip_set_match_counter (ip_set_get_bytes (counter), mext->bytes, mext->bytes_op)))return false; -ip_set_update_counter (counter, ext, flags); }if (SET_WITH_SKBINFO (set)) ip_set_get_skbinfo(ext_skbinfo(data, set),
net/netfilter/ipvs/ip_vs_core.c +2 -2
@@ -725,12 +725,12 @@ static int ip_vs_route_me_harder(struct netns_ipvs *ipvs, int af,struct dst_entry *dst =skb_dst (skb);if (dst->dev && !(dst->dev->flags &IFF_LOOPBACK ) && -ip6_route_me_harder (ipvs->net, skb) !=0 ) +ip6_route_me_harder (ipvs->net, skb->sk, skb) !=0 )return 1 ; } else#endif if (!(skb_rtable (skb)->rt_flags &RTCF_LOCAL ) && -ip_route_me_harder (ipvs->net, skb,RTN_LOCAL ) !=0 ) +ip_route_me_harder (ipvs->net, skb->sk, skb,RTN_LOCAL ) !=0 )return 1 ;return 0 ;
net/sched/sch_generic.c +3 -0
@@ -1116,10 +1116,13 @@ static void dev_deactivate_queue(struct net_device *dev, void *_qdisc_default) {struct Qdisc *qdisc =rtnl_dereference (dev_queue->qdisc); +struct Qdisc *qdisc_default = _qdisc_default;if (qdisc) {if (!(qdisc->flags &TCQ_F_BUILTIN ))set_bit (__QDISC_STATE_DEACTIVATED, &qdisc->state); + +rcu_assign_pointer (dev_queue->qdisc, qdisc_default); } }
net/tipc/topsrv.c +8 -2
@@ -671,12 +671,18 @@ static int tipc_topsrv_start(struct net *net) ret =tipc_topsrv_work_start (srv);if (ret <0 ) -return ret; + goto err_start; ret =tipc_topsrv_create_listener (srv);if (ret <0 ) -tipc_topsrv_work_stop (srv); + goto err_create; +return 0 ; + +err_create: +tipc_topsrv_work_stop (srv); +err_start: +kfree (srv);return ret; }
net/wireless/reg.c +1 -1
@@ -3374,7 +3374,7 @@ static void print_rd_rules(const struct ieee80211_regdomain *rd) power_rule = ®_rule->power_rule;if (reg_rule->flags &NL80211_RRF_AUTO_BW ) -snprintf (bw,sizeof (bw),"%d KHz, %d KHz AUTO" , +snprintf (bw,sizeof (bw),"%d KHz, %u KHz AUTO" , freq_range->max_bandwidth_khz,reg_get_max_bandwidth (rd, reg_rule));else
net/x25/af_x25.c +1 -1
@@ -824,7 +824,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, sock->state =SS_CONNECTED ; rc =0 ; out_put_neigh: -if (rc) { +if (rc && x25->neighbour) {read_lock_bh (&x25_list_lock);x25_neigh_put (x25->neighbour); x25->neighbour =NULL ;
net/xfrm/xfrm_state.c +5 -3
@@ -1825,6 +1825,7 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high)int err = -ENOENT ;__be32 minspi =htonl (low);__be32 maxspi =htonl (high); +__be32 newspi =0 ;u32 mark = x->mark.v & x->mark.m;spin_lock_bh (&x->lock);
@@ -1843,21 +1844,22 @@ int xfrm_alloc_spi(struct xfrm_state *x, u32 low, u32 high)xfrm_state_put (x0); goto unlock; } - x->id.spi = minspi; + newspi = minspi; }else {u32 spi =0 ;for (h =0 ; h < high-low+1 ; h++) { spi = low +prandom_u32 ()%(high-low+1 ); x0 =xfrm_state_lookup (net, mark, &x->id.daddr,htonl (spi), x->id.proto, x->props.family);if (x0 ==NULL ) { - x->id.spi =htonl (spi); + newspi =htonl (spi);break ; }xfrm_state_put (x0); } } -if (x->id.spi) { +if (newspi) {spin_lock_bh (&net->xfrm.xfrm_state_lock); + x->id.spi = newspi; h =xfrm_spi_hash (net, &x->id.daddr, x->id.spi, x->id.proto, x->props.family);hlist_add_head_rcu (&x->byspi, net->xfrm.state_byspi + h);spin_unlock_bh (&net->xfrm.xfrm_state_lock);
security/selinux/ibpkey.c +3 -1
@@ -161,8 +161,10 @@ static int sel_ib_pkey_sid_slow(u64 subnet_prefix, u16 pkey_num, u32 *sid)* is valid, it just won't be added to the cache. */ new =kzalloc (sizeof (*new),GFP_ATOMIC ); -if (!new) +if (!new) { + ret = -ENOMEM ; goto out; + } new->psec.subnet_prefix = subnet_prefix; new->psec.pkey = pkey_num;
sound/hda/ext/hdac_ext_controller.c +2 -0
@@ -156,6 +156,8 @@ struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus,return NULL ;
Lines of this file are not shown. View the raw message.
tools/perf/util/scripting-engines/trace-event-python.c +2 -5
Lines of this file are not shown. View the raw message.
tools/testing/selftests/proc/proc-loadavg-001.c +0 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/proc/proc-self-syscall.c +0 -1
Lines of this file are not shown. View the raw message.
tools/testing/selftests/proc/proc-uptime-002.c +0 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.