Skip to content

Commit 06f838e

Browse files
committed
Merge tag 'x86_urgent_for_v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Borislav Petkov: - Fix the vDSO exception handling return path to disable interrupts again. - A fix for the CE collector to return the proper return values to its callers which are used to convey what the collector has done with the error address. * tag 'x86_urgent_for_v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/traps: Correct exc_general_protection() and math_error() return paths RAS/CEC: Correct ce_add_elem()'s returned values
2 parents 52e4412 + 632a1c2 commit 06f838e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

arch/x86/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection)
556556
tsk->thread.trap_nr = X86_TRAP_GP;
557557

558558
if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0))
559-
return;
559+
goto exit;
560560

561561
show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
562562
force_sig(SIGSEGV);
@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr)
10571057
goto exit;
10581058

10591059
if (fixup_vdso_exception(regs, trapnr, 0, 0))
1060-
return;
1060+
goto exit;
10611061

10621062
force_sig_fault(SIGFPE, si_code,
10631063
(void __user *)uprobe_get_trap_addr(regs));

drivers/ras/cec.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,20 @@ static bool sanity_check(struct ce_array *ca)
309309
return ret;
310310
}
311311

312+
/**
313+
* cec_add_elem - Add an element to the CEC array.
314+
* @pfn: page frame number to insert
315+
*
316+
* Return values:
317+
* - <0: on error
318+
* - 0: on success
319+
* - >0: when the inserted pfn was offlined
320+
*/
312321
static int cec_add_elem(u64 pfn)
313322
{
314323
struct ce_array *ca = &ce_arr;
324+
int count, err, ret = 0;
315325
unsigned int to = 0;
316-
int count, ret = 0;
317326

318327
/*
319328
* We can be called very early on the identify_cpu() path where we are
@@ -330,8 +339,8 @@ static int cec_add_elem(u64 pfn)
330339
if (ca->n == MAX_ELEMS)
331340
WARN_ON(!del_lru_elem_unlocked(ca));
332341

333-
ret = find_elem(ca, pfn, &to);
334-
if (ret < 0) {
342+
err = find_elem(ca, pfn, &to);
343+
if (err < 0) {
335344
/*
336345
* Shift range [to-end] to make room for one more element.
337346
*/

0 commit comments

Comments
 (0)