Skip to content

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

Merged
xiaoxiang781216 merged 1 commit intoapache:masterfrom
W-M-R:swtags
Oct 12, 2024
Merged

mm/sw_tags: add config for no longer checking for tags 0#14114
xiaoxiang781216 merged 1 commit intoapache:masterfrom
W-M-R:swtags

Conversation

@W-M-R
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread mm/Kconfig Outdated
Comment thread mm/Kconfig Outdated
@xiaoxiang781216
Copy link
Copy Markdown
Contributor

let's ignore macOS ci temp break.

Comment thread mm/kasan/sw_tags.c Outdated
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 <wangmingrong1@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit a5c0dbe into apache:master Oct 12, 2024
@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