Skip to content

Conversation

@sktt
Copy link
Contributor

@sktt sktt commented Nov 9, 2023

Passing a non-canonical address to vmap would still map it, leading to #GP further down the line.

e.g., 0xffff000000000000 would map address for va=0. Let's just return NULL.

@sktt sktt requested a review from a team as a code owner November 9, 2023 15:39
@sktt sktt force-pushed the check-non-canon branch 2 times, most recently from 7c7aaf7 to 68dc913 Compare November 9, 2023 15:41
@sktt sktt added improvement A small enhancement, that makes already implemented features better Priority: 4 Nice-to-have feature labels Nov 9, 2023
@sktt sktt force-pushed the check-non-canon branch 4 times, most recently from 9c1e40b to 0f6d58c Compare November 12, 2023 22:34
Moving over the BITS_PER_LONG from bitmap.h to compiler.h.
Shifting the sign bit to the highest position turns the pointer
into a negative number that will remain sign extended when shifting
it back down.

Signed-off-by: Johannes Wikner <[email protected]>
Copy link
Contributor

@minipli-oss minipli-oss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks, Johannes!

@sktt
Copy link
Contributor Author

sktt commented Nov 13, 2023

LGTM! Thanks, Johannes!

thanks for the great tip!

@wipawel wipawel merged commit 71752e2 into KernelTestFramework:mainline Nov 13, 2023
@sktt sktt deleted the check-non-canon branch November 13, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement A small enhancement, that makes already implemented features better Priority: 4 Nice-to-have feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants