08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

05 Mar, 2020

1 commit

  • [ Upstream commit 6b8526d3abc02c08a2f888e8c20b7ac9e5776dfe ]

    In error cases a NULL can be passed to memcpy. The length will always
    be zero, so it doesn't really matter, but go ahead and check for NULL,
    anyway, to be more precise and avoid static analysis errors.

    Reported-by: kbuild test robot
    Signed-off-by: Corey Minyard
    Signed-off-by: Sasha Levin

    Corey Minyard
     

29 Feb, 2020

1 commit

  • commit dc10e4181c05a2315ddc375e963b7c763b5ee0df upstream.

    chip->allocated_banks, an array of tpm_bank_info structures, contains the
    list of TPM algorithm IDs of allocated PCR banks. It also contains the
    corresponding ID of the crypto subsystem, so that users of the TPM driver
    can calculate a digest for a PCR extend operation.

    However, if there is no mapping between TPM algorithm ID and crypto ID, the
    crypto_id field of tpm_bank_info remains set to zero (the array is
    allocated and initialized with kcalloc() in tpm2_get_pcr_allocation()).
    Zero should not be used as value for unknown mappings, as it is a valid
    crypto ID (HASH_ALGO_MD4).

    Thus, initialize crypto_id to HASH_ALGO__LAST.

    Cc: stable@vger.kernel.org # 5.1.x
    Fixes: 879b589210a9 ("tpm: retrieve digest size of unknown algorithms with PCR read")
    Signed-off-by: Roberto Sassu
    Reviewed-by: Petr Vorel
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Roberto Sassu
     

26 Feb, 2020

1 commit

  • Currently, there is only spin lock added in imx_sema4_mutex_lock(),but
    sema4 driver assume any mutex should be handled one by one and complain
    when mutex locked once again before unlocked. Hence, if another lock happens
    indeed after the last imx_sema4_mutex_lock(),the complains "imx_sema4_
    mutex_lock 135 already locked" would come out over again and again as below.
    So delay lock released into imx_sema4_mutex_unlock() to elimate such race
    contition.

    Thread1: Thread2:
    .... ....
    ------------------------------------------
    imx_sema4_mutex_lock ---->grabbed->|imx_sema4_mutex_lock |
    |"imx_sema4_mutex_lock 135 already locked"|
    ------------------------------------------
    imx_sema4_mutex_unlock imx_sema4_mutex_unlock
    .... .....

    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang
    Signed-off-by: Dong Aisheng
    (cherry picked from commit 362fdbb91f1c2e386adc6147c07f714be6134907)

    Robin Gong
     

24 Feb, 2020

2 commits

  • [ Upstream commit 98c49f1746ac44ccc164e914b9a44183fad09f51 ]

    Currently, there is an out-of-bounds read on array hpetp->hp_dev
    in the following for loop:

    870 for (i = 0; i < hdp->hd_nirqs; i++)
    871 hpetp->hp_dev[i].hd_hdwirq = hdp->hd_irq[i];

    This is due to the recent change from one-element array to
    flexible-array member in struct hpets:

    104 struct hpets {
    ...
    113 struct hpet_dev hp_dev[];
    114 };

    This change affected the total size of the dynamic memory
    allocation, decreasing it by one time the size of struct hpet_dev.

    Fix this by adjusting the allocation size when calling
    struct_size().

    Fixes: 987f028b8637c ("char: hpet: Use flexible-array member")
    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Tetsuo Handa
    Acked-by: Eric Biggers
    Link: https://lore.kernel.org/r/20200129022613.GA24281@embeddedor.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Gustavo A. R. Silva
     
  • [ Upstream commit 1b710b1b10eff9d46666064ea25f079f70bc67a8 ]

    Sergey didn't like the locking order,

    uart_port->lock -> tty_port->lock

    uart_write (uart_port->lock)
    __uart_start
    pl011_start_tx
    pl011_tx_chars
    uart_write_wakeup
    tty_port_tty_wakeup
    tty_port_default
    tty_port_tty_get (tty_port->lock)

    but those code is so old, and I have no clue how to de-couple it after
    checking other locks in the splat. There is an onging effort to make all
    printk() as deferred, so until that happens, workaround it for now as a
    short-term fix.

    LTP: starting iogen01 (export LTPROOT; rwtest -N iogen01 -i 120s -s
    read,write -Da -Dv -n 2 500b:$TMPDIR/doio.f1.$$
    1000b:$TMPDIR/doio.f2.$$)
    WARNING: possible circular locking dependency detected
    ------------------------------------------------------
    doio/49441 is trying to acquire lock:
    ffff008b7cff7290 (&(&zone->lock)->rlock){..-.}, at: rmqueue+0x138/0x2050

    but task is already holding lock:
    60ff000822352818 (&pool->lock/1){-.-.}, at: start_flush_work+0xd8/0x3f0

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #4 (&pool->lock/1){-.-.}:
    lock_acquire+0x320/0x360
    _raw_spin_lock+0x64/0x80
    __queue_work+0x4b4/0xa10
    queue_work_on+0xac/0x11c
    tty_schedule_flip+0x84/0xbc
    tty_flip_buffer_push+0x1c/0x28
    pty_write+0x98/0xd0
    n_tty_write+0x450/0x60c
    tty_write+0x338/0x474
    __vfs_write+0x88/0x214
    vfs_write+0x12c/0x1a4
    redirected_tty_write+0x90/0xdc
    do_loop_readv_writev+0x140/0x180
    do_iter_write+0xe0/0x10c
    vfs_writev+0x134/0x1cc
    do_writev+0xbc/0x130
    __arm64_sys_writev+0x58/0x8c
    el0_svc_handler+0x170/0x240
    el0_sync_handler+0x150/0x250
    el0_sync+0x164/0x180

    -> #3 (&(&port->lock)->rlock){-.-.}:
    lock_acquire+0x320/0x360
    _raw_spin_lock_irqsave+0x7c/0x9c
    tty_port_tty_get+0x24/0x60
    tty_port_default_wakeup+0x1c/0x3c
    tty_port_tty_wakeup+0x34/0x40
    uart_write_wakeup+0x28/0x44
    pl011_tx_chars+0x1b8/0x270
    pl011_start_tx+0x24/0x70
    __uart_start+0x5c/0x68
    uart_write+0x164/0x1c8
    do_output_char+0x33c/0x348
    n_tty_write+0x4bc/0x60c
    tty_write+0x338/0x474
    redirected_tty_write+0xc0/0xdc
    do_loop_readv_writev+0x140/0x180
    do_iter_write+0xe0/0x10c
    vfs_writev+0x134/0x1cc
    do_writev+0xbc/0x130
    __arm64_sys_writev+0x58/0x8c
    el0_svc_handler+0x170/0x240
    el0_sync_handler+0x150/0x250
    el0_sync+0x164/0x180

    -> #2 (&port_lock_key){-.-.}:
    lock_acquire+0x320/0x360
    _raw_spin_lock+0x64/0x80
    pl011_console_write+0xec/0x2cc
    console_unlock+0x794/0x96c
    vprintk_emit+0x260/0x31c
    vprintk_default+0x54/0x7c
    vprintk_func+0x218/0x254
    printk+0x7c/0xa4
    register_console+0x734/0x7b0
    uart_add_one_port+0x734/0x834
    pl011_register_port+0x6c/0xac
    sbsa_uart_probe+0x234/0x2ec
    platform_drv_probe+0xd4/0x124
    really_probe+0x250/0x71c
    driver_probe_device+0xb4/0x200
    __device_attach_driver+0xd8/0x188
    bus_for_each_drv+0xbc/0x110
    __device_attach+0x120/0x220
    device_initial_probe+0x20/0x2c
    bus_probe_device+0x54/0x100
    device_add+0xae8/0xc2c
    platform_device_add+0x278/0x3b8
    platform_device_register_full+0x238/0x2ac
    acpi_create_platform_device+0x2dc/0x3a8
    acpi_bus_attach+0x390/0x3cc
    acpi_bus_attach+0x108/0x3cc
    acpi_bus_attach+0x108/0x3cc
    acpi_bus_attach+0x108/0x3cc
    acpi_bus_scan+0x7c/0xb0
    acpi_scan_init+0xe4/0x304
    acpi_init+0x100/0x114
    do_one_initcall+0x348/0x6a0
    do_initcall_level+0x190/0x1fc
    do_basic_setup+0x34/0x4c
    kernel_init_freeable+0x19c/0x260
    kernel_init+0x18/0x338
    ret_from_fork+0x10/0x18

    -> #1 (console_owner){-...}:
    lock_acquire+0x320/0x360
    console_lock_spinning_enable+0x6c/0x7c
    console_unlock+0x4f8/0x96c
    vprintk_emit+0x260/0x31c
    vprintk_default+0x54/0x7c
    vprintk_func+0x218/0x254
    printk+0x7c/0xa4
    get_random_u64+0x1c4/0x1dc
    shuffle_pick_tail+0x40/0xac
    __free_one_page+0x424/0x710
    free_one_page+0x70/0x120
    __free_pages_ok+0x61c/0xa94
    __free_pages_core+0x1bc/0x294
    memblock_free_pages+0x38/0x48
    __free_pages_memory+0xcc/0xfc
    __free_memory_core+0x70/0x78
    free_low_memory_core_early+0x148/0x18c
    memblock_free_all+0x18/0x54
    mem_init+0xb4/0x17c
    mm_init+0x14/0x38
    start_kernel+0x19c/0x530

    -> #0 (&(&zone->lock)->rlock){..-.}:
    validate_chain+0xf6c/0x2e2c
    __lock_acquire+0x868/0xc2c
    lock_acquire+0x320/0x360
    _raw_spin_lock+0x64/0x80
    rmqueue+0x138/0x2050
    get_page_from_freelist+0x474/0x688
    __alloc_pages_nodemask+0x3b4/0x18dc
    alloc_pages_current+0xd0/0xe0
    alloc_slab_page+0x2b4/0x5e0
    new_slab+0xc8/0x6bc
    ___slab_alloc+0x3b8/0x640
    kmem_cache_alloc+0x4b4/0x588
    __debug_object_init+0x778/0x8b4
    debug_object_init_on_stack+0x40/0x50
    start_flush_work+0x16c/0x3f0
    __flush_work+0xb8/0x124
    flush_work+0x20/0x30
    xlog_cil_force_lsn+0x88/0x204 [xfs]
    xfs_log_force_lsn+0x128/0x1b8 [xfs]
    xfs_file_fsync+0x3c4/0x488 [xfs]
    vfs_fsync_range+0xb0/0xd0
    generic_write_sync+0x80/0xa0 [xfs]
    xfs_file_buffered_aio_write+0x66c/0x6e4 [xfs]
    xfs_file_write_iter+0x1a0/0x218 [xfs]
    __vfs_write+0x1cc/0x214
    vfs_write+0x12c/0x1a4
    ksys_write+0xb0/0x120
    __arm64_sys_write+0x54/0x88
    el0_svc_handler+0x170/0x240
    el0_sync_handler+0x150/0x250
    el0_sync+0x164/0x180

    other info that might help us debug this:

    Chain exists of:
    &(&zone->lock)->rlock --> &(&port->lock)->rlock --> &pool->lock/1

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(&pool->lock/1);
    lock(&(&port->lock)->rlock);
    lock(&pool->lock/1);
    lock(&(&zone->lock)->rlock);

    *** DEADLOCK ***

    4 locks held by doio/49441:
    #0: a0ff00886fc27408 (sb_writers#8){.+.+}, at: vfs_write+0x118/0x1a4
    #1: 8fff00080810dfe0 (&xfs_nondir_ilock_class){++++}, at:
    xfs_ilock+0x2a8/0x300 [xfs]
    #2: ffff9000129f2390 (rcu_read_lock){....}, at:
    rcu_lock_acquire+0x8/0x38
    #3: 60ff000822352818 (&pool->lock/1){-.-.}, at:
    start_flush_work+0xd8/0x3f0

    stack backtrace:
    CPU: 48 PID: 49441 Comm: doio Tainted: G W
    Hardware name: HPE Apollo 70 /C01_APACHE_MB , BIOS
    L50_5.13_1.11 06/18/2019
    Call trace:
    dump_backtrace+0x0/0x248
    show_stack+0x20/0x2c
    dump_stack+0xe8/0x150
    print_circular_bug+0x368/0x380
    check_noncircular+0x28c/0x294
    validate_chain+0xf6c/0x2e2c
    __lock_acquire+0x868/0xc2c
    lock_acquire+0x320/0x360
    _raw_spin_lock+0x64/0x80
    rmqueue+0x138/0x2050
    get_page_from_freelist+0x474/0x688
    __alloc_pages_nodemask+0x3b4/0x18dc
    alloc_pages_current+0xd0/0xe0
    alloc_slab_page+0x2b4/0x5e0
    new_slab+0xc8/0x6bc
    ___slab_alloc+0x3b8/0x640
    kmem_cache_alloc+0x4b4/0x588
    __debug_object_init+0x778/0x8b4
    debug_object_init_on_stack+0x40/0x50
    start_flush_work+0x16c/0x3f0
    __flush_work+0xb8/0x124
    flush_work+0x20/0x30
    xlog_cil_force_lsn+0x88/0x204 [xfs]
    xfs_log_force_lsn+0x128/0x1b8 [xfs]
    xfs_file_fsync+0x3c4/0x488 [xfs]
    vfs_fsync_range+0xb0/0xd0
    generic_write_sync+0x80/0xa0 [xfs]
    xfs_file_buffered_aio_write+0x66c/0x6e4 [xfs]
    xfs_file_write_iter+0x1a0/0x218 [xfs]
    __vfs_write+0x1cc/0x214
    vfs_write+0x12c/0x1a4
    ksys_write+0xb0/0x120
    __arm64_sys_write+0x54/0x88
    el0_svc_handler+0x170/0x240
    el0_sync_handler+0x150/0x250
    el0_sync+0x164/0x180

    Reviewed-by: Sergey Senozhatsky
    Signed-off-by: Qian Cai
    Link: https://lore.kernel.org/r/1573679785-21068-1-git-send-email-cai@lca.pw
    Signed-off-by: Theodore Ts'o
    Signed-off-by: Sasha Levin

    Sergey Senozhatsky
     

20 Feb, 2020

1 commit

  • commit e0354d147e5889b5faa12e64fa38187aed39aad4 upstream.

    The end of buffer check is off-by-one since the check is against
    an index that is pre-incremented before a store to buf[]. Fix this
    adjusting the bounds check appropriately.

    Addresses-Coverity: ("Out-of-bounds write")
    Fixes: 51bd6f291583 ("Add support for IPMB driver")
    Signed-off-by: Colin Ian King
    Message-Id:
    Reviewed-by: Asmaa Mnebhi
    Signed-off-by: Corey Minyard
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

06 Feb, 2020

1 commit

  • commit 9a655c77ff8fc65699a3f98e237db563b37c439b upstream.

    tpk_write()/tpk_close() could be interrupted when holding a mutex, then
    in timer handler tpk_write() may be called again trying to acquire same
    mutex, lead to deadlock.

    Google syzbot reported this issue with CONFIG_DEBUG_ATOMIC_SLEEP
    enabled:

    BUG: sleeping function called from invalid context at
    kernel/locking/mutex.c:938
    in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/1
    1 lock held by swapper/1/0:
    ...
    Call Trace:

    dump_stack+0x197/0x210
    ___might_sleep.cold+0x1fb/0x23e
    __might_sleep+0x95/0x190
    __mutex_lock+0xc5/0x13c0
    mutex_lock_nested+0x16/0x20
    tpk_write+0x5d/0x340
    resync_tnc+0x1b6/0x320
    call_timer_fn+0x1ac/0x780
    run_timer_softirq+0x6c3/0x1790
    __do_softirq+0x262/0x98c
    irq_exit+0x19b/0x1e0
    smp_apic_timer_interrupt+0x1a3/0x610
    apic_timer_interrupt+0xf/0x20

    See link https://syzkaller.appspot.com/bug?extid=2eeef62ee31f9460ad65 for
    more details.

    Fix it by using spinlock in process context instead of mutex and having
    interrupt disabled in critical section.

    Reported-by: syzbot+2eeef62ee31f9460ad65@syzkaller.appspotmail.com
    Signed-off-by: Zhenzhong Duan
    Cc: Arnd Bergmann
    Cc: Greg Kroah-Hartman
    Link: https://lore.kernel.org/r/20200113034842.435-1-zhenzhong.duan@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Zhenzhong Duan
     

26 Jan, 2020

2 commits

  • [ Upstream commit 0c0ef9ea6f3f0d5979dc7b094b0a184c1a94716b ]

    Commit 0ed266d7ae5e ("clk: ti: omap3: cleanup unnecessary clock aliases")
    removed old omap3 clock framework aliases but caused omap3-rom-rng to
    stop working with clock not found error.

    Based on discussions on the mailing list it was requested by Tero Kristo
    that it would be best to fix this issue by probing omap3-rom-rng using
    device tree to provide a proper clk property. The other option would be
    to add back the missing clock alias, but that does not help moving things
    forward with removing old legacy platform_data.

    Let's also add a proper device tree binding and keep it together with
    the fix.

    Cc: devicetree@vger.kernel.org
    Cc: Aaro Koskinen
    Cc: Adam Ford
    Cc: Pali Rohár
    Cc: Rob Herring
    Cc: Sebastian Reichel
    Cc: Tero Kristo
    Fixes: 0ed266d7ae5e ("clk: ti: omap3: cleanup unnecessary clock aliases")
    Reported-by: Aaro Koskinen
    Signed-off-by: Tony Lindgren
    Acked-by: Rob Herring
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • commit 4aa7afb0ee20a97fbf0c5bab3df028d5fb85fdab upstream.

    In the impelementation of __ipmi_bmc_register() the allocated memory for
    bmc should be released in case ida_simple_get() fails.

    Fixes: 68e7e50f195f ("ipmi: Don't use BMC product/dev ids in the BMC name")
    Signed-off-by: Navid Emamdoost
    Message-Id:
    Signed-off-by: Corey Minyard
    Signed-off-by: Greg Kroah-Hartman

    Navid Emamdoost
     

15 Jan, 2020

4 commits

  • commit a430e67d9a2c62a8c7b315b99e74de02018d0a96 upstream.

    The priv->response_length can hold the size of an response or an negative
    error code, and the tpm_common_read() needs to handle both cases correctly.
    Changed the type of response_length to signed and accounted for negative
    value in tpm_common_read().

    Cc: stable@vger.kernel.org
    Fixes: d23d12484307 ("tpm: fix invalid locking in NONBLOCKING mode")
    Reported-by: Laura Abbott
    Signed-off-by: Tadeusz Struk
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Tadeusz Struk
     
  • commit aa4a63dd981682b1742baa01237036e48bc11923 upstream.

    There has been a bunch of reports (one from kernel bugzilla linked)
    reporting that when this commit is applied it causes on some machines
    boot freezes.

    Unfortunately hardware where this commit causes a failure is not widely
    available (only one I'm aware is Lenovo T490), which means we cannot
    predict yet how long it will take to properly fix tpm_tis interrupt
    probing.

    Thus, the least worst short term action is to revert the code to the
    state before this commit. In long term we need fix the tpm_tis probing
    code to work on machines that Stefan's fix was supposed to fix.

    Fixes: 21df4a8b6018 ("tpm_tis: reserve chip for duration of tpm_tis_core_init")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=205935
    Cc: stable@vger.kernel.org
    Cc: Jerry Snitselaar
    Cc: Dan Williams
    Tested-by: Dan Williams
    Tested-by: Xiaoping Zhou
    Signed-off-by: Stefan Berger
    Reported-by: Jerry Snitselaar
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Stefan Berger
     
  • commit dda8b2af395b2ed508e2ef314ae32e122841b447 upstream.

    There has been a bunch of reports (one from kernel bugzilla linked)
    reporting that when this commit is applied it causes on some machines
    boot freezes.

    Unfortunately hardware where this commit causes a failure is not widely
    available (only one I'm aware is Lenovo T490), which means we cannot
    predict yet how long it will take to properly fix tpm_tis interrupt
    probing.

    Thus, the least worst short term action is to revert the code to the
    state before this commit. In long term we need fix the tpm_tis probing
    code to work on machines that Stefan's fix was supposed to fix.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=205935
    Fixes: 1ea32c83c699 ("tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts")
    Cc: stable@vger.kernel.org
    Cc: Jerry Snitselaar
    Cc: Dan Williams
    Tested-by: Dan Williams
    Tested-by: Xiaoping Zhou
    Signed-off-by: Stefan Berger
    Reported-by: Jerry Snitselaar
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Stefan Berger
     
  • commit 9550f210492c6f88415709002f42a9d15c0e6231 upstream.

    Revert a commit, which was included in Linux v5.5-rc3 because it did not
    properly fix the issues it was supposed to fix.

    Fixes: 21df4a8b6018 ("tpm_tis: reserve chip for duration of tpm_tis_core_init")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=205935
    Cc: stable@vger.kernel.org
    Cc: Jerry Snitselaar
    Cc: Dan Williams
    Tested-by: Dan Williams
    Tested-by: Xiaoping Zhou
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Jarkko Sakkinen
     

12 Jan, 2020

1 commit

  • [ Upstream commit 1760eb689ed68c6746744aff2092bff57c78d907 ]

    Add shutdown call back to close existing session with fTPM TA
    to support kexec scenario.

    Add parentheses to function names in comments as specified in kdoc.

    Signed-off-by: Thirupathaiah Annapureddy
    Signed-off-by: Pavel Tatashin
    Reviewed-by: Jarkko Sakkinen
    Tested-by: Sasha Levin
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Sasha Levin

    Pavel Tatashin
     

31 Dec, 2019

4 commits

  • commit d23d12484307b40eea549b8a858f5fffad913897 upstream.

    When an application sends TPM commands in NONBLOCKING mode
    the driver holds chip->tpm_mutex returning from write(),
    which triggers: "WARNING: lock held when returning to user space".
    To fix this issue the driver needs to release the mutex before
    returning and acquire it again in tpm_dev_async_work() before
    sending the command.

    Cc: stable@vger.kernel.org
    Fixes: 9e1b74a63f776 (tpm: add support for nonblocking operation)
    Reported-by: Jeffrin Jose T
    Tested-by: Jeffrin Jose T
    Signed-off-by: Tadeusz Struk
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Tadeusz Struk
     
  • commit 21df4a8b6018b842d4db181a8b24166006bad3cd upstream.

    Instead of repeatedly calling tpm_chip_start/tpm_chip_stop when
    issuing commands to the tpm during initialization, just reserve the
    chip after wait_startup, and release it when we are ready to call
    tpm_chip_register.

    Cc: Christian Bundy
    Cc: Dan Williams
    Cc: Peter Huewe
    Cc: Jarkko Sakkinen
    Cc: Jason Gunthorpe
    Cc: Stefan Berger
    Cc: stable@vger.kernel.org
    Cc: linux-integrity@vger.kernel.org
    Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
    Fixes: 5b359c7c4372 ("tpm_tis_core: Turn on the TPM before probing IRQ's")
    Suggested-by: Jarkko Sakkinen
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jerry Snitselaar
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Jerry Snitselaar
     
  • [ Upstream commit cbb79863fc3175ed5ac506465948b02a893a8235 ]

    If something has the IPMI driver open, don't allow the device
    module to be unloaded. Before it would unload and the user would
    get errors on use.

    This change is made on user request, and it makes it consistent
    with the I2C driver, which has the same behavior.

    It does change things a little bit with respect to kernel users.
    If the ACPI or IPMI watchdog (or any other kernel user) has
    created a user, then the device module cannot be unloaded. Before
    it could be unloaded,

    This does not affect hot-plug. If the device goes away (it's on
    something removable that is removed or is hot-removed via sysfs)
    then it still behaves as it did before.

    Reported-by: tony camuso
    Signed-off-by: Corey Minyard
    Tested-by: tony camuso
    Signed-off-by: Sasha Levin

    Corey Minyard
     
  • [ Upstream commit eaecce12f5f0d2c35d278e41e1bc4522393861ab ]

    When unloading omap3-rom-rng, we'll get the following:

    WARNING: CPU: 0 PID: 100 at drivers/clk/clk.c:948 clk_core_disable

    This is because the clock may be already disabled by omap3_rom_rng_idle().
    Let's fix the issue by checking for rng_idle on exit.

    Cc: Aaro Koskinen
    Cc: Adam Ford
    Cc: Pali Rohár
    Cc: Sebastian Reichel
    Cc: Tero Kristo
    Fixes: 1c6b7c2108bd ("hwrng: OMAP3 ROM Random Number Generator support")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Herbert Xu
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

18 Dec, 2019

4 commits

  • commit 998174042da229e2cf5841f574aba4a743e69650 upstream.

    Going through the uses of timeval in the user space API,
    I noticed two bugs in ppdev that were introduced in the y2038
    conversion:

    * The range check was accidentally moved from ppsettime to
    ppgettime

    * On sparc64, the microseconds are in the other half of the
    64-bit word.

    Fix both, and mark the fix for stable backports.

    Cc: stable@vger.kernel.org
    Fixes: 3b9ab374a1e6 ("ppdev: convert to y2038 safe")
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20191108203435.112759-8-arnd@arndb.de
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit be867f987a4e1222114dd07a01838a17c26f3fff upstream.

    Existing RNG data read timeout is 200us but it doesn't cover EIP76 RNG
    data rate which takes approx. 700us to produce 16 bytes of output data
    as per testing results. So configure the timeout as 1000us to also take
    account of lack of udelay()'s reliability.

    Fixes: 383212425c92 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K")
    Cc:
    Signed-off-by: Sumit Garg
    Signed-off-by: Herbert Xu
    Signed-off-by: Greg Kroah-Hartman

    Sumit Garg
     
  • commit 9c8c5742b6af76a3fd93b4e56d1d981173cf9016 upstream.

    platform_get_irq() calls dev_err() on an error. As the IRQ usage in the
    tpm_tis driver is optional, this is undesirable.

    Specifically this leads to this new false-positive error being logged:
    [ 5.135413] tpm_tis MSFT0101:00: IRQ index 0 not found

    This commit switches to platform_get_irq_optional(), which does not log
    an error, fixing this.

    Fixes: 7723f4c5ecdb ("driver core: platform: Add an error message to platform_get_irq*()"
    Cc: # 5.4.x
    Signed-off-by: Hans de Goede
    Reviewed-by: Jerry Snitselaar
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • commit f1689114acc5e89a196fec6d732dae3e48edb6ad upstream.

    devm_kcalloc() can fail and return NULL so we need to check for that.

    Cc: stable@vger.kernel.org
    Fixes: 58472f5cd4f6f ("tpm: validate TPM 2.0 commands")
    Signed-off-by: Tadeusz Struk
    Reviewed-by: Jerry Snitselaar
    Reviewed-by: Jarkko Sakkinen
    Tested-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen
    Signed-off-by: Greg Kroah-Hartman

    Tadeusz Struk
     

16 Dec, 2019

1 commit

  • This is the 5.4.3 stable release

    Conflicts:
    drivers/cpufreq/imx-cpufreq-dt.c
    drivers/spi/spi-fsl-qspi.c

    The conflict is very minor, fixed it when do the merge. The imx-cpufreq-dt.c
    is just one line code-style change, using upstream one, no any function change.

    The spi-fsl-qspi.c has minor conflicts when merge upstream fixes: c69b17da53b2
    spi: spi-fsl-qspi: Clear TDH bits in FLSHCR register

    After merge, basic boot sanity test and basic qspi test been done on i.mx

    Signed-off-by: Jason Liu

    Jason Liu
     

13 Dec, 2019

1 commit

  • commit 45a2d64696b11913bcf1087b041740edbade3e21 upstream.

    The layout of struct timeval is different on sparc64 from
    anything else, and the patch I did long ago failed to take
    this into account.

    Change it now to handle sparc64 user space correctly again.

    Quite likely nobody cares about parallel ports on sparc64,
    but there is no reason not to fix it.

    Cc: stable@vger.kernel.org
    Fixes: 9a450484089d ("lp: support 64-bit time_t user space")
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20191108203435.112759-7-arnd@arndb.de
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     

25 Nov, 2019

1 commit


19 Nov, 2019

1 commit

  • When we hot unplug a virtserialport and then try to hot plug again,
    it fails:

    (qemu) chardev-add socket,id=serial0,path=/tmp/serial0,server,nowait
    (qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
    chardev=serial0,id=serial0,name=serial0
    (qemu) device_del serial0
    (qemu) device_add virtserialport,bus=virtio-serial0.0,nr=2,\
    chardev=serial0,id=serial0,name=serial0
    kernel error:
    virtio-ports vport2p2: Error allocating inbufs
    qemu error:
    virtio-serial-bus: Guest failure in adding port 2 for device \
    virtio-serial0.0

    This happens because buffers for the in_vq are allocated when the port is
    added but are not released when the port is unplugged.

    They are only released when virtconsole is removed (see a7a69ec0d8e4)

    To avoid the problem and to be symmetric, we could allocate all the buffers
    in init_vqs() as they are released in remove_vqs(), but it sounds like
    a waste of memory.

    Rather than that, this patch changes add_port() logic to ignore ENOSPC
    error in fill_queue(), which means queue has already been filled.

    Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset")
    Cc: mst@redhat.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Laurent Vivier
    Signed-off-by: Michael S. Tsirkin

    Laurent Vivier
     

17 Nov, 2019

2 commits

  • Pull crypto fix from Herbert Xu:
    "This reverts a number of changes to the khwrng thread which feeds the
    kernel random number pool from hwrng drivers. They were trying to fix
    issues with suspend-and-resume but ended up causing regressions"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    Revert "hwrng: core - Freeze khwrng thread during suspend"

    Linus Torvalds
     
  • This reverts commit 03a3bb7ae631 ("hwrng: core - Freeze khwrng
    thread during suspend"), ff296293b353 ("random: Support freezable
    kthreads in add_hwgenerator_randomness()") and 59b569480dc8 ("random:
    Use wait_event_freezable() in add_hwgenerator_randomness()").

    These patches introduced regressions and we need more time to
    get them ready for mainline.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

03 Oct, 2019

1 commit

  • On Tue, Oct 01, 2019 at 10:14:40AM -0700, Linus Torvalds wrote:
    > The previous state of the file didn't have that 0xa at the end, so you get that
    >
    >
    > -EXPORT_SYMBOL_GPL(add_bootloader_randomness);
    > \ No newline at end of file
    > +EXPORT_SYMBOL_GPL(add_bootloader_randomness);
    >
    > which is "the '-' line doesn't have a newline, the '+' line does" marker.

    Aaha, that makes total sense, thanks for explaining. Oh well, let's fix
    it then so that people don't scratch heads like me.

    Signed-off-by: Linus Torvalds

    Borislav Petkov
     

30 Sep, 2019

2 commits

  • Merge active entropy generation updates.

    This is admittedly partly "for discussion". We need to have a way
    forward for the boot time deadlocks where user space ends up waiting for
    more entropy, but no entropy is forthcoming because the system is
    entirely idle just waiting for something to happen.

    While this was triggered by what is arguably a user space bug with
    GDM/gnome-session asking for secure randomness during early boot, when
    they didn't even need any such truly secure thing, the issue ends up
    being that our "getrandom()" interface is prone to that kind of
    confusion, because people don't think very hard about whether they want
    to block for sufficient amounts of entropy.

    The approach here-in is to decide to not just passively wait for entropy
    to happen, but to start actively collecting it if it is missing. This
    is not necessarily always possible, but if the architecture has a CPU
    cycle counter, there is a fair amount of noise in the exact timings of
    reasonably complex loads.

    We may end up tweaking the load and the entropy estimates, but this
    should be at least a reasonable starting point.

    As part of this, we also revert the revert of the ext4 IO pattern
    improvement that ended up triggering the reported lack of external
    entropy.

    * getrandom() active entropy waiting:
    Revert "Revert "ext4: make __ext4_get_inode_loc plug""
    random: try to actively add entropy rather than passively wait for it

    Linus Torvalds
     
  • For 5.3 we had to revert a nice ext4 IO pattern improvement, because it
    caused a bootup regression due to lack of entropy at bootup together
    with arguably broken user space that was asking for secure random
    numbers when it really didn't need to.

    See commit 72dbcf721566 (Revert "ext4: make __ext4_get_inode_loc plug").

    This aims to solve the issue by actively generating entropy noise using
    the CPU cycle counter when waiting for the random number generator to
    initialize. This only works when you have a high-frequency time stamp
    counter available, but that's the case on all modern x86 CPU's, and on
    most other modern CPU's too.

    What we do is to generate jitter entropy from the CPU cycle counter
    under a somewhat complex load: calling the scheduler while also
    guaranteeing a certain amount of timing noise by also triggering a
    timer.

    I'm sure we can tweak this, and that people will want to look at other
    alternatives, but there's been a number of papers written on jitter
    entropy, and this should really be fairly conservative by crediting one
    bit of entropy for every timer-induced jump in the cycle counter. Not
    because the timer itself would be all that unpredictable, but because
    the interaction between the timer and the loop is going to be.

    Even if (and perhaps particularly if) the timer actually happens on
    another CPU, the cacheline interaction between the loop that reads the
    cycle counter and the timer itself firing is going to add perturbations
    to the cycle counter values that get mixed into the entropy pool.

    As Thomas pointed out, with a modern out-of-order CPU, even quite simple
    loops show a fair amount of hard-to-predict timing variability even in
    the absense of external interrupts. But this tries to take that further
    by actually having a fairly complex interaction.

    This is not going to solve the entropy issue for architectures that have
    no CPU cycle counter, but it's not clear how (and if) that is solvable,
    and the hardware in question is largely starting to be irrelevant. And
    by doing this we can at least avoid some of the even more contentious
    approaches (like making the entropy waiting time out in order to avoid
    the possibly unbounded waiting).

    Cc: Ahmed Darwish
    Cc: Thomas Gleixner
    Cc: Theodore Ts'o
    Cc: Nicholas Mc Guire
    Cc: Andy Lutomirski
    Cc: Kees Cook
    Cc: Willy Tarreau
    Cc: Alexander E. Patrakov
    Cc: Lennart Poettering
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

28 Sep, 2019

1 commit

  • Pull kernel lockdown mode from James Morris:
    "This is the latest iteration of the kernel lockdown patchset, from
    Matthew Garrett, David Howells and others.

    From the original description:

    This patchset introduces an optional kernel lockdown feature,
    intended to strengthen the boundary between UID 0 and the kernel.
    When enabled, various pieces of kernel functionality are restricted.
    Applications that rely on low-level access to either hardware or the
    kernel may cease working as a result - therefore this should not be
    enabled without appropriate evaluation beforehand.

    The majority of mainstream distributions have been carrying variants
    of this patchset for many years now, so there's value in providing a
    doesn't meet every distribution requirement, but gets us much closer
    to not requiring external patches.

    There are two major changes since this was last proposed for mainline:

    - Separating lockdown from EFI secure boot. Background discussion is
    covered here: https://lwn.net/Articles/751061/

    - Implementation as an LSM, with a default stackable lockdown LSM
    module. This allows the lockdown feature to be policy-driven,
    rather than encoding an implicit policy within the mechanism.

    The new locked_down LSM hook is provided to allow LSMs to make a
    policy decision around whether kernel functionality that would allow
    tampering with or examining the runtime state of the kernel should be
    permitted.

    The included lockdown LSM provides an implementation with a simple
    policy intended for general purpose use. This policy provides a coarse
    level of granularity, controllable via the kernel command line:

    lockdown={integrity|confidentiality}

    Enable the kernel lockdown feature. If set to integrity, kernel features
    that allow userland to modify the running kernel are disabled. If set to
    confidentiality, kernel features that allow userland to extract
    confidential information from the kernel are also disabled.

    This may also be controlled via /sys/kernel/security/lockdown and
    overriden by kernel configuration.

    New or existing LSMs may implement finer-grained controls of the
    lockdown features. Refer to the lockdown_reason documentation in
    include/linux/security.h for details.

    The lockdown feature has had signficant design feedback and review
    across many subsystems. This code has been in linux-next for some
    weeks, with a few fixes applied along the way.

    Stephen Rothwell noted that commit 9d1f8be5cf42 ("bpf: Restrict bpf
    when kernel lockdown is in confidentiality mode") is missing a
    Signed-off-by from its author. Matthew responded that he is providing
    this under category (c) of the DCO"

    * 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (31 commits)
    kexec: Fix file verification on S390
    security: constify some arrays in lockdown LSM
    lockdown: Print current->comm in restriction messages
    efi: Restrict efivar_ssdt_load when the kernel is locked down
    tracefs: Restrict tracefs when the kernel is locked down
    debugfs: Restrict debugfs when the kernel is locked down
    kexec: Allow kexec_file() with appropriate IMA policy when locked down
    lockdown: Lock down perf when in confidentiality mode
    bpf: Restrict bpf when kernel lockdown is in confidentiality mode
    lockdown: Lock down tracing and perf kprobes when in confidentiality mode
    lockdown: Lock down /proc/kcore
    x86/mmiotrace: Lock down the testmmiotrace module
    lockdown: Lock down module params that specify hardware parameters (eg. ioport)
    lockdown: Lock down TIOCSSERIAL
    lockdown: Prohibit PCMCIA CIS storage when the kernel is locked down
    acpi: Disable ACPI table override if the kernel is locked down
    acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down
    ACPI: Limit access to custom_method when the kernel is locked down
    x86/msr: Restrict MSR access when the kernel is locked down
    x86: Lock down IO port access when the kernel is locked down
    ...

    Linus Torvalds
     

25 Sep, 2019

2 commits

  • tpm_send() does not give anymore the result back to the caller. This
    would require another memcpy(), which kind of tells that the whole
    approach is somewhat broken. Instead, as Mimi suggested, this commit
    just wraps the data to the tpm_buf, and thus the result will not go to
    the garbage.

    Obviously this assumes from the caller that it passes large enough
    buffer, which makes the whole API somewhat broken because it could be
    different size than @buflen but since trusted keys is the only module
    using this API right now I think that this fix is sufficient for the
    moment.

    In the near future the plan is to replace the parameters with a tpm_buf
    created by the caller.

    Reported-by: Mimi Zohar
    Suggested-by: Mimi Zohar
    Cc: stable@vger.kernel.org
    Fixes: 412eb585587a ("use tpm_buf in tpm_transmit_cmd() as the IO parameter")
    Signed-off-by: Jarkko Sakkinen
    Reviewed-by: Jerry Snitselaar

    Jarkko Sakkinen
     
  • Commit 0b6cf6b97b7e ("tpm: pass an array of tpm_extend_digest structures to
    tpm_pcr_extend()") modifies tpm_pcr_extend() to accept a digest for each
    PCR bank. After modification, tpm_pcr_extend() expects that digests are
    passed in the same order as the algorithms set in chip->allocated_banks.

    This patch fixes two issues introduced in the last iterations of the patch
    set: missing initialization of the TPM algorithm ID in the tpm_digest
    structures passed to tpm_pcr_extend() by the trusted key module, and
    unreleased locks in the TPM driver due to returning from tpm_pcr_extend()
    without calling tpm_put_ops().

    Cc: stable@vger.kernel.org
    Fixes: 0b6cf6b97b7e ("tpm: pass an array of tpm_extend_digest structures to tpm_pcr_extend()")
    Signed-off-by: Roberto Sassu
    Suggested-by: Jarkko Sakkinen
    Reviewed-by: Jerry Snitselaar
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen

    Roberto Sassu
     

24 Sep, 2019

2 commits

  • Pull PCI updates from Bjorn Helgaas:
    "Enumeration:

    - Consolidate _HPP/_HPX stuff in pci-acpi.c and simplify it
    (Krzysztof Wilczynski)

    - Fix incorrect PCIe device types and remove dev->has_secondary_link
    to simplify code that deals with upstream/downstream ports (Mika
    Westerberg)

    - After suspend, restore Resizable BAR size bits correctly for 1MB
    BARs (Sumit Saxena)

    - Enable PCI_MSI_IRQ_DOMAIN support for RISC-V (Wesley Terpstra)

    Virtualization:

    - Add ACS quirks for iProc PAXB (Abhinav Ratna), Amazon Annapurna
    Labs (Ali Saidi)

    - Move sysfs SR-IOV functions to iov.c (Kelsey Skunberg)

    - Remove group write permissions from sysfs sriov_numvfs,
    sriov_drivers_autoprobe (Kelsey Skunberg)

    Hotplug:

    - Simplify pciehp indicator control (Denis Efremov)

    Peer-to-peer DMA:

    - Allow P2P DMA between root ports for whitelisted bridges (Logan
    Gunthorpe)

    - Whitelist some Intel host bridges for P2P DMA (Logan Gunthorpe)

    - DMA map P2P DMA requests that traverse host bridge (Logan
    Gunthorpe)

    Amazon Annapurna Labs host bridge driver:

    - Add DT binding and controller driver (Jonathan Chocron)

    Hyper-V host bridge driver:

    - Fix hv_pci_dev->pci_slot use-after-free (Dexuan Cui)

    - Fix PCI domain number collisions (Haiyang Zhang)

    - Use instance ID bytes 4 & 5 as PCI domain numbers (Haiyang Zhang)

    - Fix build errors on non-SYSFS config (Randy Dunlap)

    i.MX6 host bridge driver:

    - Limit DBI register length (Stefan Agner)

    Intel VMD host bridge driver:

    - Fix config addressing issues (Jon Derrick)

    Layerscape host bridge driver:

    - Add bar_fixed_64bit property to endpoint driver (Xiaowei Bao)

    - Add CONFIG_PCI_LAYERSCAPE_EP to build EP/RC drivers separately
    (Xiaowei Bao)

    Mediatek host bridge driver:

    - Add MT7629 controller support (Jianjun Wang)

    Mobiveil host bridge driver:

    - Fix CPU base address setup (Hou Zhiqiang)

    - Make "num-lanes" property optional (Hou Zhiqiang)

    Tegra host bridge driver:

    - Fix OF node reference leak (Nishka Dasgupta)

    - Disable MSI for root ports to work around design problem (Vidya
    Sagar)

    - Add Tegra194 DT binding and controller support (Vidya Sagar)

    - Add support for sideband pins and slot regulators (Vidya Sagar)

    - Add PIPE2UPHY support (Vidya Sagar)

    Misc:

    - Remove unused pci_block_cfg_access() et al (Kelsey Skunberg)

    - Unexport pci_bus_get(), etc (Kelsey Skunberg)

    - Hide PM, VC, link speed, ATS, ECRC, PTM constants and interfaces in
    the PCI core (Kelsey Skunberg)

    - Clean up sysfs DEVICE_ATTR() usage (Kelsey Skunberg)

    - Mark expected switch fall-through (Gustavo A. R. Silva)

    - Propagate errors for optional regulators and PHYs (Thierry Reding)

    - Fix kernel command line resource_alignment parameter issues (Logan
    Gunthorpe)"

    * tag 'pci-v5.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (112 commits)
    PCI: Add pci_irq_vector() and other stubs when !CONFIG_PCI
    arm64: tegra: Add PCIe slot supply information in p2972-0000 platform
    arm64: tegra: Add configuration for PCIe C5 sideband signals
    PCI: tegra: Add support to enable slot regulators
    PCI: tegra: Add support to configure sideband pins
    PCI: vmd: Fix shadow offsets to reflect spec changes
    PCI: vmd: Fix config addressing when using bus offsets
    PCI: dwc: Add validation that PCIe core is set to correct mode
    PCI: dwc: al: Add Amazon Annapurna Labs PCIe controller driver
    dt-bindings: PCI: Add Amazon's Annapurna Labs PCIe host bridge binding
    PCI: Add quirk to disable MSI-X support for Amazon's Annapurna Labs Root Port
    PCI/VPD: Prevent VPD access for Amazon's Annapurna Labs Root Port
    PCI: Add ACS quirk for Amazon Annapurna Labs root ports
    PCI: Add Amazon's Annapurna Labs vendor ID
    MAINTAINERS: Add PCI native host/endpoint controllers designated reviewer
    PCI: hv: Use bytes 4 and 5 from instance ID as the PCI domain numbers
    dt-bindings: PCI: tegra: Add PCIe slot supplies regulator entries
    dt-bindings: PCI: tegra: Add sideband pins configuration entries
    PCI: tegra: Add Tegra194 PCIe support
    PCI: Get rid of dev->has_secondary_link flag
    ...

    Linus Torvalds
     
  • Pull crypto fixes froim Herbert Xu:
    "This fixes the following issues:

    - potential boot hang in hwrng

    - missing switch/break in talitos

    - bugs and warnings in hisilicon

    - build warning in inside-secure"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: hisilicon - avoid unused function warning
    hwrng: core - don't wait on add_early_randomness()
    crypto: hisilicon - Fix return value check in hisi_zip_acompress()
    crypto: hisilicon - Matching the dma address for dma_pool_free()
    crypto: hisilicon - Fix double free in sec_free_hw_sgl()
    crypto: inside-secure - Fix unused variable warning when CONFIG_PCI=n
    crypto: talitos - fix missing break in switch statement

    Linus Torvalds
     

20 Sep, 2019

2 commits

  • add_early_randomness() is called by hwrng_register() when the
    hardware is added. If this hardware and its module are present
    at boot, and if there is no data available the boot hangs until
    data are available and can't be interrupted.

    For instance, in the case of virtio-rng, in some cases the host can be
    not able to provide enough entropy for all the guests.

    We can have two easy ways to reproduce the problem but they rely on
    misconfiguration of the hypervisor or the egd daemon:

    - if virtio-rng device is configured to connect to the egd daemon of the
    host but when the virtio-rng driver asks for data the daemon is not
    connected,

    - if virtio-rng device is configured to connect to the egd daemon of the
    host but the egd daemon doesn't provide data.

    The guest kernel will hang at boot until the virtio-rng driver provides
    enough data.

    To avoid that, call rng_get_data() in non-blocking mode (wait=0)
    from add_early_randomness().

    Signed-off-by: Laurent Vivier
    Fixes: d9e797261933 ("hwrng: add randomness to system from rng...")
    Cc:
    Reviewed-by: Theodore Ts'o
    Signed-off-by: Herbert Xu

    Laurent Vivier
     
  • Pull IPMI updates from Corey Minyard:
    "A few minor fixes and some cosmetic changes.

    Nothing big here, but some minor things that people have found and
    some minor reworks for names and include files"

    * tag 'for-linus-5.4-1' of git://github.com/cminyard/linux-ipmi:
    ipmi_si_intf: Fix race in timer shutdown handling
    ipmi: move message error checking to avoid deadlock
    ipmi_ssif: avoid registering duplicate ssif interface
    ipmi: Free receive messages when in an oops
    ipmi_si: Only schedule continuously in the thread in maintenance mode
    ipmi_si: Remove ipmi_ from the device attr names
    ipmi_si: Convert device attr permissions to octal
    ipmi_si: Rework some include files
    ipmi_si: Convert timespec64 to timespec

    Linus Torvalds
     

19 Sep, 2019

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Add the ability to abort a skcipher walk.

    Algorithms:
    - Fix XTS to actually do the stealing.
    - Add library helpers for AES and DES for single-block users.
    - Add library helpers for SHA256.
    - Add new DES key verification helper.
    - Add surrounding bits for ESSIV generator.
    - Add accelerations for aegis128.
    - Add test vectors for lzo-rle.

    Drivers:
    - Add i.MX8MQ support to caam.
    - Add gcm/ccm/cfb/ofb aes support in inside-secure.
    - Add ofb/cfb aes support in media-tek.
    - Add HiSilicon ZIP accelerator support.

    Others:
    - Fix potential race condition in padata.
    - Use unbound workqueues in padata"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (311 commits)
    crypto: caam - Cast to long first before pointer conversion
    crypto: ccree - enable CTS support in AES-XTS
    crypto: inside-secure - Probe transform record cache RAM sizes
    crypto: inside-secure - Base RD fetchcount on actual RD FIFO size
    crypto: inside-secure - Base CD fetchcount on actual CD FIFO size
    crypto: inside-secure - Enable extended algorithms on newer HW
    crypto: inside-secure: Corrected configuration of EIP96_TOKEN_CTRL
    crypto: inside-secure - Add EIP97/EIP197 and endianness detection
    padata: remove cpu_index from the parallel_queue
    padata: unbind parallel jobs from specific CPUs
    padata: use separate workqueues for parallel and serial work
    padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible
    crypto: pcrypt - remove padata cpumask notifier
    padata: make padata_do_parallel find alternate callback CPU
    workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs
    workqueue: unconfine alloc/apply/free_workqueue_attrs()
    padata: allocate workqueue internally
    arm64: dts: imx8mq: Add CAAM node
    random: Use wait_event_freezable() in add_hwgenerator_randomness()
    crypto: ux500 - Fix COMPILE_TEST warnings
    ...

    Linus Torvalds