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

mm/sw_tags: add config for no longer checking for tags 0 #14114

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

W-M-R
Copy link
Contributor

@W-M-R W-M-R commented Oct 11, 2024

Summary

When dynamically loading, the read-only data of arm64 architecture is accessed through PC offset. When opening the tag kasan, because the PC value does not have a tag, accessing the read-only data will be detected with a tag mismatch error.

Impact

No

Testing

No

@github-actions github-actions bot added Area: Memory Management Memory Management issues Size: S The size of the change in this PR is small labels Oct 11, 2024
@W-M-R
Copy link
Contributor Author

W-M-R commented Oct 11, 2024

#define kasan_random_tag() (1 + rand() % ((1 << (64 - KASAN_TAG_SHIFT)) - 1)) : This macro will only generate values from 1-255, not 0 or 256

mm/Kconfig Outdated Show resolved Hide resolved
mm/Kconfig Outdated Show resolved Hide resolved
@W-M-R W-M-R force-pushed the swtags branch 4 times, most recently from 0a25b45 to 4a38995 Compare October 11, 2024 09:44
@xiaoxiang781216
Copy link
Contributor

let's ignore macOS ci temp break.

mm/kasan/sw_tags.c Outdated Show resolved Hide resolved
1. When dynamically loading, the read-only data of arm64 architecture is accessed through PC offset. When opening the tag kasan, because the PC value does not have a tag, accessing the read-only data will be detected with a tag mismatch error.
2. uninitial heap use 0xff poison, initial heap use 1-254 unpoison.

Signed-off-by: wangmingrong1 <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit a5c0dbe into apache:master Oct 12, 2024
37 checks passed
@W-M-R W-M-R deleted the swtags branch October 12, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Memory Management Memory Management issues Size: S The size of the change in this PR is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants