xenial: soft lockup in check_unsafe_exec()

Bug #1876856 reported by Vasily Averin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
In Progress
High
Unassigned

Bug Description

Endless cycle was detected few times during ubuntu 16.04 testing insied openvz VMs
dmesg output and crash dump ivestigation shows that foolowing ubuntu 16.04.patch is guilty
commit d6572202d986a84feda4cf7e6ce0bebaa18cb8fe
Author: Colin Ian King <email address hidden>
Date: Fri May 12 15:51:56 2017 +0100
    UBUNTU:SAUCE: exec: ensure file system accounting in check_unsafe_exec is correct

    BugLink: http://bugs.launchpad.net/bugs/1672819

fs/exec.c:: check_unsafe_exec()
...
recheck:
        fs_recheck = false;
        t = p;
        n_fs = 1;
        spin_lock(&p->fs->lock);
        rcu_read_lock();
        while_each_thread(p, t) {
                if (t->fs == p->fs)
                        n_fs++;
                if (t->flags & (PF_EXITING | PF_FORKNOEXEC))
                        fs_recheck = true;
        }
        rcu_read_unlock();

        if (p->fs->users > n_fs) {
                if (fs_recheck) {
                        spin_unlock(&p->fs->lock);
                        goto recheck; <<<<<< cycles forever
                }
                bprm->unsafe |= LSM_UNSAFE_SHARE;
        } else
                p->fs->in_exec = 1;
        spin_unlock(&p->fs->lock);

dmesg example is attached,
let me know if you want to look at crash dump image.
Bug is xenial-specific (4.4 kernel), other kernel branches seems are not affected.

Tags: xenial
Revision history for this message
Vasily Averin (vvs.at.openvz.org) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1876856

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: xenial
Changed in linux (Ubuntu):
status: Incomplete → Invalid
status: Invalid → Confirmed
Changed in linux (Ubuntu):
importance: Undecided → High
assignee: nobody → Colin Ian King (colin-king)
status: Confirmed → In Progress
Revision history for this message
Colin Ian King (colin-king) wrote :

I've uploaded some test kernel packages that address this issue. Do you mind testing these to see if it resolves the issue and let me know so I can get this fix into the next kernel release.

https://kernel.ubuntu.com/~cking/lp-1876856/

Revision history for this message
Vasily Averin (vvs.at.openvz.org) wrote :

Unfortunately I'm unable to verify your changes here.
Our QA cannot quickly update the failed tests to use custom kernel inside VM.

Revision history for this message
Vasily Averin (vvs.at.openvz.org) wrote :

issue was reproduced once again on 4.4.0-184 kernel

Revision history for this message
Vasily Averin (vvs.at.openvz.org) wrote :

issue was reproduced once again, now on 4.4.0-197 kernel

Changed in linux (Ubuntu):
assignee: Colin Ian King (colin-king) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.