Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception: Load access fault #127

Open
dtometzki opened this issue Nov 22, 2023 · 0 comments
Open

Unhandled exception: Load access fault #127

dtometzki opened this issue Nov 22, 2023 · 0 comments

Comments

@dtometzki
Copy link

Hello together,

i get the follwing error with the actual upstream Branch from here:

Retrieving file: /initrd.img-6.6.0-g9fe004eaf1aa
14189728 bytes read in 76 ms (178.1 MiB/s)
Retrieving file: /vmlinuz-6.6.0-g9fe004eaf1aa
Unhandled exception: Load access fault
EPC: 00000000f7f3b8ae RA: 00000000f7f3b506 TVAL: ffffffb300687fb3
EPC: 000000004022e8ae RA: 000000004022e506 reloc adjusted

SP:  00000000f76fadf0 GP:  00000000f76fcdd0 TP:  0000000000000001
T0:  00000000f770c080 T1:  01c8773300687fb3 T2:  29e029df29de29dd
S0:  00000000f770e0d0 S1:  0000000000000006 A0:  00000000f7712700
A1:  0000000000000000 A2:  ffffffff8c632701 A3:  0000000000000006
A4:  0000000000000200 A5:  00000000f7715800 A6:  01c8773300687fb3
A7:  0000000000004034 S2:  0000000000004034 S3:  00000000f770e030
S4:  00000000f7712700 S5:  00000000f7fcde18 S6:  00000000f7732bc0
S7:  000000000ffffff0 S8:  000000000000fff0 S9:  0000000000000ff0
S10: 0000000000000800 S11: 0000000000000020 T3:  00000000f7fcd8a8
T4:  000000000000000a T5:  00000000f7fcd8a8 T6:  000000000000403a

Code: 8eaa 853e 3783 000e 88b2 8f72 833e 881a (3303 0003)

Any solution or tips for that ?

Best regards
Damian

MichaIng pushed a commit to MichaIng/linux that referenced this issue Nov 29, 2023
[ Upstream commit c0e8246 ]

memset() description in ISO/IEC 9899:1999 (and elsewhere) says:

	The memset function copies the value of c (converted to an
	unsigned char) into each of the first n characters of the
	object pointed to by s.

The kernel's arm32 memset does not cast c to unsigned char. This results
in the following code to produce erroneous output:

	char a[128];
	memset(a, -128, sizeof(a));

This is because gcc will generally emit the following code before
it calls memset() :

	mov   r0, r7
	mvn   r1, starfive-tech#127        ; 0x7f
	bl    00000000 <memset>

r1 ends up with 0xffffff80 before being used by memset() and the
'a' array will have -128 once in every four bytes while the other
bytes will be set incorrectly to -1 like this (printing the first
8 bytes) :

	test_module: -128 -1 -1 -1
	test_module: -1 -1 -1 -128

The change here is to 'and' r1 with 255 before it is used.

Fixes: 1da177e ("Linux-2.6.12-rc2")
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Kursad Oney <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
MichaIng pushed a commit to MichaIng/linux that referenced this issue Nov 29, 2023
[ Upstream commit c0e8246 ]

memset() description in ISO/IEC 9899:1999 (and elsewhere) says:

	The memset function copies the value of c (converted to an
	unsigned char) into each of the first n characters of the
	object pointed to by s.

The kernel's arm32 memset does not cast c to unsigned char. This results
in the following code to produce erroneous output:

	char a[128];
	memset(a, -128, sizeof(a));

This is because gcc will generally emit the following code before
it calls memset() :

	mov   r0, r7
	mvn   r1, starfive-tech#127        ; 0x7f
	bl    00000000 <memset>

r1 ends up with 0xffffff80 before being used by memset() and the
'a' array will have -128 once in every four bytes while the other
bytes will be set incorrectly to -1 like this (printing the first
8 bytes) :

	test_module: -128 -1 -1 -1
	test_module: -1 -1 -1 -128

The change here is to 'and' r1 with 255 before it is used.

Fixes: 1da177e ("Linux-2.6.12-rc2")
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Kursad Oney <[email protected]>
Signed-off-by: Russell King (Oracle) <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant