Shraddha Barke | 12 Feb 08:23 2016
Picon

[PATCH] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version

setup_access_params_addr has 2 goals-

-Initialize the access_params field so that it can be used to send and read
commands from the device in access_with_param
-Get a bus address for the allocated memory to transfer to the device.

Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent.
Coherent mapping guarantees that the device and CPU are in sync.

Signed-off-by: Shraddha Barke <shraddha.6596 <at> gmail.com>
---
 drivers/platform/goldfish/goldfish_pipe.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index e7a29e2..49f877d 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
 <at>  <at>  -57,6 +57,7  <at>  <at> 
 #include <linux/slab.h>
 #include <linux/io.h>
 #include <linux/goldfish.h>
+#include <linux/dma-mapping.h>

 /*
  * IMPORTANT: The following constants must match the ones used and defined
 <at>  <at>  -217,17 +218,18  <at>  <at>  static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev,
 static int setup_access_params_addr(struct platform_device *pdev,
 					struct goldfish_pipe_dev *dev)
 {
(Continue reading)

Dan Carpenter | 12 Feb 07:44 2016
Picon

[patch 2/2] misc: mic: silence an overflow warning

Static checkers complain that the this is a potential array overflow.
We verify that it's not on the next line so this code is OK, but
static checker warnings are annoying.

Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>
---
We would have caught CVE-2015-5327 if we had ordered it to check first
before using the offset.

diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index c3613f3..e94c7fb 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
 <at>  <at>  -848,12 +848,13  <at>  <at>  static int vop_virtio_copy_desc(struct vop_vdev *vdev,
 				struct mic_copy_desc *copy)
 {
 	int err;
-	struct vop_vringh *vvr = &vdev->vvr[copy->vr_idx];
+	struct vop_vringh *vvr;

 	err = vop_verify_copy_args(vdev, copy);
 	if (err)
 		return err;

+	vvr = &vdev->vvr[copy->vr_idx];
 	mutex_lock(&vvr->vr_mutex);
 	if (!vop_vdevup(vdev)) {
 		err = -ENODEV;

(Continue reading)

Dan Carpenter | 12 Feb 07:40 2016
Picon

[patch 1/2] misc: mic: use after free printing error message

Swap the printk and kfree() to avoid a use after free bug.

Fixes: 61e9c905df78 ('misc: mic: Enable VOP host side functionality')
Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>

diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index c1dd000..c3613f3 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
 <at>  <at>  -290,9 +290,9  <at>  <at>  static int vop_virtio_add_device(struct vop_vdev *vdev,

 	ret = vop_copy_dp_entry(vdev, argp, &type, &dd);
 	if (ret) {
-		kfree(vdev);
 		dev_err(vop_dev(vdev), "%s %d err %d\n",
 			__func__, __LINE__, ret);
+		kfree(vdev);
 		return ret;
 	}

Dan Carpenter | 12 Feb 07:39 2016
Picon

[patch] regulator: qcom-saw: testing the wrong variable

We accidentally test "config.regmap" which is zero instead of
"vreg->regmap".

Fixes: 18bba3b50355 ('regulator: qcom-saw: Add support for SAW regulators')
Signed-off-by: Dan Carpenter <dan.carpenter <at> oracle.com>

diff --git a/drivers/regulator/qcom_saw-regulator.c b/drivers/regulator/qcom_saw-regulator.c
index c800f16..c00f0df 100644
--- a/drivers/regulator/qcom_saw-regulator.c
+++ b/drivers/regulator/qcom_saw-regulator.c
 <at>  <at>  -186,8 +186,8  <at>  <at>  static int qcom_saw_regulator_probe(struct platform_device *pdev)

 	vreg->regmap = syscon_node_to_regmap(saw_np);
 	of_node_put(saw_np);
-	if (IS_ERR(config.regmap))
-		return PTR_ERR(config.regmap);
+	if (IS_ERR(vreg->regmap))
+		return PTR_ERR(vreg->regmap);

 	snprintf(name, sizeof(name), "krait%d", cpu);

Sasha Levin | 12 Feb 06:41 2016
Picon

blk: accessing invalid memory with "blk-mq: dynamic h/w context count"

Hi all,

I've started seeing the following errors on boot:

[6035791.296570] ==================================================================
[6035791.297467] BUG: KASAN: slab-out-of-bounds in loop_init_request+0x19c/0x1c0 at addr ffff880052e5c190
[6035791.298355] Write of size 8 by task swapper/0/1
[6035791.298842] =============================================================================
[6035791.299751] BUG kmalloc-512 (Tainted: G        W      ): kasan: bad access detected
[6035791.300736] -----------------------------------------------------------------------------
[6035791.300736]
[6035791.301696] Disabling lock debugging due to kernel taint
[6035791.302220] INFO: Slab 0xffffea00014b9700 objects=32 used=32 fp=0x          (null) flags=0x1fffff80004080
[6035791.303218] INFO: Object 0xffff880052e5c000  <at> offset=0 fp=0x          (null)
[6035791.303218]
[6035791.304047] Object ffff880052e5c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.304955] Object ffff880052e5c010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.305970] Object ffff880052e5c020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.306916] Object ffff880052e5c030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.307908] Object ffff880052e5c040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.308903] Object ffff880052e5c050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.309959] Object ffff880052e5c060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.310896] Object ffff880052e5c070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.311849] Object ffff880052e5c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.312784] Object ffff880052e5c090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.313734] Object ffff880052e5c0a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.314646] Object ffff880052e5c0b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.315567] Object ffff880052e5c0c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.316519] Object ffff880052e5c0d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
[6035791.317475] Object ffff880052e5c0e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
(Continue reading)

James Bottomley | 12 Feb 06:40 2016

[GIT PULL] SCSI fixes for 4.5-rc3

A set of seven fixes.  Two regressions in the new hisi_sas arm driver,
a blacklist entry for the marvell console which was causing a reset
cascade without it, a race fix in the WRITE_SAME/DISCARD routines, a
retry fix for the rdac driver, without which, it would prematurely
return EIO and a couple of fixes for the hyper-v storvsc driver.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

The short changelog is:

Hannes Reinecke (1):
      scsi_dh_rdac: always retry MODE SELECT on command lock violation

John Garry (2):
      hisi_sas: fix v1 hw check for slot error
      hisi_sas: add dependency for HAS_IOMEM

K. Y. Srinivasan (2):
      storvsc: Use the specified target ID in device lookup
      storvsc: Install the storvsc specific timeout handler for FC devices

Martin K. Petersen (1):
      block/sd: Return -EREMOTEIO when WRITE SAME and DISCARD are disabled

Mika Westerberg (1):
      SCSI: Add Marvell Console to VPD blacklist

and the diffstat:
(Continue reading)

Shuah Khan | 12 Feb 00:41 2016

[PATCH v3 00/22] Sharing media resources across ALSA and au0828 drivers

This patch series updates ALSA driver, and au0828 core
driver to use Managed Media controller API and Media
Controller API to share media resource (tuner).

This Patch v3 series is based on linux_media master.
This work addresses Mauro and Takashi's comments on
Patch v2 series.

Changes since Patch v2 series:
- Added documentation for uapi and new MC interfaces
  1. Ran make for documentation and Mauro's doc script.
     Thanks for sharing the script.
- Updated commit logs as needed for clarity.
- media: v4l-core add enable/disable source common interfaces
  Addressed comments - added static inlines in header file
- media: dvb-frontend invoke enable/disable_source handlers
  Moved the patch after enable/disable handlers and left
  pipe in dvb_frontend_private
- media: au0828 video remove au0828_enable_analog_tuner() and
  media: au0828 video change to use v4l_enable_media_source()
  1. Collapsed these two patches - it doesn't make sense to keep
     them separate. Also added FIXME as per Mauro's suggestion.
- media: au0828 change to use Managed Media Controller API
  1. Added comment explaining the need for using udev->product
     instead of dev->board.name
- media: au0828 add enable, disable source handlers
  1. Changed to handle S-Video and Composite inputs.
  2. Fixed a bug that lets Video in when ALSA holds the
     source.
  3. Added comments to one FIXME for s_input changes.
(Continue reading)

Sebastian Andrzej Siewior | 12 Feb 00:21 2016
Picon

[PATCH 1/2] ftrace: move the CALLER_ADDRx macros into its own header

This patch moves the CALLER_ADDRx macros into their own header so it is
not required to include ftrace.h just for them.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy <at> linutronix.de>
---
 include/linux/ftrace.h        | 25 +------------------------
 include/linux/ftrace_caller.h | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 24 deletions(-)
 create mode 100644 include/linux/ftrace_caller.h

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 81de7123959d..83193c717cb9 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
 <at>  <at>  -16,8 +16,7  <at>  <at> 
 #include <linux/types.h>
 #include <linux/init.h>
 #include <linux/fs.h>
-
-#include <asm/ftrace.h>
+#include <linux/ftrace_caller.h>

 /*
  * If the arch supports passing the variable contents of
 <at>  <at>  -689,28 +688,6  <at>  <at>  static inline void __ftrace_enabled_restore(int enabled)
 #endif
 }

-/* All archs should have this, but we define it for consistency */
-#ifndef ftrace_return_address0
(Continue reading)

Arnaldo Carvalho de Melo | 11 Feb 21:27 2016

[RFC PATCH] perf hists: Do column alignment on the format iterator

We were doing column alignment in the format function for each cell,
returning a string padded with spaces so that when the next column is
printed the cursor is at its column alignment.

This ends up needlessly printing trailing spaces, do it at the format
iterator, that is where we know if it is needed, i.e. if there is more
columns to be printed.

This eliminates the need for triming lines when doing a dump using 'P'
in the TUI browser and also produces far saner results with things like
piping 'perf report' to 'less'.

Right now only the formatters for sym->name and the 'locked' column
(perf mem report), that are the ones that end up at the end of lines
in the default 'perf report', 'perf top' and 'perf mem report' tools,
the others will be done in a subsequent patch.

In the end the 'width' parameter for the formatters now mean, in
'printf' terms, the 'precision', where before it was the field 'width'.

Reported-by: Dave Jones <davej <at> codemonkey.org.uk>
Cc: Jiri Olsa <jolsa <at> kernel.org>
Cc: Namhyung Kim <namhyung <at> kernel.org>
Link: http://lkml.kernel.org/n/tip-s7iwl2gj23w92l6tibnrcqzr <at> git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme <at> redhat.com>
---
 tools/perf/ui/browsers/hists.c | 17 ++++++++++-------
 tools/perf/ui/stdio/hist.c     |  1 +
 tools/perf/util/hist.c         | 21 +++++++++++++++++++++
 tools/perf/util/hist.h         |  5 +++++
(Continue reading)

Philippe Proulx | 11 Feb 23:46 2016
Picon
Gravatar

[PATCH] perf data convert: fix possible leak

This patch removes the need to manually update the static size of
data.array in struct ctf_writer.

Signed-off-by: Philippe Proulx <eeppeliteloop <at> gmail.com>
---
 tools/perf/util/data-convert-bt.c | 57 ++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 28 deletions(-)

diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index 34cd1e4..bf0ec1a 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
 <at>  <at>  -57,7 +57,7  <at>  <at>  struct ctf_writer {

 	/* data types */
 	union {
-		struct {
+		struct field_types {
 			struct bt_ctf_field_type	*s64;
 			struct bt_ctf_field_type	*u64;
 			struct bt_ctf_field_type	*s32;
 <at>  <at>  -65,8 +65,9  <at>  <at>  struct ctf_writer {
 			struct bt_ctf_field_type	*string;
 			struct bt_ctf_field_type	*u32_hex;
 			struct bt_ctf_field_type	*u64_hex;
-		};
-		struct bt_ctf_field_type *array[6];
+		} fts;
+		struct bt_ctf_field_type *array[sizeof(struct field_types) /
+					sizeof(struct bt_ctf_field_type *)];
(Continue reading)

Yang Shi | 11 Feb 22:53 2016

[PATCH] arm64: make irq_stack_ptr more robust

Switching between stacks is only valid if we are tracing ourselves while on the
irq_stack, so it is only valid when in current and non-preemptible context,
otherwise is is just zeroed off.

Signed-off-by: Yang Shi <yang.shi <at> linaro.org>
---
 arch/arm64/kernel/stacktrace.c | 13 ++++++-------
 arch/arm64/kernel/traps.c      | 11 ++++++++++-
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
index 12a18cb..d9751a4 100644
--- a/arch/arm64/kernel/stacktrace.c
+++ b/arch/arm64/kernel/stacktrace.c
 <at>  <at>  -44,14 +44,13  <at>  <at>  int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame)
 	unsigned long irq_stack_ptr;

 	/*
-	 * Use raw_smp_processor_id() to avoid false-positives from
-	 * CONFIG_DEBUG_PREEMPT. get_wchan() calls unwind_frame() on sleeping
-	 * task stacks, we can be pre-empted in this case, so
-	 * {raw_,}smp_processor_id() may give us the wrong value. Sleeping
-	 * tasks can't ever be on an interrupt stack, so regardless of cpu,
-	 * the checks will always fail.
+	 * Switching between stacks is valid when tracing current and in
+	 * non-preemptible context.
 	 */
-	irq_stack_ptr = IRQ_STACK_PTR(raw_smp_processor_id());
+	if (tsk == current && !preemptible())
+		irq_stack_ptr = IRQ_STACK_PTR(smp_processor_id());
(Continue reading)


Gmane