commit 11454943b264b548e714d8edf932ebf306e5f808
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Sun Apr 8 14:29:52 2018 +0200

    Linux 4.16.1

commit e4423fc2f55470dc6bdd297ca599779eb5af713b
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Mon Apr 2 14:45:42 2018 -0500

    signal: Correct the offset of si_pkey and si_lower in struct siginfo on m68k
    
    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.
    
    Cc: stable@vger.kernel.org
    Reported-by: Eugene Syromiatnikov <esyr@redhat.com>
    Fixes: 859d880cf544 ("signal: Correct the offset of si_pkey in struct siginfo")
    Fixes: b68a68d3dcc1 ("signal: Move addr_lsb into the _sigfault union for clarity")
    Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4f85cbc5b6f14e9a821d75d16d86ab170a6a39f9
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Wed Mar 21 12:49:29 2018 -0400

    Fix slab name "biovec-(1<<(21-12))"
    
    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.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Cc: stable@vger.kernel.org      # v4.14+
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 4f92c1eca3ecc408db1f53a43c748d608705bfae
Author: Mike Frysinger <vapier@chromium.org>
Date:   Mon Jan 29 17:08:21 2018 -0500

    vt: change SGR 21 to follow the standards
    
    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
    
    Signed-off-by: Mike Frysinger <vapier@chromium.org>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 5bd122146ef31ad17cd54d37acefb654d8ebd124
Author: Ondrej Zary <linux@rainbow-software.org>
Date:   Tue Apr 3 10:24:34 2018 -0700

    Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad
    
    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.
    
    Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 04191afee3c812172109399c467b240b48902703
Author: Dennis Wassenberg <dennis.wassenberg@secunet.com>
Date:   Thu Mar 8 15:32:09 2018 -0800

    Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list
    
    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.
    
    Signed-off-by: Dennis Wassenberg <dennis.wassenberg@secunet.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 7430768b9191a68bef5d03dd4c77ca3901c7fa2a
Author: Masaki Ota <masaki.ota@jp.alps.com>
Date:   Mon Jan 29 14:36:54 2018 -0800

    Input: ALPS - fix TrackStick detection on Thinkpad L570 and Latitude 7370
    
    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
    Fixes: 646580f793 ("Input: ALPS - fix multi-touch decoding on SS4 plus touchpads")
    Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com>
    Tested-by: Aaron Ma <aaron.ma@canonical.com>
    Tested-by: Jonathan Liu <net147@gmail.com>
    Tested-by: Jaak Ristioja <jaak@ristioja.ee>
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c8a297b6922277cff15a23b0171993bcaadcb8a2
Author: Gaku Inami <gaku.inami.xh@renesas.com>
Date:   Tue Feb 13 11:06:40 2018 +0900

    Revert "base: arch_topology: fix section mismatch build warnings"
    
    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.
    
    Fixes: 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()")
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Gaku Inami <gaku.inami.xh@renesas.com>
    Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
    Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
    Acked-by: Sudeep Holla <sudeep.holla@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 73575c06c7f6b7112a4b5081bcab44c4fc61d280
Author: Frank Mori Hess <fmh6jj@gmail.com>
Date:   Thu Mar 15 10:25:44 2018 +0000

    staging: comedi: ni_mio_common: ack ai fifo error interrupts.
    
    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.
    
    Cc: <stable@vger.kernel.org> # v4.2+
    Signed-off-by: Frank Mori Hess <fmh6jj@gmail.com>
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1ecf69351fc7213d9441e691ffce7cb88a6bd8f7
Author: Gavin Schenk <g.schenk@eckelmann.de>
Date:   Wed Feb 14 15:25:02 2018 +0100

    siox: fix possible buffer overflow in device_add_store
    
    commit f87deada80fe483e2286e29cd866dc66ddc2b6bc upstream.
    
    Width 20 given in format string is larger than destination
    buffer 'type[20]', use %19s to prevent overflowing it.
    
    Fixes: bbecb07fa0af ("siox: new driver framework for eckelmann SIOX")
    Cc: stable <stable@vger.kernel.org>
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Gavin Schenk <g.schenk@eckelmann.de>
    Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8727321063c73d356f2c91b311b0f55b694606b5
Author: Liu Bo <bo.li.liu@oracle.com>
Date:   Wed Jan 31 17:09:13 2018 -0700

    Btrfs: fix unexpected cow in run_delalloc_nocow
    
    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.
    
    cc: <stable@vger.kernel.org> v2.6.28+
    Fixes: 17d217fe970d ("Btrfs: fix nodatasum handling in balancing code")
    Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 399ba73ff3167666ea0df1403773a0947f51f490
Author: Hans de Goede <hdegoede@redhat.com>
Date:   Fri Mar 16 21:28:09 2018 +0100

    Bluetooth: hci_bcm: Add 6 new ACPI HIDs
    
    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.
    
    Cc: stable@vger.kernel.org
    Buglink: https://bugzilla.kernel.org/attachment.cgi?id=274481
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1554835
    Reported-and-tested-by: Robert R. Howell <rhowell@uwyo.edu>
    Reported-and-tested-by: Christian Herzog <daduke@daduke.org>
    Tested-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c33af576bb2b5e89359e98a56cea0b38103f50be
Author: Eric Biggers <ebiggers@google.com>
Date:   Mon Feb 19 23:48:12 2018 -0800

    crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one
    
    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.
    
    Fixes: c12ab20b162c ("crypto: cast5/avx - avoid using temporary stack buffers")
    Cc: <stable@vger.kernel.org> # v3.8+
    Signed-off-by: Eric Biggers <ebiggers@google.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 84e2b81c9b06d2fed306b1f4ebd1fa061e7d110b
Author: Leonard Crestez <leonard.crestez@nxp.com>
Date:   Tue Mar 13 22:17:23 2018 +0200

    crypto: arm,arm64 - Fix random regeneration of S_shipped
    
    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
    
    Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
    Cc: <stable@vger.kernel.org>
    Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c01d47c2c7d89e04901cff840c217847c1cd691f
Author: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Date:   Sat Feb 24 17:03:21 2018 +0100

    crypto: ccp - return an actual key size from RSA max_size callback
    
    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.
    
    Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
    Fixes: ceeec0afd684 ("crypto: ccp - Add support for RSA on the CCP")
    Cc: stable@vger.kernel.org
    Acked-by: Gary R Hook <gary.hook@amd.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit ea75f4729c736147667b86b52ae4382b30a687d2
Author: Rui Miguel Silva <rui.silva@linaro.org>
Date:   Thu Feb 22 14:22:47 2018 +0000

    crypto: caam - Fix null dereference at error path
    
    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.
    
    Fixes: 67c2315def06 ("crypto: caam - add Queue Interface (QI) backend support")
    
    Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
    Cc: "Horia Geantă" <horia.geanta@nxp.com>
    Cc: Aymen Sghaier <aymen.sghaier@nxp.com>
    Cc: Fabio Estevam <fabio.estevam@nxp.com>
    Cc: Peng Fan <peng.fan@nxp.com>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
    Cc: <stable@vger.kernel.org> # 4.12+
    Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
    Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c7cb9698e1758fcf22f658a342db3b4eee39ced1
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Mon Mar 26 08:53:25 2018 +0800

    crypto: ahash - Fix early termination in hash walk
    
    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.
    
    Reported-by: Eli Cooper <elicooper@gmx.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 60da13207fe9eb2f2990eb8bd98d51c665631dcd
Author: LEROY Christophe <christophe.leroy@c-s.fr>
Date:   Thu Mar 22 10:57:01 2018 +0100

    crypto: talitos - fix IPsec cipher in length
    
    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.
    
    Cc: <stable@vger.kernel.org> # 4.8+
    Fixes: 549bd8bc5987 ("crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU")
    Reported-by: Horia Geantă <horia.geanta@nxp.com>
    Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
    Tested-by: Horia Geantă <horia.geanta@nxp.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 1637d9655c6ac93929512229f6074d9c61c0299b
Author: Conor McLoughlin <conor.mcloughlin@intel.com>
Date:   Tue Feb 13 08:29:56 2018 +0000

    crypto: testmgr - Fix incorrect values in PKCS#1 test vector
    
    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.
    
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
    Signed-off-by: Conor McLoughlin <conor.mcloughlin@intel.com>
    Reviewed-by: Stephan Mueller <smueller@chronox.de>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3819c95fec54f7ce2e07336dbfd641c1b2b52425
Author: Gregory CLEMENT <gregory.clement@bootlin.com>
Date:   Tue Mar 13 17:48:40 2018 +0100

    crypto: inside-secure - fix clock management
    
    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.
    
    Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto
    engine driver")
    cc: stable@vger.kernel.org
    Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 0e2503ef90d6a1fdcb72030958d9d74373c84c75
Author: LEROY Christophe <christophe.leroy@c-s.fr>
Date:   Mon Feb 26 17:40:04 2018 +0100

    crypto: talitos - don't persistently map req_ctx->hw_context and req_ctx->buf
    
    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.
    
    Reported-by: Horia Geanta <horia.geanta@nxp.com>
    Cc: <stable@vger.kernel.org>
    Fixes: 49f9783b0cea ("crypto: talitos - do hw_context DMA mapping outside the requests")
    Fixes: 37b5e8897eb5 ("crypto: talitos - chain in buffered data for ahash on SEC1")
    Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
    Tested-by: Horia Geantă <horia.geanta@nxp.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit e5733429718707a15b720de8c8b34c9e09ffad6f
Author: Gary R Hook <gary.hook@amd.com>
Date:   Wed Mar 7 11:37:42 2018 -0600

    crypto: ccp - Fill the result buffer only on digest, finup, and final ops
    
    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.
    
    Fixes: 66d7b9f6175e ("crypto: testmgr - test misuse of result in ahash")
    Signed-off-by: Gary R Hook <gary.hook@amd.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit c48f60c1a9854acc2fb9adcb4429043002dd4e6f
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Fri Mar 23 08:14:44 2018 +0800

    crypto: lrw - Free rctx->ext with kzfree
    
    commit 8c9bdab21289c211ca1ca6a5f9b7537b4a600a02 upstream.
    
    The buffer rctx->ext contains potentially sensitive data and should
    be freed with kzfree.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 700cb3f5fe75 ("crypto: lrw - Convert to skcipher")
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 190c7b3d162d2967ce17d2cc97070744312b0c7d
Author: Alexander Gerasiov <gq@redlab-i.ru>
Date:   Sun Feb 4 02:50:22 2018 +0300

    parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
    
    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])
    
    Signed-off-by: Alexander Gerasiov <gq@redlab-i.ru>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8b862cf0bfd4357408500d3254dd1e0119d57059
Author: Oliver Neukum <oneukum@suse.com>
Date:   Mon Jan 8 09:21:07 2018 -0500

    media: usbtv: prevent double free in error case
    
    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
    
    Reported-by: Yavuz, Tuba <tuba@ece.ufl.edu>
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    CC: stable@vger.kernel.org
    Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 6e86812c68c3b5538424b77d03bc25754c2be850
Author: Kees Cook <keescook@chromium.org>
Date:   Tue Mar 27 14:06:14 2018 -0700

    /dev/mem: Avoid overwriting "err" in read_mem()
    
    commit b5b38200ebe54879a7264cb6f33821f61c586a7e upstream.
    
    Successes in probe_kernel_read() would mask failures in copy_to_user()
    during read_mem().
    
    Reported-by: Brad Spengler <spender@grsecurity.net>
    Fixes: 22ec1a2aea73 ("/dev/mem: Add bounce buffer for copy-out")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kees Cook <keescook@chromium.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 8a966cd9f309c9742b7f113841e612f6c8d4654f
Author: Colin Ian King <colin.king@canonical.com>
Date:   Tue Feb 27 16:21:05 2018 +0000

    mei: remove dev_err message on an unsupported ioctl
    
    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.
    
    Signed-off-by: Colin Ian King <colin.king@canonical.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 3833927b1f96425434f6c3ec7da7063076026ba2
Author: Joel Stanley <joel@jms.id.au>
Date:   Mon Mar 5 22:17:38 2018 +1030

    serial: 8250: Add Nuvoton NPCM UART
    
    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.
    
    Reviewed-by: Rob Herring <robh@kernel.org>
    Signed-off-by: Joel Stanley <joel@jms.id.au>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit a2c10adb046e0aef274fb328b3001adab1303dec
Author: Johan Hovold <johan@kernel.org>
Date:   Tue Mar 6 09:32:43 2018 +0100

    USB: serial: cp210x: add ELDAT Easywave RX09 id
    
    commit 1f1e82f74c0947e40144688c9e36abe4b3999f49 upstream.
    
    Add device id for ELDAT Easywave RX09 tranceiver.
    
    Reported-by: Jan Jansen <nattelip@hotmail.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 351f73bc42d986321986dd211ae5b798272098b1
Author: Clemens Werther <clemens.werther@gmail.com>
Date:   Fri Mar 16 10:20:46 2018 +0100

    USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulator
    
    commit 6555ad13a01952c16485c82a52ad1f3e07e34b3a upstream.
    
    Add device id for Harman FirmwareHubEmulator to make the device
    auto-detectable by the driver.
    
    Signed-off-by: Clemens Werther <clemens.werther@gmail.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 78ac009f865e5693a1a641ce4f3334b55f78daa6
Author: Major Hayden <major@mhtx.net>
Date:   Fri Feb 23 14:29:54 2018 -0600

    USB: serial: ftdi_sio: add RT Systems VX-8 cable
    
    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.
    
    Signed-off-by: Major Hayden <major@mhtx.net>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit 17ce0c97d1e53b2db5f6e5e2a9c64b8166cf101b
Author: Omar Sandoval <osandov@fb.com>
Date:   Mon Apr 2 15:58:31 2018 -0700

    bitmap: fix memset optimization on big-endian systems
    
    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.
    
    Fixes: 2a98dc028f91 ("include/linux/bitmap.h: turn bitmap_set and bitmap_clear into memset when possible")
    Fixes: 2c6deb01525a ("bitmap: use memcmp optimisation in more situations")
    Cc: stable@kernel.org
    Reported-by: "Erhard F." <erhard_f@mailbox.org>
    Cc: Matthew Wilcox <mawilcox@microsoft.com>
    Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Omar Sandoval <osandov@fb.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>