[merged] clk-validate-pointer-in-__clk_disable.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: clk: validate pointer in __clk_disable()
has been removed from the -mm tree.  Its filename was
     clk-validate-pointer-in-__clk_disable.patch

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

------------------------------------------------------
From: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Subject: clk: validate pointer in __clk_disable()

clk_get() returns -ENOENT on error and some careless caller might
dereference it without error checking:

In mxc_rnga_remove():

        struct clk *clk = clk_get(&pdev->dev, "rng");

	// ...

        clk_disable(clk);

Since it's insane to audit the lots of existing and future clk users,
let's add a check in the callee to avoid kernel panic and warn about
any buggy user.

Cc: Russell King <rmk@xxxxxxxxxxxxxxxx>
Cc: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>
Cc: Viresh Kumar <viresh.kumar@xxxxxx>
Cc: viresh kumar <viresh.linux@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/clk/clk.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN drivers/clk/clk.c~clk-validate-pointer-in-__clk_disable drivers/clk/clk.c
--- a/drivers/clk/clk.c~clk-validate-pointer-in-__clk_disable
+++ a/drivers/clk/clk.c
@@ -465,6 +465,9 @@ static void __clk_disable(struct clk *cl
 	if (!clk)
 		return;
 
+	if (WARN_ON(IS_ERR(clk)))
+		return;
+
 	if (WARN_ON(clk->enable_count == 0))
 		return;
 
_

Patches currently in -mm which might be from fengguang.wu@xxxxxxxxx are

origin.patch
xtensa-select-generic-atomic64_t-support.patch
mm-prepare-for-removal-of-obsolete-proc-sys-vm-nr_pdflush_threads.patch
mm-clear-pages_scanned-only-if-draining-a-pcp-adds-pages-to-the-buddy-allocator-again.patch
mm-slb-add-knowledge-of-pfmemalloc-reserve-pages-fix.patch
nfs-enable-swap-on-nfs-fix.patch
memcg-prevent-oom-with-too-many-dirty-pages.patch
memcg-further-prevent-oom-with-too-many-dirty-pages.patch
memcg-add-mem_cgroup_from_css-helper-fix-2.patch
linux-next.patch
rbtree-performance-and-correctness-test-fix.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux