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

x86: add read-before-write check at runtime #1259

Merged
merged 1 commit into from
Jun 22, 2014
Merged

x86: add read-before-write check at runtime #1259

merged 1 commit into from
Jun 22, 2014

Conversation

Kijewski
Copy link
Contributor

Finding read-before-writes statically is quite difficult. In native we
can use valgrind, but on boards without an MMU we are out of luck.

x86 has an MMU, let's use it.

If -DDEBUG_READ_BEFORE_WRITE was set, then pages on the heap get
initialized upon first use. If the page was read before written, then a
debug message with the virtual and physical address of the memory
location is printed, as well as the address of the offending instruction.

Finding read-before-writes statically is quite difficult. In native we
can use valgrind, but on boards without an MMU we are out of luck.

x86 has an MMU, let's use it.

If `-DDEBUG_READ_BEFORE_WRITE` was set, then pages on the heap get
initialized upon first use. If the page was read before written, then a
debug message with the virtual and physical address of the memory
location is printed, as well as the address of the offending instruction.
@Kijewski Kijewski added the x86 label May 31, 2014
@Kijewski
Copy link
Contributor Author

Interestingly enough there is such an error in tlsf.c:181: block_set_size(), when called in tlsf_add_pool().

@OlegHahm
Copy link
Member

ACK and go.

OlegHahm added a commit that referenced this pull request Jun 22, 2014
x86: add read-before-write check at runtime
@OlegHahm OlegHahm merged commit fde1c10 into RIOT-OS:master Jun 22, 2014
@Kijewski Kijewski deleted the x86-heap-check branch June 23, 2014 00:56
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

Successfully merging this pull request may close these issues.

2 participants