From patchwork Tue Jan 8 10:01:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Penyaev X-Patchwork-Id: 10751749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B74486C5 for ; Tue, 8 Jan 2019 10:01:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5CC328BBC for ; Tue, 8 Jan 2019 10:01:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98B7228BC9; Tue, 8 Jan 2019 10:01:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A94028BBC for ; Tue, 8 Jan 2019 10:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728489AbfAHKBi (ORCPT ); Tue, 8 Jan 2019 05:01:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:58378 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727001AbfAHKBi (ORCPT ); Tue, 8 Jan 2019 05:01:38 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 01C31B0DD; Tue, 8 Jan 2019 10:01:36 +0000 (UTC) From: Roman Penyaev Cc: Roman Penyaev , Davidlohr Bueso , Jason Baron , Al Viro , Andrew Morton , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] epoll: remove wrong assert that ep_poll_callback is always called with irqs off Date: Tue, 8 Jan 2019 11:01:21 +0100 Message-Id: <20190108100121.20247-1-rpenyaev@suse.de> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP That was wrong assumption that all drivers disable irqs before waking up a wait queue. Even assert line is removed the whole logic stays correct: epoll always locks rwlock with irqs disabled and by itself does not call from interrupts, thus it is up to driver how to call wake_up_locked(), because if driver does not handle any interrupts (like fuse in the the report) of course it is safe on its side to take a simple spin_lock. Signed-off-by: Roman Penyaev Reported-by: syzbot+aea82bf9ee6ffd9a79d9@syzkaller.appspotmail.com Cc: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Cc: Andrew Morton Cc: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- fs/eventpoll.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index f307c8679027..f5f88250cdf2 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -1217,12 +1217,6 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v __poll_t pollflags = key_to_poll(key); int ewake = 0; - /* - * Called by irq context or interrupts are disabled by the wake_up_*poll - * callers. - */ - lockdep_assert_irqs_disabled(); - read_lock(&ep->lock); ep_set_busy_poll_napi_id(epi);