Skip to content
  1. Apr 16, 2020
    • Iuliana Prodan's avatar
      crypto: caam - fix the address of the last entry of S/G · 55b3209a
      Iuliana Prodan authored
      For skcipher algorithms, the input, output HW S/G tables
      look like this: [IV, src][dst, IV]
      Now, we can have 2 conditions here:
      - there is no IV;
      - src and dst are equal (in-place encryption) and scattered
      and the error is an "off-by-one" in the HW S/G table.
      
      This issue was seen with KASAN:
      BUG: KASAN: slab-out-of-bounds in skcipher_edesc_alloc+0x95c/0x1018
      
      Read of size 4 at addr ffff000022a02958 by task cryptomgr_test/321
      
      CPU: 2 PID: 321 Comm: cryptomgr_test Not tainted
      5.6.0-rc1-00165-ge4ef8383-dirty #4
      Hardware name: LS1046A RDB Board (DT)
      Call trace:
       dump_backtrace+0x0/0x260
       show_stack+0x14/0x20
       dump_stack+0xe8/0x144
       print_address_description.isra.11+0x64/0x348
       __kasan_report+0x11c/0x230
       kasan_report+0xc/0x18
       __asan_load4+0x90/0xb0
       skcipher_edesc_alloc+0x95c/0x1018
       skcipher_encrypt+0x84/0x150
       crypto_skcipher_encrypt+0x50/0x68
       test_skcipher_vec_cfg+0x4d4/0xc10
       test_skcipher_vec+0x178/0x1d8
       alg_test_skcipher+0xec/0x230
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Allocated by task 321:
       save_stack+0x24/0xb0
       __kasan_kmalloc.isra.10+0xc4/0xe0
       kasan_kmalloc+0xc/0x18
       __kmalloc+0x178/0x2b8
       skcipher_edesc_alloc+0x21c/0x1018
       skcipher_encrypt+0x84/0x150
       crypto_skcipher_encrypt+0x50/0x68
       test_skcipher_vec_cfg+0x4d4/0xc10
       test_skcipher_vec+0x178/0x1d8
       alg_test_skcipher+0xec/0x230
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Freed by task 0:
      (stack is not available)
      
      The buggy address belongs to the object at ffff000022a02800
       which belongs to the cache dma-kmalloc-512 of size 512
      The buggy address is located 344 bytes inside of
       512-byte region [ffff000022a02800, ffff000022a02a00)
      The buggy address belongs to the page:
      page:fffffe00006a8000 refcount:1 mapcount:0 mapping:ffff00093200c400
      index:0x0 compound_mapcount: 0
      flags: 0xffff00000010200(slab|head)
      raw: 0ffff00000010200 dead000000000100 dead000000000122 ffff00093200c400
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff000022a02800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
       ffff000022a02880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      >ffff000022a02900: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
                                                          ^
       ffff000022a02980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff000022a02a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      
      Fixes: 334d37c9
      
       ("crypto: caam - update IV using HW support")
      Cc: <stable@vger.kernel.org> # v5.3+
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Reviewed-by: default avatarHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      55b3209a
    • Iuliana Prodan's avatar
      crypto: caam - fix use-after-free KASAN issue for RSA algorithms · 80994e3f
      Iuliana Prodan authored
      Here's the KASAN report:
      BUG: KASAN: use-after-free in rsa_pub_done+0x70/0xe8
      Read of size 1 at addr ffff000023082014 by task swapper/0/0
      
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc1-00162-gfcb90d5 #60
      Hardware name: LS1046A RDB Board (DT)
      Call trace:
       dump_backtrace+0x0/0x260
       show_stack+0x14/0x20
       dump_stack+0xe8/0x144
       print_address_description.isra.11+0x64/0x348
       __kasan_report+0x11c/0x230
       kasan_report+0xc/0x18
       __asan_load1+0x5c/0x68
       rsa_pub_done+0x70/0xe8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
       irq_exit+0x114/0x128
       __handle_domain_irq+0x80/0xe0
       gic_handle_irq+0x50/0xa0
       el1_irq+0xb8/0x180
       cpuidle_enter_state+0xa4/0x490
       cpuidle_enter+0x48/0x70
       call_cpuidle+0x44/0x70
       do_idle+0x304/0x338
       cpu_startup_entry+0x24/0x40
       rest_init+0xf8/0x10c
       arch_call_rest_init+0xc/0x14
       start_kernel+0x774/0x7b4
      
      Allocated by task 263:
       save_stack+0x24/0xb0
       __kasan_kmalloc.isra.10+0xc4/0xe0
       kasan_kmalloc+0xc/0x18
       __kmalloc+0x178/0x2b8
       rsa_edesc_alloc+0x2cc/0xe10
       caam_rsa_enc+0x9c/0x5f0
       test_akcipher_one+0x78c/0x968
       alg_test_akcipher+0x78/0xf8
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Freed by task 0:
       save_stack+0x24/0xb0
       __kasan_slab_free+0x10c/0x188
       kasan_slab_free+0x10/0x18
       kfree+0x7c/0x298
       rsa_pub_done+0x68/0xe8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
      
      The buggy address belongs to the object at ffff000023082000
       which belongs to the cache dma-kmalloc-256 of size 256
      The buggy address is located 20 bytes inside of
       256-byte region [ffff000023082000, ffff000023082100)
      The buggy address belongs to the page:
      page:fffffe00006c2080 refcount:1 mapcount:0 mapping:ffff00093200c200 index:0x0 compound_mapcount: 0
      flags: 0xffff00000010200(slab|head)
      raw: 0ffff00000010200 dead000000000100 dead000000000122 ffff00093200c200
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff000023081f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff000023081f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      >ffff000023082000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
       ffff000023082080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff000023082100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      
      Fixes: bf537950
      
       ("crypto: caam - add crypto_engine support for RSA algorithms")
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      80994e3f
    • Iuliana Prodan's avatar
      crypto: caam - fix use-after-free KASAN issue for HASH algorithms · 63db32e6
      Iuliana Prodan authored
      Here's the KASAN report:
      BUG: KASAN: use-after-free in ahash_done+0xdc/0x3b8
      Read of size 1 at addr ffff00002303f010 by task swapper/0/0
      
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc1-00162-gfcb90d5 #59
      Hardware name: LS1046A RDB Board (DT)
      Call trace:
       dump_backtrace+0x0/0x260
       show_stack+0x14/0x20
       dump_stack+0xe8/0x144
       print_address_description.isra.11+0x64/0x348
       __kasan_report+0x11c/0x230
       kasan_report+0xc/0x18
       __asan_load1+0x5c/0x68
       ahash_done+0xdc/0x3b8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
       irq_exit+0x114/0x128
       __handle_domain_irq+0x80/0xe0
       gic_handle_irq+0x50/0xa0
       el1_irq+0xb8/0x180
       cpuidle_enter_state+0xa4/0x490
       cpuidle_enter+0x48/0x70
       call_cpuidle+0x44/0x70
       do_idle+0x304/0x338
       cpu_startup_entry+0x24/0x40
       rest_init+0xf8/0x10c
       arch_call_rest_init+0xc/0x14
       start_kernel+0x774/0x7b4
      
      Allocated by task 263:
       save_stack+0x24/0xb0
       __kasan_kmalloc.isra.10+0xc4/0xe0
       kasan_kmalloc+0xc/0x18
       __kmalloc+0x178/0x2b8
       ahash_edesc_alloc+0x58/0x1f8
       ahash_final_no_ctx+0x94/0x6e8
       ahash_final+0x24/0x30
       crypto_ahash_op+0x58/0xb0
       crypto_ahash_final+0x30/0x40
       do_ahash_op+0x2c/0xa0
       test_ahash_vec_cfg+0x894/0x9e0
       test_hash_vec_cfg+0x6c/0x88
       test_hash_vec+0xfc/0x1e0
       __alg_test_hash+0x1ac/0x368
       alg_test_hash+0xf8/0x1c8
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Freed by task 0:
       save_stack+0x24/0xb0
       __kasan_slab_free+0x10c/0x188
       kasan_slab_free+0x10/0x18
       kfree+0x7c/0x298
       ahash_done+0xd4/0x3b8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
      
      The buggy address belongs to the object at ffff00002303f000
       which belongs to the cache dma-kmalloc-128 of size 128
      The buggy address is located 16 bytes inside of
       128-byte region [ffff00002303f000, ffff00002303f080)
      The buggy address belongs to the page:
      page:fffffe00006c0fc0 refcount:1 mapcount:0 mapping:ffff00093200c000 index:0x0
      flags: 0xffff00000000200(slab)
      raw: 0ffff00000000200 dead000000000100 dead000000000122 ffff00093200c000
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff00002303ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff00002303ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      >ffff00002303f000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
       ffff00002303f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff00002303f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      
      Fixes: 21b014f0
      
       ("crypto: caam - add crypto_engine support for HASH algorithms")
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      63db32e6
    • Iuliana Prodan's avatar
      crypto: caam - fix use-after-free KASAN issue for AEAD algorithms · 5ed1e8b8
      Iuliana Prodan authored
      Here's the KASAN report:
      BUG: KASAN: use-after-free in aead_crypt_done+0x60/0xd8
      Read of size 1 at addr ffff00002303f014 by task swapper/0/0
      
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc1-00162-gfcb90d5 #58
      Hardware name: LS1046A RDB Board (DT)
      Call trace:
       dump_backtrace+0x0/0x260
       show_stack+0x14/0x20
       dump_stack+0xe8/0x144
       print_address_description.isra.11+0x64/0x348
       __kasan_report+0x11c/0x230
       kasan_report+0xc/0x18
       __asan_load1+0x5c/0x68
       aead_crypt_done+0x60/0xd8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
       irq_exit+0x114/0x128
       __handle_domain_irq+0x80/0xe0
       gic_handle_irq+0x50/0xa0
       el1_irq+0xb8/0x180
       _raw_spin_unlock_irq+0x2c/0x78
       finish_task_switch+0xa4/0x2f8
       __schedule+0x3a4/0x890
       schedule_idle+0x28/0x50
       do_idle+0x22c/0x338
       cpu_startup_entry+0x24/0x40
       rest_init+0xf8/0x10c
       arch_call_rest_init+0xc/0x14
       start_kernel+0x774/0x7b4
      
      Allocated by task 263:
       save_stack+0x24/0xb0
       __kasan_kmalloc.isra.10+0xc4/0xe0
       kasan_kmalloc+0xc/0x18
       __kmalloc+0x178/0x2b8
       aead_edesc_alloc+0x1b4/0xbf0
       ipsec_gcm_encrypt+0xd4/0x140
       crypto_aead_encrypt+0x50/0x68
       test_aead_vec_cfg+0x498/0xec0
       test_aead_vec+0x110/0x200
       alg_test_aead+0xfc/0x680
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Freed by task 0:
       save_stack+0x24/0xb0
       __kasan_slab_free+0x10c/0x188
       kasan_slab_free+0x10/0x18
       kfree+0x7c/0x298
       aead_crypt_done+0x58/0xd8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
      
      The buggy address belongs to the object at ffff00002303f000
       which belongs to the cache dma-kmalloc-128 of size 128
      The buggy address is located 20 bytes inside of
       128-byte region [ffff00002303f000, ffff00002303f080)
      The buggy address belongs to the page:
      page:fffffe00006c0fc0 refcount:1 mapcount:0 mapping:ffff00093200c000 index:0x0
      flags: 0xffff00000000200(slab)
      raw: 0ffff00000000200 dead000000000100 dead000000000122 ffff00093200c000
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff00002303ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff00002303ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      >ffff00002303f000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                               ^
       ffff00002303f080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff00002303f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
      
      Fixes: 1c240226
      
       ("crypto: caam - add crypto_engine support for AEAD algorithms")
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5ed1e8b8
    • Iuliana Prodan's avatar
      crypto: caam - fix use-after-free KASAN issue for SKCIPHER algorithms · 5af4e8d4
      Iuliana Prodan authored
      Here's the KASAN report:
      BUG: KASAN: use-after-free in skcipher_crypt_done+0xe8/0x1a8
      Read of size 1 at addr ffff00002304001c by task swapper/0/0
      
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc1-00162-gfcb90d5 #57
      Hardware name: LS1046A RDB Board (DT)
      Call trace:
       dump_backtrace+0x0/0x260
       show_stack+0x14/0x20
       dump_stack+0xe8/0x144
       print_address_description.isra.11+0x64/0x348
       __kasan_report+0x11c/0x230
       kasan_report+0xc/0x18
       __asan_load1+0x5c/0x68
       skcipher_crypt_done+0xe8/0x1a8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
       irq_exit+0x114/0x128
       __handle_domain_irq+0x80/0xe0
       gic_handle_irq+0x50/0xa0
       el1_irq+0xb8/0x180
       _raw_spin_unlock_irq+0x2c/0x78
       finish_task_switch+0xa4/0x2f8
       __schedule+0x3a4/0x890
       schedule_idle+0x28/0x50
       do_idle+0x22c/0x338
       cpu_startup_entry+0x24/0x40
       rest_init+0xf8/0x10c
       arch_call_rest_init+0xc/0x14
       start_kernel+0x774/0x7b4
      
      Allocated by task 263:
       save_stack+0x24/0xb0
       __kasan_kmalloc.isra.10+0xc4/0xe0
       kasan_kmalloc+0xc/0x18
       __kmalloc+0x178/0x2b8
       skcipher_edesc_alloc+0x21c/0x1018
       skcipher_encrypt+0x84/0x150
       crypto_skcipher_encrypt+0x50/0x68
       test_skcipher_vec_cfg+0x4d4/0xc10
       test_skcipher_vec+0xf8/0x1d8
       alg_test_skcipher+0xec/0x230
       alg_test.part.44+0x114/0x4a0
       alg_test+0x1c/0x60
       cryptomgr_test+0x34/0x58
       kthread+0x1b8/0x1c0
       ret_from_fork+0x10/0x18
      
      Freed by task 0:
       save_stack+0x24/0xb0
       __kasan_slab_free+0x10c/0x188
       kasan_slab_free+0x10/0x18
       kfree+0x7c/0x298
       skcipher_crypt_done+0xe0/0x1a8
       caam_jr_dequeue+0x390/0x608
       tasklet_action_common.isra.13+0x1ec/0x230
       tasklet_action+0x24/0x30
       efi_header_end+0x1a4/0x370
      
      The buggy address belongs to the object at ffff000023040000
       which belongs to the cache dma-kmalloc-512 of size 512
      The buggy address is located 28 bytes inside of
       512-byte region [ffff000023040000, ffff000023040200)
      The buggy address belongs to the page:
      page:fffffe00006c1000 refcount:1 mapcount:0 mapping:ffff00093200c400 index:0x0 compound_mapcount: 0
      flags: 0xffff00000010200(slab|head)
      raw: 0ffff00000010200 dead000000000100 dead000000000122 ffff00093200c400
      raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff00002303ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
       ffff00002303ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
      >ffff000023040000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
       ffff000023040080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff000023040100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      
      Fixes: ee38767f
      
       ("crypto: caam - support crypto_engine framework for SKCIPHER algorithms")
      Signed-off-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5af4e8d4
  2. Apr 13, 2020
    • Linus Torvalds's avatar
      Linux 5.7-rc1 · 8f3d9f35
      Linus Torvalds authored
      v5.7-rc1
      8f3d9f35
    • Linus Torvalds's avatar
      MAINTAINERS: sort field names for all entries · 3b50142d
      Linus Torvalds authored
      
      
      This sorts the actual field names too, potentially causing even more
      chaos and confusion at merge time if you have edited the MAINTAINERS
      file.  But the end result is a more consistent layout, and hopefully
      it's a one-time pain minimized by doing this just before the -rc1
      release.
      
      This was entirely scripted:
      
        ./scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS --order
      
      Requested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3b50142d
    • Linus Torvalds's avatar
      MAINTAINERS: sort entries by entry name · 4400b7d6
      Linus Torvalds authored
      
      
      They are all supposed to be sorted, but people who add new entries don't
      always know the alphabet.  Plus sometimes the entry names get edited,
      and people don't then re-order the entry.
      
      Let's see how painful this will be for merging purposes (the MAINTAINERS
      file is often edited in various different trees), but Joe claims there's
      relatively few patches in -next that touch this, and doing it just
      before -rc1 is likely the best time.  Fingers crossed.
      
      This was scripted with
      
        /scripts/parse-maintainers.pl --input=MAINTAINERS --output=MAINTAINERS
      
      but then I also ended up manually upper-casing a few entry names that
      stood out when looking at the end result.
      
      Requested-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4400b7d6
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4f8a3cc1
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of three patches to fix the fallout of the newly added split
        lock detection feature.
      
        It addressed the case where a KVM guest triggers a split lock #AC and
        KVM reinjects it into the guest which is not prepared to handle it.
      
        Add proper sanity checks which prevent the unconditional injection
        into the guest and handles the #AC on the host side in the same way as
        user space detections are handled. Depending on the detection mode it
        either warns and disables detection for the task or kills the task if
        the mode is set to fatal"
      
      * tag 'x86-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        KVM: VMX: Extend VMXs #AC interceptor to handle split lock #AC in guest
        KVM: x86: Emulate split-lock access as a write in emulator
        x86/split_lock: Provide handle_guest_split_lock()
      4f8a3cc1
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0785249f
      Linus Torvalds authored
      Pull time(keeping) updates from Thomas Gleixner:
      
       - Fix the time_for_children symlink in /proc/$PID/ so it properly
         reflects that it part of the 'time' namespace
      
       - Add the missing userns limit for the allowed number of time
         namespaces, which was half defined but the actual array member was
         not added. This went unnoticed as the array has an exessive empty
         member at the end but introduced a user visible regression as the
         output was corrupted.
      
       - Prevent further silent ucount corruption by adding a BUILD_BUG_ON()
         to catch half updated data.
      
      * tag 'timers-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        ucount: Make sure ucounts in /proc/sys/user don't regress again
        time/namespace: Add max_time_namespaces ucount
        time/namespace: Fix time_for_children symlink
      0785249f
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 590680d1
      Linus Torvalds authored
      Pull scheduler fixes/updates from Thomas Gleixner:
      
       - Deduplicate the average computations in the scheduler core and the
         fair class code.
      
       - Fix a raise between runtime distribution and assignement which can
         cause exceeding the quota by up to 70%.
      
       - Prevent negative results in the imbalanace calculation
      
       - Remove a stale warning in the workqueue code which can be triggered
         since the call site was moved out of preempt disabled code. It's a
         false positive.
      
       - Deduplicate the print macros for procfs
      
       - Add the ucmap values to the SCHED_DEBUG procfs output for completness
      
      * tag 'sched-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/debug: Add task uclamp values to SCHED_DEBUG procfs
        sched/debug: Factor out printing formats into common macros
        sched/debug: Remove redundant macro define
        sched/core: Remove unused rq::last_load_update_tick
        workqueue: Remove the warning in wq_worker_sleeping()
        sched/fair: Fix negative imbalance in imbalance calculation
        sched/fair: Fix race between runtime distribution and assignment
        sched/fair: Align rq->avg_idle and rq->avg_scan_cost
      590680d1
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 20e2aa81
      Linus Torvalds authored
      Pull perf fixes from Thomas Gleixner:
       "Three fixes/updates for perf:
      
         - Fix the perf event cgroup tracking which tries to track the cgroup
           even for disabled events.
      
         - Add Ice Lake server support for uncore events
      
         - Disable pagefaults when retrieving the physical address in the
           sampling code"
      
      * tag 'perf-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Disable page faults when getting phys address
        perf/x86/intel/uncore: Add Ice Lake server uncore support
        perf/cgroup: Correct indirection in perf_less_group_idx()
        perf/core: Fix event cgroup tracking
      20e2aa81
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 652fa53c
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "Three small fixes/updates for the locking core code:
      
         - Plug a task struct reference leak in the percpu rswem
           implementation.
      
         - Document the refcount interaction with PID_MAX_LIMIT
      
         - Improve the 'invalid wait context' data dump in lockdep so it
           contains all information which is required to decode the problem"
      
      * tag 'locking-urgent-2020-04-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/lockdep: Improve 'invalid wait context' splat
        locking/refcount: Document interaction with PID_MAX_LIMIT
        locking/percpu-rwsem: Fix a task_struct refcount
      652fa53c
    • Linus Torvalds's avatar
      Merge tag '5.7-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 4119bf9f
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Ten cifs/smb fixes:
      
         - five RDMA (smbdirect) related fixes
      
         - add experimental support for swap over SMB3 mounts
      
         - also a fix which improves performance of signed connections"
      
      * tag '5.7-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        smb3: enable swap on SMB3 mounts
        smb3: change noisy error message to FYI
        smb3: smbdirect support can be configured by default
        cifs: smbd: Do not schedule work to send immediate packet on every receive
        cifs: smbd: Properly process errors on ib_post_send
        cifs: Allocate crypto structures on the fly for calculating signatures of incoming packets
        cifs: smbd: Update receive credits before sending and deal with credits roll back on failure before sending
        cifs: smbd: Check send queue size before posting a send
        cifs: smbd: Merge code to track pending packets
        cifs: ignore cached share root handle closing errors
      4119bf9f
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 50bda5fa
      Linus Torvalds authored
      Pull NFS client bugfix from Trond Myklebust:
       "Fix an RCU read lock leakage in pnfs_alloc_ds_commits_list()"
      
      * tag 'nfs-for-5.7-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        pNFS: Fix RCU lock leakage
      50bda5fa
  3. Apr 12, 2020
    • Linus Torvalds's avatar
      Merge tag 'nios2-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2 · b032227c
      Linus Torvalds authored
      Pull nios2 updates from Ley Foon Tan:
      
       - Remove nios2-dev@lists.rocketboards.org from MAINTAINERS
      
       - remove 'resetvalue' property
      
       - rename 'altr,gpio-bank-width' -> 'altr,ngpio'
      
       - enable the common clk subsystem on Nios2
      
      * tag 'nios2-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
        MAINTAINERS: Remove nios2-dev@lists.rocketboards.org
        arch: nios2: remove 'resetvalue' property
        arch: nios2: rename 'altr,gpio-bank-width' -> 'altr,ngpio'
        arch: nios2: Enable the common clk subsystem on Nios2
      b032227c
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.7-1' of git://git.infradead.org/users/hch/dma-mapping · 75e71883
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
      
       - fix an integer truncation in dma_direct_get_required_mask
         (Kishon Vijay Abraham)
      
       - fix the display of dma mapping types (Grygorii Strashko)
      
      * tag 'dma-mapping-5.7-1' of git://git.infradead.org/users/hch/dma-mapping:
        dma-debug: fix displaying of dma allocation type
        dma-direct: fix data truncation in dma_direct_get_required_mask()
      75e71883
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · b753101a
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - raise minimum supported binutils version to 2.23
      
       - remove old CONFIG_AS_* macros that we know binutils >= 2.23 supports
      
       - move remaining CONFIG_AS_* tests to Kconfig from Makefile
      
       - enable -Wtautological-compare warnings to catch more issues
      
       - do not support GCC plugins for GCC <= 4.7
      
       - fix various breakages of 'make xconfig'
      
       - include the linker version used for linking the kernel into
         LINUX_COMPILER, which is used for the banner, and also exposed to
         /proc/version
      
       - link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y, which
         allows us to remove the lib-ksyms.o workaround, and to solve the last
         known issue of the LLVM linker
      
       - add dummy tools in scripts/dummy-tools/ to enable all compiler tests
         in Kconfig, which will be useful for distro maintainers
      
       - support the single switch, LLVM=1 to use Clang and all LLVM utilities
         instead of GCC and Binutils.
      
       - support LLVM_IAS=1 to enable the integrated assembler, which is still
         experimental
      
      * tag 'kbuild-v5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (36 commits)
        kbuild: fix comment about missing include guard detection
        kbuild: support LLVM=1 to switch the default tools to Clang/LLVM
        kbuild: replace AS=clang with LLVM_IAS=1
        kbuild: add dummy toolchains to enable all cc-option etc. in Kconfig
        kbuild: link lib-y objects to vmlinux forcibly when CONFIG_MODULES=y
        MIPS: fw: arc: add __weak to prom_meminit and prom_free_prom_memory
        kbuild: remove -I$(srctree)/tools/include from scripts/Makefile
        kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
        Documentation/llvm: fix the name of llvm-size
        kbuild: mkcompile_h: Include $LD version in /proc/version
        kconfig: qconf: Fix a few alignment issues
        kconfig: qconf: remove some old bogus TODOs
        kconfig: qconf: fix support for the split view mode
        kconfig: qconf: fix the content of the main widget
        kconfig: qconf: Change title for the item window
        kconfig: qconf: clean deprecated warnings
        gcc-plugins: drop support for GCC <= 4.7
        kbuild: Enable -Wtautological-compare
        x86: update AS_* macros to binutils >=2.23, supporting ADX and AVX2
        crypto: x86 - clean up poly1305-x86_64-cryptogams.S by 'make clean'
        ...
      b753101a
    • Sedat Dilek's avatar
      mailmap: Add Sedat Dilek (replacement for expired email address) · c7850ae4
      Sedat Dilek authored
      
      
      I do not longer work for credativ Germany.
      
      Please, use my private email address instead.
      
      This is for the case when people want to CC me on
      patches sent from my old business email address.
      
      Signed-off-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c7850ae4
  4. Apr 11, 2020
    • Trond Myklebust's avatar
      pNFS: Fix RCU lock leakage · 27d231c0
      Trond Myklebust authored
      Another brown paper bag moment. pnfs_alloc_ds_commits_list() is leaking
      the RCU lock.
      
      Fixes: a9901899
      
       ("pNFS: Add infrastructure for cleaning up per-layout commit structures")
      Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
      27d231c0
    • Xiaoyao Li's avatar
      KVM: VMX: Extend VMXs #AC interceptor to handle split lock #AC in guest · e6f8b6c1
      Xiaoyao Li authored
      
      
      Two types of #AC can be generated in Intel CPUs:
       1. legacy alignment check #AC
       2. split lock #AC
      
      Reflect #AC back into the guest if the guest has legacy alignment checks
      enabled or if split lock detection is disabled.
      
      If the #AC is not a legacy one and split lock detection is enabled, then
      invoke handle_guest_split_lock() which will either warn and disable split
      lock detection for this task or force SIGBUS on it.
      
      [ tglx: Switch it to handle_guest_split_lock() and rename the misnamed
        helper function. ]
      
      Suggested-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115517.176308876@linutronix.de
      e6f8b6c1
    • Xiaoyao Li's avatar
      KVM: x86: Emulate split-lock access as a write in emulator · 9de6fe3c
      Xiaoyao Li authored
      
      
      Emulate split-lock accesses as writes if split lock detection is on
      to avoid #AC during emulation, which will result in a panic(). This
      should never occur for a well-behaved guest, but a malicious guest can
      manipulate the TLB to trigger emulation of a locked instruction[1].
      
      More discussion can be found at [2][3].
      
      [1] https://lkml.kernel.org/r/8c5b11c9-58df-38e7-a514-dc12d687b198@redhat.com
      [2] https://lkml.kernel.org/r/20200131200134.GD18946@linux.intel.com
      [3] https://lkml.kernel.org/r/20200227001117.GX9940@linux.intel.com
      
      Suggested-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115517.084300242@linutronix.de
      9de6fe3c
    • Thomas Gleixner's avatar
      x86/split_lock: Provide handle_guest_split_lock() · d7e94dbd
      Thomas Gleixner authored
      
      
      Without at least minimal handling for split lock detection induced #AC,
      VMX will just run into the same problem as the VMWare hypervisor, which
      was reported by Kenneth.
      
      It will inject the #AC blindly into the guest whether the guest is
      prepared or not.
      
      Provide a function for guest mode which acts depending on the host
      SLD mode. If mode == sld_warn, treat it like user space, i.e. emit a
      warning, disable SLD and mark the task accordingly. Otherwise force
      SIGBUS.
      
       [ bp: Add a !CPU_SUP_INTEL stub for handle_guest_split_lock(). ]
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Link: https://lkml.kernel.org/r/20200410115516.978037132@linutronix.de
      Link: https://lkml.kernel.org/r/20200402123258.895628824@linutronix.de
      d7e94dbd
    • Masahiro Yamada's avatar
      kbuild: fix comment about missing include guard detection · 00d76a0c
      Masahiro Yamada authored
      
      
      The keyword here is 'twice' to explain the trick.
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      00d76a0c
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 5b8b9d0c
      Linus Torvalds authored
      Merge yet more updates from Andrew Morton:
      
       - Almost all of the rest of MM (memcg, slab-generic, slab, pagealloc,
         gup, hugetlb, pagemap, memremap)
      
       - Various other things (hfs, ocfs2, kmod, misc, seqfile)
      
      * akpm: (34 commits)
        ipc/util.c: sysvipc_find_ipc() should increase position index
        kernel/gcov/fs.c: gcov_seq_next() should increase position index
        fs/seq_file.c: seq_read(): add info message about buggy .next functions
        drivers/dma/tegra20-apb-dma.c: fix platform_get_irq.cocci warnings
        change email address for Pali Rohár
        selftests: kmod: test disabling module autoloading
        selftests: kmod: fix handling test numbers above 9
        docs: admin-guide: document the kernel.modprobe sysctl
        fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once()
        kmod: make request_module() return an error when autoloading is disabled
        mm/memremap: set caching mode for PCI P2PDMA memory to WC
        mm/memory_hotplug: add pgprot_t to mhp_params
        powerpc/mm: thread pgprot_t through create_section_mapping()
        x86/mm: introduce __set_memory_prot()
        x86/mm: thread pgprot_t through init_memory_mapping()
        mm/memory_hotplug: rename mhp_restrictions to mhp_params
        mm/memory_hotplug: drop the flags field from struct mhp_restrictions
        mm/special: create generic fallbacks for pte_special() and pte_mkspecial()
        mm/vma: introduce VM_ACCESS_FLAGS
        mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS
        ...
      5b8b9d0c
    • Linus Torvalds's avatar
      Merge tag 'docs-5.7-2' of git://git.lwn.net/linux · ca6151a9
      Linus Torvalds authored
      Pull Documentation fixes from Jonathan Corbet:
       "A handful of late-arriving fixes for the documentation tree"
      
      * tag 'docs-5.7-2' of git://git.lwn.net/linux:
        Documentation: android: binderfs: add 'stats' mount option
        Documentation: driver-api/usb/writing_usb_driver.rst Updates documentation links
        docs: driver-api: address duplicate label warning
        Documentation: sysrq: fix RST formatting
        docs: kernel-parameters.txt: Fix broken references
        docs: kernel-parameters.txt: Remove nompx
        docs: filesystems: fix typo in qnx6.rst
      ca6151a9
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.7-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux · 4e4bdcfa
      Linus Torvalds authored
      Pull orangefs updates from Mike Marshall:
       "A fix and two cleanups.
      
        Fix:
      
         - Christoph Hellwig noticed that some logic I added to
           orangefs_file_read_iter introduced a race condition, so he sent a
           reversion patch. I had to modify his patch since reverting at this
           point broke Orangefs.
      
        Cleanups:
      
         - Christoph Hellwig noticed that we were doing some unnecessary work
           in orangefs_flush, so he sent in a patch that removed the un-needed
           code.
      
         - Al Viro told me he had trouble building Orangefs. Orangefs should
           be easy to build, even for Al :-).
      
           I looked back at the test server build notes in orangefs.txt, just
           in case that's where the trouble really is, and found a couple of
           typos and made a couple of clarifications"
      
      * tag 'for-linus-5.7-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
        orangefs: clarify build steps for test server in orangefs.txt
        orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush
        orangefs: get rid of knob code...
      4e4bdcfa
    • Linus Torvalds's avatar
      Merge tag 'xtensa-20200410' of git://github.com/jcmvbkbc/linux-xtensa · 9539303a
      Linus Torvalds authored
      Pull xtensa updates from Max Filippov:
      
       - replace setup_irq() by request_irq()
      
       - cosmetic fixes in xtensa Kconfig and boot/Makefile
      
      * tag 'xtensa-20200410' of git://github.com/jcmvbkbc/linux-xtensa:
        arch/xtensa: fix grammar in Kconfig help text
        xtensa: remove meaningless export ccflags-y
        xtensa: replace setup_irq() by request_irq()
      9539303a
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.7-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · e6383b18
      Linus Torvalds authored
      Pull more xen updates from Juergen Gross:
      
       - two cleanups
      
       - fix a boot regression introduced in this merge window
      
       - fix wrong use of memory allocation flags
      
      * tag 'for-linus-5.7-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        x86/xen: fix booting 32-bit pv guest
        x86/xen: make xen_pvmmu_arch_setup() static
        xen/blkfront: fix memory allocation flags in blkfront_setup_indirect()
        xen: Use evtchn_type_t as a type for event channels
      e6383b18
    • Vasily Averin's avatar
      ipc/util.c: sysvipc_find_ipc() should increase position index · 89163f93
      Vasily Averin authored
      
      
      If seq_file .next function does not change position index, read after
      some lseek can generate unexpected output.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=206283
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarWaiman Long <longman@redhat.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: NeilBrown <neilb@suse.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/b7a20945-e315-8bb0-21e6-3875c14a8494@virtuozzo.com
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      89163f93
    • Vasily Averin's avatar
      kernel/gcov/fs.c: gcov_seq_next() should increase position index · f4d74ef6
      Vasily Averin authored
      
      
      If seq_file .next function does not change position index, read after
      some lseek can generate unexpected output.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=206283
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarPeter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Cc: NeilBrown <neilb@suse.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Waiman Long <longman@redhat.com>
      Link: http://lkml.kernel.org/r/f65c6ee7-bd00-f910-2f8a-37cc67e4ff88@virtuozzo.com
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f4d74ef6
    • Vasily Averin's avatar
      fs/seq_file.c: seq_read(): add info message about buggy .next functions · 3bfa7e14
      Vasily Averin authored
      Patch series "seq_file .next functions should increase position index".
      
      In Aug 2018 NeilBrown noticed commit 1f4aace6
      
       ("fs/seq_file.c:
      simplify seq_file iteration code and interface")
      
      "Some ->next functions do not increment *pos when they return NULL...
      Note that such ->next functions are buggy and should be fixed.  A simple
      demonstration is dd if=/proc/swaps bs=1000 skip=1 Choose any block size
      larger than the size of /proc/swaps.  This will always show the whole
      last line of /proc/swaps"
      
      Described problem is still actual.  If you make lseek into middle of
      last output line following read will output end of last line and whole
      last line once again.
      
        $ dd if=/proc/swaps bs=1  # usual output
        Filename				Type		Size	Used	Priority
        /dev/dm-0                             partition	4194812	97536	-2
        104+0 records in
        104+0 records out
        104 bytes copied
      
        $ dd if=/proc/swaps bs=40 skip=1    # last line was generated twice
        dd: /proc/swaps: cannot skip to specified offset
        v/dm-0                                partition	4194812	97536	-2
        /dev/dm-0                             partition	4194812	97536	-2
        3+1 records in
        3+1 records out
        131 bytes copied
      
      There are lot of other affected files, I've found 30+ including
      /proc/net/ip_tables_matches and /proc/sysvipc/*
      
      I've sent patches into maillists of affected subsystems already, this
      patch-set fixes the problem in files related to pstore, tracing, gcov,
      sysvipc and other subsystems processed via linux-kernel@ mailing list
      directly
      
      https://bugzilla.kernel.org/show_bug.cgi?id=206283
      
      This patch (of 4):
      
      Add debug code to seq_read() to detect missed or out-of-tree incorrect
      .next seq_file functions.
      
      [akpm@linux-foundation.org: s/pr_info/pr_info_ratelimited/, per Qian Cai]
      https://bugzilla.kernel.org/show_bug.cgi?id=206283
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: NeilBrown <neilb@suse.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Manfred Spraul <manfred@colorfullife.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Waiman Long <longman@redhat.com>
      Link: http://lkml.kernel.org/r/244674e5-760c-86bd-d08a-047042881748@virtuozzo.com
      Link: http://lkml.kernel.org/r/7c24087c-e280-e580-5b0c-0cdaeb14cd18@virtuozzo.com
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3bfa7e14
    • kbuild test robot's avatar
      drivers/dma/tegra20-apb-dma.c: fix platform_get_irq.cocci warnings · cb8d9937
      kbuild test robot authored
      Remove dev_err() messages after platform_get_irq*() failures.
      platform_get_irq() already prints an error.
      
      Generated by: scripts/coccinelle/api/platform_get_irq.cocci
      
      Fixes: 6c41ac96
      
       ("dmaengine: tegra-apb: Support COMPILE_TEST")
      Signed-off-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDmitry Osipenko <digetx@gmail.com>
      Acked-by: default avatarThierry Reding <treding@nvidia.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Vinod Koul <vinod.koul@linux.intel.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Jon Hunter <jonathanh@nvidia.com>
      Link: http://lkml.kernel.org/r/alpine.DEB.2.21.2002271133450.2973@hadrien
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cb8d9937
    • Pali Rohár's avatar
      change email address for Pali Rohár · 149ed3d4
      Pali Rohár authored
      
      
      For security reasons I stopped using gmail account and kernel address is
      now up-to-date alias to my personal address.
      
      People periodically send me emails to address which they found in source
      code of drivers, so this change reflects state where people can contact
      me.
      
      [ Added .mailmap entry as per Joe Perches  - Linus ]
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Joe Perches <joe@perches.com>
      Link: http://lkml.kernel.org/r/20200307104237.8199-1-pali@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      149ed3d4
    • Eric Biggers's avatar
      selftests: kmod: test disabling module autoloading · 23756e55
      Eric Biggers authored
      
      
      Test that request_module() fails with -ENOENT when
      /proc/sys/kernel/modprobe contains (a) a nonexistent path, and (b) an
      empty path.
      
      Case (b) is a regression test for the patch "kmod: make request_module()
      return an error when autoloading is disabled".
      
      Tested with 'kmod.sh -t 0010 && kmod.sh -t 0011', and also simply with
      'kmod.sh' to run all kmod tests.
      
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Vander Stoep <jeffv@google.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: NeilBrown <neilb@suse.com>
      Link: http://lkml.kernel.org/r/20200312202552.241885-5-ebiggers@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      23756e55
    • Eric Biggers's avatar
      selftests: kmod: fix handling test numbers above 9 · 6d573a07
      Eric Biggers authored
      
      
      get_test_count() and get_test_enabled() were broken for test numbers
      above 9 due to awk interpreting a field specification like '$0010' as
      octal rather than decimal.  Fix it by stripping the leading zeroes.
      
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Vander Stoep <jeffv@google.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: NeilBrown <neilb@suse.com>
      Link: http://lkml.kernel.org/r/20200318230515.171692-5-ebiggers@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6d573a07
    • Eric Biggers's avatar
      docs: admin-guide: document the kernel.modprobe sysctl · 6e715825
      Eric Biggers authored
      
      
      Document the kernel.modprobe sysctl in the same place that all the other
      kernel.* sysctls are documented.  Make sure to mention how to use this
      sysctl to completely disable module autoloading, and how this sysctl
      relates to CONFIG_STATIC_USERMODEHELPER.
      
      [ebiggers@google.com: v5]
        Link: http://lkml.kernel.org/r/20200318230515.171692-4-ebiggers@kernel.org
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Vander Stoep <jeffv@google.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: NeilBrown <neilb@suse.com>
      Link: http://lkml.kernel.org/r/20200312202552.241885-4-ebiggers@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6e715825
    • Eric Biggers's avatar
      fs/filesystems.c: downgrade user-reachable WARN_ONCE() to pr_warn_once() · 26c5d78c
      Eric Biggers authored
      After request_module(), nothing is stopping the module from being
      unloaded until someone takes a reference to it via try_get_module().
      
      The WARN_ONCE() in get_fs_type() is thus user-reachable, via userspace
      running 'rmmod' concurrently.
      
      Since WARN_ONCE() is for kernel bugs only, not for user-reachable
      situations, downgrade this warning to pr_warn_once().
      
      Keep it printed once only, since the intent of this warning is to detect
      a bug in modprobe at boot time.  Printing the warning more than once
      wouldn't really provide any useful extra information.
      
      Fixes: 41124db8
      
       ("fs: warn in case userspace lied about modprobe return")
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarJessica Yu <jeyu@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Vander Stoep <jeffv@google.com>
      Cc: Jessica Yu <jeyu@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: NeilBrown <neilb@suse.com>
      Cc: <stable@vger.kernel.org>		[4.13+]
      Link: http://lkml.kernel.org/r/20200312202552.241885-3-ebiggers@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      26c5d78c
    • Eric Biggers's avatar
      kmod: make request_module() return an error when autoloading is disabled · d7d27cfc
      Eric Biggers authored
      
      
      Patch series "module autoloading fixes and cleanups", v5.
      
      This series fixes a bug where request_module() was reporting success to
      kernel code when module autoloading had been completely disabled via
      'echo > /proc/sys/kernel/modprobe'.
      
      It also addresses the issues raised on the original thread
      (https://lkml.kernel.org/lkml/20200310223731.126894-1-ebiggers@kernel.org/T/#u)
      bydocumenting the modprobe sysctl, adding a self-test for the empty path
      case, and downgrading a user-reachable WARN_ONCE().
      
      This patch (of 4):
      
      It's long been possible to disable kernel module autoloading completely
      (while still allowing manual module insertion) by setting
      /proc/sys/kernel/modprobe to the empty string.
      
      This can be preferable to setting it to a nonexistent file since it
      avoids the overhead of an attempted execve(), avoids potential
      deadlocks, and avoids the call to security_kernel_module_request() and
      thus on SELinux-based systems eliminates the need to write SELinux rules
      to dontaudit module_request.
      
      However, when module autoloading is disabled in this way,
      request_module() returns 0.  This is broken because callers expect 0 to
      mean that the module was successfully loaded.
      
      Apparently this was never noticed because this method of disabling
      module autoloading isn't used much, and also most callers don't use the
      return value of request_module() since it's always necessary to check
      whether the module registered its functionality or not anyway.
      
      But improperly returning 0 can indeed confuse a few callers, for example
      get_fs_type() in fs/filesystems.c where it causes a WARNING to be hit:
      
      	if (!fs && (request_module("fs-%.*s", len, name) == 0)) {
      		fs = __get_fs_type(name, len);
      		WARN_ONCE(!fs, "request_module fs-%.*s succeeded, but still no fs?\n", len, name);
      	}
      
      This is easily reproduced with:
      
      	echo > /proc/sys/kernel/modprobe
      	mount -t NONEXISTENT none /
      
      It causes:
      
      	request_module fs-NONEXISTENT succeeded, but still no fs?
      	WARNING: CPU: 1 PID: 1106 at fs/filesystems.c:275 get_fs_type+0xd6/0xf0
      	[...]
      
      This should actually use pr_warn_once() rather than WARN_ONCE(), since
      it's also user-reachable if userspace immediately unloads the module.
      Regardless, request_module() should correctly return an error when it
      fails.  So let's make it return -ENOENT, which matches the error when
      the modprobe binary doesn't exist.
      
      I've also sent patches to document and test this case.
      
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarJessica Yu <jeyu@kernel.org>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Vander Stoep <jeffv@google.com>
      Cc: Ben Hutchings <benh@debian.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20200310223731.126894-1-ebiggers@kernel.org
      Link: http://lkml.kernel.org/r/20200312202552.241885-1-ebiggers@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d7d27cfc
    • Logan Gunthorpe's avatar
      mm/memremap: set caching mode for PCI P2PDMA memory to WC · a50d8d98
      Logan Gunthorpe authored
      
      
      PCI BAR IO memory should never be mapped as WB, however prior to this
      the PAT bits were set WB and it was typically overridden by MTRR
      registers set by the firmware.
      
      Set PCI P2PDMA memory to be UC as this is what it currently, typically,
      ends up being mapped as on x86 after the MTRR registers override the
      cache setting.
      
      Future use-cases may need to generalize this by adding flags to select
      the caching type, as some P2PDMA cases may not want UC.  However, those
      use-cases are not upstream yet and this can be changed when they arrive.
      
      Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Eric Badger <ebadger@gigaio.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200306170846.9333-8-logang@deltatee.com
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a50d8d98