4.16.1-stable review
Greg Kroah-Hartman
maintainercover 4.16.1-stable review
This is the start of the stable review cycle for the 4.16.1 release. There are 31 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 8 08:43:15 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.16.1-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.16.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.16.1-rc1
Eric W. Biederman <[email protected]>
signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k
Mikulas Patocka <[email protected]>
Fix slab name "biovec-(1<<(21-12))"
Mike Frysinger <[email protected]>
vt: change SGR 21 to follow the standards
Ondrej Zary <[email protected]>
Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad
Dennis Wassenberg <[email protected]>
Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list
Masaki Ota <[email protected]>
Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370
Gaku Inami <[email protected]>
Revert "base: arch_topology: fix section mismatch build warnings"
Frank Mori Hess <[email protected]>
staging: comedi: ni_mio_common: ack ai fifo error interrupts.
Gavin Schenk <[email protected]>
siox: fix possible buffer overflow in device_add_store
Liu Bo <[email protected]>
Btrfs: fix unexpected cow in run_delalloc_nocow
Hans de Goede <[email protected]>
Bluetooth: hci_bcm: Add 6 new ACPI HIDs
Eric Biggers <[email protected]>
crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one
Leonard Crestez <[email protected]>
crypto: arm,arm64 - Fix random regeneration of S_shipped
Maciej S. Szmigiero <[email protected]>
crypto: ccp - return an actual key size from RSA max_size callback
Rui Miguel Silva <[email protected]>
crypto: caam - Fix null dereference at error path
Herbert Xu <[email protected]>
crypto: ahash - Fix early termination in hash walk
LEROY Christophe <[email protected]>
crypto: talitos - fix IPsec cipher in length
Conor McLoughlin <[email protected]>
crypto: testmgr - Fix incorrect values in PKCS#1 test vector
Gregory CLEMENT <[email protected]>
crypto: inside-secure - fix clock management
LEROY Christophe <[email protected]>
crypto: talitos - don't persistently map req_ctx->hw_context and req_ctx->buf
Gary R Hook <[email protected]>
crypto: ccp - Fill the result buffer only on digest, finup, and final ops
Herbert Xu <[email protected]>
crypto: lrw - Free rctx->ext with kzfree
Alexander Gerasiov <[email protected]>
parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
Oliver Neukum <[email protected]>
media: usbtv: prevent double free in error case
Kees Cook <[email protected]>
/dev/mem: Avoid overwriting "err" in read_mem()
Colin Ian King <[email protected]>
mei: remove dev_err message on an unsupported ioctl
Joel Stanley <[email protected]>
serial: 8250: Add Nuvoton NPCM UART
Johan Hovold <[email protected]>
USB: serial: cp210x: add ELDAT Easywave RX09 id
Clemens Werther <[email protected]>
USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulator
Major Hayden <[email protected]>
USB: serial: ftdi_sio: add RT Systems VX-8 cable
Omar Sandoval <[email protected]>
bitmap: fix memset optimization on big-endian systems
-------------
Diffstat:
Documentation/devicetree/bindings/serial/8250.txt | 1 + Makefile | 4 +- arch/arm/crypto/Makefile | 2 + arch/arm64/crypto/Makefile | 2 + arch/x86/crypto/cast5_avx_glue.c | 3 +- block/bio.c | 4 +- crypto/ahash.c | 7 +- crypto/lrw.c | 2 +- crypto/testmgr.h | 6 +- drivers/base/arch_topology.c | 12 +- drivers/bluetooth/hci_bcm.c | 6 + drivers/char/mem.c | 6 +- drivers/crypto/caam/ctrl.c | 3 - drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 2 +- drivers/crypto/ccp/ccp-crypto-rsa.c | 7 +- drivers/crypto/ccp/ccp-crypto-sha.c | 2 +- drivers/crypto/inside-secure/safexcel.c | 2 +- drivers/crypto/talitos.c | 168 +++++++++------------- drivers/input/mouse/alps.c | 24 +++- drivers/input/serio/i8042-x86ia64io.h | 24 ++++ drivers/media/usb/usbtv/usbtv-core.c | 2 + drivers/misc/mei/main.c | 1 - drivers/parport/parport_pc.c | 4 + drivers/siox/siox-core.c | 2 +- drivers/staging/comedi/drivers/ni_mio_common.c | 2 + drivers/tty/serial/8250/8250_of.c | 1 + drivers/tty/serial/8250/8250_port.c | 33 +++++ drivers/tty/vt/vt.c | 6 +- drivers/usb/serial/cp210x.c | 1 + drivers/usb/serial/ftdi_sio.c | 2 + drivers/usb/serial/ftdi_sio_ids.h | 9 ++ fs/btrfs/inode.c | 37 ++++- include/linux/bitmap.h | 22 ++- include/linux/compat.h | 6 +- include/uapi/asm-generic/siginfo.h | 7 +- include/uapi/linux/serial_core.h | 3 + 36 files changed, 269 insertions(+), 156 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/31 bitmap: fix memset optimization on big-endian systems
4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Omar Sandoval <[email protected]>
commit 21035965f60b0502fc6537b232839389bb4ce664 upstream.
Commit 2a98dc028f91 ("include/linux/bitmap.h: turn bitmap_set and bitmap_clear into memset when possible") introduced an optimization to bitmap_{set,clear}() which uses memset() when the start and length are constants aligned to a byte.
This is wrong on big-endian systems; our bitmaps are arrays of unsigned long, so bit n is not at byte n / 8 in memory. This was caught by the Btrfs selftests, but the bitmap selftests also fail when run on a big-endian machine.
We can still use memset if the start and length are aligned to an unsigned long, so do that on big-endian. The same problem applies to the memcmp in bitmap_equal(), so fix it there, too.
--- include/linux/bitmap.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
include/linux/bitmap.h +17 -5
@@ -302,12 +302,20 @@ static inline void bitmap_complement(uns__bitmap_complement (dst, src, nbits); } +#ifdef __LITTLE_ENDIAN +#define BITMAP_MEM_ALIGNMENT 8 +#else +#define BITMAP_MEM_ALIGNMENT (8 * sizeof(unsigned long)) +#endif +#define BITMAP_MEM_MASK (BITMAP_MEM_ALIGNMENT - 1) +static inline int bitmap_equal (const unsigned long *src1,const unsigned long *src2,unsigned int nbits) {if (small_const_nbits (nbits))return !((*src1 ^ *src2) &BITMAP_LAST_WORD_MASK (nbits)); -if (__builtin_constant_p (nbits &7 ) &&IS_ALIGNED (nbits,8 )) +if (__builtin_constant_p (nbits &BITMAP_MEM_MASK ) && +IS_ALIGNED (nbits,BITMAP_MEM_ALIGNMENT ))return !memcmp (src1, src2, nbits /8 );return __bitmap_equal (src1, src2, nbits); }
@@ -358,8 +366,10 @@ static __always_inline void bitmap_set(u {if (__builtin_constant_p (nbits) && nbits ==1 )__set_bit (start, map); -else if (__builtin_constant_p (start &7 ) &&IS_ALIGNED (start,8 ) && -__builtin_constant_p (nbits &7 ) &&IS_ALIGNED (nbits,8 )) +else if (__builtin_constant_p (start &BITMAP_MEM_MASK ) && +IS_ALIGNED (start,BITMAP_MEM_ALIGNMENT ) && +__builtin_constant_p (nbits &BITMAP_MEM_MASK ) && +IS_ALIGNED (nbits,BITMAP_MEM_ALIGNMENT ))memset ((char *)map + start /8 ,0xff , nbits /8 );else __bitmap_set (map, start, nbits);
@@ -370,8 +380,10 @@ static __always_inline void bitmap_clear {if (__builtin_constant_p (nbits) && nbits ==1 )__clear_bit (start, map); -else if (__builtin_constant_p (start &7 ) &&IS_ALIGNED (start,8 ) && -__builtin_constant_p (nbits &7 ) &&IS_ALIGNED (nbits,8 )) +else if (__builtin_constant_p (start &BITMAP_MEM_MASK ) && +IS_ALIGNED (start,BITMAP_MEM_ALIGNMENT ) && +__builtin_constant_p (nbits &BITMAP_MEM_MASK ) && +IS_ALIGNED (nbits,BITMAP_MEM_ALIGNMENT ))memset ((char *)map + start /8 ,0 , nbits /8 );else __bitmap_clear (map, start, nbits);
Greg Kroah-Hartman
maintainerPATCH 2/31 USB: serial: ftdi_sio: add RT Systems VX-8 cable
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Major Hayden <[email protected]>
commit 9608e5c0f079390473b484ef92334dfd3431bb89 upstream.
This patch adds a device ID for the RT Systems cable used to program Yaesu VX-8R/VX-8DR handheld radios. It uses the main FTDI VID instead of the common RT Systems VID.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 3 +++ 2 files changed, 4 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -769,6 +769,7 @@ static const struct usb_device_id id_tab .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, { USB_DEVICE(NOVITUS_VID, NOVITUS_BONO_E_PID) }, + { USB_DEVICE(FTDI_VID, RTSYSTEMS_USB_VX8_PID) }, { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_S03_PID) }, { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_59_PID) }, { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_USB_57A_PID) },
drivers/usb/serial/ftdi_sio_ids.h +3 -0
@@ -923,6 +923,9 @@/* * RT Systems programming cables for various ham radios */ +/* This device uses the VID of FTDI */ +#define RTSYSTEMS_USB_VX8_PID 0x9e50/* USB-VX8 USB to 7 pin modular plug for Yaesu VX-8 radio */ +#define RTSYSTEMS_VID 0x2100/* Vendor ID */ #define RTSYSTEMS_USB_S03_PID 0x9001/* RTS-03 USB to Serial Adapter */ #define RTSYSTEMS_USB_59_PID 0x9e50/* USB-59 USB to 8 pin plug */
Greg Kroah-Hartman
maintainerPATCH 5/31 serial: 8250: Add Nuvoton NPCM UART
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joel Stanley <[email protected]>
commit f597fbce38d230af95384f4a04e0a13a1d0ad45d upstream.
The Nuvoton UART is almost compatible with the 8250 driver when probed via the 8250_of driver, however it requires some extra configuration at startup.
--- Documentation/devicetree/bindings/serial/8250.txt | 1 drivers/tty/serial/8250/8250_of.c | 1 drivers/tty/serial/8250/8250_port.c | 33 ++++++++++++++++++++++ include/uapi/linux/serial_core.h | 3 ++ 4 files changed, 38 insertions(+)
Documentation/devicetree/bindings/serial/8250.txt +1 -0
@@ -24,6 +24,7 @@ Required properties: - "ti,da830-uart" - "aspeed,ast2400-vuart" - "aspeed,ast2500-vuart" + - "nuvoton,npcm750-uart" - "serial" if the port type is unknown. - reg : offset and length of the register set for the device. - interrupts : should contain uart interrupt.
drivers/tty/serial/8250/8250_of.c +1 -0
@@ -316,6 +316,7 @@ static const struct of_device_id of_plat { .compatible = "mrvl,mmp-uart", .data = (void *)PORT_XSCALE, }, { .compatible = "ti,da830-uart", .data = (void *)PORT_DA830, }, + { .compatible = "nuvoton,npcm750-uart", .data = (void *)PORT_NPCM, }, { /* end of list */ }, }; MODULE_DEVICE_TABLE(of, of_platform_serial_table);
drivers/tty/serial/8250/8250_port.c +33 -0
@@ -47,6 +47,10 @@#define UART_EXAR_SLEEP 0x8b/* Sleep mode */ #define UART_EXAR_DVID 0x8d/* Device identification */ +/* Nuvoton NPCM timeout register */ +#define UART_NPCM_TOR 7 +#define UART_NPCM_TOIE BIT(7)/* Timeout Interrupt Enable */ +/* * Debugging. */
@@ -293,6 +297,15 @@ static const struct serial8250_config ua UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, .flags = UART_CAP_FIFO, }, + [PORT_NPCM] = { + .name = "Nuvoton 16550", + .fifo_size = 16, + .tx_loadsz = 16, + .fcr =UART_FCR_ENABLE_FIFO |UART_FCR_R_TRIG_10 | + UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT, + .rxtrig_bytes = {1, 4, 8, 14}, + .flags = UART_CAP_FIFO, + }, };/* Uart divisor latch read */
@@ -2140,6 +2153,15 @@ int serial8250_do_startup(struct uart_po UART_DA830_PWREMU_MGMT_FREE); } +if (port->type ==PORT_NPCM ) { +/* +* Nuvoton calls the scratch register 'UART_TOR' (timeout +* register). Enable it, and set TIOC (timeout interrupt +* comparator) to be 0x20 for correct operation. +*/ +serial_port_out (port,UART_NPCM_TOR ,UART_NPCM_TOIE |0x20 ); + } +#ifdef CONFIG_SERIAL_8250_RSA /* * If this is an RSA port, see if we can kick it up to the
@@ -2462,6 +2484,15 @@ static unsigned int xr17v35x_get_divisorreturn quot_16 >>4 ; } +/* Nuvoton NPCM UARTs have a custom divisor calculation */ +static unsigned int npcm_get_divisor (struct uart_8250_port *up, +unsigned int baud) +{ +struct uart_port *port = &up->port; + +return DIV_ROUND_CLOSEST (port->uartclk,16 * baud +2 ) -2 ; +} +static unsigned int serial8250_get_divisor (struct uart_8250_port *up,unsigned int baud,unsigned int *frac)
@@ -2482,6 +2513,8 @@ static unsigned int serial8250_get_divis quot =0x8002 ; else if (up->port.type == PORT_XR17V35X) quot =xr17v35x_get_divisor (up, baud, frac); + else if (up->port.type == PORT_NPCM) + quot =npcm_get_divisor (up, baud); else quot =uart_get_divisor (port, baud);
include/uapi/linux/serial_core.h +3 -0
@@ -76,6 +76,9 @@#define PORT_SUNZILOG 38#define PORT_SUNSAB 39 +/* Nuvoton UART */ +#define PORT_NPCM 40 +/* Intel EG20 */ #define PORT_PCH_8LINE 44#define PORT_PCH_2LINE 45
Greg Kroah-Hartman
maintainerPATCH 6/31 mei: remove dev_err message on an unsupported ioctl
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Colin Ian King <[email protected]>
commit bb0829a741792b56c908d7745bc0b2b540293bcc upstream.
Currently the driver spams the kernel log on unsupported ioctls which is unnecessary as the ioctl returns -ENOIOCTLCMD to indicate this anyway. I suspect this was originally for debugging purposes but it really is not required so remove it.
--- drivers/misc/mei/main.c | 1 - 1 file changed, 1 deletion(-)
drivers/misc/mei/main.c +0 -1
@@ -507,7 +507,6 @@ static long mei_ioctl(struct file *file,break ;default : -dev_err (dev->dev,": unsupported ioctl %d.\n" , cmd); rets = -ENOIOCTLCMD ; }
Greg Kroah-Hartman
maintainerPATCH 10/31 crypto: lrw - Free rctx->ext with kzfree
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 8c9bdab21289c211ca1ca6a5f9b7537b4a600a02 upstream.
The buffer rctx->ext contains potentially sensitive data and should be freed with kzfree.
--- crypto/lrw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/lrw.c +1 -1
@@ -313,7 +313,7 @@ static void exit_crypt(struct skcipher_r rctx->left =0 ;if (rctx->ext) -kfree (rctx->ext); +kzfree (rctx->ext); }static int do_encrypt (struct skcipher_request *req,int err)
Greg Kroah-Hartman
maintainerPATCH 11/31 crypto: ccp - Fill the result buffer only on digest, finup, and final ops
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gary R Hook <[email protected]>
commit 0ee991be4cdd88587aedbf68cdacd1765f57236a upstream.
Any change to the result buffer should only happen on final, finup and digest operations. Changes to the buffer for update, import, export, etc, are not allowed.
--- drivers/crypto/ccp/ccp-crypto-aes-cmac.c | 2 +- drivers/crypto/ccp/ccp-crypto-sha.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/ccp/ccp-crypto-aes-cmac.c +1 -1
@@ -46,7 +46,7 @@ static int ccp_aes_cmac_complete(struct }/* Update result area if supplied */ -if (req->result) +if (req->result && rctx->final)memcpy (req->result, rctx->iv, digest_size); e_free:
drivers/crypto/ccp/ccp-crypto-sha.c +1 -1
@@ -47,7 +47,7 @@ static int ccp_sha_complete(struct crypt }/* Update result area if supplied */ -if (req->result) +if (req->result && rctx->final)memcpy (req->result, rctx->ctx, digest_size); e_free:
Greg Kroah-Hartman
maintainerPATCH 12/31 crypto: talitos - dont persistently map req_ctx->hw_context and req_ctx->buf
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: LEROY Christophe <[email protected]>
commit ad4cd51fb8375109edb377712b5f9c0c31ece33e upstream.
Commit 49f9783b0cea ("crypto: talitos - do hw_context DMA mapping outside the requests") introduced a persistent dma mapping of req_ctx->hw_context
Commit 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash on SEC1") introduced a persistent dma mapping of req_ctx->buf
As there is no destructor for req_ctx (the request context), the associated dma handlers where set in ctx (the tfm context). This is wrong as several hash operations can run with the same ctx.
This patch removes this persistent mapping.
--- drivers/crypto/talitos.c | 132 +++++++++++++++-------------------------------- 1 file changed, 44 insertions(+), 88 deletions(-)
drivers/crypto/talitos.c +44 -88
@@ -832,8 +832,6 @@ struct talitos_ctx {unsigned int keylen;unsigned int enckeylen;unsigned int authkeylen; -dma_addr_t dma_buf; -dma_addr_t dma_hw_context; };#define HASH_MAX_BLOCK_SIZE SHA512_BLOCK_SIZE
@@ -1690,9 +1688,30 @@ static void common_nonsnoop_hash_unmap(s struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); +struct talitos_private *priv =dev_get_drvdata (dev); +bool is_sec1 =has_ftr_sec1 (priv); +struct talitos_desc *desc = &edesc->desc; +struct talitos_desc *desc2 = desc +1 ; + +unmap_single_talitos_ptr (dev, &edesc->desc.ptr[5 ],DMA_FROM_DEVICE ); +if (desc->next_desc && + desc->ptr[5 ].ptr != desc2->ptr[5 ].ptr) +unmap_single_talitos_ptr (dev, &desc2->ptr[5 ],DMA_FROM_DEVICE );talitos_sg_unmap (dev, edesc, req_ctx->psrc,NULL ,0 ,0 ); +/* When using hashctx-in, must unmap it. */ +if (from_talitos_ptr_len (&edesc->desc.ptr[1 ], is_sec1)) +unmap_single_talitos_ptr (dev, &edesc->desc.ptr[1 ], +DMA_TO_DEVICE ); +else if (desc->next_desc) +unmap_single_talitos_ptr (dev, &desc2->ptr[1 ], +DMA_TO_DEVICE ); + +if (is_sec1 && req_ctx->nbuf) +unmap_single_talitos_ptr (dev, &desc->ptr[3 ], +DMA_TO_DEVICE ); +if (edesc->dma_len)dma_unmap_single (dev, edesc->dma_link_tbl, edesc->dma_len,DMA_BIDIRECTIONAL );
@@ -1766,8 +1785,10 @@ static int common_nonsnoop_hash(struct t/* hash context in */ if (!req_ctx->first || req_ctx->swinit) { -to_talitos_ptr (&desc->ptr[1 ], ctx->dma_hw_context, - req_ctx->hw_context_size, is_sec1); +map_single_talitos_ptr (dev, &desc->ptr[1 ], + req_ctx->hw_context_size, + (char *)req_ctx->hw_context, +DMA_TO_DEVICE ); req_ctx->swinit =0 ; }/* Indicate next op is not the first. */
@@ -1793,10 +1814,9 @@ static int common_nonsnoop_hash(struct t* data in */ if (is_sec1 && req_ctx->nbuf) { -dma_addr_t dma_buf = ctx->dma_buf + req_ctx->buf_idx * -HASH_MAX_BLOCK_SIZE ; - -to_talitos_ptr (&desc->ptr[3 ], dma_buf, req_ctx->nbuf, is_sec1); +map_single_talitos_ptr (dev, &desc->ptr[3 ], req_ctx->nbuf, + req_ctx->buf[req_ctx->buf_idx], +DMA_TO_DEVICE ); }else { sg_count =talitos_sg_map (dev, req_ctx->psrc, length, edesc, &desc->ptr[3 ], sg_count, offset,0 );
@@ -1812,8 +1832,9 @@ static int common_nonsnoop_hash(struct tcrypto_ahash_digestsize (tfm), areq->result, DMA_FROM_DEVICE); else - to_talitos_ptr(&desc->ptr[5], ctx->dma_hw_context, - req_ctx->hw_context_size, is_sec1); + map_single_talitos_ptr(dev, &desc->ptr[5], + req_ctx->hw_context_size, + req_ctx->hw_context, DMA_FROM_DEVICE);/* last DWORD empty */
@@ -1832,9 +1853,14 @@ static int common_nonsnoop_hash(struct t desc->hdr |=DESC_HDR_MODE0_MDEU_CONT ; desc->hdr &= ~DESC_HDR_DONE_NOTIFY ; -to_talitos_ptr (&desc2->ptr[1 ], ctx->dma_hw_context, - req_ctx->hw_context_size, is_sec1); - +if (desc->ptr[1 ].ptr) +copy_talitos_ptr (&desc2->ptr[1 ], &desc->ptr[1 ], + is_sec1); +else +map_single_talitos_ptr (dev, &desc2->ptr[1 ], + req_ctx->hw_context_size, + req_ctx->hw_context, +DMA_TO_DEVICE );copy_talitos_ptr (&desc2->ptr[2 ], &desc->ptr[2 ], is_sec1); sg_count =talitos_sg_map (dev, req_ctx->psrc, length, edesc, &desc2->ptr[3 ], sg_count, offset,0 );
@@ -1842,8 +1868,10 @@ static int common_nonsnoop_hash(struct t sync_needed = true;copy_talitos_ptr (&desc2->ptr[5 ], &desc->ptr[5 ], is_sec1);if (req_ctx->last) -to_talitos_ptr (&desc->ptr[5 ], ctx->dma_hw_context, - req_ctx->hw_context_size, is_sec1); +map_single_talitos_ptr (dev, &desc->ptr[5 ], + req_ctx->hw_context_size, + req_ctx->hw_context, +DMA_FROM_DEVICE ); next_desc =dma_map_single (dev, &desc2->hdr1,TALITOS_DESC_SIZE ,DMA_BIDIRECTIONAL );
@@ -1881,12 +1909,8 @@ static struct talitos_edesc *ahash_edescstatic int ahash_init (struct ahash_request *areq) {struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev;struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq);unsigned int size; -struct talitos_private *priv =dev_get_drvdata (dev); -bool is_sec1 =has_ftr_sec1 (priv);/* Initialize the context */ req_ctx->buf_idx =0 ;
@@ -1898,18 +1922,6 @@ static int ahash_init(struct ahash_reque : TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512; req_ctx->hw_context_size = size; -if (ctx->dma_hw_context) -dma_unmap_single (dev, ctx->dma_hw_context, size, -DMA_BIDIRECTIONAL ); - ctx->dma_hw_context =dma_map_single (dev, req_ctx->hw_context, size, -DMA_BIDIRECTIONAL ); -if (ctx->dma_buf) -dma_unmap_single (dev, ctx->dma_buf,sizeof (req_ctx->buf), -DMA_TO_DEVICE ); -if (is_sec1) - ctx->dma_buf =dma_map_single (dev, req_ctx->buf, -sizeof (req_ctx->buf), -DMA_TO_DEVICE );return 0 ; }
@@ -1920,9 +1932,6 @@ static int ahash_init(struct ahash_requestatic int ahash_init_sha224_swinit (struct ahash_request *areq) {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq); -struct crypto_ahash *tfm =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev;ahash_init (areq); req_ctx->swinit =1 ;/* prevent h/w initting context with sha256 values*/
@@ -1940,9 +1949,6 @@ static int ahash_init_sha224_swinit(stru req_ctx->hw_context[8 ] =0 ; req_ctx->hw_context[9 ] =0 ; -dma_sync_single_for_device (dev, ctx->dma_hw_context, - req_ctx->hw_context_size,DMA_TO_DEVICE ); -return 0 ; }
@@ -2046,13 +2052,6 @@ static int ahash_process_req(struct ahas/* request SEC to INIT hash. */ if (req_ctx->first && !req_ctx->swinit) edesc->desc.hdr |=DESC_HDR_MODE0_MDEU_INIT ; -if (is_sec1) { -dma_addr_t dma_buf = ctx->dma_buf + req_ctx->buf_idx * -HASH_MAX_BLOCK_SIZE ; - -dma_sync_single_for_device (dev, dma_buf, - req_ctx->nbuf,DMA_TO_DEVICE ); - }/* When the tfm context has a keylen, it's an HMAC. * A first or last (ie. not middle) descriptor must request HMAC.
@@ -2106,12 +2105,7 @@ static int ahash_export(struct ahash_req {struct talitos_ahash_req_ctx *req_ctx =ahash_request_ctx (areq);struct talitos_export_state *export = out; -struct crypto_ahash *ahash =crypto_ahash_reqtfm (areq); -struct talitos_ctx *ctx =crypto_ahash_ctx (ahash); -struct device *dev = ctx->dev; -dma_sync_single_for_cpu (dev, ctx->dma_hw_context, - req_ctx->hw_context_size,DMA_FROM_DEVICE );memcpy (export->hw_context, req_ctx->hw_context, req_ctx->hw_context_size);memcpy (export->buf, req_ctx->buf[req_ctx->buf_idx], req_ctx->nbuf);
@@ -2130,31 +2124,14 @@ static int ahash_import(struct ahash_reqstruct crypto_ahash *tfm =crypto_ahash_reqtfm (areq);const struct talitos_export_state *export = in;unsigned int size; -struct talitos_ctx *ctx =crypto_ahash_ctx (tfm); -struct device *dev = ctx->dev; -struct talitos_private *priv =dev_get_drvdata (dev); -bool is_sec1 =has_ftr_sec1 (priv);memset (req_ctx,0 ,sizeof (*req_ctx)); size = (crypto_ahash_digestsize (tfm) <=SHA256_DIGEST_SIZE ) ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; req_ctx->hw_context_size = size; -if (ctx->dma_hw_context) -dma_unmap_single (dev, ctx->dma_hw_context, size, -DMA_BIDIRECTIONAL ); -memcpy (req_ctx->hw_context, export->hw_context, size); - ctx->dma_hw_context =dma_map_single (dev, req_ctx->hw_context, size, -DMA_BIDIRECTIONAL ); -if (ctx->dma_buf) -dma_unmap_single (dev, ctx->dma_buf,sizeof (req_ctx->buf), -DMA_TO_DEVICE );memcpy (req_ctx->buf[0 ], export->buf, export->nbuf); -if (is_sec1) - ctx->dma_buf =dma_map_single (dev, req_ctx->buf, -sizeof (req_ctx->buf), -DMA_TO_DEVICE ); req_ctx->swinit = export->swinit; req_ctx->first = export->first; req_ctx->last = export->last;
@@ -3064,27 +3041,6 @@ static void talitos_cra_exit(struct crypdma_unmap_single (dev, ctx->dma_key, ctx->keylen,DMA_TO_DEVICE ); } -static void talitos_cra_exit_ahash (struct crypto_tfm *tfm) -{ -struct talitos_ctx *ctx =crypto_tfm_ctx (tfm); -struct device *dev = ctx->dev; -unsigned int size; - -talitos_cra_exit (tfm); - - size = (crypto_ahash_digestsize (__crypto_ahash_cast (tfm)) <= -SHA256_DIGEST_SIZE ) - ?TALITOS_MDEU_CONTEXT_SIZE_MD5_SHA1_SHA256 - :TALITOS_MDEU_CONTEXT_SIZE_SHA384_SHA512 ; - -if (ctx->dma_hw_context) -dma_unmap_single (dev, ctx->dma_hw_context, size, -DMA_BIDIRECTIONAL ); -if (ctx->dma_buf) -dma_unmap_single (dev, ctx->dma_buf,HASH_MAX_BLOCK_SIZE *2 , -DMA_TO_DEVICE ); -} -/* * given the alg's descriptor header template, determine whether descriptor * type and primary/secondary execution units required match the hw
@@ -3183,7 +3139,7 @@ static struct talitos_crypto_alg *talitocase CRYPTO_ALG_TYPE_AHASH : alg = &t_alg->algt.alg.hash.halg.base; alg->cra_init = talitos_cra_init_ahash; - alg->cra_exit = talitos_cra_exit_ahash; + alg->cra_exit = talitos_cra_exit; alg->cra_type = &crypto_ahash_type; t_alg->algt.alg.hash.init = ahash_init; t_alg->algt.alg.hash.update = ahash_update;
Greg Kroah-Hartman
maintainerPATCH 13/31 crypto: inside-secure - fix clock management
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory CLEMENT <[email protected]>
commit f962eb46e7a9b98a58d2483f5eb216e738fec732 upstream.
In this driver the clock is got but never put when the driver is removed or if there is an error in the probe.
Using the managed version of clk_get() allows to let the kernel take care of it.
engine driver")
--- drivers/crypto/inside-secure/safexcel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/inside-secure/safexcel.c +1 -1
@@ -894,7 +894,7 @@ static int safexcel_probe(struct platforreturn PTR_ERR (priv->base); } - priv->clk =of_clk_get (dev->of_node,0 ); + priv->clk =devm_clk_get (&pdev->dev,NULL );if (!IS_ERR (priv->clk)) { ret =clk_prepare_enable (priv->clk);if (ret) {
Greg Kroah-Hartman
maintainerPATCH 15/31 crypto: talitos - fix IPsec cipher in length
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: LEROY Christophe <[email protected]>
commit 2b1227301a8e4729409694e323b72c064c47cb6b upstream.
For SEC 2.x+, cipher in length must contain only the ciphertext length. In case of using hardware ICV checking, the ICV length is provided via the "extent" field of the descriptor pointer.
--- drivers/crypto/talitos.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-)
drivers/crypto/talitos.c +20 -16
@@ -1128,10 +1128,10 @@ next:return count; } -static int talitos_sg_map (struct device *dev,struct scatterlist *src, -unsigned int len,struct talitos_edesc *edesc, -struct talitos_ptr *ptr, -int sg_count,unsigned int offset,int tbl_off) +static int talitos_sg_map_ext (struct device *dev,struct scatterlist *src, +unsigned int len,struct talitos_edesc *edesc, +struct talitos_ptr *ptr,int sg_count, +unsigned int offset,int tbl_off,int elen) {struct talitos_private *priv =dev_get_drvdata (dev);bool is_sec1 =has_ftr_sec1 (priv);
@@ -1140,6 +1140,7 @@ static int talitos_sg_map(struct deviceto_talitos_ptr (ptr,0 ,0 , is_sec1);return 1 ; } +to_talitos_ptr_ext_set (ptr, elen, is_sec1);if (sg_count ==1 ) {to_talitos_ptr (ptr,sg_dma_address (src) + offset, len, is_sec1);return sg_count;
@@ -1148,7 +1149,7 @@ static int talitos_sg_map(struct deviceto_talitos_ptr (ptr, edesc->dma_link_tbl + offset, len, is_sec1);return sg_count; } - sg_count =sg_to_link_tbl_offset (src, sg_count, offset, len, + sg_count =sg_to_link_tbl_offset (src, sg_count, offset, len + elen, &edesc->link_tbl[tbl_off]);if (sg_count ==1 ) {/* Only one segment now, so no link tbl needed*/
@@ -1162,6 +1163,15 @@ static int talitos_sg_map(struct devicereturn sg_count; } +static int talitos_sg_map (struct device *dev,struct scatterlist *src, +unsigned int len,struct talitos_edesc *edesc, +struct talitos_ptr *ptr,int sg_count, +unsigned int offset,int tbl_off) +{ +return talitos_sg_map_ext (dev, src, len, edesc, ptr, sg_count, offset, + tbl_off,0 ); +} +/* * fill in and submit ipsec_esp descriptor */
@@ -1179,7 +1189,7 @@ static int ipsec_esp(struct talitos_edesunsigned int ivsize =crypto_aead_ivsize (aead);int tbl_off =0 ;int sg_count, ret; -int sg_link_tbl_len; +int elen =0 ;bool sync_needed = false;struct talitos_private *priv =dev_get_drvdata (dev);bool is_sec1 =has_ftr_sec1 (priv);
@@ -1221,17 +1231,11 @@ static int ipsec_esp(struct talitos_edes* extent is bytes of HMAC postpended to ciphertext, * typically 12 for ipsec */ - sg_link_tbl_len = cryptlen; - -if (is_ipsec_esp) { -to_talitos_ptr_ext_set (&desc->ptr[4 ], authsize, is_sec1); - -if (desc->hdr &DESC_HDR_MODE1_MDEU_CICV ) - sg_link_tbl_len += authsize; - } +if (is_ipsec_esp && (desc->hdr &DESC_HDR_MODE1_MDEU_CICV )) + elen = authsize; - ret =talitos_sg_map (dev, areq->src, sg_link_tbl_len, edesc, - &desc->ptr[4 ], sg_count, areq->assoclen, tbl_off); + ret =talitos_sg_map_ext (dev, areq->src, cryptlen, edesc, &desc->ptr[4 ], + sg_count, areq->assoclen, tbl_off, elen);if (ret >1 ) { tbl_off += ret;
Greg Kroah-Hartman
maintainerPATCH 16/31 crypto: ahash - Fix early termination in hash walk
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Herbert Xu <[email protected]>
commit 900a081f6912a8985dc15380ec912752cb66025a upstream.
When we have an unaligned SG list entry where there is no leftover aligned data, the hash walk code will incorrectly return zero as if the entire SG list has been processed.
This patch fixes it by moving onto the next page instead.
--- crypto/ahash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
crypto/ahash.c +4 -3
@@ -92,13 +92,14 @@ int crypto_hash_walk_done(struct crypto_if (nbytes && walk->offset & alignmask && !err) { walk->offset =ALIGN (walk->offset, alignmask +1 ); - walk->data += walk->offset; - nbytes =min (nbytes, ((unsigned int )(PAGE_SIZE )) - walk->offset); walk->entrylen -= nbytes; -return nbytes; +if (nbytes) { + walk->data += walk->offset; +return nbytes; + } }if (walk->flags &CRYPTO_ALG_ASYNC )
Greg Kroah-Hartman
maintainerPATCH 17/31 crypto: caam - Fix null dereference at error path
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rui Miguel Silva <[email protected]>
commit b85149f6f5d5a9279f29a73b2e95342f4d465e73 upstream.
caam_remove already removes the debugfs entry, so we need to remove the one immediately before calling caam_remove.
This fix a NULL dereference at error paths is caam_probe fail.
--- drivers/crypto/caam/ctrl.c | 3 --- 1 file changed, 3 deletions(-)
drivers/crypto/caam/ctrl.c +0 -3
@@ -815,9 +815,6 @@ static int caam_probe(struct platform_dereturn 0 ; caam_remove: -#ifdef CONFIG_DEBUG_FS -debugfs_remove_recursive (ctrlpriv->dfs_root); -#endif caam_remove (pdev);return ret;
Greg Kroah-Hartman
maintainerPATCH 18/31 crypto: ccp - return an actual key size from RSA max_size callback
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maciej S. Szmigiero <[email protected]>
commit 0a9eb80e643064266868bd2fb2cd608e669309b0 upstream.
rsa-pkcs1pad uses a value returned from a RSA implementation max_size callback as a size of an input buffer passed to the RSA implementation for encrypt and sign operations.
CCP RSA implementation uses a hardware input buffer which size depends only on the current RSA key length, so it should return this key length in the max_size callback, too.
This also matches what the kernel software RSA implementation does.
Previously, the value returned from this callback was always the maximum RSA key size the CCP hardware supports.
This resulted in this huge buffer being passed by rsa-pkcs1pad to CCP even for smaller key sizes and then in a buffer overflow when ccp_run_rsa_cmd() tried to copy this large input buffer into a RSA key length-sized hardware input buffer.
--- drivers/crypto/ccp/ccp-crypto-rsa.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/crypto/ccp/ccp-crypto-rsa.c +3 -4
@@ -60,10 +60,9 @@ static int ccp_rsa_complete(struct cryptstatic unsigned int ccp_rsa_maxsize (struct crypto_akcipher *tfm) { -if (ccp_version () >CCP_VERSION (3 ,0 )) -return CCP5_RSA_MAXMOD ; -else -return CCP_RSA_MAXMOD ; +struct ccp_ctx *ctx =akcipher_tfm_ctx (tfm); + +return ctx->u.rsa.n_len; }static int ccp_rsa_crypt (struct akcipher_request *req,bool encrypt)
Greg Kroah-Hartman
maintainerPATCH 19/31 crypto: arm,arm64 - Fix random regeneration of S_shipped
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leonard Crestez <[email protected]>
commit 6aaf49b495b446ff6eec0ac983f781ca0dc56a73 upstream.
The decision to rebuild .S_shipped is made based on the relative timestamps of .S_shipped and .pl files but git makes this essentially random. This means that the perl script might run anyway (usually at most once per checkout), defeating the whole purpose of _shipped.
Fix by skipping the rule unless explicit make variables are provided:REGENERATE_ARM_CRYPTO or REGENERATE_ARM64_CRYPTO.
This can produce nasty occasional build failures downstream, for example for toolchains with broken perl. The solution is minimally intrusive to make it easier to push into stable.
Another report on a similar issue here: https://lkml.org/lkml/2018/3/8/1379
--- arch/arm/crypto/Makefile | 2 ++ arch/arm64/crypto/Makefile | 2 ++ 2 files changed, 4 insertions(+)
arch/arm/crypto/Makefile +2 -0
@@ -54,6 +54,7 @@ crct10dif-arm-ce-y := crct10dif-ce-core. crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o chacha20-neon-y := chacha20-neon-core.o chacha20-neon-glue.o +ifdef REGENERATE_ARM_CRYPTO quiet_cmd_perl = PERL $@ cmd_perl = $(PERL) $(<) > $(@)
@@ -62,5 +63,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl $(call cmd,perl) +endif .PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S
arch/arm64/crypto/Makefile +2 -0
@@ -67,6 +67,7 @@ CFLAGS_aes-glue-ce.o := -DUSE_V8_CRYPTO_ $(obj)/aes-glue-%.o: $(src)/aes-glue.c FORCE $(call if_changed_rule,cc_o_c) +ifdef REGENERATE_ARM64_CRYPTO quiet_cmd_perlasm = PERLASM $@ cmd_perlasm = $(PERL) $(<) void $(@)
@@ -75,5 +76,6 @@ $(src)/sha256-core.S_shipped: $(src)/sha $(src)/sha512-core.S_shipped: $(src)/sha512-armv8.pl $(call cmd,perlasm) +endif .PRECIOUS: $(obj)/sha256-core.S $(obj)/sha512-core.S
Greg Kroah-Hartman
maintainerPATCH 20/31 crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Biggers <[email protected]>
commit 8f461b1e02ed546fbd0f11611138da67fd85a30f upstream.
With ecb-cast5-avx, if a 128+ byte scatterlist element followed a shorter one, then the algorithm accidentally encrypted/decrypted only 8 bytes instead of the expected 128 bytes. Fix it by setting the encryption/decryption 'fn' correctly.
--- arch/x86/crypto/cast5_avx_glue.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/crypto/cast5_avx_glue.c +1 -2
@@ -66,8 +66,6 @@ static int ecb_crypt(struct blkcipher_devoid (*fn)(struct cast5_ctx *ctx,u8 *dst,const u8 *src);int err; - fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way; - err =blkcipher_walk_virt (desc, walk); desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP ;
@@ -79,6 +77,7 @@ static int ecb_crypt(struct blkcipher_de/* Process multi-block batch */ if (nbytes >= bsize *CAST5_PARALLEL_BLOCKS ) { + fn = (enc) ? cast5_ecb_enc_16way : cast5_ecb_dec_16way; do { fn(ctx, wdst, wsrc);
Greg Kroah-Hartman
maintainerPATCH 21/31 Bluetooth: hci_bcm: Add 6 new ACPI HIDs
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit 4063cafa3b24ff04635bdedc97cd3e4320415065 upstream.
Add 6 new ACPI HIDs to enable bluetooth on devices using these HIDs, I've tested the following HIDs / devices:
BCM2E74: Jumper ezPad mini 3
BCM2E83: Acer Iconia Tab8 w1-810
BCM2E90: Meegopad T08
BCM2EAA: Chuwi Vi8 plus (CWI519)
The reporter of Red Hat bugzilla 1554835 has tested:
BCM2E84: Lenovo Yoga2
The reporter of kernel bugzilla 274481 has tested:
BCM2E38: Toshiba Encore
Note the Lenovo Yoga2 and Toshiba Encore also needs the earlier patch to treat all Interrupt ACPI resources as active low.
--- drivers/bluetooth/hci_bcm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/bluetooth/hci_bcm.c +6 -0
@@ -1080,6 +1080,7 @@ static const struct hci_uart_proto bcm_p#ifdef CONFIG_ACPI static const struct acpi_device_id bcm_acpi_match[] = { {"BCM2E1A" , (kernel_ulong_t)&acpi_bcm_int_last_gpios }, + {"BCM2E38" , (kernel_ulong_t)&acpi_bcm_int_last_gpios }, {"BCM2E39" , (kernel_ulong_t)&acpi_bcm_int_last_gpios }, {"BCM2E3A" , (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E3D", (kernel_ulong_t)&acpi_bcm_int_last_gpios },
@@ -1092,12 +1093,17 @@ static const struct acpi_device_id bcm_a { "BCM2E67", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E71", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E72", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, + { "BCM2E74", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E7B", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E7C", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E7E", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, + { "BCM2E83", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, + { "BCM2E84", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, + { "BCM2E90", (kernel_ulong_t)&acpi_bcm_int_last_gpios }, { "BCM2E95", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, { "BCM2E96", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, { "BCM2EA4", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, + { "BCM2EAA", (kernel_ulong_t)&acpi_bcm_int_first_gpios }, { }, };MODULE_DEVICE_TABLE (acpi, bcm_acpi_match);
Greg Kroah-Hartman
maintainerPATCH 22/31 Btrfs: fix unexpected cow in run_delalloc_nocow
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Liu Bo <[email protected]>
commit 5811375325420052fcadd944792a416a43072b7f upstream.
Fstests generic/475 provides a way to fail metadata reads while checking if checksum exists for the inode inside run_delalloc_nocow(), and csum_exist_in_range() interprets error (-EIO) as inode having checksum and makes its caller enter the cow path.
In case of free space inode, this ends up with a warning in cow_file_range().
The same problem applies to btrfs_cross_ref_exist() since it may also read metadata in between.
With this, run_delalloc_nocow() bails out when errors occur at the two places.
--- fs/btrfs/inode.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-)
fs/btrfs/inode.c +32 -5
@@ -1262,6 +1262,8 @@ static noinline int csum_exist_in_range(list_del (&sums->list);kfree (sums); } +if (ret <0 ) +return ret;return 1 ; }
@@ -1394,10 +1396,23 @@ next_slot: goto out_check;if (btrfs_extent_readonly (fs_info, disk_bytenr)) goto out_check; -if (btrfs_cross_ref_exist (root, ino, - found_key.offset - - extent_offset, disk_bytenr)) + ret =btrfs_cross_ref_exist (root, ino, + found_key.offset - + extent_offset, disk_bytenr); +if (ret) { +/* +* ret could be -EIO if the above fails to read +* metadata. +*/ +if (ret <0 ) { +if (cow_start != (u64)-1 ) + cur_offset = cow_start; + goto error; + } + +WARN_ON_ONCE (nolock); goto out_check; + } disk_bytenr += extent_offset; disk_bytenr += cur_offset - found_key.offset; num_bytes =min (end +1 , extent_end) - cur_offset;
@@ -1415,10 +1430,22 @@ next_slot:* this ensure that csum for a given extent are * either valid or do not exist. */ -if (csum_exist_in_range (fs_info, disk_bytenr, - num_bytes)) { + ret =csum_exist_in_range (fs_info, disk_bytenr, + num_bytes); +if (ret) {if (!nolock)btrfs_end_write_no_snapshotting (root); + +/* +* ret could be -EIO if the above fails to read +* metadata. +*/ +if (ret <0 ) { +if (cow_start != (u64)-1 ) + cur_offset = cow_start; + goto error; + } +WARN_ON_ONCE (nolock); goto out_check; }if (!btrfs_inc_nocow_writers (fs_info, disk_bytenr)) {
Greg Kroah-Hartman
maintainerPATCH 23/31 siox: fix possible buffer overflow in device_add_store
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gavin Schenk <[email protected]>
commit f87deada80fe483e2286e29cd866dc66ddc2b6bc upstream.
Width 20 given in format string is larger than destination buffer 'type[20]', use %19s to prevent overflowing it.
--- drivers/siox/siox-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/siox/siox-core.c +1 -1
@@ -594,7 +594,7 @@ static ssize_t device_add_store(struct dsize_t inbytes =0 , outbytes =0 ;u8 statustype =0 ; - ret =sscanf (buf,"%20s %zu %zu %hhu" , type, &inbytes, + ret =sscanf (buf,"%19s %zu %zu %hhu" , type, &inbytes, &outbytes, &statustype);if (ret !=3 && ret !=4 )return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 24/31 staging: comedi: ni_mio_common: ack ai fifo error interrupts.
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frank Mori Hess <[email protected]>
commit e1d9fc04c41840a4688ef6ce90b6dcca157ea4d7 upstream.
Ack ai fifo error interrupts in interrupt handler to clear interrupt after fifo overflow. It should prevent lock-ups after the ai fifo overflows.
--- drivers/staging/comedi/drivers/ni_mio_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/comedi/drivers/ni_mio_common.c +2 -0
@@ -1275,6 +1275,8 @@ static void ack_a_interrupt(struct comed ack |=NISTC_INTA_ACK_AI_START ;if (a_status &NISTC_AI_STATUS1_STOP ) ack |=NISTC_INTA_ACK_AI_STOP ; +if (a_status &NISTC_AI_STATUS1_OVER ) + ack |=NISTC_INTA_ACK_AI_ERR ;if (ack)ni_stc_writew (dev, ack,NISTC_INTA_ACK_REG ); }
Greg Kroah-Hartman
maintainerPATCH 25/31 Revert "base: arch_topology: fix section mismatch build warnings"
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gaku Inami <[email protected]>
commit 9de9a449482677a75f1edd2049268a7efc40fc96 upstream.
This reverts commit 452562abb5b7 ("base: arch_topology: fix section mismatch build warnings"). It causes the notifier call hangs in some use-cases.
In some cases with using maxcpus, some of cpus are booted first and then the remaining cpus are booted. As an example, some users who want to realize fast boot up often use the following procedure.
1) Define all CPUs on device tree (CA57x4 + CA53x4)
2) Add "maxcpus=4" in bootargs
3) Kernel boot up with CA57x4
4) After kernel boot up, CA53x4 is booted from user
When kernel init was finished, CPUFREQ_POLICY_NOTIFIER was not still unregisterd. This means that "__init init_cpu_capacity_callback()" will be called after kernel init sequence. To avoid this problem, it needs to remove __init{,data} annotations by reverting this commit.
Also, this commit was needed to fix kernel compile issue below. However, this issue was also fixed by another patch: commit 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()") in v4.15 as well.
Whereas commit 452562abb5b7 added all the missing __init annotations, commit 82d8ba717ccb removed it from free_raw_capacity().
WARNING: vmlinux.o(.text+0x548f24): Section mismatch in reference from the function init_cpu_capacity_callback() to the variable .init.text:$x
The function init_cpu_capacity_callback() references the variable __init $x.
This is often because init_cpu_capacity_callback lacks a __init annotation or the annotation of $x is wrong.
--- drivers/base/arch_topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/base/arch_topology.c +6 -6
@@ -169,11 +169,11 @@ bool __init topology_parse_cpu_capacity( }#ifdef CONFIG_CPU_FREQ -static cpumask_var_t cpus_to_visit__initdata ; -static void __init parsing_done_workfn (struct work_struct *work); -static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn); +static cpumask_var_t cpus_to_visit; +static void parsing_done_workfn (struct work_struct *work); +static DECLARE_WORK(parsing_done_work, parsing_done_workfn); -static int __init +static int init_cpu_capacity_callback (struct notifier_block *nb,unsigned long val,void *data)
@@ -209,7 +209,7 @@ init_cpu_capacity_callback(struct notifireturn 0 ; } -static struct notifier_block init_cpu_capacity_notifier__initdata = { +static struct notifier_block init_cpu_capacity_notifier = { .notifier_call = init_cpu_capacity_callback, };
@@ -242,7 +242,7 @@ static int __init register_cpufreq_notif }core_initcall (register_cpufreq_notifier); -static void __init parsing_done_workfn (struct work_struct *work) +static void parsing_done_workfn (struct work_struct *work) {cpufreq_unregister_notifier (&init_cpu_capacity_notifier,CPUFREQ_POLICY_NOTIFIER );
Greg Kroah-Hartman
maintainerPATCH 26/31 Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masaki Ota <[email protected]>
commit 567b9b549cfa1cbc202762ae97b5385c29ade1e3 upstream.
The primary interface for the touchpad device in Thinkpad L570 is SMBus, so ALPS overlooked PS2 interface Firmware setting of TrackStick, and shipped with TrackStick otp bit is disabled.
The address 0xD7 contains device number information, so we can identify the device by checking this value, but to access it we need to enable Command mode, and then re-enable the device. Devices shipped in Thinkpad L570 report either 0x0C or 0x1D as device numbers, if we see them we assume that the devices are DualPoints.
The same issue exists on Dell Latitude 7370.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196929
--- drivers/input/mouse/alps.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-)
drivers/input/mouse/alps.c +21 -3
@@ -2544,13 +2544,31 @@ static int alps_update_btn_info_ss4_v2(u }static int alps_update_dual_info_ss4_v2 (unsigned char otp[][4 ], -struct alps_data *priv) +struct alps_data *priv, +struct psmouse *psmouse) {bool is_dual = false; +int reg_val =0 ; +struct ps2dev *ps2dev = &psmouse->ps2dev; -if (IS_SS4PLUS_DEV (priv->dev_id)) +if (IS_SS4PLUS_DEV (priv->dev_id)) { is_dual = (otp[0 ][0 ] >>4 ) &0x01 ; +if (!is_dual) { +/* For support TrackStick of Thinkpad L/E series */ +if (alps_exit_command_mode (psmouse) ==0 && +alps_enter_command_mode (psmouse) ==0 ) { + reg_val =alps_command_mode_read_reg (psmouse, +0xD7 ); + } +alps_exit_command_mode (psmouse); +ps2_command (ps2dev,NULL ,PSMOUSE_CMD_ENABLE ); + +if (reg_val ==0x0C || reg_val ==0x1D ) + is_dual = true; + } + } +if (is_dual) priv->flags |=ALPS_DUALPOINT |ALPS_DUALPOINT_WITH_PRESSURE ;
@@ -2573,7 +2591,7 @@ static int alps_set_defaults_ss4_v2(strualps_update_btn_info_ss4_v2 (otp, priv); -alps_update_dual_info_ss4_v2 (otp, priv); +alps_update_dual_info_ss4_v2 (otp, priv, psmouse);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 31/31 signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric W. Biederman <[email protected]>
commit 8420f71943ae96dcd78da5bd4a5c2827419d340c upstream.
The change moving addr_lsb into the _sigfault union failed to take into account that _sigfault._addr_bnd._lower being a pointer forced the entire union to have pointer alignment. The fix for _sigfault._addr_bnd._lower having pointer alignment failed to take into account that m68k has a pointer alignment less than the size of a pointer. So simply making the padding members pointers changed the location of later members in the structure.
Fix this by directly computing the needed size of the padding members, and making the padding members char arrays of the needed size. AKA if __alignof__(void *) is 1 sizeof(short) otherwise __alignof__(void *). Which should be exactly the same rules the compiler whould have used when computing the padding.
I have tested this change by adding BUILD_BUG_ONs to m68k to verify the offset of every member of struct siginfo, and with those testing that the offsets of the fields in struct siginfo is the same before I changed the generic _sigfault member and after the correction to the _sigfault member.
I have also verified that the x86 with it's own BUILD_BUG_ONs to verify the offsets of the siginfo members also compiles cleanly.
--- include/linux/compat.h | 6 ++++-- include/uapi/asm-generic/siginfo.h | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-)
include/linux/compat.h +4 -2
@@ -222,6 +222,8 @@ typedef struct compat_siginfo {#ifdef __ARCH_SI_TRAPNOint _trapno;/* TRAP # which caused the signal */ #endif +#define __COMPAT_ADDR_BND_PKEY_PAD (__alignof__(compat_uptr_t) < sizeof(short) ? \ + sizeof(short) : __alignof__(compat_uptr_t))union {/* * used when si_code=BUS_MCEERR_AR or
@@ -230,13 +232,13 @@ typedef struct compat_siginfo {short int _addr_lsb;/* Valid LSB of the reported address. */ /* used when si_code=SEGV_BNDERR */ struct { -compat_uptr_t _dummy_bnd; +char _dummy_bnd[__COMPAT_ADDR_BND_PKEY_PAD];compat_uptr_t _lower;compat_uptr_t _upper; } _addr_bnd;/* used when si_code=SEGV_PKUERR */ struct { -compat_uptr_t _dummy_pkey; +char _dummy_pkey[__COMPAT_ADDR_BND_PKEY_PAD];u32 _pkey; } _addr_pkey; };
include/uapi/asm-generic/siginfo.h +5 -2
@@ -94,6 +94,9 @@ typedef struct siginfo {unsigned int _flags;/* see ia64 si_flags */ unsigned long _isr;/* isr */ #endif + +#define __ADDR_BND_PKEY_PAD (__alignof__(void *) < sizeof(short) ? \ + sizeof(short) : __alignof__(void *))union {/* * used when si_code=BUS_MCEERR_AR or
@@ -102,13 +105,13 @@ typedef struct siginfo {short _addr_lsb;/* LSB of the reported address */ /* used when si_code=SEGV_BNDERR */ struct { -void *_dummy_bnd; +char _dummy_bnd[__ADDR_BND_PKEY_PAD];void __user *_lower;void __user *_upper; } _addr_bnd;/* used when si_code=SEGV_PKUERR */ struct { -void *_dummy_pkey; +char _dummy_pkey[__ADDR_BND_PKEY_PAD];__u32 _pkey; } _addr_pkey; };
Greg Kroah-Hartman
maintainerPATCH 14/31 crypto: testmgr - Fix incorrect values in PKCS#1 test vector
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Conor McLoughlin <[email protected]>
commit 333e18c5cc74438f8940c7f3a8b3573748a371f9 upstream.
The RSA private key for the first form should have version, prime1, prime2, exponent1, exponent2, coefficient values 0.
With non-zero values for prime1,2, exponent 1,2 and coefficient the Intel QAT driver will assume that values are provided for the private key second form. This will result in signature verification failures for modules where QAT device is present and the modules are signed with rsa,sha256.
--- crypto/testmgr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
crypto/testmgr.h +3 -3
@@ -548,7 +548,7 @@ static const struct akcipher_testvec rsastatic const struct akcipher_testvec pkcs1pad_rsa_tv_template[] = { { .key = -"\x30\x82\x03\x1f\x02\x01\x10\x02\x82\x01\x01\x00\xd7\x1e\x77\x82" +"\x30\x82\x03\x1f\x02\x01\x00\x02\x82\x01\x01\x00\xd7\x1e\x77\x82" "\x8c\x92\x31\xe7\x69\x02\xa2\xd5\x5c\x78\xde\xa2\x0c\x8f\xfe\x28" "\x59\x31\xdf\x40\x9c\x60\x61\x06\xb9\x2f\x62\x40\x80\x76\xcb\x67" "\x4a\xb5\x59\x56\x69\x17\x07\xfa\xf9\x4c\xbd\x6c\x37\x7a\x46\x7d"
@@ -597,8 +597,8 @@ static const struct akcipher_testvec pkc"\xfe\xf8\x27\x1b\xd6\x55\x60\x5e\x48\xb7\x6d\x9a\xa8\x37\xf9\x7a" "\xde\x1b\xcd\x5d\x1a\x30\xd4\xe9\x9e\x5b\x3c\x15\xf8\x9c\x1f\xda" "\xd1\x86\x48\x55\xce\x83\xee\x8e\x51\xc7\xde\x32\x12\x47\x7d\x46" -"\xb8\x35\xdf\x41\x02\x01\x30\x02\x01\x30\x02\x01\x30\x02\x01\x30" - "\x02\x01\x30", +"\xb8\x35\xdf\x41\x02\x01\x00\x02\x01\x00\x02\x01\x00\x02\x01\x00" + "\x02\x01\x00", .key_len = 804,/* * m is SHA256 hash of following message:
Greg Kroah-Hartman
maintainerPATCH 27/31 Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dennis Wassenberg <[email protected]>
commit b56af54ac78c54a519d82813836f305d7f76ef27 upstream.
Reset i8042 before probing because of insufficient BIOS initialisation of the i8042 serial controller. This makes Synaptics touchpad detection possible. Without resetting the Synaptics touchpad is not detected because there are always NACK messages from AUX port.
--- drivers/input/serio/i8042-x86ia64io.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +7 -0
@@ -621,6 +621,13 @@ static const struct dmi_system_id __init }, }, { +/* Lenovo ThinkPad L460 */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"), + }, + }, + {/* Clevo P650RS, 650RP6, Sager NP8152-S, and others */ .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
Greg Kroah-Hartman
maintainerPATCH 28/31 Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ondrej Zary <[email protected]>
commit 04bb1719c4de94700056241d4c0fe3c1413f5aff upstream.
The touch sensor buttons on Sony VAIO VGN-CS series laptops (e.g. VGN-CS31S) are a separate PS/2 device. As the MUX is disabled for all VAIO machines by the nomux blacklist, the data from touch sensor buttons and touchpad are combined. The protocol used by the buttons is probably similar to the touchpad protocol (both are Synaptics) so both devices get enabled. The controller combines the data, creating a mess which results in random button clicks, touchpad stopping working and lost sync error messages:
psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 4 psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 psmouse serio1: TouchPad at isa0060/serio1/input0 lost sync at byte 1 psmouse serio1: issuing reconnect request
Add a new i8042_dmi_forcemux_table whitelist with VGN-CS. With MUX enabled, touch sensor buttons are detected as separate device (and left disabled as there's currently no driver), fixing all touchpad problems.
--- drivers/input/serio/i8042-x86ia64io.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/input/serio/i8042-x86ia64io.h +17 -0
@@ -530,6 +530,20 @@ static const struct dmi_system_id __init { } }; +static const struct dmi_system_id i8042_dmi_forcemux_table[]__initconst = { + { +/* +* Sony Vaio VGN-CS series require MUX or the touch sensor +* buttons will disturb touchpad operation +*/ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Sony Corporation" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"VGN-CS" ), + }, + }, + { } +}; +/* * On some Asus laptops, just running self tests cause problems. */
@@ -1170,6 +1184,9 @@ static int __init i8042_platform_init(voif (dmi_check_system (i8042_dmi_nomux_table)) i8042_nomux = true; +if (dmi_check_system (i8042_dmi_forcemux_table)) + i8042_nomux = false; +if (dmi_check_system (i8042_dmi_notimeout_table)) i8042_notimeout = true;
Greg Kroah-Hartman
maintainerPATCH 29/31 vt: change SGR 21 to follow the standards
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Frysinger <[email protected]>
commit 65d9982d7e523a1a8e7c9af012da0d166f72fc56 upstream.
ECMA-48 [1] (aka ISO 6429) has defined SGR 21 as "doubly underlined" since at least March 1984. The Linux kernel has treated it as SGR 22 "normal intensity" since it was added in Linux-0.96b in June 1992. Before that, it was simply ignored. Other terminal emulators have either ignored it, or treat it as double underline now. xterm for example added support in its 304 release (May 2014) [2] where it was previously ignoring it.
Changing this behavior shouldn't be an issue:
- It isn't a named capability in ncurses's terminfo database, so no script is using libtinfo/libcurses to look this up, or using tput to query & output the right sequence.
- Any script assuming SGR 21 will reset intensity in all terminals already do not work correctly on non-Linux VTs (including running under screen/tmux/etc...).
- If someone has written a script that only runs in the Linux VT, and they're using SGR 21 (instead of SGR 22), the output should still be readable.
imo it's important to change this as the Linux VT's non-conformance is sometimes used as an argument for other terminal emulators to not implement SGR 21 at all, or do so incorrectly.
[1]: https://www.ecma-international.org/publications/standards/Ecma-048.htm
[2]: https://github.com/ThomasDickey/xterm-snapshots/commit/2fd29cb98d214cb536bcafbee00bc73b3f1eeb9d
--- drivers/tty/vt/vt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/tty/vt/vt.c +5 -1
@@ -1354,6 +1354,11 @@ static void csi_m(struct vc_data *vc)case 3 : vc->vc_italic =1 ;break ; +case 21 : +/* +* No console drivers support double underline, so +* convert it to a single underline. +*/ case 4 : vc->vc_underline =1 ;break ;
@@ -1389,7 +1394,6 @@ static void csi_m(struct vc_data *vc) vc->vc_disp_ctrl =1 ; vc->vc_toggle_meta =1 ;break ; -case 21 :case 22 : vc->vc_intensity =1 ;break ;
Greg Kroah-Hartman
maintainerPATCH 3/31 USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulator
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Clemens Werther <[email protected]>
commit 6555ad13a01952c16485c82a52ad1f3e07e34b3a upstream.
Add device id for Harman FirmwareHubEmulator to make the device auto-detectable by the driver.
--- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 7 insertions(+)
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -932,6 +932,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) }, { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_FHE_PID) }, { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) }, { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -1445,6 +1445,12 @@#define FTDI_CINTERION_MC55I_PID 0xA951/* +* Product: FirmwareHubEmulator +* Manufacturer: Harman Becker Automotive Systems +*/ +#define FTDI_FHE_PID 0xA9A0 + +/* * Product: Comet Caller ID decoder * Manufacturer: Crucible Technologies */
Greg Kroah-Hartman
maintainerPATCH 30/31 Fix slab name "biovec-(1<<(21-12))"
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit bd5c4facf59648581d2f1692dad7b107bf429954 upstream.
I'm getting a slab named "biovec-(1<<(21-12))". It is caused by unintended expansion of the macro BIO_MAX_PAGES. This patch renames it to biovec-max.
--- block/bio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
block/bio.c +2 -2
@@ -43,9 +43,9 @@* break badly! cannot be bigger than what you can fit into an * unsigned short */ -#define BV (x) { .nr_vecs = x, .name = "biovec-"__stringify(x) } +#define BV (x, n) { .nr_vecs = x, .name = "biovec-"#n }static struct biovec_slab bvec_slabs[BVEC_POOL_NR ]__read_mostly = { -BV (1 ),BV (4 ),BV (16 ),BV (64 ),BV (128 ),BV (BIO_MAX_PAGES ), +BV (1 ,1 ),BV (4 ,4 ),BV (16 ,16 ),BV (64 ,64 ),BV (128 ,128 ),BV (BIO_MAX_PAGES , max), };#undef BV
Greg Kroah-Hartman
maintainerPATCH 4/31 USB: serial: cp210x: add ELDAT Easywave RX09 id
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 1f1e82f74c0947e40144688c9e36abe4b3999f49 upstream.
Add device id for ELDAT Easywave RX09 tranceiver.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -155,6 +155,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */ { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */ { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ + { USB_DEVICE(0x155A, 0x1006) }, /* ELDAT Easywave RX09 */ { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */ { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */ { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
Greg Kroah-Hartman
maintainerPATCH 7/31 /dev/mem: Avoid overwriting "err" in read_mem()
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit b5b38200ebe54879a7264cb6f33821f61c586a7e upstream.
Successes in probe_kernel_read() would mask failures in copy_to_user() during read_mem().
--- drivers/char/mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/char/mem.c +3 -3
@@ -137,7 +137,7 @@ static ssize_t read_mem(struct file *filwhile (count >0 ) {unsigned long remaining; -int allowed; +int allowed, probe; sz =size_inside_page (p, count);
@@ -160,9 +160,9 @@ static ssize_t read_mem(struct file *filif (!ptr) goto failed; - err =probe_kernel_read (bounce, ptr, sz); + probe =probe_kernel_read (bounce, ptr, sz);unxlate_dev_mem_ptr (p, ptr); -if (err) +if (probe) goto failed; remaining =copy_to_user (buf, bounce, sz);
Greg Kroah-Hartman
maintainerPATCH 8/31 media: usbtv: prevent double free in error case
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit 50e7044535537b2a54c7ab798cd34c7f6d900bd2 upstream.
Quoting the original report:
It looks like there is a double-free vulnerability in Linux usbtv driver on an error path of usbtv_probe function. When audio registration fails, usbtv_video_free function ends up freeing usbtv data structure, which gets freed the second time under usbtv_video_fail label.
usbtv_audio_fail:
usbtv_video_free(usbtv); =>
v4l2_device_put(&usbtv->v4l2_dev);
=> v4l2_device_put
=> kref_put
=> v4l2_device_release => usbtv_release (CALLBACK)
=> kfree(usbtv) (1st time)
usbtv_video_fail:
usb_set_intfdata(intf, NULL);
usb_put_dev(usbtv->udev);
kfree(usbtv); (2nd time)So, as we have refcounting, use it
--- drivers/media/usb/usbtv/usbtv-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/usb/usbtv/usbtv-core.c +2 -0
@@ -112,6 +112,8 @@ static int usbtv_probe(struct usb_interfreturn 0 ; usbtv_audio_fail: +/* we must not free at this point */ +usb_get_dev (usbtv->udev);usbtv_video_free (usbtv); usbtv_video_fail:
Greg Kroah-Hartman
maintainerPATCH 9/31 parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
In reply to Greg Kroah-Hartman4.16-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Gerasiov <[email protected]>
commit 823f7923833c6cc2b16e601546d607dcfb368004 upstream.
WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382 but serial ports are not soldered on board. Detected as
Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
--- drivers/parport/parport_pc.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/parport/parport_pc.c +4 -0
@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards { netmos_9901, netmos_9865, quatech_sppxp100, + wch_ch382l, };
@@ -2708,6 +2709,7 @@ static struct parport_pc_pci { /* netmos_9901 */ { 1, { { 0, -1 }, } }, /* netmos_9865 */ { 1, { { 0, -1 }, } }, /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, + /* wch_ch382l */ { 1, { { 2, -1 }, } }, }; static const struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2797,6 +2799,8 @@ static const struct pci_device_id parpor/* Quatech SPPXP-100 Parallel port PCI ExpressCard */ {PCI_VENDOR_ID_QUATECH ,PCI_DEVICE_ID_QUATECH_SPPXP_100 , PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 }, +/* WCH CH382L PCI-E single parallel port card */ + { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l }, { 0, } /* terminate list */ };MODULE_DEVICE_TABLE (pci, parport_pc_pci_tbl);
stable-rc/linux-4.16.y boot: 65 boots: 1 failed, 62 passed with 2 untried/unknown (v4.16-32-g30380aa57922)
stable-rc/linux-4.16.y boot: 65 boots: 1 failed, 62 passed with 2 untried/unknown (v4.16-32-g30380aa57922)
Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.16.y/kernel/v4.16-32-g30380aa57922/
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-4.16.y/kernel/v4.16-32-g30380aa57922/
Tree: stable-rc
Branch: linux-4.16.y
Git Describe: v4.16-32-g30380aa57922
Git Commit: 30380aa579224caf6a737160802151f466fe3953
Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 32 unique boards, 14 SoC families, 15 builds out of 186
Boot Failure Detected:
arm:
mvebu_v7_defconfig
armada-375-db: 1 failed lab---
For more info write to <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.16.1 release. There are 31 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 8 08:43:15 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.16.1-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.16.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Greg Kroah-Hartman
maintainerQuoted 15 lines · Shuah Khan
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.16.1 release. There are 31 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 8 08:43:15 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.16.1-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.16.y
and the diffstat can be found below.
Quoted 6 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Thanks for testing all of these (there were a lot), and letting me know.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.16.1 release. There are 31 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 8 08:43:15 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.16.1-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.16.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm and x86_64.
Summary
------------------------------------------------------------------------
kernel: 4.16.1-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.16.y
git commit: 30380aa579224caf6a737160802151f466fe3953
git describe: v4.16-32-g30380aa57922
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.16-oe/build/v4.16-32-g30380aa57922
No regressions (compared to build )
------------------------------------------------------------------------
Boards, architectures and test suites:
-------------------------------------
dragonboard-410c - arm64
* boot - fail: 1, pass: 20
* kselftest - skip: 20, pass: 45
* libhugetlbfs - skip: 1, pass: 90
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 17, pass: 64
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 2, pass: 61
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - skip: 1, pass: 21
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - pass: 14
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 147, pass: 1003
* ltp-timers-tests - skip: 1, pass: 12
hi6220-hikey - arm64
* boot - pass: 20
* kselftest - skip: 17, pass: 48
* libhugetlbfs - skip: 1, pass: 90
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 17, pass: 64
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 2, pass: 61
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - skip: 1, pass: 21
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - skip: 4, pass: 10
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 150, pass: 1000
* ltp-timers-tests - skip: 1, pass: 12
juno-r2 - arm64
* boot - pass: 20
* kselftest - skip: 17, pass: 48
* libhugetlbfs - skip: 1, pass: 90
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 17, pass: 64
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 2, pass: 61
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - pass: 22
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - skip: 4, pass: 10
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 148, pass: 1002
* ltp-timers-tests - skip: 1, pass: 12
qemu_x86_64
* boot - pass: 22
* kselftest - skip: 23, pass: 57
* kselftest-vsyscall-mode-native - skip: 23, pass: 57
* kselftest-vsyscall-mode-none - skip: 23, pass: 57
* libhugetlbfs - skip: 1, pass: 90
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 17, pass: 64
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 6, pass: 57
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - pass: 22
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - skip: 1, pass: 13
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 149, pass: 1001
* ltp-timers-tests - skip: 1, pass: 12
x15 - arm
* boot - pass: 20
* kselftest - skip: 21, fail: 1, pass: 40
* libhugetlbfs - skip: 1, fail: 1, pass: 86
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 18, pass: 63
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 2, pass: 61
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - skip: 2, pass: 20
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - skip: 1, pass: 13
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 97, pass: 1053
* ltp-timers-tests - skip: 1, pass: 12
x86_64
* boot - pass: 22
* kselftest - skip: 24, pass: 61
* kselftest-vsyscall-mode-native - skip: 19, pass: 61
* kselftest-vsyscall-mode-none - skip: 19, fail: 1, pass: 60
* libhugetlbfs - skip: 1, pass: 90
* ltp-cap_bounds-tests - pass: 2
* ltp-containers-tests - skip: 17, pass: 62
* ltp-fcntl-locktests-tests - pass: 2
* ltp-filecaps-tests - pass: 2
* ltp-fs-tests - skip: 1, pass: 62
* ltp-fs_bind-tests - pass: 2
* ltp-fs_perms_simple-tests - pass: 19
* ltp-fsx-tests - pass: 2
* ltp-hugetlb-tests - pass: 22
* ltp-io-tests - pass: 3
* ltp-ipc-tests - pass: 9
* ltp-math-tests - pass: 11
* ltp-nptl-tests - pass: 2
* ltp-pty-tests - pass: 4
* ltp-sched-tests - skip: 5, pass: 9
* ltp-securebits-tests - pass: 4
* ltp-syscalls-tests - skip: 119, pass: 1031
* ltp-timers-tests - skip: 1, pass: 12
--
Linaro QA (beta)
https://qa-reports.linaro.org
Greg Kroah-Hartman
maintainerQuoted 25 lines · Naresh Kamboju
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.16.1 release. There are 31 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Apr 8 08:43:15 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.16.1-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-4.16.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm andx86_64.Summary
------------------------------------------------------------------------
Quoted 8 lines
kernel: 4.16.1-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.16.y
git commit:30380aa579224caf6a737160802151f466fe3953
git describe: v4.16-32-g30380aa57922
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.16-oe/build/v4.16-32-g30380aa57922No regressions (compared to build )
Compared to what build? :)
thanks,
greg k-h
Quoted 13 lines
Quoted 13 lines
Results from Linaro’s test farm.
No regressions on arm64, arm andx86_64.Summary
------------------------------------------------------------------------kernel: 4.16.1-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.16.y
git commit:30380aa579224caf6a737160802151f466fe3953
git describe: v4.16-32-g30380aa57922
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.16-oe/build/v4.16-32-g30380aa57922
Quoted 3 lines
Quoted 1 line
No regressions (compared to build )
Compared to what build? :)
There is no previous build to compare.
stable-rc 4.16 is the new build in our system.
This build results will act as base line for coming up 4.16 builds.
- Naresh
Greg Kroah-Hartman
maintainerQuoted 13 lines · Naresh Kamboju
Quoted 13 lines
Quoted 13 lines
Results from Linaro’s test farm.
No regressions on arm64, arm andx86_64.Summary
------------------------------------------------------------------------kernel: 4.16.1-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.16.y
git commit:30380aa579224caf6a737160802151f466fe3953
git describe: v4.16-32-g30380aa57922
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.16-oe/build/v4.16-32-g30380aa57922
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
No regressions (compared to build )
Compared to what build? :)
There is no previous build to compare.
stable-rc 4.16 is the new build in our system.
This build results will act as base line for coming up 4.16 builds.
Why were you all not testing 4.16-rc releases and the final 4.16.0 release? For some reason I thought you all were doing that.
thanks,
greg k-h
Quoted 16 lines · Greg Kroah-Hartman
Quoted 15 lines · Naresh Kamboju
Quoted 15 lines
Quoted 14 lines
Results from Linaro’s test farm.
No regressions on arm64, arm andx86_64.Summary
------------------------------------------------------------------------kernel: 4.16.1-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-4.16.y
git commit:30380aa579224caf6a737160802151f466fe3953
git describe: v4.16-32-g30380aa57922
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-4.16-oe/build/v4.16-32-g30380aa57922No regressions (compared to build )
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Compared to what build? :)
There is no previous build to compare.
stable-rc 4.16 is the new build in our system.
This build results will act as base line for coming up 4.16 builds.Why were you all not testing 4.16-rc releases and the final 4.16.0 release? For some reason I thought you all were doing that.
Hi Greg -
We track each branch separately and since linux-4.16.y is new, this was the first build. But, we tested 4.16 release on our mainline tracking branch (along with all the RCs and such before release). We have been testing all along, it just doesn't show up here because this is a new git branch and new qa-reports 'project'.
In any case, we review all test failures to identify any issues, on all LTS branches, stable, mainline, and next. So, regardless of whether or not qa-reports identifies something as a 'regression', we'll notice it.
Hope that helps,
Dan