All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Jiri Slaby <jslaby@suse.cz>
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 07:19:35 -0600	[thread overview]
Message-ID: <51544367.2020904@linaro.org> (raw)
In-Reply-To: <51541C9B.4000802@suse.cz>

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.



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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28 10:34 Out-of-bound access in sysrq Jiri Slaby
2013-03-28 13:19 ` Mathieu Poirier [this message]
2013-03-28 13:28   ` Jiri Slaby

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=51544367.2020904@linaro.org \
    --to=mathieu.poirier@linaro.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.