From: Markos Chandras <Markos.Chandras@imgtec.com>
To: Aaro Koskinen <aaro.koskinen@nsn.com>,
Ralf Baechle <ralf@linux-mips.org>,
David Daney <david.daney@cavium.com>, <linux-mips@linux-mips.org>,
<linux-kernel@vger.kernel.org>
Cc: <stable@vger.kernel.org>
Subject: Re: [PATCH] MIPS: OCTEON: make get_system_type() thread-safe
Date: Tue, 22 Jul 2014 13:31:58 +0100 [thread overview]
Message-ID: <53CE59BE.104@imgtec.com> (raw)
In-Reply-To: <1406029868-6210-1-git-send-email-aaro.koskinen@nsn.com>
On 07/22/2014 12:51 PM, Aaro Koskinen wrote:
> get_system_type() is not thread-safe on OCTEON. It uses static data,
> also more dangerous issue is that it's calling cvmx_fuse_read_byte()
> every time without any synchronization. Currently it's possible to get
> processes stuck looping forever in kernel simply by launching multiple
> readers of /proc/cpuinfo:
>
> (while true; do cat /proc/cpuinfo > /dev/null; done) &
> (while true; do cat /proc/cpuinfo > /dev/null; done) &
> ...
>
> Fix by initializing the system type string only once during the early
> boot.
>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
> Cc: stable@vger.kernel.org
> ---
> arch/mips/cavium-octeon/setup.c | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 deletions(-)
>
It looks reasonable to me.
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
--
markos
prev parent reply other threads:[~2014-07-22 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 11:51 [PATCH] MIPS: OCTEON: make get_system_type() thread-safe Aaro Koskinen
2014-07-22 12:31 ` Markos Chandras [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=53CE59BE.104@imgtec.com \
--to=markos.chandras@imgtec.com \
--cc=aaro.koskinen@nsn.com \
--cc=david.daney@cavium.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).