ACPI/nfit: correct the badrange to be reported in nfit_handle_mce()
Subsystems (2)
PATCH 1/1 ACPI/nfit: correct the badrange to be reported in nfit_handle_mce()
The badrange to be reported should always cover mce->addr.
--- drivers/acpi/nfit/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/nfit/mce.c +1 -1
@@ -63,7 +63,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,/* If this fails due to an -ENOMEM, there is little we can do */ nvdimm_bus_add_badrange (acpi_desc->nvdimm_bus, -ALIGN (mce->addr,L1_CACHE_BYTES ), +ALIGN_DOWN (mce->addr,L1_CACHE_BYTES ),L1_CACHE_BYTES );nvdimm_region_notify (nfit_spa->nd_region,NVDIMM_REVALIDATE_POISON );
Signature · 5 lines
2.26.0.106.g9fadedd _______________________________________________ Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 1 line · Zhen Lei
The badrange to be reported should always cover
mce->addr.
Maybe I should change this description to:
Make sure the badrange to be reported can always cover mce->addr.
Quoted 20 lines
Signed-off-by Zhen Lei <[email protected]>--- drivers/acpi/nfit/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/nfit/mce.c +1
-1@@ -63,7 +63,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,/* If this fails due to an -ENOMEM, there is little we can do */ nvdimm_bus_add_badrange (acpi_desc->nvdimm_bus, -ALIGN (mce->addr,L1_CACHE_BYTES ), +ALIGN_DOWN (mce->addr,L1_CACHE_BYTES ),L1_CACHE_BYTES );nvdimm_region_notify (nfit_spa->nd_region,NVDIMM_REVALIDATE_POISON );
Quoted 7 lines · Leizhen (ThunderTown)
Quoted 1 line · Zhen Lei
The badrange to be reported should always cover
mce->addr.Maybe I should change this description to:
Make sure the badrange to be reported can always covermce->addr.
Yes, I like that better. Can you also say a bit more about how you found this bug? As far as I can see this looks like -stable material.
Quoted 5 lines · Dan Williams
Quoted 3 lines · Leizhen (ThunderTown)
Quoted 7 lines
Quoted 4 lines · Zhen Lei
Quoted 1 line
The badrange to be reported should always cover
mce->addr.Maybe I should change this description to:
Make sure the badrange to be reported can always covermce->addr.Yes, I like that better. Can you also say a bit more about how you found this bug? As far as I can see this looks like -stable material.
I found it when I was learning the code. I'm looking at it carefully.
Quoted 2 lines
Quoted 10 lines · Leizhen (ThunderTown)
Quoted 6 lines · Dan Williams
Quoted 4 lines · Leizhen (ThunderTown)
On 2020/11/18 16:41, Zhen Lei wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
The badrange to be reported should always cover
mce->addr.Maybe I should change this description to:
Make sure the badrange to be reported can always covermce->addr.Yes, I like that better. Can you also say a bit more about how you found this bug? As far as I can see this looks like -stable material.
I found it when I was learning the code. I'm looking at it carefully.
Ok, good eye.
The impact of this one is somewhat mitigated by the fact that errors are expanded to 512 byte blast radius, and error consumption maps 4k around errors. I suspect few are trying to use the badblock list to do fine grained recovery so this bug went unnoticed.
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Quoted 6 lines · Zhen Lei
The badrange to be reported should always cover
mce->addr.Signed-off-by Zhen Lei <[email protected]>--- drivers/acpi/nfit/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Ah good find, agreed with Dan that this is stable material. Minor nit, I'd recommend rewording the subject line to something like:
"acpi/nfit: fix badrange insertion in nfit_handle_mce()"
Otherwise, looks good to me.
Quoted 6 lines
drivers/acpi/nfit/mce.c +0
-0
drivers/acpi/nfit/mce.c static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, · line 69
Quoted 8 lines
drivers/acpi/nfit/mce.c +1
-1@@ -63,7 +63,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,/* If this fails due to an -ENOMEM, there is little we can do */ nvdimm_bus_add_badrange (acpi_desc->nvdimm_bus, -ALIGN (mce->addr,L1_CACHE_BYTES ), +ALIGN_DOWN (mce->addr,L1_CACHE_BYTES ),L1_CACHE_BYTES );nvdimm_region_notify (nfit_spa->nd_region,NVDIMM_REVALIDATE_POISON );
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]
Quoted 8 lines · Vishal L
Quoted 6 lines · Zhen Lei
The badrange to be reported should always cover
mce->addr.Signed-off-by Zhen Lei <[email protected]>--- drivers/acpi/nfit/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Ah good find, agreed with Dan that this is stable material. Minor nit, I'd recommend rewording the subject line to something like:
"acpi/nfit: fix badrange insertion in
nfit_handle_mce()"
OK, I will send v2.
Quoted 19 lines
Otherwise, looks good to me.
Reviewed-by Vishal Verma <[email protected]>Quoted 14 lines
drivers/acpi/nfit/mce.c +1
-1@@ -63,7 +63,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val,/* If this fails due to an -ENOMEM, there is little we can do */ nvdimm_bus_add_badrange (acpi_desc->nvdimm_bus, -ALIGN (mce->addr,L1_CACHE_BYTES ), +ALIGN_DOWN (mce->addr,L1_CACHE_BYTES ),L1_CACHE_BYTES );nvdimm_region_notify (nfit_spa->nd_region,NVDIMM_REVALIDATE_POISON );