Skip to contentSkip to conversation

Oops caused by ERST Table not supported.

Patch-next Jin Dongming 2 participants 2 messages May 10, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

On my server(x86_64) when the mcelog is executed, it will cause oops. And following information could be gotten.

Call Trace:
  [<ffffffff812ceefd>] ? avc_has_perm_noaudit+0x4d/0x680
  [<ffffffff812ceefd>] ? avc_has_perm_noaudit+0x4d/0x680
  [<ffffffff8142492b>] erst_read_next+0x3b/0x100
  [<ffffffff81028def>] apei_read_mce+0x2f/0x170
  [<ffffffff811bfc5d>] ? check_object+0x36d/0x430
  [<ffffffff811c059c>] ? init_object+0x9c/0xe0
  [<ffffffff811c38ef>] ? __slab_alloc+0x7cf/0x8b0
  [<ffffffff81025cba>] ? mce_read+0x4a/0x510
  [<ffffffff811c49ab>] ? __kmalloc+0x2db/0x390
  [<ffffffff81025cba>] ? mce_read+0x4a/0x510
  [<ffffffff811bf81d>] ? check_bytes_and_report+0x3d/0x110
  [<ffffffff816caf1e>] ? _cond_resched+0x3e/0x80
  [<ffffffff8102613b>] mce_read+0x4cb/0x510
  [<ffffffff812cb9f2>] ? security_file_permission+0x122/0x130
  [<ffffffff811dff16>] ? rw_verify_area+0x196/0x210
  [<ffffffff811e0e7b>] vfs_read+0x1bb/0x2f0
  [<ffffffff811e172d>] sys_read+0x8d/0xe0
  [<ffffffff81003c9b>] system_call_fastpath+0x16/0x1b

This is because of the ERST Table not supported on my server and it makes the variable "ctx" used by erst_read_nextis NULL. So I make the patch to solve this problem.

And I confirmed it on my server(x86_64).

---
 drivers/acpi/apei/erst.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/acpi/apei/erst.c +3 -0
index 5fe5c0f..2ebc391 100644
@@ -698,6 +698,9 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen)
 	unsigned long flags;
 	u64 record_id;
 
+	if (erst_disable)
+		return -ENODEV;
+
 	spin_lock_irqsave(&erst_lock, flags);
 	rc = __erst_get_next_record_id(&record_id);
 	if (rc) {
Signature · 1 line
1.7.0.3
Acked-by
#1 lore raw

Hi, Dongming,

Quoted 39 lines · Jin Dongming

On my server(x86_64) when the mcelog is executed, it will cause oops. And following information could be gotten.

Call Trace:
  [<ffffffff812ceefd>] ? avc_has_perm_noaudit+0x4d/0x680
  [<ffffffff812ceefd>] ? avc_has_perm_noaudit+0x4d/0x680
  [<ffffffff8142492b>] erst_read_next+0x3b/0x100
  [<ffffffff81028def>] apei_read_mce+0x2f/0x170
  [<ffffffff811bfc5d>] ? check_object+0x36d/0x430
  [<ffffffff811c059c>] ? init_object+0x9c/0xe0
  [<ffffffff811c38ef>] ? __slab_alloc+0x7cf/0x8b0
  [<ffffffff81025cba>] ? mce_read+0x4a/0x510
  [<ffffffff811c49ab>] ? __kmalloc+0x2db/0x390
  [<ffffffff81025cba>] ? mce_read+0x4a/0x510
  [<ffffffff811bf81d>] ? check_bytes_and_report+0x3d/0x110
  [<ffffffff816caf1e>] ? _cond_resched+0x3e/0x80
  [<ffffffff8102613b>] mce_read+0x4cb/0x510
  [<ffffffff812cb9f2>] ? security_file_permission+0x122/0x130
  [<ffffffff811dff16>] ? rw_verify_area+0x196/0x210
  [<ffffffff811e0e7b>] vfs_read+0x1bb/0x2f0
  [<ffffffff811e172d>] sys_read+0x8d/0xe0
  [<ffffffff81003c9b>] system_call_fastpath+0x16/0x1b

This is because of the ERST Table not supported on my server and it makes the variable "ctx" used by erst_read_nextis NULL. So I make the patch to solve this problem.

And I confirmed it on my server(x86_64).

---
 drivers/acpi/apei/erst.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/acpi/apei/erst.c +0 -0
index 5fe5c0f..2ebc391 100644

drivers/acpi/apei/erst.c ssize_t erst_read_next(struct cper_record_header *record, size_t buflen) · line 706

Quoted 9 lines
drivers/acpi/apei/erst.c +3 -0
@@ -698,6 +698,9 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen)
 	unsigned long flags;
 	u64 record_id;
 
+	if (erst_disable)
+		return -ENODEV;
+
 	spin_lock_irqsave(&erst_lock, flags);
 	rc = __erst_get_next_record_id(&record_id);
 	if (rc) {

Thank you very much for your fixing.

Best Regards,
Huang Ying