Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
"Misc fixes: a kerneldoc build warning fix, add SRSO mitigation for
AMD-derived Hygon processors, and fix a SGX kernel crash in the page
fault handler that can trigger when ksgxd races to reclaim the SECS
special page, by making the SECS page unswappable"

* tag 'x86-urgent-2023-10-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/sgx: Resolves SECS reclaim vs. page fault for EAUG race
x86/srso: Add SRSO mitigation for Hygon processors
x86/kgdb: Fix a kerneldoc warning when build with W=1

+26 -7
+1 -1
arch/x86/kernel/cpu/common.c
··· 1303 1303 VULNBL_AMD(0x15, RETBLEED), 1304 1304 VULNBL_AMD(0x16, RETBLEED), 1305 1305 VULNBL_AMD(0x17, RETBLEED | SMT_RSB | SRSO), 1306 - VULNBL_HYGON(0x18, RETBLEED | SMT_RSB), 1306 + VULNBL_HYGON(0x18, RETBLEED | SMT_RSB | SRSO), 1307 1307 VULNBL_AMD(0x19, SRSO), 1308 1308 {} 1309 1309 };
+25 -5
arch/x86/kernel/cpu/sgx/encl.c
··· 235 235 return epc_page; 236 236 } 237 237 238 + /* 239 + * Ensure the SECS page is not swapped out. Must be called with encl->lock 240 + * to protect the enclave states including SECS and ensure the SECS page is 241 + * not swapped out again while being used. 242 + */ 243 + static struct sgx_epc_page *sgx_encl_load_secs(struct sgx_encl *encl) 244 + { 245 + struct sgx_epc_page *epc_page = encl->secs.epc_page; 246 + 247 + if (!epc_page) 248 + epc_page = sgx_encl_eldu(&encl->secs, NULL); 249 + 250 + return epc_page; 251 + } 252 + 238 253 static struct sgx_encl_page *__sgx_encl_load_page(struct sgx_encl *encl, 239 254 struct sgx_encl_page *entry) 240 255 { ··· 263 248 return entry; 264 249 } 265 250 266 - if (!(encl->secs.epc_page)) { 267 - epc_page = sgx_encl_eldu(&encl->secs, NULL); 268 - if (IS_ERR(epc_page)) 269 - return ERR_CAST(epc_page); 270 - } 251 + epc_page = sgx_encl_load_secs(encl); 252 + if (IS_ERR(epc_page)) 253 + return ERR_CAST(epc_page); 271 254 272 255 epc_page = sgx_encl_eldu(entry, encl->secs.epc_page); 273 256 if (IS_ERR(epc_page)) ··· 351 338 return VM_FAULT_OOM; 352 339 353 340 mutex_lock(&encl->lock); 341 + 342 + epc_page = sgx_encl_load_secs(encl); 343 + if (IS_ERR(epc_page)) { 344 + if (PTR_ERR(epc_page) == -EBUSY) 345 + vmret = VM_FAULT_NOPAGE; 346 + goto err_out_unlock; 347 + } 354 348 355 349 epc_page = sgx_alloc_epc_page(encl_page, false); 356 350 if (IS_ERR(epc_page)) {
-1
arch/x86/kernel/kgdb.c
··· 695 695 } 696 696 697 697 /** 698 - * 699 698 * kgdb_skipexception - Bail out of KGDB when we've been triggered. 700 699 * @exception: Exception vector number 701 700 * @regs: Current &struct pt_regs.