public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "4 . 6+" <stable@vger.kernel.org>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH 4/6+] cpufreq: Use struct kobj_attribute instead of struct global_attr
Date: Thu, 7 Mar 2019 16:18:27 +0100	[thread overview]
Message-ID: <20190307151827.GA4215@kroah.com> (raw)
In-Reply-To: <20190307140807.32th3altinvvv7dj@vireshk-i7>

On Thu, Mar 07, 2019 at 07:38:07PM +0530, Viresh Kumar wrote:
> On 07-03-19, 13:21, Greg KH wrote:
> > On Thu, Mar 07, 2019 at 04:52:52PM +0530, Viresh Kumar wrote:
> > > commit 625c85a62cb7d3c79f6e16de3cfa972033658250 upstream.
> > > 
> > > The cpufreq_global_kobject is created using kobject_create_and_add()
> > > helper, which assigns the kobj_type as dynamic_kobj_ktype and show/store
> > > routines are set to kobj_attr_show() and kobj_attr_store().
> > > 
> > > These routines pass struct kobj_attribute as an argument to the
> > > show/store callbacks. But all the cpufreq files created using the
> > > cpufreq_global_kobject expect the argument to be of type struct
> > > attribute. Things work fine currently as no one accesses the "attr"
> > > argument. We may not see issues even if the argument is used, as struct
> > > kobj_attribute has struct attribute as its first element and so they
> > > will both get same address.
> > > 
> > > But this is logically incorrect and we should rather use struct
> > > kobj_attribute instead of struct global_attr in the cpufreq core and
> > > drivers and the show/store callbacks should take struct kobj_attribute
> > > as argument instead.
> > > 
> > > This bug is caught using CFI CLANG builds in android kernel which
> > > catches mismatch in function prototypes for such callbacks.
> > > 
> > > Cc: 4.6+ <stable@vger.kernel.org> # 4.6+
> > > Reported-by: Donghee Han <dh.han@samsung.com>
> > > Reported-by: Sangkyu Kim <skwith.kim@samsung.com>
> > > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > 
> > > ---
> > > This needs to be applied from v4.6 to v4.9 (including both).
> > 
> > Does not apply to the 4.9.y stable queue :(
> > 
> > Are you sure you backported this correctly?  No need to care about 4.6.
> 
> Same as 4.4, attached is the patch which I just now applied on
> 4.9.161. Git cherry-pick was able to figure it out just fine.

I can not use git cherry-pick when you give me a patch to apply :(

  reply	other threads:[~2019-03-07 15:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 11:22 [PATCH 4/6+] cpufreq: Use struct kobj_attribute instead of struct global_attr Viresh Kumar
2019-03-07 12:21 ` Greg KH
2019-03-07 14:08   ` Viresh Kumar
2019-03-07 15:18     ` Greg KH [this message]
2019-03-07 15:23       ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307151827.GA4215@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox