mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: Out-of-bound access in sysrq
Date: Thu, 28 Mar 2013 14:28:52 +0100	[thread overview]
Message-ID: <51544594.2010509@suse.cz> (raw)
In-Reply-To: <51544367.2020904@linaro.org>

On 03/28/2013 02:19 PM, Mathieu Poirier wrote:
> On 13-03-28 04:34 AM, Jiri Slaby wrote:
>> Guys,
>>
>> how is this supposed to work?
>>
>> #define SYSRQ_KEY_RESET_MAX     20 /* Should be plenty */
>> static unsigned short sysrq_reset_seq[SYSRQ_KEY_RESET_MAX];
>> ...
>> unsigned short platform_sysrq_reset_seq[] __weak = { KEY_RESERVED };
>> ...
>> static inline void sysrq_register_handler(void)
>> {
>> ...
>>         for (i = 0; i < ARRAY_SIZE(sysrq_reset_seq); i++) {
>>                 key = platform_sysrq_reset_seq[i];
>>                 if (key == KEY_RESERVED || key > KEY_MAX)
>> ...
>>
>>
>>
>>
>> i runs from 0 to 19 incl., but platform_sysrq_reset_seq, if not
>> overriden, is of size 1, so?
>>
>> thanks,
>>
> 
> Unless I'm missing something, 'i' won't go higher than '0' since the
> first element of platform_sysrq_reset_seq is set to KEY_RESERVED and in
> such case the 'break' is executed.

Of course, I was apparently sleeping yet. Sorry for the noise!

-- 
js
suse labs

      reply	other threads:[~2013-03-28 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 10:34 Jiri Slaby
2013-03-28 13:19 ` Mathieu Poirier
2013-03-28 13:28   ` Jiri Slaby [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=51544594.2010509@suse.cz \
    --to=jslaby@suse.cz \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=torvalds@linux-foundation.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

Powered by JetHome