linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: WANG Chao <chao.wang@ucloud.cn>
To: Borislav Petkov <bp@alien8.de>
Cc: Tony Luck <tony.luck@intel.com>,
	linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org
Subject: Re: [PATCH 1/3] RAS/CEC: fix __find_elem
Date: Thu, 25 Apr 2019 16:05:05 +0800	[thread overview]
Message-ID: <20190425080505.GB10363@WANG-Chaos-MacBook-Pro.local> (raw)
Message-ID: <20190425080505.wLxHeLn3G9Lc3xE5hDSjTHP4eCQJCgyP9oO_yE5hgtw@z> (raw)
In-Reply-To: <20190425075612.GA10363@WANG-Chaos-MacBook-Pro.local>

On 04/25/19 at 03:56P, WANG Chao wrote:
> On 04/18/19 at 11:41P, WANG Chao wrote:
> > A left over pfn (because we don't clear) at ca->array[n] can be a match
> > in __find_elem. Later it'd cause a memmove size overflow in del_elem.
> > 
> > Signed-off-by: WANG Chao <chao.wang@ucloud.cn>
> > ---
> >  drivers/ras/cec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c
> > index 2d9ec378a8bc..2e0bf1269c31 100644
> > --- a/drivers/ras/cec.c
> > +++ b/drivers/ras/cec.c
> > @@ -206,7 +206,7 @@ static int __find_elem(struct ce_array *ca, u64 pfn, unsigned int *to)
> >  
> >  	this_pfn = PFN(ca->array[min]);
> >  
> > -	if (this_pfn == pfn)
> > +	if (this_pfn == pfn && ca->n > min)
> >  		return min;
> >  
> >  	return -ENOKEY;
> 
> Any thought on this one?

Aha, I see there's another fix queued. Thanks.

  parent reply	other threads:[~2019-04-25  8:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  3:41 [1/3] RAS/CEC: fix __find_elem WANG Chao
2019-04-18  3:41 ` [PATCH 1/3] " WANG Chao
2019-04-18  3:41 ` [2/3] RAS/CEC: make ces_entered smp safe WANG Chao
2019-04-18  3:41   ` [PATCH 2/3] " WANG Chao
2019-04-20 10:19   ` [tip:ras/core] RAS/CEC: Increment cec_entered under the mutex lock tip-bot for Borislav Petkov
2019-04-20 10:19     ` tip-bot for WANG Chao
2019-04-20 10:22   ` tip-bot for Borislav Petkov
2019-04-20 10:22     ` tip-bot for WANG Chao
2019-04-18  3:41 ` [3/3] RAS/CEC: immediate soft-offline page when count_threshold == 1 WANG Chao
2019-04-18  3:41   ` [PATCH 3/3] " WANG Chao
2019-04-20 11:57   ` [3/3] " Borislav Petkov
2019-04-20 11:57     ` [PATCH 3/3] " Borislav Petkov
2019-04-24  2:43     ` [3/3] " WANG Chao
2019-04-24  2:43       ` [PATCH 3/3] " WANG Chao
2019-04-24 10:26       ` [3/3] " Borislav Petkov
2019-04-24 10:26         ` [PATCH 3/3] " Borislav Petkov
2019-04-25  7:56 ` [1/3] RAS/CEC: fix __find_elem WANG Chao
2019-04-25  7:56   ` [PATCH 1/3] " WANG Chao
2019-04-25  8:05   ` WANG Chao [this message]
2019-04-25  8:05     ` WANG Chao

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=20190425080505.GB10363@WANG-Chaos-MacBook-Pro.local \
    --to=chao.wang@ucloud.cn \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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 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).