Bug 200637 - ARM64: bad_mode() handler may not result in panic always due to die() call in the beginning
Summary: ARM64: bad_mode() handler may not result in panic always due to die() call in...
Status: NEW
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: ARM (show other bugs)
Hardware: ARM Linux
: P1 normal
Assignee: linux-arm-kernel@lists.arm.linux.org.uk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-24 07:19 UTC by Hari Kishore Vyas
Modified: 2018-07-24 08:47 UTC (History)
1 user (show)

See Also:
Kernel Version: 4.17,4.18
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Hari Kishore Vyas 2018-07-24 07:19:37 UTC
While analyzing one issue and code walk through, it is noticed that bad_mode() handler call may not result in panic always which it must.

asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
{
        console_verbose();

        pr_crit("Bad mode in %s handler detected on CPU%d, code 0x%08x -- %s\n",
                handler[reason], smp_processor_id(), esr,
                esr_get_class_string(esr));

        die("Oops - bad mode", regs, 0);
        local_daif_mask();
        panic("bad mode");
        restore_console_loglevel();
}

die() handler calls __die() which may not return NOTIFY_STOP always with user mode and that will result in process killing. System will continue and kernel will not panic.

Probably fix could be to remove die() call from bad_mode()
Issue is difficult to produce but code walk-through showing issue clearly.

Note You need to log in before you can comment on or make changes to this bug.