1. 28 5月, 2014 4 次提交
  2. 20 5月, 2014 2 次提交
  3. 18 5月, 2014 1 次提交
    • M
      target: fix memory leak on XCOPY · 1e1110c4
      Mikulas Patocka 提交于
      On each processed XCOPY command, two "kmalloc-512" memory objects are
      leaked. These represent two allocations of struct xcopy_pt_cmd in
      target_core_xcopy.c.
      
      The reason for the memory leak is that the cmd_kref field is not
      initialized (thus, it is zero because the allocations were done with
      kzalloc). When we decrement zero kref in target_put_sess_cmd, the result
      is not zero, thus target_release_cmd_kref is not called.
      
      This patch fixes the bug by moving kref initialization from
      target_get_sess_cmd to transport_init_se_cmd (this function is called from
      target_core_xcopy.c, so it will correctly initialize cmd_kref). It can be
      easily verified that all code that calls target_get_sess_cmd also calls
      transport_init_se_cmd earlier, thus moving kref_init shouldn't introduce
      any new problems.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org	# 3.12+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1e1110c4
  4. 17 5月, 2014 5 次提交
  5. 16 5月, 2014 9 次提交
  6. 15 5月, 2014 13 次提交
  7. 14 5月, 2014 4 次提交
    • T
      of: make of_update_property() usable earlier in the boot process · 582da652
      Thomas Petazzoni 提交于
      Commit 75b57ecf ('of: Make device
      nodes kobjects so they show up in sysfs') has turned Device Tree nodes
      in kobjects and added a sysfs based representation for Device Tree
      nodes. Since the sysfs logic is only available after the execution of
      a core_initcall(), the patch took precautions in of_add_property() and
      of_remove_property() to not do any sysfs related manipulation early in
      the boot process.
      
      However, it forgot to do the same for of_update_property(), which if
      used early in the boot process (before core_initcalls have been
      called), tries to call sysfs_remove_bin_file(), and crashes:
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 0 at /home/thomas/projets/linux-2.6/fs/kernfs/dir.c:1216 kernfs_remove_by_name_ns+0x80/0x88()
      kernfs: can not remove '(null)', no directory
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.15.0-rc1-00127-g1d7e7b2-dirty #423
      [<c0014910>] (unwind_backtrace) from [<c00110ec>] (show_stack+0x10/0x14)
      [<c00110ec>] (show_stack) from [<c04c84b8>] (dump_stack+0x84/0x94)
      [<c04c84b8>] (dump_stack) from [<c001d8c0>] (warn_slowpath_common+0x6c/0x88)
      [<c001d8c0>] (warn_slowpath_common) from [<c001d90c>] (warn_slowpath_fmt+0x30/0x40)
      [<c001d90c>] (warn_slowpath_fmt) from [<c0104468>] (kernfs_remove_by_name_ns+0x80/0x88)
      [<c0104468>] (kernfs_remove_by_name_ns) from [<c0394d98>] (of_update_property+0xc0/0xf0)
      [<c0394d98>] (of_update_property) from [<c0647248>] (mvebu_timer_and_clk_init+0xfc/0x194)
      [<c0647248>] (mvebu_timer_and_clk_init) from [<c0640934>] (start_kernel+0x218/0x350)
      [<c0640934>] (start_kernel) from [<00008070>] (0x8070)
      ---[ end trace 3406ff24bd97382e ]---
      Unable to handle kernel NULL pointer dereference at virtual address 0000003c
      pgd = c0004000
      [0000003c] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W     3.15.0-rc1-00127-g1d7e7b2-dirty #423
      task: c10ad4d8 ti: c10a2000 task.ti: c10a2000
      PC is at kernfs_find_ns+0x8/0xf0
      LR is at kernfs_find_and_get_ns+0x30/0x48
      pc : [<c0103834>]    lr : [<c010394c>]    psr: 600001d3
      sp : c10a3f34  ip : 00000073  fp : 00000000
      r10: 00000000  r9 : cfffc240  r8 : cfdf2980
      r7 : cf812c00  r6 : 00000000  r5 : 00000000  r4 : c10b45e0
      r3 : c10ad4d8  r2 : 00000000  r1 : cf812c00  r0 : 00000000
      Flags: nZCv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c53c7d  Table: 0000404a  DAC: 00000015
      Process swapper/0 (pid: 0, stack limit = 0xc10a2240)
      Stack: (0xc10a3f34 to 0xc10a4000)
      3f20:                                              c10b45e0 00000000 00000000
      3f40: cf812c00 c010394c 00000063 cf812c00 00000001 cf812c00 cfdf29ac c03932cc
      3f60: 00000063 cf812bc0 cfdf29ac cf812c00 ffffffff c03943f8 cfdf2980 c0104468
      3f80: cfdf2a04 cfdf2980 cf812bc0 c06634b0 c10aa3c0 c0394da4 c10f74dc cfdf2980
      3fa0: cf812bc0 c0647248 c10aa3c0 ffffffff c10de940 c10aa3c0 ffffffff c0640934
      3fc0: ffffffff ffffffff c06404ec 00000000 00000000 c06634b0 00000000 10c53c7d
      3fe0: c10aa434 c06634ac c10ae4c8 0000406a 414fc091 00008070 00000000 00000000
      [<c0103834>] (kernfs_find_ns) from [<00000001>] (0x1)
      Code: e5c89001 eaffffcf e92d40f0 e1a06002 (e1d023bc)
      ---[ end trace 3406ff24bd97382f ]---
      Kernel panic - not syncing: Attempted to kill the idle task!
      ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
      
      To fix this problem, we simply skip the sysfs related calls in
      of_update_property(), and rely on of_init() to fix up things when it
      will be called, exactly as is done in of_add_property() and
      of_remove_property().
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Fixes: 75b57ecf ("of: Make device nodes kobjects so they show up in sysfs")
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      582da652
    • G
      [media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode · 97d9d23d
      Guennadi Liakhovetski 提交于
      If a struct contains 64-bit fields, it is aligned on 64-bit boundaries
      within containing structs in 64-bit compilations. This is the case with
      struct v4l2_window, which contains pointers and is embedded into struct
      v4l2_format, and that one is embedded into struct v4l2_create_buffers.
      Unlike some other structs, used as a part of the kernel ABI as ioctl()
      arguments, that are packed, these structs aren't packed. This isn't a
      problem per se, but the ioctl-compat code for VIDIOC_CREATE_BUFS contains
      a bug, that triggers in such 64-bit builds. That code wrongly assumes,
      that in struct v4l2_create_buffers, struct v4l2_format immediately follows
      the __u32 memory field, which in fact isn't the case. This bug wasn't
      visible until now, because until recently hardly any applications used
      this ioctl() and mostly embedded 32-bit only drivers implemented it. This
      is changing now with addition of this ioctl() to some USB drivers, e.g.
      UVC. This patch fixes the bug by copying parts of struct
      v4l2_create_buffers separately.
      Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      Cc: stable@vger.kernel.org
      97d9d23d
    • G
      [media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space · cfece585
      Guennadi Liakhovetski 提交于
      Commit 75e2bdad "ov7670: allow
      configuration of image size, clock speed, and I/O method" uses a wrong
      index to iterate an array. Apart from being wrong, it also uses an
      unchecked value from user-space, which can cause access to unmapped
      memory in the kernel, triggered by a normal desktop user with rights to
      use V4L2 devices.
      Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Acked-by: NJonathan Corbet <corbet@lwn.net>
      Cc: stable@vger.kernel.org
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      cfece585
    • V
      iscsi_ibft: Fix finding Broadcom specific ibft sign · 629c27aa
      Vikas Chaudhary 提交于
      Search for Broadcom specific ibft sign "BIFT"
      along with other possible values on UEFI
      
      This patch is fix for regression introduced in
      “935a9fee”.
      https://lkml.org/lkml/2011/12/16/353
      
      This impacts Broadcom CNA for iSCSI Boot on UEFI platform.
      Signed-off-by: NVikas Chaudhary <vikas.chaudhary@qlogic.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: NMike Christie <michaelc@cs.wisc.edu>
      629c27aa
  8. 13 5月, 2014 2 次提交