From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Pavel Machek <pavel@ucw.cz>, Dan Carpenter <dan.carpenter@oracle.com>
Cc: Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] PM / sysfs: return -EINVAL for bogus strings
Date: Wed, 12 Jul 2017 21:35:59 +0000 [thread overview]
Message-ID: <2623737.CVamlDn37b@aspire.rjw.lan> (raw)
In-Reply-To: <20170710072935.GA12630@amd>
On Monday, July 10, 2017 09:29:35 AM Pavel Machek wrote:
> On Mon 2017-07-10 10:21:40, Dan Carpenter wrote:
> > In the current code, if the user accidentally writes a bogus command to
> > this sysfs file, then we set the latency tolerance to an uninitialized
> > variable.
> >
> > Fixes: 2d984ad132a8 ("PM / QoS: Introcuce latency tolerance device PM QoS type")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Acked-by: Pavel Machek <pavel@ucw.cz>
>
> I'd suggest this is a stable candidate. It only leaks 32 bits to
> userspace, but still...
>
> > @@ -272,6 +272,8 @@ static ssize_t pm_qos_latency_tolerance_store(struct device *dev,
> > value = PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT;
> > else if (!strcmp(buf, "any") || !strcmp(buf, "any\n"))
> > value = PM_QOS_LATENCY_ANY;
> > + else
> > + return -EINVAL;
> > }
> > ret = dev_pm_qos_update_user_latency_tolerance(dev, value);
> > return ret < 0 ? ret : n;
>
>
Applied, thanks!
prev parent reply other threads:[~2017-07-12 21:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 7:21 [PATCH] PM / sysfs: return -EINVAL for bogus strings Dan Carpenter
2017-07-10 7:29 ` Pavel Machek
2017-07-12 21:35 ` Rafael J. Wysocki [this message]
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=2623737.CVamlDn37b@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=len.brown@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
/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