From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCBCAC10F13 for ; Thu, 11 Apr 2019 14:43:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D9622186A for ; Thu, 11 Apr 2019 14:43:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554993803; bh=wUWFuf+WHiV6BDu0I8v9xd7ZAwTAoQUrnqWZkOGZT3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=11d14B1tJyoxSqfpGCyFFdt5cUxFHuCFLMwgE1htlLTMAAn2rNcTQtkU3RC2N1RF3 otLHo5fsa+QyEaG+VbfC+6PG4TlmRaXN2PNAOzmuKjYBIgpSzdvuufFZfUShzygvgZ H9iRrcKDOM9OdyBwA+gzDupMSBtpOGzS2iYZGx2w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726585AbfDKOnX (ORCPT ); Thu, 11 Apr 2019 10:43:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:41242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726577AbfDKOnW (ORCPT ); Thu, 11 Apr 2019 10:43:22 -0400 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BCC912077C; Thu, 11 Apr 2019 14:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554993802; bh=wUWFuf+WHiV6BDu0I8v9xd7ZAwTAoQUrnqWZkOGZT3g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mqK/tnXyEbxB+1Olg6D5s4eqoMSftMbn1CdrssKGgG8nIR1s0861sCyvrLEJPvmOS XsWRdb9Wp55B3gHsfGqdyiypgthxhpNtRn/7J3LWy4Aqip3Vt2y9cLbhVi3xhFR8JO wTqqT/zmGd0hxU5HSNLvdJCWOZxhRqzKQ7eGKOfw= Date: Thu, 11 Apr 2019 10:43:20 -0400 From: Sasha Levin To: Matthew Ruffell Cc: stable@vger.kernel.org Subject: Re: [PATCH 4.9 0/3] fanotify: Fix notification subsystem hang Message-ID: <20190411144320.GM11568@sasha-vm> References: <20190411032430.17353-1-matthew.ruffell@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190411032430.17353-1-matthew.ruffell@canonical.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Apr 11, 2019 at 03:24:27PM +1200, Matthew Ruffell wrote: >BugLink: https://bugs.launchpad.net/bugs/1775165 > >[Note to upstream] >I understand that this patch is a little long for -stable, but this patch series >fixes a real issue, seen by real users, is testable, and is made up from >upstream commits. Please consider it. > >[Impact] > >When userspace tasks which are processing fanotify permission events act >incorrectly, the fsnotify_mark_srcu SRCU is held indefinitely which causes >the whole notification subsystem to hang. > >This has been seen in production, and it can also be seen when running the >Linux Test Project testsuite, specifically fanotify07. > >[Fix] > >Instead of holding the SRCU lock while waiting for userspace to respond, >which may never happen, or not in the order we are expecting, we drop the >fsnotify_mark_srcu SRCU lock before waiting for userspace response, and then >reacquire the lock again when userspace responds. > >The fixes are from a series of upstream commits: > >05f0e38724e8449184acd8fbf0473ee5a07adc6c (cherry-pick) >9385a84d7e1f658bb2d96ab798393e4b16268aaa (backport) >abc77577a669f424c5d0c185b9994f2621c52aa4 (backport) > >[Testcase] > >You can reproduce the problem pretty quickly with the Linux Test Project: > >Steps (with root): > 1. sudo apt-get install git xfsprogs -y > 2. git clone --depth=1 https://github.com/linux-test-project/ltp.git > 3. cd ltp > 4. make autotools > 5. ./configure > 6. make; make install > 7. cd /opt/ltp > 8. echo -e "fanotify07 fanotify07 \nfanotify08 fanotify08" > /tmp/jobs > 9. ./runltp -f /tmp/jobs I've queued up this and the 4.4 patches, thank you! -- Thanks, Sasha