Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
OSUSecLab
vSGX
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
vSGX
/
evm-kernel-fix1.patch
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
36 lines (31 loc) · 1.52 KB
master
Breadcrumbs
vSGX
/
evm-kernel-fix1.patch
Copy path
Top
File metadata and controls
Code
Blame
36 lines (31 loc) · 1.52 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 14b71ebe33a1f988187b722b450414f936912ab0 Mon Sep 17 00:00:00 2001
From: NSKernel <zhao.3289@osu.edu>
Date: Tue, 17 May 2022 05:10:26 +0800
Subject: [PATCH] Fixed clflush uaccess problem
---
kernel/emusgx/switchless_sync.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/emusgx/switchless_sync.c b/kernel/emusgx/switchless_sync.c
index 9e426758b..43e284fc4 100644
--- a/kernel/emusgx/switchless_sync.c
+++ b/kernel/emusgx/switchless_sync.c
@@ -326,7 +326,9 @@ int _enclave_local emusgx_switchless_new_slot(void *addr, void *page_data, struc
// the page is already flushed from the switchless syncing list
// Unmap the original addr from the memory to stop any writing to the page
+ __uaccess_begin();
clflush_cache_range(emusgx_switchless_pages[index].addr, 4096);
+ __uaccess_end();
// For some weird reason the mapped page is not the same as what we allocated
// So we will be using get_user_pages to get the real backing of the page
get_user_pages((unsigned long)emusgx_switchless_pages[index].addr, 1, 0, &in_kernel_page, NULL);
@@ -441,7 +443,9 @@ void _enclave_local emusgx_sync_all_pages(char print, char force_sync) {
}
if (emusgx_switchless_pages[i].status == EMUSGX_SWITCHLESS_SLOT_INUSE) {
+ __uaccess_begin();
clflush_cache_range(emusgx_switchless_pages[i].addr, 4096);
+ __uaccess_end();
get_user_pages((unsigned long)emusgx_switchless_pages[i].addr, 1, 0, &in_kernel_page, NULL);
emusgx_sync_on_dirty(i, in_kernel_page, force_sync);
if (unlikely(print)) {
--
2.25.1
You can’t perform that action at this time.