1. 28 11月, 2016 21 次提交
  2. 10 11月, 2016 1 次提交
    • J
      ppdev: fix double-free of pp->pdev->name · b13d1433
      Jann Horn 提交于
      free_pardevice() is called by parport_unregister_device() and already frees
      pp->pdev->name, don't try to do it again.
      
      This bug causes kernel crashes.
      
      I found and verified this with KASAN and some added pr_emerg()s:
      
      [   60.316568] pp_release: pp->pdev->name == ffff88039cb264c0
      [   60.316692] free_pardevice: freeing par_dev->name at ffff88039cb264c0
      [   60.316706] pp_release: kfree(ffff88039cb264c0)
      [   60.316714] ==========================================================
      [   60.316722] BUG: Double free or freeing an invalid pointer
      [   60.316731] Unexpected shadow byte: 0xFB
      [   60.316801] Object at ffff88039cb264c0, in cache kmalloc-32 size: 32
      [   60.316813] Allocated:
      [   60.316824] PID = 1695
      [   60.316869] Freed:
      [   60.316880] PID = 1695
      [   60.316935] ==========================================================
      Signed-off-by: NJann Horn <jann@thejh.net>
      Acked-by: NSudip Mukherjee <sudipm.mukherjee@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b13d1433
  3. 31 10月, 2016 2 次提交
    • J
      tpm: remove invalid min length check from tpm_do_selftest() · befd9965
      Jarkko Sakkinen 提交于
      Removal of this check was not properly amended to the original commit.
      
      Cc: stable@vger.kernel.org
      Fixes: 0c541332 ("tpm: use tpm_pcr_read_dev() in tpm_do_selftest()")
      Signed-off-by: NJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Signed-off-by: NJames Morris <james.l.morris@oracle.com>
      befd9965
    • M
      virtio: console: Unlock vqs while freeing buffers · 34563769
      Matt Redfearn 提交于
      Commit c6017e79 ("virtio: console: add locks around buffer removal
      in port unplug path") added locking around the freeing of buffers in the
      vq. However, when free_buf() is called with can_sleep = true and rproc
      is enabled, it calls dma_free_coherent() directly, requiring interrupts
      to be enabled. Currently a WARNING is triggered due to the spin locking
      around free_buf, with a call stack like this:
      
      WARNING: CPU: 3 PID: 121 at ./include/linux/dma-mapping.h:433
      free_buf+0x1a8/0x288
      Call Trace:
      [<8040c538>] show_stack+0x74/0xc0
      [<80757240>] dump_stack+0xd0/0x110
      [<80430d98>] __warn+0xfc/0x130
      [<80430ee0>] warn_slowpath_null+0x2c/0x3c
      [<807e7c6c>] free_buf+0x1a8/0x288
      [<807ea590>] remove_port_data+0x50/0xac
      [<807ea6a0>] unplug_port+0xb4/0x1bc
      [<807ea858>] virtcons_remove+0xb0/0xfc
      [<807b6734>] virtio_dev_remove+0x58/0xc0
      [<807f918c>] __device_release_driver+0xac/0x134
      [<807f924c>] device_release_driver+0x38/0x50
      [<807f7edc>] bus_remove_device+0xfc/0x130
      [<807f4b74>] device_del+0x17c/0x21c
      [<807f4c38>] device_unregister+0x24/0x38
      [<807b6b50>] unregister_virtio_device+0x28/0x44
      
      Fix this by restructuring the loops to allow the locks to only be taken
      where it is necessary to protect the vqs, and release it while the
      buffer is being freed.
      
      Fixes: c6017e79 ("virtio: console: add locks around buffer removal in port unplug path")
      Cc: stable@vger.kernel.org
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      34563769
  4. 19 10月, 2016 1 次提交
  5. 12 10月, 2016 3 次提交
  6. 11 10月, 2016 1 次提交
    • E
      latent_entropy: Mark functions with __latent_entropy · 0766f788
      Emese Revfy 提交于
      The __latent_entropy gcc attribute can be used only on functions and
      variables.  If it is on a function then the plugin will instrument it for
      gathering control-flow entropy. If the attribute is on a variable then
      the plugin will initialize it with random contents.  The variable must
      be an integer, an integer array type or a structure with integer fields.
      
      These specific functions have been selected because they are init
      functions (to help gather boot-time entropy), are called at unpredictable
      times, or they have variable loops, each of which provide some level of
      latent entropy.
      Signed-off-by: NEmese Revfy <re.emese@gmail.com>
      [kees: expanded commit message]
      Signed-off-by: NKees Cook <keescook@chromium.org>
      0766f788
  7. 06 10月, 2016 2 次提交
  8. 03 10月, 2016 1 次提交
    • X
      ipmi: fix crash on reading version from proc after unregisted bmc · bd85f4b3
      Xie XiuQi 提交于
      I meet a crash, which could be reproduce:
      1) while true; do cat /proc/ipmi/0/version; done
      2) modprobe -rv ipmi_si ipmi_msghandler ipmi_devintf
      
      [82761.021137] IPMI BT: req2rsp=5 secs retries=2
      [82761.034524] ipmi device interface
      [82761.222218] ipmi_si ipmi_si.0: Found new BMC (man_id: 0x0007db, prod_id: 0x0001, dev_id: 0x01)
      [82761.222230] ipmi_si ipmi_si.0: IPMI bt interface initialized
      [82903.922740] BUG: unable to handle kernel NULL pointer dereference at 00000000000002d4
      [82903.930952] IP: [<ffffffffa030d9e8>] smi_version_proc_show+0x18/0x40 [ipmi_msghandler]
      [82903.939220] PGD 86693a067 PUD 865304067 PMD 0
      [82903.943893] Thread overran stack, or stack corrupted
      [82903.949034] Oops: 0000 [#1] SMP
      [82903.983091] Modules linked in: ipmi_si(-) ipmi_msghandler binfmt_misc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter
      ...
      [82904.057285]  pps_core scsi_transport_sas dm_mod vfio_iommu_type1 vfio xt_sctp nf_conntrack_proto_sctp nf_nat_proto_sctp
                      nf_nat nf_conntrack sctp libcrc32c [last unloaded: ipmi_devintf]
      [82904.073169] CPU: 37 PID: 28089 Comm: cat Tainted: GF          O   ---- -------   3.10.0-327.28.3.el7.x86_64 #1
      [82904.083373] Hardware name: Huawei RH2288H V3/BC11HGSA0, BIOS 3.22 05/16/2016
      [82904.090592] task: ffff880101cc2e00 ti: ffff880369c54000 task.ti: ffff880369c54000
      [82904.098414] RIP: 0010:[<ffffffffa030d9e8>]  [<ffffffffa030d9e8>] smi_version_proc_show+0x18/0x40 [ipmi_msghandler]
      [82904.109124] RSP: 0018:ffff880369c57e70  EFLAGS: 00010203
      [82904.114608] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000024688470
      [82904.121912] RDX: fffffffffffffff4 RSI: ffffffffa0313404 RDI: ffff8808670ce200
      [82904.129218] RBP: ffff880369c57e70 R08: 0000000000019720 R09: ffffffff81204a27
      [82904.136521] R10: ffff88046f803300 R11: 0000000000000246 R12: ffff880662399700
      [82904.143828] R13: 0000000000000001 R14: ffff880369c57f48 R15: ffff8808670ce200
      [82904.151128] FS:  00007fb70c9ca740(0000) GS:ffff88086e340000(0000) knlGS:0000000000000000
      [82904.159557] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [82904.165473] CR2: 00000000000002d4 CR3: 0000000864c0c000 CR4: 00000000003407e0
      [82904.172778] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [82904.180084] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [82904.187385] Stack:
      [82904.189573]  ffff880369c57ee0 ffffffff81204f1a 00000000122a2427 0000000001426000
      [82904.197392]  ffff8808670ce238 0000000000010000 0000000000000000 0000000000000fff
      [82904.205198]  00000000122a2427 ffff880862079600 0000000001426000 ffff880369c57f48
      [82904.212962] Call Trace:
      [82904.219667]  [<ffffffff81204f1a>] seq_read+0xfa/0x3a0
      [82904.224893]  [<ffffffff8124ce2d>] proc_reg_read+0x3d/0x80
      [82904.230468]  [<ffffffff811e102c>] vfs_read+0x9c/0x170
      [82904.235689]  [<ffffffff811e1b7f>] SyS_read+0x7f/0xe0
      [82904.240816]  [<ffffffff81649209>] system_call_fastpath+0x16/0x1b
      [82904.246991] Code: 30 a0 e8 0c 6f ef e0 5b 5d c3 66 0f 1f 84 00 00 00 00 00 0f 1f
                     44 00 00 48 8b 47 78 55 48 c7 c6 04 34 31 a0 48 89 e5 48 8b 40 50 <0f>
      	       b6 90 d4 02 00 00 31 c0 89 d1 83 e2 0f c0 e9 04 0f b6 c9 e8
      [82904.267710] RIP  [<ffffffffa030d9e8>] smi_version_proc_show+0x18/0x40 [ipmi_msghandler]
      [82904.276079]  RSP <ffff880369c57e70>
      [82904.279734] CR2: 00000000000002d4
      [82904.283731] ---[ end trace a69e4328b49dd7c4 ]---
      [82904.328118] Kernel panic - not syncing: Fatal exception
      
      Reading versin from /proc need bmc device struct available. So in this patch
      we move add/remove_proc_entries between ipmi_bmc_register and ipmi_bmc_unregister.
      
      Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NXie XiuQi <xiexiuqi@huawei.com>
      Signed-off-by: NCorey Minyard <cminyard@mvista.com>
      bd85f4b3
  9. 30 9月, 2016 4 次提交
  10. 28 9月, 2016 1 次提交
  11. 27 9月, 2016 3 次提交