Linux 4.19.216
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.216 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/arc/include/asm/pgtable.h | 2 + arch/arm/include/asm/pgtable-2level.h | 2 + arch/arm/include/asm/pgtable-3level.h | 2 + arch/mips/include/asm/pgtable-32.h | 3 ++ arch/powerpc/include/asm/pte-common.h | 2 + arch/riscv/include/asm/pgtable-32.h | 2 + drivers/amba/bus.c | 3 -- drivers/infiniband/hw/qib/qib_user_sdma.c | 34 +++++++++++++++++++++--------- drivers/media/firewire/firedtv-avc.c | 14 +++++++++--- drivers/media/firewire/firedtv-ci.c | 2 + drivers/net/ethernet/sfc/ethtool.c | 10 +------- drivers/scsi/scsi.c | 4 ++- drivers/scsi/scsi_sysfs.c | 9 +++++++ include/asm-generic/pgtable.h | 13 +++++++++++ 15 files changed, 78 insertions(+), 26 deletions(-)
Arnd Bergmann (1):
arch: pgtable: define MAX_POSSIBLE_PHYSMEM_BITS where needed
Dan Carpenter (1):
media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt()
Erik Ekman (1):
sfc: Fix reading non-legacy supported link modes
Greg Kroah-Hartman (1):
Linux 4.19.216
Gustavo A. R. Silva (1):
IB/qib: Use struct_size() helper
Mike Marciniszyn (1):
IB/qib: Protect from buffer overflow in struct qib_user_sdma_pkt fields
Ming Lei (1):
scsi: core: Put LLD module refcnt after SCSI device is released
Wang Kefeng (1):
ARM: 9120/1: Revert "amba: make use of -1 IRQs warn"
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 215 +SUBLEVEL = 216 EXTRAVERSION = NAME = "People's Front"
arch/arc/include/asm/pgtable.h +2 -0
@@ -138,8 +138,10 @@#ifdef CONFIG_ARC_HAS_PAE40 #define PTE_BITS_NON_RWX_IN_PD1 (0xff00000000 | PAGE_MASK | _PAGE_CACHEABLE) +#define MAX_POSSIBLE_PHYSMEM_BITS 40#else #define PTE_BITS_NON_RWX_IN_PD1 (PAGE_MASK | _PAGE_CACHEABLE) +#define MAX_POSSIBLE_PHYSMEM_BITS 32#endif /**************************************************************************
arch/arm/include/asm/pgtable-2level.h +2 -0
@@ -78,6 +78,8 @@#define PTE_HWTABLE_OFF (PTE_HWTABLE_PTRS * sizeof(pte_t))#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u32)) +#define MAX_POSSIBLE_PHYSMEM_BITS 32 +/* * PMD_SHIFT determines the size of the area a second-level page table can map * PGDIR_SHIFT determines what a third-level page table entry can map
arch/arm/include/asm/pgtable-3level.h +2 -0
@@ -37,6 +37,8 @@#define PTE_HWTABLE_OFF (0)#define PTE_HWTABLE_SIZE (PTRS_PER_PTE * sizeof(u64)) +#define MAX_POSSIBLE_PHYSMEM_BITS 40 +/* * PGDIR_SHIFT determines the size a top-level page table entry can map. */
arch/mips/include/asm/pgtable-32.h +3 -0
@@ -111,6 +111,7 @@ static inline void pmd_clear(pmd_t *pmdp)#if defined(CONFIG_XPA ) +#define MAX_POSSIBLE_PHYSMEM_BITS 40#define pte_pfn (x) (((unsigned long)((x).pte_high >> _PFN_SHIFT)) | (unsigned long)((x).pte_low << _PAGE_PRESENT_SHIFT))static inline pte_t pfn_pte (unsigned long pfn,pgprot_t prot)
@@ -126,6 +127,7 @@ pfn_pte(unsigned long pfn, pgprot_t prot)#elif defined(CONFIG_PHYS_ADDR_T_64BIT ) && defined(CONFIG_CPU_MIPS32 ) +#define MAX_POSSIBLE_PHYSMEM_BITS 36#define pte_pfn (x) ((unsigned long)((x).pte_high >> 6))static inline pte_t pfn_pte (unsigned long pfn,pgprot_t prot)
@@ -140,6 +142,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)#else +#define MAX_POSSIBLE_PHYSMEM_BITS 32#ifdef CONFIG_CPU_VR41XX #define pte_pfn (x) ((unsigned long)((x).pte >> (PAGE_SHIFT + 2)))#define pfn_pte (pfn, prot) __pte(((pfn) << (PAGE_SHIFT + 2)) | pgprot_val(prot))
arch/powerpc/include/asm/pte-common.h +2 -0
@@ -110,8 +110,10 @@ static inline bool pte_user(pte_t pte)*/ #if defined(CONFIG_PPC32 ) && defined(CONFIG_PTE_64BIT )#define PTE_RPN_MASK (~((1ULL<<PTE_RPN_SHIFT)-1)) +#define MAX_POSSIBLE_PHYSMEM_BITS 36#else #define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1)) +#define MAX_POSSIBLE_PHYSMEM_BITS 32#endif /* _PAGE_CHG_MASK masks of bits that are to be preserved across
arch/riscv/include/asm/pgtable-32.h +2 -0
@@ -22,4 +22,6 @@#define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)#define PGDIR_MASK (~(PGDIR_SIZE - 1)) +#define MAX_POSSIBLE_PHYSMEM_BITS 34 +#endif /* _ASM_RISCV_PGTABLE_32_H */
drivers/amba/bus.c +0 -3
@@ -360,9 +360,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)void __iomem *tmp;int i, ret; -WARN_ON (dev->irq[0 ] == (unsigned int )-1 ); -WARN_ON (dev->irq[1 ] == (unsigned int )-1 ); - ret =request_resource (parent, &dev->res);if (ret) goto err_out;
drivers/infiniband/hw/qib/qib_user_sdma.c +24 -10
@@ -606,7 +606,7 @@ static int qib_user_sdma_coalesce(const struct qib_devdata *dd,/* * How many pages in this iovec element? */ -static int qib_user_sdma_num_pages (const struct iovec *iov) +static size_t qib_user_sdma_num_pages (const struct iovec *iov) {const unsigned long addr = (unsigned long ) iov->iov_base;const unsigned long len = iov->iov_len;
@@ -662,7 +662,7 @@ static void qib_user_sdma_free_pkt_frag(struct device *dev,static int qib_user_sdma_pin_pages (const struct qib_devdata *dd,struct qib_user_sdma_queue *pq,struct qib_user_sdma_pkt *pkt, -unsigned long addr,int tlen,int npages) +unsigned long addr,int tlen,size_t npages) {struct page *pages[8 ];int i, j;
@@ -726,7 +726,7 @@ static int qib_user_sdma_pin_pkt(const struct qib_devdata *dd,unsigned long idx;for (idx =0 ; idx < niov; idx++) { -const int npages =qib_user_sdma_num_pages (iov + idx); +const size_t npages =qib_user_sdma_num_pages (iov + idx);const unsigned long addr = (unsigned long ) iov[idx].iov_base; ret = qib_user_sdma_pin_pages(dd, pq, pkt, addr,
@@ -828,8 +828,8 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,unsigned pktnw;unsigned pktnwc;int nfrags =0 ; -int npages =0 ; -int bytes_togo =0 ; +size_t npages =0 ; +size_t bytes_togo =0 ;int tiddma =0 ;int cfur;
@@ -889,7 +889,11 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd, npages +=qib_user_sdma_num_pages (&iov[idx]); - bytes_togo += slen; +if (check_add_overflow (bytes_togo, slen, &bytes_togo) || + bytes_togo >type_max (typeof (pkt->bytes_togo))) { + ret = -EINVAL ; + goto free_pbc; + } pktnwc += slen >>2 ; idx++; nfrags++;
@@ -908,10 +912,10 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd, }if (frag_size) { -int pktsize, tidsmsize, n; +size_t tidsmsize, n, pktsize, sz, addrlimit; n = npages*((2 *PAGE_SIZE /frag_size)+1 ); - pktsize =sizeof (*pkt) +sizeof (pkt->addr[0 ])*n; + pktsize =struct_size (pkt, addr, n);/* * Determine if this is tid-sdma or just sdma.
@@ -926,14 +930,24 @@ static int qib_user_sdma_queue_pkts(const struct qib_devdata *dd,else tidsmsize =0 ; - pkt =kmalloc (pktsize+tidsmsize,GFP_KERNEL ); +if (check_add_overflow (pktsize, tidsmsize, &sz)) { + ret = -EINVAL ; + goto free_pbc; + } + pkt =kmalloc (sz,GFP_KERNEL );if (!pkt) { ret = -ENOMEM ; goto free_pbc; } pkt->largepkt =1 ; pkt->frag_size = frag_size; - pkt->addrlimit = n +ARRAY_SIZE (pkt->addr); +if (check_add_overflow (n,ARRAY_SIZE (pkt->addr), + &addrlimit) || + addrlimit >type_max (typeof (pkt->addrlimit))) { + ret = -EINVAL ; + goto free_pbc; + } + pkt->addrlimit = addrlimit;if (tiddma) {char *tidsm = (char *)pkt + pktsize;
drivers/media/firewire/firedtv-avc.c +11 -3
@@ -1169,7 +1169,11 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) read_pos += program_info_length; write_pos += program_info_length; } -while (read_pos < length) { +while (read_pos +4 < length) { +if (write_pos +4 >=sizeof (c->operand) -4 ) { + ret = -EINVAL ; + goto out; + } c->operand[write_pos++] = msg[read_pos++]; c->operand[write_pos++] = msg[read_pos++]; c->operand[write_pos++] = msg[read_pos++];
@@ -1181,13 +1185,17 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) c->operand[write_pos++] = es_info_length >>8 ; c->operand[write_pos++] = es_info_length &0xff ;if (es_info_length >0 ) { +if (read_pos >= length) { + ret = -EINVAL ; + goto out; + } pmt_cmd_id = msg[read_pos++];if (pmt_cmd_id !=1 && pmt_cmd_id !=4 )dev_err (fdtv->device,"invalid pmt_cmd_id %d at stream level\n" , pmt_cmd_id); -if (es_info_length >sizeof (c->operand) -4 - - write_pos) { +if (es_info_length >sizeof (c->operand) -4 - write_pos || + es_info_length > length - read_pos) { ret = -EINVAL ; goto out; }
drivers/media/firewire/firedtv-ci.c +2 -0
@@ -138,6 +138,8 @@ static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg) }else { data_length = msg->msg[3 ]; } +if (data_length >sizeof (msg->msg) - data_pos) +return -EINVAL ;return avc_ca_pmt (fdtv, &msg->msg[data_pos], data_length); }
drivers/net/ethernet/sfc/ethtool.c +2 -8
@@ -131,20 +131,14 @@ efx_ethtool_get_link_ksettings(struct net_device *net_dev, {struct efx_nic *efx =netdev_priv (net_dev);struct efx_link_state *link_state = &efx->link_state; -u32 supported;mutex_lock (&efx->mac_lock); efx->phy_op->get_link_ksettings (efx, cmd);mutex_unlock (&efx->mac_lock);/* Both MACs support pause frames (bidirectional and respond-only) */ -ethtool_convert_link_mode_to_legacy_u32 (&supported, - cmd->link_modes.supported); - - supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; - -ethtool_convert_legacy_u32_to_link_mode (cmd->link_modes.supported, - supported); +ethtool_link_ksettings_add_link_mode (cmd, supported, Pause); +ethtool_link_ksettings_add_link_mode (cmd, supported, Asym_Pause);if (LOOPBACK_INTERNAL (efx)) { cmd->base.speed = link_state->speed;
drivers/scsi/scsi.c +3 -1
@@ -575,8 +575,10 @@ EXPORT_SYMBOL(scsi_device_get);*/ void scsi_device_put (struct scsi_device *sdev) { -module_put (sdev->host->hostt->module); +struct module *mod = sdev->host->hostt->module; +put_device (&sdev->sdev_gendev); +module_put (mod); }EXPORT_SYMBOL (scsi_device_put);
drivers/scsi/scsi_sysfs.c +9 -0
@@ -431,9 +431,12 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)struct list_head *this, *tmp;struct scsi_vpd *vpd_pg80 =NULL , *vpd_pg83 =NULL ;unsigned long flags; +struct module *mod; sdev = container_of(work, struct scsi_device, ew.work); + mod = sdev->host->hostt->module; +scsi_dh_release_device (sdev); parent = sdev->sdev_gendev.parent;
@@ -474,11 +477,17 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)if (parent)put_device (parent); +module_put (mod); }static void scsi_device_dev_release (struct device *dev) {struct scsi_device *sdp =to_scsi_device (dev); + +/* Set module pointer as NULL in case of module unloading */ +if (!try_module_get (sdp->host->hostt->module)) + sdp->host->hostt->module =NULL ; +execute_in_process_context (scsi_device_dev_release_usercontext, &sdp->ew); }
include/asm-generic/pgtable.h +13 -0
@@ -1115,6 +1115,19 @@ static inline bool arch_has_pfn_modify_check(void)#endif /* !__ASSEMBLY__ */ +#if !defined(MAX_POSSIBLE_PHYSMEM_BITS ) && !defined(CONFIG_64BIT ) +#ifdef CONFIG_PHYS_ADDR_T_64BIT +/* +* ZSMALLOC needs to know the highest PFN on 32-bit architectures +* with physical address space extension, but falls back to +* BITS_PER_LONG otherwise. +*/ +#error Missing MAX_POSSIBLE_PHYSMEM_BITS definition +#else +#define MAX_POSSIBLE_PHYSMEM_BITS 32 +#endif +#endif +#ifndef has_transparent_hugepage#ifdef CONFIG_TRANSPARENT_HUGEPAGE #define has_transparent_hugepage () 1