Skip to contentSkip to conversation

fs-proc-task_mmuc-check-the-return-value-of-mpol_to_str.patch removed from -mm tree

merged [email protected] 1 participant 1 message Sep 12, 2013

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] fs-proc-task_mmuc-check-the-return-value-of-mpol_to_str.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 12 Sep 2013 12:48:33 -0700

The patch titled
Subject: fs/proc/task_mmu.c: check the return value of mpol_to_str()
has been removed from the -mm tree. Its filename was
fs-proc-task_mmuc-check-the-return-value-of-mpol_to_str.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Chen Gang <[email protected]>
Subject: fs/proc/task_mmu.c: check the return value of mpol_to_str()

mpol_to_str() may fail, and not fill the buffer (e.g. -EINVAL), so need check about it, or buffer may not be zero based, and next seq_printf() will cause issue.

The failure return need after mpol_cond_put() to match get_vma_policy().

Cc Cyrill Gorcunov <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Andi Kleen <[email protected]>

---

 fs/proc/task_mmu.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/proc/task_mmu.c renamed from fs/proc/task_mmu.c~fs-proc-task_mmuc-check-the-return-value-of-mpol_to_str +3 -1
diff -puN fs/proc/task_mmu.c~fs-proc-task_mmuc-check-the-return-value-of-mpol_to_str fs/proc/task_mmu.c
@@ -1402,8 +1402,10 @@ static int show_numa_map(struct seq_file
 	walk.mm = mm;
 
 	pol = get_vma_policy(task, vma, vma->vm_start);
-	mpol_to_str(buffer, sizeof(buffer), pol);
+	n = mpol_to_str(buffer, sizeof(buffer), pol);
 	mpol_cond_put(pol);
+	if (n < 0)
+		return n;
 
 	seq_printf(m, "%08lx %s", vma->vm_start, buffer);
 

_

Patches currently in -mm which might be from [email protected] are

origin.patch
sh64-kernel-use-usp-instead-of-fn.patch sh64-kernel-remove-useless-variable-regs.patch include-linux-interrupth-add-dummy-irq_set_irq_wake-for-generic_hardirqs.patch h8300-kernel-timer-timer8c-add-missing-semicolon.patch mm-kconfig-add-mmu-dependency-for-migration.patch