Bug 6128 - Ensure kernel in the atomic context if #VC handler fetch userspace instructions
Summary: Ensure kernel in the atomic context if #VC handler fetch userspace instructions
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Guanjun
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-08 13:34 UTC by wojiaohanliyang
Modified: 2023-08-08 17:43 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wojiaohanliyang hygon_group 2023-08-08 13:34:57 UTC
Description of problem:

Assuming the following scenario, userspace's instructions at the end of one page, and the next adjacent page is not in the page table. If this userspace instruction cause #VC exception, the #VC handler may read 15 bytes from the boundary of instruction, this will leads to #PF if boundary of instruction + 15 cross the page. The #PF is unexpected because this may cause more nested #VC and even cause guest crashes. We can make #VC handler stay in atomic context when read userspace's instruction and forward to page fault handler if it's necessary to read the next adjacent page which is unmmapped.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 小龙 admin 2023-08-08 17:43:04 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2034