Linux 4.14.87
Greg KH
maintainerI'm announcing the release of the 4.14.87 kernel.
All users of the 4.14 kernel series must upgrade.
The updated 4.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.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
------------
Makefile | 5 arch/arc/Kconfig | 2 arch/arc/Makefile | 2 arch/arc/configs/axs101_defconfig | 2 arch/arc/configs/axs103_defconfig | 1 arch/arc/configs/axs103_smp_defconfig | 1 arch/arc/configs/hsdk_defconfig | 1 arch/arc/configs/nps_defconfig | 2 arch/arc/configs/nsim_700_defconfig | 1 arch/arc/configs/nsimosci_defconfig | 2 arch/arc/configs/nsimosci_hs_defconfig | 1 arch/arc/configs/nsimosci_hs_smp_defconfig | 1 arch/arc/configs/tb10x_defconfig | 1 arch/arc/configs/vdk_hs38_defconfig | 1 arch/arc/configs/vdk_hs38_smp_defconfig | 1 arch/mips/include/asm/syscall.h | 2 arch/mips/ralink/mt7620.c | 2 arch/x86/kvm/svm.c | 19 - drivers/gpu/drm/ast/ast_main.c | 3 drivers/gpu/drm/drm_auth.c | 2 drivers/gpu/drm/gma500/mdfld_intel_display.c | 2 drivers/gpu/drm/meson/meson_dw_hdmi.c | 1 drivers/gpu/drm/meson/meson_viu.c | 12 - drivers/gpu/drm/msm/adreno/adreno_device.c | 5 drivers/infiniband/hw/mlx5/main.c | 29 -- drivers/infiniband/ulp/iser/iser_verbs.c | 7 drivers/input/joystick/xpad.c | 16 - drivers/input/keyboard/cros_ec_keyb.c | 3 drivers/input/keyboard/matrix_keypad.c | 23 + drivers/input/mouse/elan_i2c_core.c | 3 drivers/input/mouse/synaptics.c | 1 drivers/net/ethernet/qlogic/qed/qed_debug.c | 6 drivers/reset/core.c | 9 drivers/scsi/bfa/bfa_fcbuild.c | 8 drivers/scsi/bfa/bfa_fcs.c | 78 +++--- drivers/scsi/bfa/bfa_fcs_lport.c | 62 ++--- drivers/scsi/bfa/bfa_ioc.c | 2 drivers/scsi/bfa/bfa_svc.c | 4 drivers/scsi/bfa/bfad.c | 20 - drivers/scsi/bfa/bfad_attr.c | 2 drivers/scsi/bfa/bfad_bsg.c | 6 drivers/scsi/scsi_devinfo.c | 22 - drivers/staging/rts5208/sd.c | 6 drivers/thermal/hisi_thermal.c | 318 ++++++++++++++------------- drivers/tty/serial/kgdboc.c | 43 +-- fs/btrfs/disk-io.c | 10 fs/btrfs/tree-checker.c | 8 fs/kernfs/symlink.c | 2 fs/udf/super.c | 16 - fs/udf/unicode.c | 14 - fs/userfaultfd.c | 15 + include/linux/reset.h | 34 +- kernel/debug/kdb/kdb_support.c | 4 kernel/events/uprobes.c | 12 - lib/kobject.c | 2 lib/test_hexdump.c | 2 mm/hugetlb.c | 2 mm/shmem.c | 31 ++ mm/truncate.c | 8 mm/userfaultfd.c | 62 +++-- mm/vmstat.c | 4 net/ipv4/ip_tunnel.c | 4 net/tipc/subscr.c | 2 scripts/Makefile.extrawarn | 3 scripts/unifdef.c | 4 sound/pci/trident/trident.c | 2 sound/x86/intel_hdmi_audio.c | 2 67 files changed, 537 insertions(+), 446 deletions(-)
Adam Wong (1):
Input: elan_i2c - add support for ELAN0621 touchpad
Alexey Brodkin (1):
arc: [devboards] Add support of NFSv3 ACL
Andrea Arcangeli (5):
userfaultfd: use ENOENT instead of EFAULT if the atomic copy user fails
userfaultfd: shmem: allocate anonymous memory for MAP_PRIVATE shmem
userfaultfd: shmem: add i_size checks
userfaultfd: shmem: UFFDIO_COPY: set the page dirty if VM_WRITE is not set
userfaultfd: shmem/hugetlbfs: only allow to register VM_MAYWRITE vmas
Andrea Parri (1):
uprobes: Fix handle_swbp() vs. unregister() + register() race once more
Arnd Bergmann (5):
drm: gma500: fix logic error
scsi: bfa: convert to strlcpy/strlcat
staging: rts5208: fix gcc-8 logic error warning
kdb: use memmove instead of overlapping memcpy
net: qed: use correct strncpy() size
Brian Norris (1):
Input: cros_ec_keyb - fix button/switch capability reports
Cameron Gutman (1):
Input: xpad - quirk all PDP Xbox One gamepads
Christian Hoff (1):
Input: matrix_keypad - check for errors from of_get_named_gpio()
Daniel Lezcano (5):
thermal/drivers/hisi: Remove the multiple sensors support thermal/drivers/hisi: Remove pointless lock thermal/drivers/hisi: Encapsulate register writes into helpers thermal/drivers/hisi: Fix configuration register setting thermal/drivers/hisi: Remove costly sensor inspection
Dmitry V. Levin (1):
mips: fix mips_get_syscall_arg o32 check
Greg Kroah-Hartman (1):
Linux 4.14.87
Guenter Roeck (2):
kobject: Replace strncpy with memcpy
kernfs: Replace strncpy with memcpy
Guoqing Jiang (1):
tipc: use destination length for copy string
Jan Kara (1):
udf: Allow mounting volumes with incorrect identification strings
Johan Hovold (1):
drm/msm: fix OF child-node lookup
Kevin Hilman (1):
ARC: change defconfig defaults to ARCv2
Laura Abbott (2):
kgdboc: Fix restrict error
kgdboc: Fix warning with module build
Linus Torvalds (2):
test_hexdump: use memcpy instead of strncpy
unifdef: use memcpy instead of strncpy
Lyude Paul (3):
drm/meson: Enable fast_io in meson_dw_hdmi_regmap_config drm/meson: Fix OOB memory accesses in meson_viu_set_osd_lut()
Input: synaptics - add PNP ID for ThinkPad P50 to SMBus
Martin Wilck (1):
scsi: scsi_devinfo: cleanly zero-pad devinfo strings
Masahiro Yamada (2):
reset: make device_reset_optional() really optional
reset: remove remaining WARN_ON() in <linux/reset.h>
Mathias Kresin (1):
MIPS: ralink: Fix mt7620 nd_sd pinmux
Michael Guralnik (1):
IB/mlx5: Avoid load failure due to unknown link width
Nikolay Borisov (1):
btrfs: Always try all copies when reading extent buffers
Noah Westervelt (1):
Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15ARR
Patrick Gaskin (1):
Input: elan_i2c - add ELAN0620 to the ACPI table
Pavel Tikhomirov (1):
mm: cleancache: fix corruption on missed inode invalidation
Qu Wenruo (1):
btrfs: tree-checker: Don't check max block group size as current max chunk size limit is unreliable
Roman Gushchin (1):
mm: hide incomplete nr_indirectly_reclaimable in /proc/zoneinfo
Sagi Grimberg (1):
iser: set sector for ambiguous mr status errors
Sam Bobroff (1):
drm/ast: Fix incorrect free on ioregs
Sergio Correia (1):
drm: set is_master to 0 upon drm_new_set_master() failure
Stephen Rothwell (1):
disable stringop truncation warnings for now
Sultan Alsawaf (1):
ip_tunnel: Fix name string concatenate in __ip_tunnel_create()
Takashi Iwai (2):
ALSA: intel_hdmi: Use strlcpy() instead of strncpy()
ALSA: trident: Suppress gcc string warning
Wei Wang (1):
svm: Add mutex_lock to protect apic_access_page_done on AMD systems
Xiongfeng Wang (1):
Kbuild: suppress packed-not-aligned warning for default setting only
Greg KH
maintainerMakefile +4 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 86 +SUBLEVEL = 87 EXTRAVERSION = NAME = Petit Gorille
@@ -803,6 +803,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign) +# disable stringop warnings in gcc 8+ +KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
arch/arc/Kconfig +1 -1
@@ -109,7 +109,7 @@ endmenu choice prompt "ARC Instruction Set" - default ISA_ARCOMPACT + default ISA_ARCV2 config ISA_ARCOMPACT bool "ARCompact ISA"
arch/arc/Makefile +1 -1
@@ -6,7 +6,7 @@ # published by the Free Software Foundation. # -KBUILD_DEFCONFIG := nsim_700_defconfig +KBUILD_DEFCONFIG := nsim_hs_defconfig cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
arch/arc/configs/axs101_defconfig +2 -0
@@ -15,6 +15,7 @@ CONFIG_PERF_EVENTS=y # CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y CONFIG_MODULE_UNLOAD=y
@@ -98,6 +99,7 @@ CONFIG_VFAT_FS=y CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/axs103_defconfig +1 -0
@@ -97,6 +97,7 @@ CONFIG_VFAT_FS=y CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/axs103_smp_defconfig +1 -0
@@ -100,6 +100,7 @@ CONFIG_VFAT_FS=y CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/hsdk_defconfig +1 -0
@@ -66,6 +66,7 @@ CONFIG_EXT3_FS=y CONFIG_VFAT_FS=y CONFIG_TMPFS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/nps_defconfig +2 -0
@@ -15,6 +15,7 @@ CONFIG_SYSCTL_SYSCALL=y CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y
@@ -74,6 +75,7 @@ CONFIG_PROC_KCORE=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_ROOT_NFS=y CONFIG_DEBUG_INFO=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/nsim_700_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_LBDAF is not set
arch/arc/configs/nsimosci_defconfig +2 -0
@@ -16,6 +16,7 @@ CONFIG_EMBEDDED=y CONFIG_PERF_EVENTS=y # CONFIG_SLUB_DEBUG is not set # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_KPROBES=y CONFIG_MODULES=y # CONFIG_LBDAF is not set
@@ -69,5 +70,6 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set
arch/arc/configs/nsimosci_hs_defconfig +1 -0
@@ -68,5 +68,6 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set
arch/arc/configs/nsimosci_hs_smp_defconfig +1 -0
@@ -79,6 +79,7 @@ CONFIG_EXT2_FS_XATTR=y CONFIG_TMPFS=y # CONFIG_MISC_FILESYSTEMS is not set CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y # CONFIG_ENABLE_WARN_DEPRECATED is not set # CONFIG_ENABLE_MUST_CHECK is not set CONFIG_FTRACE=y
arch/arc/configs/tb10x_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_KALLSYMS_ALL=y # CONFIG_AIO is not set CONFIG_EMBEDDED=y # CONFIG_COMPAT_BRK is not set +CONFIG_ISA_ARCOMPACT=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_FORCE_LOAD=y
arch/arc/configs/vdk_hs38_defconfig +1 -0
@@ -88,6 +88,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/arc/configs/vdk_hs38_smp_defconfig +1 -0
@@ -92,6 +92,7 @@ CONFIG_NTFS_FS=y CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_NFS_FS=y +CONFIG_NFS_V3_ACL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y # CONFIG_ENABLE_WARN_DEPRECATED is not set
arch/mips/include/asm/syscall.h +1 -1
@@ -51,7 +51,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,#ifdef CONFIG_64BIT case 4 :case 5 :case 6 :case 7 :#ifdef CONFIG_MIPS32_O32 -if (test_thread_flag (TIF_32BIT_REGS )) +if (test_tsk_thread_flag (task,TIF_32BIT_REGS ))return get_user (*arg, (int *)usp + n); else#endif
arch/mips/ralink/mt7620.c +1 -1
@@ -84,7 +84,7 @@ static struct rt2880_pmx_func pcie_rst_grp[] = { };static struct rt2880_pmx_func nd_sd_grp[] = {FUNC ("nand" ,MT7620_GPIO_MODE_NAND ,45 ,15 ), -FUNC ("sd" ,MT7620_GPIO_MODE_SD ,45 ,15 ) +FUNC ("sd" ,MT7620_GPIO_MODE_SD ,47 ,13 ) };static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
arch/x86/kvm/svm.c +11 -8
@@ -1399,20 +1399,23 @@ static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu,static int avic_init_access_page (struct kvm_vcpu *vcpu) {struct kvm *kvm = vcpu->kvm; -int ret; +int ret =0 ; +mutex_lock (&kvm->slots_lock);if (kvm->arch.apic_access_page_done) -return 0 ; + goto out; - ret =x86_set_memory_region (kvm, -APIC_ACCESS_PAGE_PRIVATE_MEMSLOT , -APIC_DEFAULT_PHYS_BASE , -PAGE_SIZE ); + ret =__x86_set_memory_region (kvm, +APIC_ACCESS_PAGE_PRIVATE_MEMSLOT , +APIC_DEFAULT_PHYS_BASE , +PAGE_SIZE );if (ret) -return ret; + goto out; kvm->arch.apic_access_page_done = true; -return 0 ; +out: +mutex_unlock (&kvm->slots_lock); +return ret; }static int avic_init_backing_page (struct kvm_vcpu *vcpu)
drivers/gpu/drm/ast/ast_main.c +2 -1
@@ -583,7 +583,8 @@ void ast_driver_unload(struct drm_device *dev)drm_mode_config_cleanup (dev);ast_mm_fini (ast); -pci_iounmap (dev->pdev, ast->ioregs); +if (ast->ioregs != ast->regs +AST_IO_MM_OFFSET ) +pci_iounmap (dev->pdev, ast->ioregs);pci_iounmap (dev->pdev, ast->regs);kfree (ast); }
drivers/gpu/drm/drm_auth.c +2 -0
@@ -133,6 +133,7 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)lockdep_assert_held_once (&dev->master_mutex); +WARN_ON (fpriv->is_master); old_master = fpriv->master; fpriv->master =drm_master_create (dev);if (!fpriv->master) {
@@ -161,6 +162,7 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv)/* drop references and restore old master on failure */ drm_master_put (&fpriv->master); fpriv->master = old_master; + fpriv->is_master =0 ;return ret; }
drivers/gpu/drm/gma500/mdfld_intel_display.c +1 -1
@@ -99,7 +99,7 @@ void mdfldWaitForPipeEnable(struct drm_device *dev, int pipe)/* Wait for for the pipe enable to take effect. */ for (count =0 ; count <COUNT_MAX ; count++) { temp =REG_READ (map->conf); -if ((temp &PIPEACONF_PIPE_STATE ) ==1 ) +if (temp &PIPEACONF_PIPE_STATE )break ; } }
drivers/gpu/drm/meson/meson_dw_hdmi.c +1 -0
@@ -697,6 +697,7 @@ static const struct regmap_config meson_dw_hdmi_regmap_config = { .reg_read = meson_dw_hdmi_reg_read, .reg_write = meson_dw_hdmi_reg_write, .max_register = 0x10000, + .fast_io = true, };static bool meson_hdmi_connector_is_available (struct device *dev)
drivers/gpu/drm/meson/meson_viu.c +6 -6
@@ -184,18 +184,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel,if (lut_sel ==VIU_LUT_OSD_OETF ) {writel (0 , priv->io_base +_REG (addr_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_OETF_LUT_SIZE /2 ); i++)writel (r_map[i *2 ] | (r_map[i *2 +1 ] <<16 ), priv->io_base +_REG (data_port));writel (r_map[OSD_OETF_LUT_SIZE -1 ] | (g_map[0 ] <<16 ), priv->io_base +_REG (data_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_OETF_LUT_SIZE /2 ); i++)writel (g_map[i *2 +1 ] | (g_map[i *2 +2 ] <<16 ), priv->io_base +_REG (data_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_OETF_LUT_SIZE /2 ); i++)writel (b_map[i *2 ] | (b_map[i *2 +1 ] <<16 ), priv->io_base +_REG (data_port));
@@ -211,18 +211,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel, }else if (lut_sel ==VIU_LUT_OSD_EOTF ) {writel (0 , priv->io_base +_REG (addr_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_EOTF_LUT_SIZE /2 ); i++)writel (r_map[i *2 ] | (r_map[i *2 +1 ] <<16 ), priv->io_base +_REG (data_port));writel (r_map[OSD_EOTF_LUT_SIZE -1 ] | (g_map[0 ] <<16 ), priv->io_base +_REG (data_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_EOTF_LUT_SIZE /2 ); i++)writel (g_map[i *2 +1 ] | (g_map[i *2 +2 ] <<16 ), priv->io_base +_REG (data_port)); -for (i =0 ; i <20 ; i++) +for (i =0 ; i < (OSD_EOTF_LUT_SIZE /2 ); i++)writel (b_map[i *2 ] | (b_map[i *2 +1 ] <<16 ), priv->io_base +_REG (data_port));
drivers/gpu/drm/msm/adreno/adreno_device.c +3 -2
@@ -223,8 +223,7 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)struct device_node *child, *node;int ret; - node =of_find_compatible_node (dev->of_node,NULL , -"qcom,gpu-pwrlevels" ); + node =of_get_compatible_child (dev->of_node,"qcom,gpu-pwrlevels" );if (!node) {dev_err (dev,"Could not find the GPU powerlevels\n" );return -ENXIO ;
@@ -245,6 +244,8 @@ static int adreno_get_legacy_pwrlevels(struct device *dev)dev_pm_opp_add (dev, val,0 ); } +of_node_put (node); +return 0 ; }
drivers/infiniband/hw/mlx5/main.c +11 -18
@@ -869,31 +869,26 @@ enum mlx5_ib_width { MLX5_IB_WIDTH_12X = 1 << 4 }; -static int translate_active_width (struct ib_device *ibdev,u8 active_width, +static void translate_active_width (struct ib_device *ibdev,u8 active_width,u8 *ib_width) {struct mlx5_ib_dev *dev =to_mdev (ibdev); -int err =0 ; -if (active_width &MLX5_IB_WIDTH_1X ) { +if (active_width &MLX5_IB_WIDTH_1X ) *ib_width =IB_WIDTH_1X ; - }else if (active_width &MLX5_IB_WIDTH_2X ) { -mlx5_ib_dbg (dev,"active_width %d is not supported by IB spec\n" , - (int )active_width); - err = -EINVAL ; - }else if (active_width &MLX5_IB_WIDTH_4X ) { +else if (active_width &MLX5_IB_WIDTH_4X ) *ib_width =IB_WIDTH_4X ; - }else if (active_width &MLX5_IB_WIDTH_8X ) { +else if (active_width &MLX5_IB_WIDTH_8X ) *ib_width =IB_WIDTH_8X ; - }else if (active_width &MLX5_IB_WIDTH_12X ) { +else if (active_width &MLX5_IB_WIDTH_12X ) *ib_width =IB_WIDTH_12X ; - }else { -mlx5_ib_dbg (dev,"Invalid active_width %d\n" , +else { +mlx5_ib_dbg (dev,"Invalid active_width %d, setting width to default value: 4x\n" , (int )active_width); - err = -EINVAL ; + *ib_width =IB_WIDTH_4X ; } -return err; +return ; }static int mlx5_mtu_to_ib_mtu (int mtu)
@@ -1001,10 +996,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,if (err) goto out; - err =translate_active_width (ibdev, ib_link_width_oper, - &props->active_width); -if (err) - goto out; +translate_active_width (ibdev, ib_link_width_oper, &props->active_width); + err =mlx5_query_port_ib_proto_oper (mdev, &props->active_speed, port);if (err) goto out;
drivers/infiniband/ulp/iser/iser_verbs.c +3 -4
@@ -1108,7 +1108,9 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, IB_MR_CHECK_SIG_STATUS, &mr_status);if (ret) {pr_err ("ib_check_mr_status failed, ret %d\n" , ret); - goto err; +/* Not a lot we can do, return ambiguous guard error */ + *sector =0 ; +return 0x1 ; }if (mr_status.fail_status &IB_MR_CHECK_SIG_STATUS ) {
@@ -1136,9 +1138,6 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, }return 0 ; -err: -/* Not alot we can do here, return ambiguous guard error */ -return 0x1 ; }void iser_err_comp (struct ib_wc *wc,const char *type)
drivers/input/joystick/xpad.c +6 -10
@@ -483,18 +483,18 @@ static const u8 xboxone_hori_init[] = { };/* -* This packet is required for some of the PDP pads to start +* This packet is required for most (all?) of the PDP pads to start * sending input reports. These pads include: (0x0e6f:0x02ab), -* (0x0e6f:0x02a4). +* (0x0e6f:0x02a4), (0x0e6f:0x02a6). */ static const u8 xboxone_pdp_init1[] = {0x0a ,0x20 ,0x00 ,0x03 ,0x00 ,0x01 ,0x14 };/* -* This packet is required for some of the PDP pads to start +* This packet is required for most (all?) of the PDP pads to start * sending input reports. These pads include: (0x0e6f:0x02ab), -* (0x0e6f:0x02a4). +* (0x0e6f:0x02a4), (0x0e6f:0x02a6). */ static const u8 xboxone_pdp_init2[] = {0x06 ,0x20 ,0x00 ,0x02 ,0x01 ,0x00
@@ -530,12 +530,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {XBOXONE_INIT_PKT (0x0e6f ,0x0165 , xboxone_hori_init),XBOXONE_INIT_PKT (0x0f0d ,0x0067 , xboxone_hori_init),XBOXONE_INIT_PKT (0x0000 ,0x0000 , xboxone_fw2015_init), -XBOXONE_INIT_PKT (0x0e6f ,0x02ab , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02ab , xboxone_pdp_init2), -XBOXONE_INIT_PKT (0x0e6f ,0x02a4 , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02a4 , xboxone_pdp_init2), -XBOXONE_INIT_PKT (0x0e6f ,0x02a6 , xboxone_pdp_init1), -XBOXONE_INIT_PKT (0x0e6f ,0x02a6 , xboxone_pdp_init2), +XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_init1), +XBOXONE_INIT_PKT (0x0e6f ,0x0000 , xboxone_pdp_init2),XBOXONE_INIT_PKT (0x24c6 ,0x541a , xboxone_rumblebegin_init),XBOXONE_INIT_PKT (0x24c6 ,0x542a , xboxone_rumblebegin_init), XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init),
drivers/input/keyboard/cros_ec_keyb.c +2 -1
@@ -506,7 +506,8 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev)for (i =0 ; i <ARRAY_SIZE (cros_ec_keyb_bs); i++) {const struct cros_ec_bs_map *map = &cros_ec_keyb_bs[i]; -if (buttons &BIT (map->bit)) +if ((map->ev_type ==EV_KEY && (buttons &BIT (map->bit))) || + (map->ev_type ==EV_SW && (switches &BIT (map->bit))))input_set_capability (idev, map->ev_type, map->code); }
drivers/input/keyboard/matrix_keypad.c +14 -9
@@ -407,7 +407,7 @@ matrix_keypad_parse_dt(struct device *dev)struct matrix_keypad_platform_data *pdata;struct device_node *np = dev->of_node;unsigned int *gpios; -int i, nrow, ncol; +int ret, i, nrow, ncol;if (!np) {dev_err (dev,"device lacks DT data\n" );
@@ -452,12 +452,19 @@ matrix_keypad_parse_dt(struct device *dev)return ERR_PTR (-ENOMEM ); } -for (i =0 ; i < pdata->num_row_gpios; i++) - gpios[i] =of_get_named_gpio (np,"row-gpios" , i); +for (i =0 ; i < nrow; i++) { + ret =of_get_named_gpio (np,"row-gpios" , i); +if (ret <0 ) +return ERR_PTR (ret); + gpios[i] = ret; + } -for (i =0 ; i < pdata->num_col_gpios; i++) - gpios[pdata->num_row_gpios + i] = -of_get_named_gpio (np,"col-gpios" , i); +for (i =0 ; i < ncol; i++) { + ret =of_get_named_gpio (np,"col-gpios" , i); +if (ret <0 ) +return ERR_PTR (ret); + gpios[nrow + i] = ret; + } pdata->row_gpios = gpios; pdata->col_gpios = &gpios[pdata->num_row_gpios];
@@ -484,10 +491,8 @@ static int matrix_keypad_probe(struct platform_device *pdev) pdata =dev_get_platdata (&pdev->dev);if (!pdata) { pdata =matrix_keypad_parse_dt (&pdev->dev); -if (IS_ERR (pdata)) { -dev_err (&pdev->dev,"no platform data defined\n" ); +if (IS_ERR (pdata))return PTR_ERR (pdata); - } }else if (!pdata->keymap_data) {dev_err (&pdev->dev,"no keymap data defined\n" );return -EINVAL ;
drivers/input/mouse/elan_i2c_core.c +3 -0
@@ -1264,6 +1264,9 @@ static const struct acpi_device_id elan_acpi_id[] = { { "ELAN0618", 0 }, { "ELAN061C", 0 }, { "ELAN061D", 0 }, + { "ELAN061E", 0 }, + { "ELAN0620", 0 }, + { "ELAN0621", 0 }, { "ELAN0622", 0 }, { "ELAN1000", 0 }, { }
drivers/input/mouse/synaptics.c +1 -0
@@ -170,6 +170,7 @@ static const char * const smbus_pnp_ids[] = {"LEN0048" ,/* X1 Carbon 3 */ "LEN0046" ,/* X250 */ "LEN004a" ,/* W541 */ +"LEN005b" ,/* P50 */ "LEN0071" ,/* T480 */ "LEN0072" ,/* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ "LEN0073", /* X1 Carbon G5 (Elantech) */
drivers/net/ethernet/qlogic/qed/qed_debug.c +2 -4
@@ -3590,10 +3590,8 @@ static u32 qed_grc_dump_big_ram(struct qed_hwfn *p_hwfn, total_blocks = big_ram->num_of_blocks[dev_data->chip_id]; ram_size = total_blocks *BIG_RAM_BLOCK_SIZE_DWORDS ; -strncpy (type_name, big_ram->instance_name, -strlen (big_ram->instance_name)); -strncpy (mem_name, big_ram->instance_name, -strlen (big_ram->instance_name)); +strscpy (type_name, big_ram->instance_name,sizeof (type_name)); +strscpy (mem_name, big_ram->instance_name,sizeof (mem_name));/* Dump memory header */ offset += qed_grc_dump_mem_hdr(p_hwfn,
drivers/reset/core.c +5 -4
@@ -566,17 +566,18 @@ EXPORT_SYMBOL_GPL(__devm_reset_control_get);* device_reset - find reset controller associated with the device * and perform reset * @dev: device to be reset by the controller +* @optional: whether it is optional to reset the device * -* Convenience wrapper for reset_control_get() and reset_control_reset(). +* Convenience wrapper for __reset_control_get() and reset_control_reset(). * This is useful for the common case of devices with single, dedicated reset * lines. */ -int device_reset (struct device *dev) +int __device_reset (struct device *dev,bool optional) {struct reset_control *rstc;int ret; - rstc =reset_control_get (dev,NULL ); + rstc =__reset_control_get (dev,NULL ,0 ,0 , optional);if (IS_ERR (rstc))return PTR_ERR (rstc);
@@ -586,7 +587,7 @@ int device_reset(struct device *dev)return ret; } -EXPORT_SYMBOL_GPL (device_reset); +EXPORT_SYMBOL_GPL (__device_reset);/** * APIs to manage an array of reset controls.
drivers/scsi/bfa/bfa_fcbuild.c +4 -4
@@ -1250,8 +1250,8 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,memset (rspnid,0 ,sizeof (struct fcgs_rspnid_req_s )); rspnid->dap = s_id; - rspnid->spn_len = (u8 )strlen ((char *)name); -strncpy ((char *)rspnid->spn, (char *)name, rspnid->spn_len); +strlcpy (rspnid->spn, name,sizeof (rspnid->spn)); + rspnid->spn_len = (u8 )strlen (rspnid->spn);return sizeof (struct fcgs_rspnid_req_s ) +sizeof (struct ct_hdr_s ); }
@@ -1271,8 +1271,8 @@ fc_rsnn_nn_build(struct fchs_s *fchs, void *pyld, u32 s_id,memset (rsnn_nn,0 ,sizeof (struct fcgs_rsnn_nn_req_s )); rsnn_nn->node_name = node_name; - rsnn_nn->snn_len = (u8 )strlen ((char *)name); -strncpy ((char *)rsnn_nn->snn, (char *)name, rsnn_nn->snn_len); +strlcpy (rsnn_nn->snn, name,sizeof (rsnn_nn->snn)); + rsnn_nn->snn_len = (u8 )strlen (rsnn_nn->snn);return sizeof (struct fcgs_rsnn_nn_req_s ) +sizeof (struct ct_hdr_s ); }
drivers/scsi/bfa/bfa_fcs.c +39 -39
112 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_lport.c +24 -38
134 lines not on this page · raw message
drivers/scsi/bfa/bfa_ioc.c +1 -1
@@ -2803,7 +2803,7 @@ void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc, char *manufacturer) { memset((void *)manufacturer, 0, BFA_ADAPTER_MFG_NAME_LEN); -strncpy (manufacturer,BFA_MFG_NAME ,BFA_ADAPTER_MFG_NAME_LEN ); +strlcpy (manufacturer,BFA_MFG_NAME ,BFA_ADAPTER_MFG_NAME_LEN ); }void
drivers/scsi/bfa/bfa_svc.c +2 -2
@@ -350,8 +350,8 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid, lp.eid = event; lp.log_type =BFA_PL_LOG_TYPE_STRING ; lp.misc = misc; -strncpy (lp.log_entry.string_log, log_str, -BFA_PL_STRING_LOG_SZ -1 ); +strlcpy (lp.log_entry.string_log, log_str, +BFA_PL_STRING_LOG_SZ ); lp.log_entry.string_log[BFA_PL_STRING_LOG_SZ -1 ] ='\0' ;bfa_plog_add (plog, &lp); }
drivers/scsi/bfa/bfad.c +10 -10
@@ -983,20 +983,20 @@ bfad_start_ops(struct bfad_s *bfad) {/* Fill the driver_info info to fcs*/ memset (&driver_info,0 ,sizeof (driver_info)); -strncpy (driver_info.version,BFAD_DRIVER_VERSION , -sizeof (driver_info.version) -1 ); +strlcpy (driver_info.version,BFAD_DRIVER_VERSION , +sizeof (driver_info.version));if (host_name) -strncpy (driver_info.host_machine_name, host_name, -sizeof (driver_info.host_machine_name) -1 ); +strlcpy (driver_info.host_machine_name, host_name, +sizeof (driver_info.host_machine_name));if (os_name) -strncpy (driver_info.host_os_name, os_name, -sizeof (driver_info.host_os_name) -1 ); +strlcpy (driver_info.host_os_name, os_name, +sizeof (driver_info.host_os_name));if (os_patch) -strncpy (driver_info.host_os_patch, os_patch, -sizeof (driver_info.host_os_patch) -1 ); +strlcpy (driver_info.host_os_patch, os_patch, +sizeof (driver_info.host_os_patch)); -strncpy (driver_info.os_device_name, bfad->pci_name, -sizeof (driver_info.os_device_name) -1 ); +strlcpy (driver_info.os_device_name, bfad->pci_name, +sizeof (driver_info.os_device_name));/* FCS driver info init */ spin_lock_irqsave (&bfad->bfad_lock, flags);
drivers/scsi/bfa/bfad_attr.c +1 -1
@@ -843,7 +843,7 @@ bfad_im_symbolic_name_show(struct device *dev, struct device_attribute *attr,char symname[BFA_SYMNAME_MAXLEN ];bfa_fcs_lport_get_attr (&bfad->bfa_fcs.fabric.bport, &port_attr); -strncpy (symname, port_attr.port_cfg.sym_name.symname, +strlcpy (symname, port_attr.port_cfg.sym_name.symname,BFA_SYMNAME_MAXLEN );return snprintf (buf,PAGE_SIZE ,"%s\n" , symname); }
drivers/scsi/bfa/bfad_bsg.c +3 -3
@@ -127,7 +127,7 @@ bfad_iocmd_ioc_get_attr(struct bfad_s *bfad, void *cmd)/* fill in driver attr info */ strcpy (iocmd->ioc_attr.driver_attr.driver,BFAD_DRIVER_NAME ); -strncpy (iocmd->ioc_attr.driver_attr.driver_ver, +strlcpy (iocmd->ioc_attr.driver_attr.driver_ver,BFAD_DRIVER_VERSION ,BFA_VERSION_LEN );strcpy (iocmd->ioc_attr.driver_attr.fw_ver, iocmd->ioc_attr.adapter_attr.fw_ver);
@@ -315,9 +315,9 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd) iocmd->attr.port_type = port_attr.port_type; iocmd->attr.loopback = port_attr.loopback; iocmd->attr.authfail = port_attr.authfail; -strncpy (iocmd->attr.port_symname.symname, +strlcpy (iocmd->attr.port_symname.symname, port_attr.port_cfg.sym_name.symname, -sizeof (port_attr.port_cfg.sym_name.symname)); +sizeof (iocmd->attr.port_symname.symname)); iocmd->status =BFA_STATUS_OK ;return 0 ;
drivers/scsi/scsi_devinfo.c +7 -15
@@ -34,7 +34,6 @@ struct scsi_dev_info_list_table { }; -static const char spaces[] =" " ;/* 16 of them */ static unsigned scsi_default_dev_flags;static LIST_HEAD (scsi_dev_info_list);static char scsi_dev_flags[256 ];
@@ -296,20 +295,13 @@ static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length,size_t from_length; from_length =strlen (from); -strncpy (to, from,min (to_length, from_length)); -if (from_length < to_length) { -if (compatible) { -/* -* NUL terminate the string if it is short. -*/ - to[from_length] ='\0' ; - }else { -/* -* space pad the string if it is short. -*/ -strncpy (&to[from_length], spaces, - to_length - from_length); - } +/* this zero-pads the destination */ +strncpy (to, from, to_length); +if (from_length < to_length && !compatible) { +/* +* space pad the string if it is short. +*/ +memset (&to[from_length],' ' , to_length - from_length); }if (from_length > to_length) printk(KERN_WARNING "%s: %s string '%s' is too long\n",
drivers/staging/rts5208/sd.c +0 -6
@@ -4125,12 +4125,6 @@ int ext_sd_send_cmd_get_rsp(struct rtsx_chip *chip, u8 cmd_idx, u32 arg,rtsx_trace (chip);return STATUS_FAIL ; } - - }else if (rsp_type ==SD_RSP_TYPE_R0 ) { -if ((ptr[3 ] &0x1E ) !=0x03 ) { -rtsx_trace (chip); -return STATUS_FAIL ; - } } } }
drivers/thermal/hisi_thermal.c +166 -152
430 lines not on this page · raw message
drivers/tty/serial/kgdboc.c +21 -22
66 lines not on this page · raw message
fs/btrfs/disk-io.c +1 -9
@@ -451,9 +451,9 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info,int mirror_num =0 ;int failed_mirror =0 ; -clear_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags); io_tree = &BTRFS_I (fs_info->btree_inode)->io_tree;while (1 ) { +clear_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags); ret =read_extent_buffer_pages (io_tree, eb,WAIT_COMPLETE , btree_get_extent, mirror_num);if (!ret) {
@@ -464,14 +464,6 @@ static int btree_read_extent_buffer_pages(struct btrfs_fs_info *fs_info, ret = -EIO ; } -/* -* This buffer's crc is fine, but its contents are corrupted, so -* there is no reason to read the other copies, they won't be -* any less wrong. -*/ -if (test_bit (EXTENT_BUFFER_CORRUPT , &eb->bflags)) -break ; - num_copies =btrfs_num_copies (fs_info, eb->start, eb->len);if (num_copies ==1 )
fs/btrfs/tree-checker.c +3 -5
@@ -348,13 +348,11 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info,/* * Here we don't really care about alignment since extent allocator can -* handle it. We care more about the size, as if one block group is -* larger than maximum size, it's must be some obvious corruption. +* handle it. We care more about the size. */ -if (key->offset >BTRFS_MAX_DATA_CHUNK_SIZE || key->offset ==0 ) { +if (key->offset ==0 ) {block_group_err (fs_info, leaf, slot, -"invalid block group size, have %llu expect (0, %llu]" , - key->offset,BTRFS_MAX_DATA_CHUNK_SIZE ); +"invalid block group size 0" );return -EUCLEAN ; }
fs/kernfs/symlink.c +1 -1
@@ -88,7 +88,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent,int slen =strlen (kn->name); len -= slen; -strncpy (s + len, kn->name, slen); +memcpy (s + len, kn->name, slen);if (len) s[--len] ='/' ;
fs/udf/super.c +10 -6
@@ -922,16 +922,20 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) } ret =udf_dstrCS0toUTF8 (outstr,31 , pvoldesc->volIdent,32 ); -if (ret <0 ) - goto out_bh; - -strncpy (UDF_SB (sb)->s_volume_ident, outstr, ret); +if (ret <0 ) { +strcpy (UDF_SB (sb)->s_volume_ident,"InvalidName" ); +pr_warn ("incorrect volume identification, setting to " +"'InvalidName'\n" ); + }else { +strncpy (UDF_SB (sb)->s_volume_ident, outstr, ret); + }udf_debug ("volIdent[] = '%s'\n" ,UDF_SB (sb)->s_volume_ident); ret =udf_dstrCS0toUTF8 (outstr,127 , pvoldesc->volSetIdent,128 ); -if (ret <0 ) +if (ret <0 ) { + ret =0 ; goto out_bh; - + } outstr[ret] =0 ;udf_debug ("volSetIdent[] = '%s'\n" , outstr);
fs/udf/unicode.c +11 -3
@@ -341,6 +341,11 @@ static int udf_name_to_CS0(uint8_t *ocu, int ocu_max_len,return u_len; } +/* +* Convert CS0 dstring to output charset. Warning: This function may truncate +* input string if it is too long as it is used for informational strings only +* and it is better to truncate the string than to refuse mounting a media. +*/ int udf_dstrCS0toUTF8 (uint8_t *utf_o,int o_len,const uint8_t *ocu_i,int i_len) {
@@ -349,9 +354,12 @@ int udf_dstrCS0toUTF8(uint8_t *utf_o, int o_len,if (i_len >0 ) { s_len = ocu_i[i_len -1 ];if (s_len >= i_len) { -pr_err ("incorrect dstring lengths (%d/%d)\n" , - s_len, i_len); -return -EINVAL ; +pr_warn ("incorrect dstring lengths (%d/%d)," +" truncating\n" , s_len, i_len); + s_len = i_len -1 ; +/* 2-byte encoding? Need to round properly... */ +if (ocu_i[0 ] ==16 ) + s_len -= (s_len -1 ) &2 ; } }
fs/userfaultfd.c +15 -0
@@ -1362,6 +1362,19 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx, ret = -EINVAL ;if (!vma_can_userfault (cur)) goto out_unlock; + +/* +* UFFDIO_COPY will fill file holes even without +* PROT_WRITE. This check enforces that if this is a +* MAP_SHARED, the process has write permission to the backing +* file. If VM_MAYWRITE is set it also enforces that on a +* MAP_SHARED vma: there is no F_WRITE_SEAL and no further +* F_WRITE_SEAL can be taken until the vma is destroyed. +*/ + ret = -EPERM ; +if (unlikely (!(cur->vm_flags &VM_MAYWRITE ))) + goto out_unlock; +/* * If this vma contains ending address, and huge pages * check alignment.
@@ -1407,6 +1420,7 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx,BUG_ON (!vma_can_userfault (vma));BUG_ON (vma->vm_userfaultfd_ctx.ctx && vma->vm_userfaultfd_ctx.ctx != ctx); +WARN_ON (!(vma->vm_flags &VM_MAYWRITE ));/* * Nothing to do: this vma is already registered into this
@@ -1553,6 +1567,7 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx,cond_resched ();BUG_ON (!vma_can_userfault (vma)); +WARN_ON (!(vma->vm_flags &VM_MAYWRITE ));/* * Nothing to do: this vma is already registered into this
include/linux/reset.h +13 -21
@@ -20,22 +20,16 @@ struct reset_control *__reset_control_get(struct device *dev, const char *id, int index, bool shared, bool optional);void reset_control_put (struct reset_control *rstc); +int __device_reset (struct device *dev,bool optional);struct reset_control *__devm_reset_control_get (struct device *dev,const char *id,int index,bool shared,bool optional); -int __must_check device_reset (struct device *dev); -struct reset_control *devm_reset_control_array_get (struct device *dev,bool shared,bool optional);struct reset_control *of_reset_control_array_get (struct device_node *np,bool shared,bool optional); -static inline int device_reset_optional (struct device *dev) -{ -return device_reset (dev); -} -#else static inline int reset_control_reset (struct reset_control *rstc)
@@ -62,15 +56,9 @@ static inline void reset_control_put(struct reset_control *rstc) { } -static inline int __must_check device_reset (struct device *dev) -{ -WARN_ON (1 ); -return -ENOTSUPP ; -} - -static inline int device_reset_optional (struct device *dev) +static inline int __device_reset (struct device *dev,bool optional) { -return -ENOTSUPP ; +return optional ?0 : -ENOTSUPP ; } static inline struct reset_control *__of_reset_control_get(
@@ -109,6 +97,16 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)#endif /* CONFIG_RESET_CONTROLLER */ +static inline int __must_check device_reset (struct device *dev) +{ +return __device_reset (dev, false); +} + +static inline int device_reset_optional (struct device *dev) +{ +return __device_reset (dev, true); +} +/** * reset_control_get_exclusive - Lookup and obtain an exclusive reference * to a reset controller.
@@ -127,9 +125,6 @@ of_reset_control_array_get(struct device_node *np, bool shared, bool optional)static inline struct reset_control *__must_check reset_control_get_exclusive (struct device *dev,const char *id) { -#ifndef CONFIG_RESET_CONTROLLER -WARN_ON (1 ); -#endif return __reset_control_get (dev, id,0 , false, false); }
@@ -275,9 +270,6 @@ static inline struct reset_control * __must_check devm_reset_control_get_exclusive(struct device *dev, const char *id) { -#ifndef CONFIG_RESET_CONTROLLER - WARN_ON(1); -#endif return __devm_reset_control_get(dev, id, 0, false, false); }
kernel/debug/kdb/kdb_support.c +2 -2
@@ -129,13 +129,13 @@ int kdbnearsym(unsigned long addr, kdb_symtab_t *symtab) }if (i >=ARRAY_SIZE (kdb_name_table)) {debug_kfree (kdb_name_table[0 ]); -memcpy (kdb_name_table, kdb_name_table+1 , +memmove (kdb_name_table, kdb_name_table+1 ,sizeof (kdb_name_table[0 ]) * (ARRAY_SIZE (kdb_name_table)-1 )); }else {debug_kfree (knt1); knt1 = kdb_name_table[i]; -memcpy (kdb_name_table+i, kdb_name_table+i+1 , +memmove (kdb_name_table+i, kdb_name_table+i+1 ,sizeof (kdb_name_table[0 ]) * (ARRAY_SIZE (kdb_name_table)-i-1 )); }
kernel/events/uprobes.c +10 -2
@@ -616,7 +616,7 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file,BUG_ON ((uprobe->offset & ~PAGE_MASK ) +UPROBE_SWBP_INSN_SIZE >PAGE_SIZE ); -smp_wmb ();/* pairs with rmb() in find_active_uprobe() */ +smp_wmb ();/* pairs with the smp_rmb() in handle_swbp() */ set_bit (UPROBE_COPY_INSN , &uprobe->flags); out:
@@ -1910,10 +1910,18 @@ static void handle_swbp(struct pt_regs *regs)* After we hit the bp, _unregister + _register can install the * new and not-yet-analyzed uprobe at the same address, restart. */ -smp_rmb ();/* pairs with wmb() in install_breakpoint() */ if (unlikely (!test_bit (UPROBE_COPY_INSN , &uprobe->flags))) goto out; +/* +* Pairs with the smp_wmb() in prepare_uprobe(). +* +* Guarantees that if we see the UPROBE_COPY_INSN bit set, then +* we must also see the stores to &uprobe->arch performed by the +* prepare_uprobe() call. +*/ +smp_rmb (); +/* Tracing handlers use ->utask to communicate with fetch methods */ if (!get_utask ()) goto out;
lib/kobject.c +1 -1
@@ -127,7 +127,7 @@ static void fill_kobj_path(struct kobject *kobj, char *path, int length)int cur =strlen (kobject_name (parent));/* back up enough to print this name with '/' */ length -= cur; -strncpy (path + length,kobject_name (parent), cur); +memcpy (path + length,kobject_name (parent), cur); *(path + --length) ='/' ; }
lib/test_hexdump.c +1 -1
@@ -81,7 +81,7 @@ static void __init test_hexdump_prepare_test(size_t len, int rowsize,const char *q = *result++;size_t amount =strlen (q); -strncpy (p, q, amount); +memcpy (p, q, amount); p += amount; *p++ =' ' ;
mm/hugetlb.c +1 -1
@@ -4037,7 +4037,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,/* fallback to copy_from_user outside mmap_sem */ if (unlikely (ret)) { - ret = -EFAULT ; + ret = -ENOENT ; *pagep = page;/* don't free the page */ goto out;
mm/shmem.c +28 -3
@@ -2244,6 +2244,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,struct page *page;pte_t _dst_pte, *dst_pte;int ret; +pgoff_t offset, max_off; ret = -ENOMEM ;if (!shmem_inode_acct_block (inode,1 ))
@@ -2266,7 +2267,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, *pagep = page;shmem_inode_unacct_blocks (inode,1 );/* don't free the page */ -return -EFAULT ; +return -ENOENT ; } }else {/* mfill_zeropage_atomic */ clear_highpage (page);
@@ -2281,6 +2282,12 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,__SetPageSwapBacked (page);__SetPageUptodate (page); + ret = -EFAULT ; + offset =linear_page_index (dst_vma, dst_addr); + max_off =DIV_ROUND_UP (i_size_read (inode),PAGE_SIZE ); +if (unlikely (offset >= max_off)) + goto out_release; + ret =mem_cgroup_try_charge (page, dst_mm, gfp, &memcg, false);if (ret) goto out_release;
@@ -2298,9 +2305,25 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, _dst_pte =mk_pte (page, dst_vma->vm_page_prot);if (dst_vma->vm_flags &VM_WRITE ) _dst_pte =pte_mkwrite (pte_mkdirty (_dst_pte)); +else { +/* +* We don't set the pte dirty if the vma has no +* VM_WRITE permission, so mark the page dirty or it +* could be freed from under us. We could do it +* unconditionally before unlock_page(), but doing it +* only if VM_WRITE is not set is faster. +*/ +set_page_dirty (page); + } - ret = -EEXIST ; dst_pte =pte_offset_map_lock (dst_mm, dst_pmd, dst_addr, &ptl); + + ret = -EFAULT ; + max_off =DIV_ROUND_UP (i_size_read (inode),PAGE_SIZE ); +if (unlikely (offset >= max_off)) + goto out_release_uncharge_unlock; + + ret = -EEXIST ;if (!pte_none (*dst_pte)) goto out_release_uncharge_unlock;
@@ -2318,13 +2341,15 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm,/* No need to invalidate - it was non-present before */ update_mmu_cache (dst_vma, dst_addr, dst_pte); -unlock_page (page);pte_unmap_unlock (dst_pte, ptl); +unlock_page (page); ret =0 ; out:return ret; out_release_uncharge_unlock:pte_unmap_unlock (dst_pte, ptl); +ClearPageDirty (page); +delete_from_page_cache (page); out_release_uncharge:mem_cgroup_cancel_charge (page, memcg, false); out_release:
mm/truncate.c +6 -2
@@ -471,9 +471,13 @@ void truncate_inode_pages_final(struct address_space *mapping)*/ spin_lock_irq (&mapping->tree_lock);spin_unlock_irq (&mapping->tree_lock); - -truncate_inode_pages (mapping,0 ); } + +/* +* Cleancache needs notification even if there are no pages or shadow +* entries. +*/ +truncate_inode_pages (mapping,0 ); }EXPORT_SYMBOL (truncate_inode_pages_final);
mm/userfaultfd.c +46 -16
127 lines not on this page · raw message
mm/vmstat.c +4 -0
@@ -1500,6 +1500,10 @@ static void zoneinfo_show_print(struct seq_file *m, pg_data_t *pgdat,if (is_zone_first_populated (pgdat, zone)) {seq_printf (m,"\n per-node stats" );for (i =0 ; i <NR_VM_NODE_STAT_ITEMS ; i++) { +/* Skip hidden vmstat items. */ +if (*vmstat_text[i +NR_VM_ZONE_STAT_ITEMS + +NR_VM_NUMA_STAT_ITEMS ] =='\0' ) +continue ; seq_printf(m, "\n %-12s %lu", vmstat_text[i + NR_VM_ZONE_STAT_ITEMS + NR_VM_NUMA_STAT_ITEMS],
net/ipv4/ip_tunnel.c +2 -2
@@ -261,8 +261,8 @@ static struct net_device *__ip_tunnel_create(struct net *net, }else {if (strlen (ops->kind) > (IFNAMSIZ -3 )) goto failed; -strlcpy (name, ops->kind,IFNAMSIZ ); -strncat (name,"%d" ,2 ); +strcpy (name, ops->kind); +strcat (name,"%d" ); }ASSERT_RTNL ();
net/tipc/subscr.c +1 -1
@@ -375,7 +375,7 @@ int tipc_topsrv_start(struct net *net) topsrv->tipc_conn_new = tipc_subscrb_connect_cb; topsrv->tipc_conn_release = tipc_subscrb_release_cb; -strncpy (topsrv->name, name,strlen (name) +1 ); +strscpy (topsrv->name, name,sizeof (topsrv->name)); tn->topsrv = topsrv;atomic_set (&tn->subscription_count,0 );
scripts/Makefile.extrawarn +3 -0
@@ -11,6 +11,8 @@ # are not supported by all versions of the compiler # ========================================================================== +KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) + ifeq ("$(origin W)", "command line") export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) endif
@@ -26,6 +28,7 @@ warning-1 += -Wold-style-definition warning-1 += $(call cc-option, -Wmissing-include-dirs) warning-1 += $(call cc-option, -Wunused-but-set-variable) warning-1 += $(call cc-option, -Wunused-const-variable) +warning-1 += $(call cc-option, -Wpacked-not-aligned) warning-1 += $(call cc-disable-warning, missing-field-initializers) warning-1 += $(call cc-disable-warning, sign-compare)
scripts/unifdef.c +2 -2
@@ -395,7 +395,7 @@ usage(void)* When we have processed a group that starts off with a known-false * #if/#elif sequence (which has therefore been deleted) followed by a * #elif that we don't understand and therefore must keep, we edit the -* latter into a #if to keep the nesting correct. We use strncpy() to +* latter into a #if to keep the nesting correct. We use memcpy() to * overwrite the 4 byte token "elif" with "if " without a '\0' byte. * * When we find a true #elif in a group, the following block will
@@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); }static void Itrue (void ) {Ftrue ();ignoreon (); }static void Ifalse (void ) {Ffalse ();ignoreon (); }/* modify this line */ -static void Mpass (void ) {strncpy (keyword,"if " ,4 );Pelif (); } +static void Mpass (void ) {memcpy (keyword,"if " ,4 );Pelif (); }static void Mtrue (void ) {keywordedit ("else" );state (IS_TRUE_MIDDLE ); }static void Melif (void ) {keywordedit ("endif" );state (IS_FALSE_TRAILER ); }static void Melse (void ) {keywordedit ("endif" );state (IS_FALSE_ELSE ); }
sound/pci/trident/trident.c +1 -1
@@ -123,7 +123,7 @@ static int snd_trident_probe(struct pci_dev *pci, }else {strcpy (card->shortname,"Trident " ); } -strcat (card->shortname, card->driver); +strcat (card->shortname, str);sprintf (card->longname,"%s PCI Audio at 0x%lx, irq %d" , card->shortname, trident->port, trident->irq);
sound/x86/intel_hdmi_audio.c +1 -1
@@ -1839,7 +1839,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)/* setup private data which can be retrieved when required */ pcm->private_data = ctx; pcm->info_flags =0 ; -strncpy (pcm->name, card->shortname,strlen (card->shortname)); +strlcpy (pcm->name, card->shortname,strlen (card->shortname));/* setup the ops for playabck */ snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &had_pcm_ops);