kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Colin King <colin.king@canonical.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] perf tests: fix out of bounds access on array fd when cnt is 100
Date: Wed, 14 Mar 2018 19:00:16 +0000	[thread overview]
Message-ID: <20180314190016.GF27335@kernel.org> (raw)
In-Reply-To: <20180314173354.11250-1-colin.king@canonical.com>

Em Wed, Mar 14, 2018 at 05:33:54PM +0000, Colin King escreveu:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently when cnt is 100 an array bounds overflow occurs on the assignment
> of fd[cnt]. Fix this by performing the bounds check on cnt before writing
> to fd.
> 
> Detected by cppcheck:
> tools/perf/tests/bp_account.c:115: (warning) Either the condition
> 'cnt=100' is redundant or the array 'fd[100]' is accessed at index 100,
> which is out of bounds.
> 
> Fixes: 032db28e5fa3 ("perf tests: Add breakpoint accounting/modify test")

Thanks, applied.

- Arnaldo

      reply	other threads:[~2018-03-14 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 17:33 [PATCH][next] perf tests: fix out of bounds access on array fd when cnt is 100 Colin King
2018-03-14 19:00 ` Arnaldo Carvalho de Melo [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=20180314190016.GF27335@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=colin.king@canonical.com \
    --cc=jolsa@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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).