Skip to content

xtensa: ace 3.0: Unchecked error leads to exception #101339

@lyakh

Description

@lyakh

Describe the bug

Allocation at

l2_table = dup_l2_table(src_l2_table, action);
can fail, which then leads to an exception. The result should be checked and handled instead, at least with an assertion.

Further, if a new domain with a new L1 page table has been allocated with no mappings, then memory gets mapped so that that new domain is also updated, this line

src_l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
will return NULL which then also will lead to an exception. When that is fixed by

@@ -1136,6 +1136,8 @@ static void dup_l2_table_if_needed(uint32_t *l1_table, uint32_t l1_pos)
 	uint32_t *l2_table, *src_l2_table;
 
 	src_l2_table = (uint32_t *)PTE_PPN_GET(l1_table[l1_pos]);
+	if (!src_l2_table)
+		return;
 
 	if (l2_page_tables_counter[l2_table_to_counter_pos(src_l2_table)] == 1) {
 		/* Only one user of L2 table, no need to duplicate. */

another exception occurs later when unmapping that memory

Regression

  • This is a regression.

Steps to reproduce

No response

Relevant log output

Impact

Major – Severely degrades functionality; workaround is difficult or unavailable.

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area: XtensaXtensa ArchitecturebugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions