Linux 4.14.145
Greg KH
maintainerI'm announcing the release of the 4.14.145 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:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/mips/Kconfig | 3 - arch/mips/include/asm/smp.h | 12 +++++ arch/mips/sibyte/common/Makefile | 1 arch/mips/sibyte/common/dma.c | 14 ------ arch/mips/vdso/Makefile | 4 + arch/powerpc/include/asm/uaccess.h | 1 arch/s390/kvm/interrupt.c | 10 ++++ arch/s390/kvm/kvm-s390.c | 2 arch/x86/Makefile | 1 arch/x86/kvm/vmx.c | 7 ++- arch/x86/kvm/x86.c | 7 +++ drivers/base/core.c | 53 +++++++++++++++++++++++++- drivers/bluetooth/btusb.c | 5 -- drivers/clk/rockchip/clk-mmc-phase.c | 4 - drivers/crypto/talitos.c | 67 ++++++++++++++++++++++++--------- drivers/firmware/ti_sci.c | 8 +-- drivers/gpio/gpiolib-acpi.c | 42 ++++++++++++++++++-- drivers/gpio/gpiolib.c | 20 ++++++--- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 5 +- drivers/gpu/drm/meson/meson_plane.c | 16 +++++++ drivers/isdn/capi/capi.c | 10 ++++ drivers/mtd/nand/mtk_nand.c | 21 ++++------ drivers/net/phy/phylink.c | 6 +- drivers/net/tun.c | 16 +++++-- drivers/net/usb/cdc_ether.c | 13 ++++-- drivers/nvmem/core.c | 15 +++++-- drivers/pci/pci-driver.c | 3 - drivers/platform/x86/pmc_atom.c | 8 +++ fs/btrfs/compression.c | 31 +++++++++++++++ fs/btrfs/compression.h | 3 + fs/btrfs/props.c | 6 -- fs/btrfs/tree-log.c | 8 +-- fs/ubifs/tnc.c | 16 +++++-- include/uapi/linux/isdn/capicmd.h | 1 kernel/irq/resend.c | 2 net/bridge/br_mdb.c | 2 net/core/dev.c | 2 net/core/skbuff.c | 19 +++++++++ net/ipv4/tcp_input.c | 2 net/ipv6/ping.c | 2 net/sched/sch_hhf.c | 2 net/sctp/protocol.c | 2 net/sctp/sm_sideeffect.c | 2 net/tipc/name_distr.c | 3 - 45 files changed, 365 insertions(+), 114 deletions(-)
Alex Williamson (1):
PCI: Always allow probing with driver_override
Andrew F. Davis (1):
firmware: ti_sci: Always request response from firmware
Bjørn Mork (1):
cdc_ether: fix rndis support for Mediatek based smartphones
Christophe JAILLET (2):
ipv6: Fix the link time qualifier of 'ping_v6_proc_exit_net()'
sctp: Fix the link time qualifier of 'sctp_ctrlsock_exit()'
Christophe Leroy (6):
crypto: talitos - check AES key size
crypto: talitos - fix CTR alg blocksize
crypto: talitos - check data blocksize in ablkcipher.
crypto: talitos - fix ECB algs ivsize
crypto: talitos - Do not modify req->cryptlen on decryption.
crypto: talitos - HMAC SNOOP NO AFEU mode requires SW icv checking.
Cong Wang (1):
sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
David Sterba (1):
btrfs: compression: add helper for type to string conversion
Douglas Anderson (1):
clk: rockchip: Don't yell about bad mmc phases when getting
Eric Biggers (1):
isdn/capi: check message length in capi_write()
Filipe Manana (1):
Btrfs: fix assertion failure during fsync and use of stale transaction
Fuqian Huang (1):
KVM: x86: work around leak of uninitialized stack contents
Greg Kroah-Hartman (2):
Revert "MIPS: SiByte: Enable swiotlb for SWARM, LittleSur and BigSur" Linux 4.14.145
Hans de Goede (1):
gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
Jean Delvare (1):
nvmem: Use the same permissions for eeprom as for nvmem
Johannes Thumshirn (1):
btrfs: correctly validate compression type
Kent Gibson (2):
gpio: fix line flag validation in linehandle_create
gpio: fix line flag validation in lineevent_create
Linus Torvalds (1):
x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
Mario Limonciello (1):
Revert "Bluetooth: btusb: driver to enable the usb-wakeup feature"
Muchun Song (1):
driver core: Fix use-after-free and double free on glue directory
Neal Cardwell (1):
tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
Neil Armstrong (1):
drm/meson: Add support for XBGR8888 & ABGR8888 formats
Nicolas Dichtel (1):
bridge/mdb: remove wrong use of NLM_F_MULTI
Nishka Dasgupta (1):
drm/mediatek: mtk_drm_drv.c: Add of_node_put() before goto
Paolo Bonzini (1):
KVM: nVMX: handle page fault in vmread
Paul Burton (2):
MIPS: VDSO: Prevent use of smp_processor_id()
MIPS: VDSO: Use same -m%-float cflag as the kernel proper
Richard Weinberger (1):
ubifs: Correctly use tnc_next() in search_dh_cookie()
Shmulik Ladkani (1):
net: gso: Fix skb_segment splat when splitting gso_size mangled skb having linear-headed frag_list
Stefan Chulski (1):
net: phylink: Fix flow control resolution
Steffen Dirkwinkel (1):
platform/x86: pmc_atom: Add CB4063 Beckhoff Automation board to critclk_systems DMI table
Subash Abhinov Kasiviswanathan (1):
net: Fix null de-reference of device refcount
Suraj Jitindar Singh (1):
powerpc: Add barrier_nospec to raw_copy_in_user()
Thomas Huth (1):
KVM: s390: Do not leak kernel stack data in the KVM_S390_INTERRUPT ioctl
Xiaolei Li (1):
mtd: rawnand: mtk: Fix wrongly assigned OOB buffer pointer issue
Xin Long (2):
sctp: use transport pf_retrans in sctp_do_8_2_transport_strike
tipc: add NULL pointer check before calling kfree_rcu
Yang Yingliang (1):
tun: fix use-after-free when register netdev failed
Yunfeng Ye (1):
genirq: Prevent NULL pointer dereference in resend_irqs()
Greg KH
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 14 -SUBLEVEL = 144 +SUBLEVEL = 145 EXTRAVERSION = NAME = Petit Gorille
arch/mips/Kconfig +0 -3
@@ -800,7 +800,6 @@ config SIBYTE_SWARM select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN select ZONE_DMA32 if 64BIT - select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SIBYTE_LITTLESUR bool "Sibyte BCM91250C2-LittleSur"
@@ -823,7 +822,6 @@ config SIBYTE_SENTOSA select SYS_HAS_CPU_SB1 select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_LITTLE_ENDIAN - select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SIBYTE_BIGSUR bool "Sibyte BCM91480B-BigSur"
@@ -837,7 +835,6 @@ config SIBYTE_BIGSUR select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN select ZONE_DMA32 if 64BIT - select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI config SNI_RM bool "SNI RM200/300/400"
arch/mips/include/asm/smp.h +11 -1
@@ -25,7 +25,17 @@ extern cpumask_t cpu_sibling_map[];extern cpumask_t cpu_core_map[];extern cpumask_t cpu_foreign_map[]; -#define raw_smp_processor_id () (current_thread_info()->cpu) +static inline int raw_smp_processor_id (void ) +{ +#if defined(__VDSO__) + extern int vdso_smp_processor_id(void) + __compiletime_error("VDSO should not call smp_processor_id()"); +return vdso_smp_processor_id (); +#else +return current_thread_info ()->cpu; +#endif +} +#define raw_smp_processor_id raw_smp_processor_id/* Map from cpu id to sequential logical cpu number. This will only not be idempotent when cpus failed to come on-line. */
arch/mips/sibyte/common/Makefile +0 -1
@@ -1,5 +1,4 @@ obj-y := cfe.o -obj-$(CONFIG_SWIOTLB) += dma.o obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o
arch/mips/sibyte/common/dma.c deleted +0 -14
@@ -1,14 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* -* DMA support for Broadcom SiByte platforms. -* -* Copyright (c) 2018 Maciej W. Rozycki -*/ - -#include <linux/swiotlb.h> -#include <asm/bootinfo.h> - -void __init plat_swiotlb_setup (void ) -{ -swiotlb_init (1 ); -}
arch/mips/vdso/Makefile +3 -1
@@ -7,7 +7,9 @@ ccflags-vdso := \ $(filter -I%,$(KBUILD_CFLAGS)) \ $(filter -E%,$(KBUILD_CFLAGS)) \ $(filter -mmicromips,$(KBUILD_CFLAGS)) \ - $(filter -march=%,$(KBUILD_CFLAGS)) + $(filter -march=%,$(KBUILD_CFLAGS)) \ + $(filter -m%-float,$(KBUILD_CFLAGS)) \ + -D__VDSO__ cflags-vdso := $(ccflags-vdso) \ $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ -O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
arch/powerpc/include/asm/uaccess.h +1 -0
@@ -280,6 +280,7 @@ extern unsigned long __copy_tofrom_user(void __user *to,static inline unsigned long raw_copy_in_user (void __user *to,const void __user *from,unsigned long n) { +barrier_nospec ();return __copy_tofrom_user (to, from, n); }#endif /* __powerpc64__ */
arch/s390/kvm/interrupt.c +10 -0
@@ -1701,6 +1701,16 @@ int s390int_to_s390irq(struct kvm_s390_interrupt *s390int,case KVM_S390_MCHK : irq->u.mchk.mcic = s390int->parm64;break ; +case KVM_S390_INT_PFAULT_INIT : + irq->u.ext.ext_params = s390int->parm; + irq->u.ext.ext_params2 = s390int->parm64; +break ; +case KVM_S390_RESTART : +case KVM_S390_INT_CLOCK_COMP : +case KVM_S390_INT_CPU_TIMER : +break ; +default : +return -EINVAL ; }return 0 ; }
arch/s390/kvm/kvm-s390.c +1 -1
@@ -3730,7 +3730,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, }case KVM_S390_INTERRUPT : {struct kvm_s390_interrupt s390int; -struct kvm_s390_irq s390irq; +struct kvm_s390_irq s390irq = {}; r = -EFAULT ;if (copy_from_user (&s390int, argp,sizeof (s390int)))
arch/x86/Makefile +1 -0
@@ -39,6 +39,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os -D__KERNEL__ \ REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector) +REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member) REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4)) export REALMODE_CFLAGS
arch/x86/kvm/vmx.c +5 -2
@@ -7996,6 +7996,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu)unsigned long exit_qualification =vmcs_readl (EXIT_QUALIFICATION );u32 vmx_instruction_info =vmcs_read32 (VMX_INSTRUCTION_INFO );gva_t gva =0 ; +struct x86_exception e;if (!nested_vmx_check_permission (vcpu))return 1 ;
@@ -8023,8 +8024,10 @@ static int handle_vmread(struct kvm_vcpu *vcpu) vmx_instruction_info, true, &gva))return 1 ;/* _system ok, nested_vmx_check_permission has verified cpl=0 */ -kvm_write_guest_virt_system (vcpu, gva, &field_value, - (is_long_mode (vcpu) ?8 :4 ),NULL ); +if (kvm_write_guest_virt_system (vcpu, gva, &field_value, + (is_long_mode (vcpu) ?8 :4 ), +NULL )) +kvm_inject_page_fault (vcpu, &e); }nested_vmx_succeed (vcpu);
arch/x86/kvm/x86.c +7 -0
@@ -4721,6 +4721,13 @@ int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,/* kvm_write_guest_virt_system can pull in tons of pages. */ vcpu->arch.l1tf_flush_l1d = true; +/* +* FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED +* is returned, but our callers are not ready for that and they blindly +* call kvm_inject_page_fault. Ensure that they at least do not leak +* uninitialized kernel stack memory into cr2 and error code. +*/ +memset (exception,0 ,sizeof (*exception));return kvm_write_guest_virt_helper (addr, val, bytes, vcpu,PFERR_WRITE_MASK , exception); }
drivers/base/core.c +52 -1
64 lines not on this page · raw message
drivers/bluetooth/btusb.c +0 -5
@@ -1124,10 +1124,6 @@ static int btusb_open(struct hci_dev *hdev) } data->intf->needs_remote_wakeup =1 ; -/* device specific wakeup source enabled and required for USB -* remote wakeup while host is suspended -*/ -device_wakeup_enable (&data->udev->dev);if (test_and_set_bit (BTUSB_INTR_RUNNING , &data->flags)) goto done;
@@ -1191,7 +1187,6 @@ static int btusb_close(struct hci_dev *hdev) goto failed; data->intf->needs_remote_wakeup =0 ; -device_wakeup_disable (&data->udev->dev);usb_autopm_put_interface (data->intf); failed:
drivers/clk/rockchip/clk-mmc-phase.c +1 -3
@@ -59,10 +59,8 @@ static int rockchip_mmc_get_phase(struct clk_hw *hw)u32 delay_num =0 ;/* See the comment for rockchip_mmc_set_phase below */ -if (!rate) { -pr_err ("%s: invalid clk rate\n" , __func__); +if (!rate)return -EINVAL ; - } raw_value =readl (mmc_clock->reg) >> (mmc_clock->shift);
drivers/crypto/talitos.c +50 -17
197 lines not on this page · raw message
drivers/firmware/ti_sci.c +4 -4
@@ -471,9 +471,9 @@ static int ti_sci_cmd_get_revision(struct ti_sci_info *info)struct ti_sci_xfer *xfer;int ret; -/* No need to setup flags since it is expected to respond */ xfer =ti_sci_get_one_xfer (info,TI_SCI_MSG_VERSION , -0x0 ,sizeof (struct ti_sci_msg_hdr ), +TI_SCI_FLAG_REQ_ACK_ON_PROCESSED , +sizeof (struct ti_sci_msg_hdr ),sizeof (*rev_info));if (IS_ERR (xfer)) { ret =PTR_ERR (xfer);
@@ -601,9 +601,9 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle, info =handle_to_ti_sci_info (handle); dev = info->dev; -/* Response is expected, so need of any flags */ xfer =ti_sci_get_one_xfer (info,TI_SCI_MSG_GET_DEVICE_STATE , -0 ,sizeof (*req),sizeof (*resp)); +TI_SCI_FLAG_REQ_ACK_ON_PROCESSED , +sizeof (*req),sizeof (*resp));if (IS_ERR (xfer)) { ret =PTR_ERR (xfer);dev_err (dev,"Message alloc failed(%d)\n" , ret);
drivers/gpio/gpiolib-acpi.c +38 -4
63 lines not on this page · raw message
drivers/gpio/gpiolib.c +14 -6
@@ -444,12 +444,23 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)struct linehandle_state *lh;struct file *file;int fd, i, count =0 , ret; +u32 lflags;if (copy_from_user (&handlereq, ip,sizeof (handlereq)))return -EFAULT ;if ((handlereq.lines ==0 ) || (handlereq.lines >GPIOHANDLES_MAX ))return -EINVAL ; + lflags = handlereq.flags; + +/* +* Do not allow both INPUT & OUTPUT flags to be set as they are +* contradictory. +*/ +if ((lflags &GPIOHANDLE_REQUEST_INPUT ) && + (lflags &GPIOHANDLE_REQUEST_OUTPUT )) +return -EINVAL ; + lh =kzalloc (sizeof (*lh),GFP_KERNEL );if (!lh)return -ENOMEM ;
@@ -470,7 +481,6 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)/* Request each GPIO */ for (i =0 ; i < handlereq.lines; i++) {u32 offset = handlereq.lineoffsets[i]; -u32 lflags = handlereq.flags;struct gpio_desc *desc;if (offset >= gdev->ngpio) {
@@ -805,7 +815,9 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip) }/* This is just wrong: we don't look for events on output lines */ -if (lflags &GPIOHANDLE_REQUEST_OUTPUT ) { +if ((lflags &GPIOHANDLE_REQUEST_OUTPUT ) || + (lflags &GPIOHANDLE_REQUEST_OPEN_DRAIN ) || + (lflags &GPIOHANDLE_REQUEST_OPEN_SOURCE )) { ret = -EINVAL ; goto out_free_label; }
@@ -819,10 +831,6 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)if (lflags &GPIOHANDLE_REQUEST_ACTIVE_LOW )set_bit (FLAG_ACTIVE_LOW , &desc->flags); -if (lflags &GPIOHANDLE_REQUEST_OPEN_DRAIN ) -set_bit (FLAG_OPEN_DRAIN , &desc->flags); -if (lflags &GPIOHANDLE_REQUEST_OPEN_SOURCE ) -set_bit (FLAG_OPEN_SOURCE , &desc->flags); ret =gpiod_direction_input (desc);if (ret)
drivers/gpu/drm/mediatek/mtk_drm_drv.c +4 -1
@@ -504,12 +504,15 @@ static int mtk_drm_probe(struct platform_device *pdev) comp =devm_kzalloc (dev,sizeof (*comp),GFP_KERNEL );if (!comp) { ret = -ENOMEM ; +of_node_put (node); goto err_node; } ret =mtk_ddp_comp_init (dev, node, comp, comp_id,NULL ); -if (ret) +if (ret) { +of_node_put (node); goto err_node; + } private->ddp_comp[comp_id] = comp; }
drivers/gpu/drm/meson/meson_plane.c +16 -0
@@ -124,6 +124,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, priv->viu.osd1_blk0_cfg[0 ] |=OSD_BLK_MODE_32 |OSD_COLOR_MATRIX_32_ARGB ;break ; +case DRM_FORMAT_XBGR8888 : +/* For XRGB, replace the pixel's alpha by 0xFF */ +writel_bits_relaxed (OSD_REPLACE_EN ,OSD_REPLACE_EN , + priv->io_base +_REG (VIU_OSD1_CTRL_STAT2 )); + priv->viu.osd1_blk0_cfg[0 ] |=OSD_BLK_MODE_32 | +OSD_COLOR_MATRIX_32_ABGR ; +break ;case DRM_FORMAT_ARGB8888 :/* For ARGB, use the pixel's alpha */ writel_bits_relaxed(OSD_REPLACE_EN, 0,
@@ -131,6 +138,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, priv->viu.osd1_blk0_cfg[0 ] |=OSD_BLK_MODE_32 |OSD_COLOR_MATRIX_32_ARGB ;break ; +case DRM_FORMAT_ABGR8888 : +/* For ARGB, use the pixel's alpha */ +writel_bits_relaxed (OSD_REPLACE_EN ,0 , + priv->io_base +_REG (VIU_OSD1_CTRL_STAT2 )); + priv->viu.osd1_blk0_cfg[0 ] |=OSD_BLK_MODE_32 | +OSD_COLOR_MATRIX_32_ABGR ; +break ;case DRM_FORMAT_RGB888 : priv->viu.osd1_blk0_cfg[0 ] |=OSD_BLK_MODE_24 |OSD_COLOR_MATRIX_24_RGB ;
@@ -200,7 +214,9 @@ static const struct drm_plane_funcs meson_plane_funcs = {static const uint32_t supported_drm_formats[] = {DRM_FORMAT_ARGB8888 , +DRM_FORMAT_ABGR8888 ,DRM_FORMAT_XRGB8888 , +DRM_FORMAT_XBGR8888 ,DRM_FORMAT_RGB888 ,DRM_FORMAT_RGB565 , };
drivers/isdn/capi/capi.c +9 -1
@@ -687,6 +687,9 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *pposif (!cdev->ap.applid)return -ENODEV ; +if (count <CAPIMSG_BASELEN ) +return -EINVAL ; + skb =alloc_skb (count,GFP_USER );if (!skb)return -ENOMEM ;
@@ -697,7 +700,8 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos } mlen =CAPIMSG_LEN (skb->data);if (CAPIMSG_CMD (skb->data) ==CAPI_DATA_B3_REQ ) { -if ((size_t )(mlen +CAPIMSG_DATALEN (skb->data)) != count) { +if (count <CAPI_DATA_B3_REQ_LEN || + (size_t )(mlen +CAPIMSG_DATALEN (skb->data)) != count) {kfree_skb (skb);return -EINVAL ; }
@@ -710,6 +714,10 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *pposCAPIMSG_SETAPPID (skb->data, cdev->ap.applid);if (CAPIMSG_CMD (skb->data) ==CAPI_DISCONNECT_B3_RESP ) { +if (count <CAPI_DISCONNECT_B3_RESP_LEN ) { +kfree_skb (skb); +return -EINVAL ; + }mutex_lock (&cdev->lock);capincci_free (cdev,CAPIMSG_NCCI (skb->data));mutex_unlock (&cdev->lock);
drivers/mtd/nand/mtk_nand.c +10 -11
@@ -846,19 +846,21 @@ static int mtk_nfc_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,return ret &NAND_STATUS_FAIL ? -EIO :0 ; } -static int mtk_nfc_update_ecc_stats (struct mtd_info *mtd,u8 *buf,u32 sectors) +static int mtk_nfc_update_ecc_stats (struct mtd_info *mtd,u8 *buf,u32 start, +u32 sectors) {struct nand_chip *chip =mtd_to_nand (mtd);struct mtk_nfc *nfc =nand_get_controller_data (chip);struct mtk_nfc_nand_chip *mtk_nand =to_mtk_nand (chip);struct mtk_ecc_stats stats; +u32 reg_size = mtk_nand->fdm.reg_size;int rc, i; rc =nfi_readl (nfc,NFI_STA ) &STA_EMP_PAGE ;if (rc) {memset (buf,0xff , sectors * chip->ecc.size);for (i =0 ; i < sectors; i++) -memset (oob_ptr (chip, i),0xff , mtk_nand->fdm.reg_size); +memset (oob_ptr (chip, start + i),0xff , reg_size);return 0 ; }
@@ -878,7 +880,7 @@ static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,u32 spare = mtk_nand->spare_per_sector;u32 column, sectors, start, end, reg;dma_addr_t addr; -int bitflips; +int bitflips =0 ;size_t len;u8 *buf;int rc;
@@ -946,14 +948,11 @@ static int mtk_nfc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,if (rc <0 ) {dev_err (nfc->dev,"subpage done timeout\n" ); bitflips = -EIO ; - }else { - bitflips =0 ; -if (!raw) { - rc =mtk_ecc_wait_done (nfc->ecc,ECC_DECODE ); - bitflips = rc <0 ? -ETIMEDOUT : -mtk_nfc_update_ecc_stats (mtd, buf, sectors); -mtk_nfc_read_fdm (chip, start, sectors); - } + }else if (!raw) { + rc =mtk_ecc_wait_done (nfc->ecc,ECC_DECODE ); + bitflips = rc <0 ? -ETIMEDOUT : +mtk_nfc_update_ecc_stats (mtd, buf, start, sectors); +mtk_nfc_read_fdm (chip, start, sectors); }dma_unmap_single (nfc->dev, addr, len,DMA_FROM_DEVICE );
drivers/net/phy/phylink.c +3 -3
@@ -359,8 +359,8 @@ static void phylink_get_fixed_state(struct phylink *pl, struct phylink_link_stat* Local device Link partner * Pause AsymDir Pause AsymDir Result * 1 X 1 X TX+RX -* 0 1 1 1 RX -* 1 1 0 1 TX +* 0 1 1 1 TX +* 1 1 0 1 RX */ static void phylink_resolve_flow (struct phylink *pl,struct phylink_link_state *state)
@@ -381,7 +381,7 @@ static void phylink_resolve_flow(struct phylink *pl, new_pause =MLO_PAUSE_TX |MLO_PAUSE_RX ; else if (pause & MLO_PAUSE_ASYM) new_pause = state->pause &MLO_PAUSE_SYM ? -MLO_PAUSE_RX :MLO_PAUSE_TX ; +MLO_PAUSE_TX :MLO_PAUSE_RX ; }else { new_pause = pl->link_config.pause &MLO_PAUSE_TXRX_MASK ; }
drivers/net/tun.c +11 -5
@@ -630,7 +630,8 @@ static void tun_detach_all(struct net_device *dev)module_put (THIS_MODULE ); } -static int tun_attach (struct tun_struct *tun,struct file *file,bool skip_filter) +static int tun_attach (struct tun_struct *tun,struct file *file, +bool skip_filter,bool publish_tun) {struct tun_file *tfile = file->private_data;struct net_device *dev = tun->dev;
@@ -672,7 +673,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file, bool skip_filte tfile->queue_index = tun->numqueues; tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN ; -rcu_assign_pointer (tfile->tun, tun); +if (publish_tun) +rcu_assign_pointer (tfile->tun, tun);rcu_assign_pointer (tun->tfiles[tun->numqueues], tfile); tun->numqueues++;
@@ -2011,7 +2013,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)if (err <0 )return err; - err =tun_attach (tun, file, ifr->ifr_flags &IFF_NOFILTER ); + err =tun_attach (tun, file, ifr->ifr_flags &IFF_NOFILTER , true);if (err <0 )return err;
@@ -2100,13 +2102,17 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) NETIF_F_HW_VLAN_STAG_TX);INIT_LIST_HEAD (&tun->disabled); - err =tun_attach (tun, file, false); + err =tun_attach (tun, file, false, false);if (err <0 ) goto err_free_flow; err =register_netdevice (tun->dev);if (err <0 ) goto err_detach; +/* free_netdev() won't check refcnt, to aovid race +* with dev_put() we need publish tun after registration. +*/ +rcu_assign_pointer (tfile->tun, tun); }netif_carrier_on (tun->dev);
@@ -2252,7 +2258,7 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr) ret =security_tun_dev_attach_queue (tun->security);if (ret <0 ) goto unlock; - ret =tun_attach (tun, file, false); + ret =tun_attach (tun, file, false, true); }else if (ifr->ifr_flags &IFF_DETACH_QUEUE ) { tun =rtnl_dereference (tfile->tun);if (!tun || !(tun->flags &IFF_MULTI_QUEUE ) || tfile->detached)
drivers/net/usb/cdc_ether.c +10 -3
@@ -221,9 +221,16 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) goto bad_desc; } skip: -if ( rndis && - header.usb_cdc_acm_descriptor && - header.usb_cdc_acm_descriptor->bmCapabilities) { +/* Communcation class functions with bmCapabilities are not +* RNDIS. But some Wireless class RNDIS functions use +* bmCapabilities for their own purpose. The failsafe is +* therefore applied only to Communication class RNDIS +* functions. The rndis test is redundant, but a cheap +* optimization. +*/ +if (rndis &&is_rndis (&intf->cur_altsetting->desc) && + header.usb_cdc_acm_descriptor && + header.usb_cdc_acm_descriptor->bmCapabilities) {dev_dbg (&intf->dev,"ACM capabilities %02x, not really RNDIS?\n" , header.usb_cdc_acm_descriptor->bmCapabilities);
drivers/nvmem/core.c +11 -4
@@ -407,10 +407,17 @@ static int nvmem_setup_compat(struct nvmem_device *nvmem,if (!config->base_dev)return -EINVAL ; -if (nvmem->read_only) - nvmem->eeprom = bin_attr_ro_root_nvmem; -else - nvmem->eeprom = bin_attr_rw_root_nvmem; +if (nvmem->read_only) { +if (config->root_only) + nvmem->eeprom = bin_attr_ro_root_nvmem; +else + nvmem->eeprom = bin_attr_ro_nvmem; + }else { +if (config->root_only) + nvmem->eeprom = bin_attr_rw_root_nvmem; +else + nvmem->eeprom = bin_attr_rw_nvmem; + } nvmem->eeprom.attr.name ="eeprom" ; nvmem->eeprom.size = nvmem->size;#ifdef CONFIG_DEBUG_LOCK_ALLOC
drivers/pci/pci-driver.c +2 -1
@@ -400,7 +400,8 @@ void __weak pcibios_free_irq(struct pci_dev *dev)#ifdef CONFIG_PCI_IOV static inline bool pci_device_can_probe (struct pci_dev *pdev) { -return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe); +return (!pdev->is_virtfn || pdev->physfn->sriov->drivers_autoprobe || + pdev->driver_override); }#else static inline bool pci_device_can_probe (struct pci_dev *pdev)
drivers/platform/x86/pmc_atom.c +8 -0
@@ -451,6 +451,14 @@ static const struct dmi_system_id critclk_systems[] = { DMI_MATCH(DMI_BOARD_NAME, "CB3163"), }, }, + { +/* pmc_plt_clk* - are used for ethernet controllers */ + .ident = "Beckhoff CB4063", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Beckhoff Automation" ), + DMI_MATCH(DMI_BOARD_NAME, "CB4063"), + }, + }, {/* pmc_plt_clk* - are used for ethernet controllers */ .ident = "Beckhoff CB6263",
fs/btrfs/compression.c +31 -0
@@ -43,6 +43,37 @@#include "extent_io.h" #include "extent_map.h" +static const char *const btrfs_compress_types[] = {"" ,"zlib" ,"lzo" ,"zstd" }; + +const char *btrfs_compress_type2str (enum btrfs_compression_type type) +{ +switch (type) { +case BTRFS_COMPRESS_ZLIB : +case BTRFS_COMPRESS_LZO : +case BTRFS_COMPRESS_ZSTD : +case BTRFS_COMPRESS_NONE : +return btrfs_compress_types[type]; + } + +return NULL ; +} + +bool btrfs_compress_is_valid_type (const char *str,size_t len) +{ +int i; + +for (i =1 ; i <ARRAY_SIZE (btrfs_compress_types); i++) { +size_t comp_len =strlen (btrfs_compress_types[i]); + +if (len < comp_len) +continue ; + +if (!strncmp (btrfs_compress_types[i], str, comp_len)) +return true; + } +return false; +} +static int btrfs_decompress_bio (struct compressed_bio *cb); static inline int compressed_bio_size(struct btrfs_fs_info *fs_info,
fs/btrfs/compression.h +3 -0
@@ -130,6 +130,9 @@ extern const struct btrfs_compress_op btrfs_zlib_compress;extern const struct btrfs_compress_op btrfs_lzo_compress;extern const struct btrfs_compress_op btrfs_zstd_compress; +const char *btrfs_compress_type2str (enum btrfs_compression_type type); +bool btrfs_compress_is_valid_type (const char *str,size_t len); +int btrfs_compress_heuristic (struct inode *inode,u64 start,u64 end);#endif
fs/btrfs/props.c +1 -5
@@ -386,11 +386,7 @@ int btrfs_subvol_inherit_props(struct btrfs_trans_handle *trans,static int prop_compression_validate (const char *value,size_t len) { -if (!strncmp ("lzo" , value,3 )) -return 0 ; -else if (!strncmp ("zlib" , value,4 )) -return 0 ; -else if (!strncmp ("zstd" , value,4 )) +if (btrfs_compress_is_valid_type (value, len))return 0 ;return -EINVAL ;
fs/btrfs/tree-log.c +4 -4
@@ -5122,7 +5122,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,BTRFS_I (other_inode),LOG_OTHER_INODE ,0 ,LLONG_MAX , ctx); -iput (other_inode); +btrfs_add_delayed_iput (other_inode);if (err) goto out_unlock;else
@@ -5539,7 +5539,7 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans, }if (btrfs_inode_in_log (BTRFS_I (di_inode), trans->transid)) { -iput (di_inode); +btrfs_add_delayed_iput (di_inode);break ; }
@@ -5551,7 +5551,7 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,if (!ret &&btrfs_must_commit_transaction (trans,BTRFS_I (di_inode))) ret =1 ; -iput (di_inode); +btrfs_add_delayed_iput (di_inode);if (ret) goto next_dir_inode;if (ctx->log_new_dentries) {
@@ -5698,7 +5698,7 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans,if (!ret && ctx && ctx->log_new_dentries) ret =log_new_dir_dentries (trans, root,BTRFS_I (dir_inode), ctx); -iput (dir_inode); +btrfs_add_delayed_iput (dir_inode);if (ret) goto out; }
fs/ubifs/tnc.c +11 -5
@@ -1164,8 +1164,8 @@ static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c,* o exact match, i.e. the found zero-level znode contains key @key, then %1 * is returned and slot number of the matched branch is stored in @n; * o not exact match, which means that zero-level znode does not contain -* @key, then %0 is returned and slot number of the closest branch is stored -* in @n; +* @key, then %0 is returned and slot number of the closest branch or %-1 +* is stored in @n; In this case calling tnc_next() is mandatory. * o @key is so small that it is even less than the lowest key of the * leftmost zero-level node, then %0 is returned and %0 is stored in @n. *
@@ -1882,13 +1882,19 @@ int ubifs_tnc_lookup_nm(struct ubifs_info *c, const union ubifs_key *key,static int search_dh_cookie (struct ubifs_info *c,const union ubifs_key *key,struct ubifs_dent_node *dent,uint32_t cookie, -struct ubifs_znode **zn,int *n) +struct ubifs_znode **zn,int *n,int exact) {int err;struct ubifs_znode *znode = *zn;struct ubifs_zbranch *zbr;union ubifs_key *dkey; +if (!exact) { + err =tnc_next (c, &znode, n); +if (err) +return err; + } +for (;;) { zbr = &znode->zbranch[*n]; dkey = &zbr->key;
@@ -1930,7 +1936,7 @@ static int do_lookup_dh(struct ubifs_info *c, const union ubifs_key *key,if (unlikely (err <0 )) goto out_unlock; - err =search_dh_cookie (c, key, dent, cookie, &znode, &n); + err =search_dh_cookie (c, key, dent, cookie, &znode, &n, err); out_unlock:mutex_unlock (&c->tnc_mutex);
@@ -2716,7 +2722,7 @@ int ubifs_tnc_remove_dh(struct ubifs_info *c, const union ubifs_key *key,if (unlikely (err <0 )) goto out_free; - err =search_dh_cookie (c, key, dent, cookie, &znode, &n); + err =search_dh_cookie (c, key, dent, cookie, &znode, &n, err);if (err) goto out_free; }
include/uapi/linux/isdn/capicmd.h +1 -0
@@ -16,6 +16,7 @@#define CAPI_MSG_BASELEN 8#define CAPI_DATA_B3_REQ_LEN (CAPI_MSG_BASELEN+4+4+2+2+2)#define CAPI_DATA_B3_RESP_LEN (CAPI_MSG_BASELEN+4+2) +#define CAPI_DISCONNECT_B3_RESP_LEN (CAPI_MSG_BASELEN+4)/*----- CAPI commands -----*/ #define CAPI_ALERT 0x01
kernel/irq/resend.c +2 -0
@@ -38,6 +38,8 @@ static void resend_irqs(unsigned long arg) irq =find_first_bit (irqs_resend, nr_irqs);clear_bit (irq, irqs_resend); desc =irq_to_desc (irq); +if (!desc) +continue ;local_irq_disable (); desc->handle_irq (desc);local_irq_enable ();
net/bridge/br_mdb.c +1 -1
@@ -373,7 +373,7 @@ static int nlmsg_populate_rtr_fill(struct sk_buff *skb,struct nlmsghdr *nlh;struct nlattr *nest; - nlh =nlmsg_put (skb, pid, seq, type,sizeof (*bpm),NLM_F_MULTI ); + nlh =nlmsg_put (skb, pid, seq, type,sizeof (*bpm),0 );if (!nlh)return -EMSGSIZE ;
net/core/dev.c +2 -0
@@ -7698,6 +7698,8 @@ int register_netdevice(struct net_device *dev) ret =notifier_to_errno (ret);if (ret) {rollback_registered (dev); +rcu_barrier (); + dev->reg_state =NETREG_UNREGISTERED ; }/*
net/core/skbuff.c +19 -0
@@ -3514,6 +3514,25 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb,int pos;int dummy; +if (list_skb && !list_skb->head_frag &&skb_headlen (list_skb) && + (skb_shinfo (head_skb)->gso_type &SKB_GSO_DODGY )) { +/* gso_size is untrusted, and we have a frag_list with a linear +* non head_frag head. +* +* (we assume checking the first list_skb member suffices; +* i.e if either of the list_skb members have non head_frag +* head, then the first one has too). +* +* If head_skb's headlen does not fit requested gso_size, it +* means that the frag_list members do NOT terminate on exact +* gso_size boundaries. Hence we cannot perform skb_frag_t page +* sharing. Therefore we must fallback to copying the frag_list +* skbs; we do so by disabling SG. +*/ +if (mss !=GSO_BY_FRAGS && mss !=skb_headlen (head_skb)) + features &= ~NETIF_F_SG ; + } +__skb_push (head_skb, doffset); proto =skb_network_protocol (head_skb, &dummy);if (unlikely (!proto))
net/ipv4/tcp_input.c +1 -1
@@ -247,7 +247,7 @@ static void tcp_ecn_accept_cwr(struct tcp_sock *tp, const struct sk_buff *skb)static void tcp_ecn_withdraw_cwr (struct tcp_sock *tp) { - tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR ; + tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR ; }static void __tcp_ecn_check_ce (struct sock *sk,const struct sk_buff *skb)
net/ipv6/ping.c +1 -1
@@ -233,7 +233,7 @@ static int __net_init ping_v6_proc_init_net(struct net *net)return ping_proc_register (net, &ping_v6_seq_afinfo); } -static void __net_init ping_v6_proc_exit_net (struct net *net) +static void __net_exit ping_v6_proc_exit_net(struct net *net) {return ping_proc_unregister (net, &ping_v6_seq_afinfo); }
net/sched/sch_hhf.c +1 -1
@@ -528,7 +528,7 @@ static int hhf_change(struct Qdisc *sch, struct nlattr *opt) new_hhf_non_hh_weight =nla_get_u32 (tb[TCA_HHF_NON_HH_WEIGHT ]); non_hh_quantum = (u64 )new_quantum * new_hhf_non_hh_weight; -if (non_hh_quantum >INT_MAX ) +if (non_hh_quantum ==0 || non_hh_quantum >INT_MAX )return -EINVAL ;sch_tree_lock (sch);
net/sctp/protocol.c +1 -1
@@ -1344,7 +1344,7 @@ static int __net_init sctp_ctrlsock_init(struct net *net)return status; } -static void __net_init sctp_ctrlsock_exit (struct net *net) +static void __net_exit sctp_ctrlsock_exit(struct net *net) {/* Free the control endpoint. */ inet_ctl_sock_destroy (net->sctp.ctl_sock);
net/sctp/sm_sideeffect.c +1 -1
@@ -542,7 +542,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_cmd_seq *commands,if (net->sctp.pf_enable && (transport->state ==SCTP_ACTIVE ) && (transport->error_count < transport->pathmaxrxt) && - (transport->error_count > asoc->pf_retrans)) { + (transport->error_count > transport->pf_retrans)) { sctp_assoc_control_transport(asoc, transport, SCTP_TRANSPORT_PF,
net/tipc/name_distr.c +2 -1
@@ -224,7 +224,8 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr) publ->key); } -kfree_rcu (p, rcu); +if (p) +kfree_rcu (p, rcu); }/**