1. 20 11月, 2020 4 次提交
  2. 06 11月, 2020 1 次提交
  3. 10 10月, 2020 1 次提交
  4. 18 9月, 2020 2 次提交
  5. 17 9月, 2020 2 次提交
  6. 15 9月, 2020 2 次提交
    • B
      EDAC/ghes: Check whether the driver is on the safe list correctly · 251c54ea
      Borislav Petkov 提交于
      With CONFIG_DEBUG_TEST_DRIVER_REMOVE=y, a system would try to probe,
      unregister and probe again a driver.
      
      When ghes_edac is attempted to be loaded on a system which is not on
      the safe platforms list, ghes_edac_register() would return early. The
      unregister counterpart ghes_edac_unregister() would still attempt to
      unregister and exit early at the refcount test, leading to the refcount
      underflow below.
      
      In order to not do *anything* on the unregister path too, reuse the
      force_load parameter and check it on that path too, before fumbling with
      the refcount.
      
        ghes_edac: ghes_edac_register: entry
        ghes_edac: ghes_edac_register: return -ENODEV
        ------------[ cut here ]------------
        refcount_t: underflow; use-after-free.
        WARNING: CPU: 10 PID: 1 at lib/refcount.c:28 refcount_warn_saturate+0xb9/0x100
        Modules linked in:
        CPU: 10 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4+ #12
        Hardware name: GIGABYTE MZ01-CE1-00/MZ01-CE1-00, BIOS F02 08/29/2018
        RIP: 0010:refcount_warn_saturate+0xb9/0x100
        Code: 82 e8 fb 8f 4d 00 90 0f 0b 90 90 c3 80 3d 55 4c f5 00 00 75 88 c6 05 4c 4c f5 00 01 90 48 c7 c7 d0 8a 10 82 e8 d8 8f 4d 00 90 <0f> 0b 90 90 c3 80 3d 30 4c f5 00 00 0f 85 61 ff ff ff c6 05 23 4c
        RSP: 0018:ffffc90000037d58 EFLAGS: 00010292
        RAX: 0000000000000026 RBX: ffff88840b8da000 RCX: 0000000000000000
        RDX: 0000000000000001 RSI: ffffffff8216b24f RDI: 00000000ffffffff
        RBP: ffff88840c662e00 R08: 0000000000000001 R09: 0000000000000001
        R10: 0000000000000001 R11: 0000000000000046 R12: 0000000000000000
        R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
        FS:  0000000000000000(0000) GS:ffff88840ee80000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 0000000000000000 CR3: 0000800002211000 CR4: 00000000003506e0
        Call Trace:
         ghes_edac_unregister
         ghes_remove
         platform_drv_remove
         really_probe
         driver_probe_device
         device_driver_attach
         __driver_attach
         ? device_driver_attach
         ? device_driver_attach
         bus_for_each_dev
         bus_add_driver
         driver_register
         ? bert_init
         ghes_init
         do_one_initcall
         ? rcu_read_lock_sched_held
         kernel_init_freeable
         ? rest_init
         kernel_init
         ret_from_fork
         ...
        ghes_edac: ghes_edac_unregister: FALSE, refcount: -1073741824
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/20200911164950.GB19320@zn.tnic
      251c54ea
    • B
      EDAC/ghes: Clear scanned data on unload · cd8100f1
      Borislav Petkov 提交于
      Commit
      
        b972fdba ("EDAC/ghes: Fix NULL pointer dereference in ghes_edac_register()")
      
      didn't clear all the information from the scanned system and, more
      specifically, left ghes_hw.num_dimms to its previous value. On a
      second load (CONFIG_DEBUG_TEST_DRIVER_REMOVE=y), the driver would use
      the leftover num_dimms value which is not 0 and thus the 0 check in
      enumerate_dimms() will get bypassed and it would go directly to the
      pointer deref:
      
        d = &hw->dimms[hw->num_dimms];
      
      which is, of course, NULL:
      
        #PF: supervisor write access in kernel mode
        #PF: error_code(0x0002) - not-present page
        PGD 0 P4D 0
        Oops: 0002 [#1] PREEMPT SMP
        CPU: 7 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4+ #7
        Hardware name: GIGABYTE MZ01-CE1-00/MZ01-CE1-00, BIOS F02 08/29/2018
        RIP: 0010:enumerate_dimms.cold+0x7b/0x375
      
      Reset the whole ghes_hw on driver unregister so that no stale values are
      used on a second system scan.
      
      Fixes: b972fdba ("EDAC/ghes: Fix NULL pointer dereference in ghes_edac_register()")
      Cc: Shiju Jose <shiju.jose@huawei.com>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/20200911164817.GA19320@zn.tnic
      cd8100f1
  7. 09 9月, 2020 1 次提交
  8. 02 9月, 2020 2 次提交
  9. 01 9月, 2020 1 次提交
  10. 28 8月, 2020 1 次提交
  11. 24 8月, 2020 1 次提交
  12. 20 8月, 2020 1 次提交
  13. 18 8月, 2020 1 次提交
  14. 17 8月, 2020 4 次提交
  15. 11 8月, 2020 1 次提交
  16. 23 6月, 2020 1 次提交
  17. 19 6月, 2020 1 次提交
  18. 17 6月, 2020 2 次提交
    • Q
      EDAC: Fix reference count leaks · 17ed808a
      Qiushi Wu 提交于
      When kobject_init_and_add() returns an error, it should be handled
      because kobject_init_and_add() takes a reference even when it fails. If
      this function returns an error, kobject_put() must be called to properly
      clean up the memory associated with the object.
      
      Therefore, replace calling kfree() and call kobject_put() and add a
      missing kobject_put() in the edac_device_register_sysfs_main_kobj()
      error path.
      
       [ bp: Massage and merge into a single patch. ]
      
      Fixes: b2ed215a ("Kobject: change drivers/edac to use kobject_init_and_add")
      Signed-off-by: NQiushi Wu <wu000273@umn.edu>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/20200528202238.18078-1-wu000273@umn.edu
      Link: https://lkml.kernel.org/r/20200528203526.20908-1-wu000273@umn.edu
      17ed808a
    • B
      EDAC/ghes: Scan the system once on driver init · b9cae277
      Borislav Petkov 提交于
      Change the hardware scanning and figuring out how many DIMMs a machine
      has to a single, one-time thing which happens once on driver init. After
      that scanning completes, struct ghes_hw_desc contains a representation
      of the hardware which the driver can then use for later initialization.
      
      Then, copy the DIMM information into the respective EDAC core
      representation of those.
      
      Get rid of ghes_edac_dimm_fill and use a struct dimm_info array
      directly.
      
      This way, hw detection and further driver initialization is nicely
      and logically split. Further additions should all be added to
      ghes_scan_system() and the hw representation extended as needed.
      
      There should be no functionality change resulting from this patch.
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      b9cae277
  19. 16 6月, 2020 5 次提交
  20. 14 6月, 2020 1 次提交
    • M
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada 提交于
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  21. 29 5月, 2020 1 次提交
  22. 23 5月, 2020 1 次提交
  23. 20 5月, 2020 1 次提交
  24. 28 4月, 2020 2 次提交