Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1564020

Re: namespace: deadlock in dec_pid_namespaces

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From ebiederm@xmission.com (Eric W. Biederman)
Newsgroups linux.kernel
Subject Re: namespace: deadlock in dec_pid_namespaces
Date Sat, 21 Jan 2017 01:40:01 +0100
Message-ID <t1RSN-5Ms-15@gated-at.bofh.it> (permalink)
References <t1H74-7EL-19@gated-at.bofh.it> <t1Hqq-7M4-31@gated-at.bofh.it> <t1LX4-2d6-11@gated-at.bofh.it> <t1Qam-4J3-11@gated-at.bofh.it>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)
MIME-Version 1.0
Content-Type text/plain
X-Xm-Spf eid=1cUjbO-00058L-Ky;;;mid=<87lgu5w92e.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=101.100.131.98;;;frm=ebiederm@xmission.com;;;spf=neutral
X-Xm-Aid U2FsdGVkX19HPeTKa5uv+wk9alg/+QaGYkW3HN5sr24=
X-Sa-Exim-Connect-IP 101.100.131.98
X-Sa-Exim-Mail-From ebiederm@xmission.com
X-Spam-Report * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa01 1397; Body=1 Fuz1=1 Fuz2=1]
X-Spam-Dcc XMission; sa01 1397; Body=1 Fuz1=1 Fuz2=1
X-Spam-Combo ;Nikolay Borisov <n.borisov.lkml@gmail.com>
X-Spam-Timing total 439 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.3 (0.8%), b_tie_ro: 2.4 (0.5%), parse: 1.25 (0.3%), extract_message_metadata: 4.6 (1.0%), get_uri_detail_list: 1.95 (0.4%), tests_pri_-1000: 6 (1.4%), tests_pri_-950: 1.96 (0.4%), tests_pri_-900: 1.69 (0.4%), tests_pri_-400: 29 (6.6%), check_bayes: 27 (6.2%), b_tokenize: 10 (2.3%), b_tok_get_all: 7 (1.7%), b_comp_prob: 3.8 (0.9%), b_tok_touch_all: 2.7 (0.6%), b_finish: 0.85 (0.2%), tests_pri_0: 363 (82.7%), check_dkim_signature: 0.84 (0.2%), check_dkim_adsp: 4.4 (1.0%), tests_pri_500: 6 (1.4%), rewrite_mail: 0.00 (0.0%)
X-Spam-Flag No
X-Sa-Exim-Version 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600)
X-Sa-Exim-Scanned Yes (on in02.mta.xmission.com)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 40
Organization linux.* mail to news gateway
X-Original-Cc Dmitry Vyukov <dvyukov@google.com>, avagin <avagin@openvz.org>, serge@hallyn.com, Kees Cook <keescook@chromium.org>, Al Viro <viro@zeniv.linux.org.uk>, LKML <linux-kernel@vger.kernel.org>, syzkaller <syzkaller@googlegroups.com>
X-Original-Date Sat, 21 Jan 2017 13:28:09 +1300
X-Original-Message-ID <87lgu5w92e.fsf@xmission.com>
X-Original-References <CACT4Y+ZV1fHVJO7hweJDYOfAsR1hh2CyP+o=COWAhKonfNzSoQ@mail.gmail.com> <bce4b00c-8032-04f1-7fd8-ad16f9f3cef6@gmail.com> <877f5py5c2.fsf@xmission.com> <fba89f51-5db7-a6e2-2715-eee120146b9e@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1564020

Show key headers only | View raw


Nikolay Borisov <n.borisov.lkml@gmail.com> writes:

> On 20.01.2017 20:05, Eric W. Biederman wrote:
>> Nikolay Borisov <n.borisov.lkml@gmail.com> writes:
>> 
>>> On 20.01.2017 15:07, Dmitry Vyukov wrote:
>>>> Hello,
>>>>
>>>> I've got the following deadlock report while running syzkaller fuzzer
>>>> on eec0d3d065bfcdf9cd5f56dd2a36b94d12d32297 of linux-next (on odroid
>>>> device if it matters):
>> 
>> I am puzzled I thought we had fixed this with:
>>   add7c65ca426 ("pid: fix lockdep deadlock warning due to ucount_lock")
>> But apparently not.  We  just moved it from hardirq to softirq context.  Bah.
>> 
>> Thank you very much for the report.
>> 
>> Nikolay can you make your change use spinlock_irq?  And have put_ucounts
>> do spin_lock_irqsave?  That way we just don't care where we call this.
>
> Like the one attached?

Exactly thank you.  Dmitry if you have time to test that patch and
verify it fixes your issue I would appreciate it.

> I haven't really taken careful look as to whether
> the function where _irq versions do fiddle with irq state, since this
> might cause a problem if we unconditionally enable them.

In code paths where we can sleep irqs must come in enabled or it's a
bug.

spin_lock_irq which unconditionally disables irqs is thus safe on the
allocation path.

Similary spin_unlock_irq which unconditionally enables irqs is also safe
on the allocation path.

Eric

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

namespace: deadlock in dec_pid_namespaces Dmitry Vyukov <dvyukov@google.com> - 2017-01-20 14:10 +0100
  Re: namespace: deadlock in dec_pid_namespaces Nikolay Borisov <n.borisov.lkml@gmail.com> - 2017-01-20 14:30 +0100
    Re: namespace: deadlock in dec_pid_namespaces ebiederm@xmission.com (Eric W. Biederman) - 2017-01-20 19:20 +0100
      Re: namespace: deadlock in dec_pid_namespaces Nikolay Borisov <n.borisov.lkml@gmail.com> - 2017-01-20 23:50 +0100
        Re: namespace: deadlock in dec_pid_namespaces ebiederm@xmission.com (Eric W. Biederman) - 2017-01-21 01:40 +0100
          Re: namespace: deadlock in dec_pid_namespaces Dmitry Vyukov <dvyukov@google.com> - 2017-01-23 10:40 +0100

csiph-web