+ cpufreq-fix-null-pointer-dereference-regression-in-conservative-gov.patch added to -mm tree

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

 



The patch titled
     cpufreq: fix NULL pointer dereference regression in conservative gov
has been added to the -mm tree.  Its filename is
     cpufreq-fix-null-pointer-dereference-regression-in-conservative-gov.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: cpufreq: fix NULL pointer dereference regression in conservative gov
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@xxxxxxxxx>

Commit ee88415caf736b89500f16e0a545614541a45005 ("[CPUFREQ] Cleanup
locking in conservative governor") introduced this regression when it
removed enable bit in cpu_dbs_info_s.

That added a possibility of dbs_cpufreq_notifier getting called for a CPU
that is not yet managed by conservative governor.  That will happen as the
transition notifier is set as soon as one CPU switches to conservative
governor and other CPUs can get a NULL pointer dereference without the
enable bit check.  Add the enable bit back again.

Reported-by: Lermytte Christophe <Christophe.Lermytte@xxxxxxxxxxx>
Tested-by: Lermytte Christophe <Christophe.Lermytte@xxxxxxxxxxx>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>
Cc: Dave Jones <davej@xxxxxxxxxx>
Cc: "Rafael J. Wysocki" <rjw@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/cpufreq/cpufreq_conservative.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN drivers/cpufreq/cpufreq_conservative.c~cpufreq-fix-null-pointer-dereference-regression-in-conservative-gov drivers/cpufreq/cpufreq_conservative.c
--- a/drivers/cpufreq/cpufreq_conservative.c~cpufreq-fix-null-pointer-dereference-regression-in-conservative-gov
+++ a/drivers/cpufreq/cpufreq_conservative.c
@@ -63,6 +63,7 @@ struct cpu_dbs_info_s {
 	unsigned int down_skip;
 	unsigned int requested_freq;
 	int cpu;
+	unsigned int enable:1;
 	/*
 	 * percpu mutex that serializes governor limit change with
 	 * do_dbs_timer invocation. We do not want do_dbs_timer to run
@@ -141,6 +142,9 @@ dbs_cpufreq_notifier(struct notifier_blo
 
 	struct cpufreq_policy *policy;
 
+	if (!this_dbs_info->enable)
+		return 0;
+
 	policy = this_dbs_info->cur_policy;
 
 	/*
@@ -497,6 +501,7 @@ static inline void dbs_timer_init(struct
 	int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
 	delay -= jiffies % delay;
 
+	dbs_info->enable = 1;
 	INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
 	queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work,
 				delay);
@@ -504,6 +509,7 @@ static inline void dbs_timer_init(struct
 
 static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
 {
+	dbs_info->enable = 0;
 	cancel_delayed_work_sync(&dbs_info->work);
 }
 
_

Patches currently in -mm which might be from venkatesh.pallipadi@xxxxxxxxx are

linux-next.patch
kernel-core-add-smp_call_function_any.patch
kernel-core-add-smp_call_function_any-update.patch
arch-x86-kernel-cpu-cpufreq-acpi-cpufreqc-avoid-cross-cpu-interrupts-by-using-smp_call_function_any.patch
cpuidle-menu-governor-reduce-latency-on-exit.patch
cpufreq-fix-null-pointer-dereference-regression-in-conservative-gov.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