From: Borislav Petkov <bp@alien8.de>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
Tony Luck <tony.luck@intel.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [1/2] ras: fix an off-by-one error in __find_elem()
Date: Tue, 16 Apr 2019 11:07:26 +0200 [thread overview]
Message-ID: <20190416090726.GD27892@zn.tnic> (raw)
On Mon, Apr 15, 2019 at 06:20:00PM -0700, Cong Wang wrote:
> ce_arr.array[] is always within the range [0, ce_arr.n-1].
> However, the binary search code in __find_elem() uses ce_arr.n
> as the maximum index, which could lead to an off-by-one
> out-of-bound access when the element after the last is exactly
> the one just got deleted, that is, 'min' returned to caller as
> 'ce_arr.n'.
Sorry, I don't follow.
There's a debugfs interface in /sys/kernel/debug/ras/cec/ with which you
can input random PFNs and test the thing.
Show me pls how this can happen with an example.
Thx.
WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <bp@alien8.de>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
Tony Luck <tony.luck@intel.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/2] ras: fix an off-by-one error in __find_elem()
Date: Tue, 16 Apr 2019 11:07:26 +0200 [thread overview]
Message-ID: <20190416090726.GD27892@zn.tnic> (raw)
Message-ID: <20190416090726.MwlHwz2uULhjSmQWYkCiDHTY4p6BaX1_HFNK2BGA_PY@z> (raw)
In-Reply-To: <20190416012001.5338-1-xiyou.wangcong@gmail.com>
On Mon, Apr 15, 2019 at 06:20:00PM -0700, Cong Wang wrote:
> ce_arr.array[] is always within the range [0, ce_arr.n-1].
> However, the binary search code in __find_elem() uses ce_arr.n
> as the maximum index, which could lead to an off-by-one
> out-of-bound access when the element after the last is exactly
> the one just got deleted, that is, 'min' returned to caller as
> 'ce_arr.n'.
Sorry, I don't follow.
There's a debugfs interface in /sys/kernel/debug/ras/cec/ with which you
can input random PFNs and test the thing.
Show me pls how this can happen with an example.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
next reply other threads:[~2019-04-16 9:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 9:07 Borislav Petkov [this message]
2019-04-16 9:07 ` [PATCH 1/2] ras: fix an off-by-one error in __find_elem() Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2019-04-18 22:54 [1/2] " Cong Wang
2019-04-18 22:54 ` [PATCH 1/2] " Cong Wang
2019-04-17 21:15 [1/2] " Luck, Tony
2019-04-17 21:15 ` [PATCH 1/2] " Luck, Tony
2019-04-17 2:37 [1/2] " Cong Wang
2019-04-17 2:37 ` [PATCH 1/2] " Cong Wang
2019-04-17 2:31 [1/2] " Cong Wang
2019-04-17 2:31 ` [PATCH 1/2] " Cong Wang
2019-04-17 1:53 [1/2] " Luck, Tony
2019-04-17 1:53 ` [PATCH 1/2] " Luck, Tony
2019-04-16 23:47 [1/2] " Cong Wang
2019-04-16 23:47 ` [PATCH 1/2] " Cong Wang
2019-04-16 23:28 [1/2] " Luck, Tony
2019-04-16 23:28 ` [PATCH 1/2] " Luck, Tony
2019-04-16 23:18 [1/2] " Cong Wang
2019-04-16 23:18 ` [PATCH 1/2] " Cong Wang
2019-04-16 22:18 [1/2] " Luck, Tony
2019-04-16 22:18 ` [PATCH 1/2] " Luck, Tony
2019-04-16 18:06 [2/2] ras: close the race condition with timer Cong Wang
2019-04-16 18:06 ` [PATCH 2/2] " Cong Wang
2019-04-16 18:00 [2/2] " Cong Wang
2019-04-16 18:00 ` [PATCH 2/2] " Cong Wang
2019-04-16 17:42 [2/2] " Borislav Petkov
2019-04-16 17:42 ` [PATCH 2/2] " Borislav Petkov
2019-04-16 17:09 [2/2] " Cong Wang
2019-04-16 17:09 ` [PATCH 2/2] " Cong Wang
2019-04-16 17:01 [1/2] ras: fix an off-by-one error in __find_elem() Cong Wang
2019-04-16 17:01 ` [PATCH 1/2] " Cong Wang
2019-04-16 9:58 [2/2] ras: close the race condition with timer Borislav Petkov
2019-04-16 9:58 ` [PATCH 2/2] " Borislav Petkov
2019-04-16 1:20 [2/2] " Cong Wang
2019-04-16 1:20 ` [PATCH 2/2] " Cong Wang
2019-04-16 1:20 [1/2] ras: fix an off-by-one error in __find_elem() Cong Wang
2019-04-16 1:20 ` [PATCH 1/2] " Cong Wang
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=20190416090726.GD27892@zn.tnic \
--to=bp@alien8.de \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=xiyou.wangcong@gmail.com \
/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.