From patchwork Wed Oct 10 10:04:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 10634291 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 D269B679F for ; Wed, 10 Oct 2018 10:04:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D5342920D for ; Wed, 10 Oct 2018 10:04:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F3F02960A; Wed, 10 Oct 2018 10:04:23 +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 BE7D02920D for ; Wed, 10 Oct 2018 10:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbeJJRZr (ORCPT ); Wed, 10 Oct 2018 13:25:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:34830 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726573AbeJJRZr (ORCPT ); Wed, 10 Oct 2018 13:25:47 -0400 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 0AE66AC90; Wed, 10 Oct 2018 10:04:20 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8804F1E3617; Wed, 10 Oct 2018 12:04:18 +0200 (CEST) From: Jan Kara To: Jens Axboe Cc: , Tetsuo Handa , Jan Kara Subject: [PATCH 0/15 v2] loop: Fix oops and possible deadlocks Date: Wed, 10 Oct 2018 12:04:00 +0200 Message-Id: <20181010100415.26525-1-jack@suse.cz> X-Mailer: git-send-email 2.16.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, this patch series fixes oops and possible deadlocks as reported by syzbot [1] [2]. The second patch in the series (from Tetsuo) fixes the oops, the remaining patches are cleaning up the locking in the loop driver so that we can in the end reasonably easily switch to rereading partitions without holding mutex protecting the loop device. I have lightly tested the patches by creating, deleting, and modifying loop devices but if there's some more comprehensive loopback device testsuite, I can try running it. Review is welcome! Changes since v1: * Added patch moving fput() calls in loop_change_fd() from under loop_ctl_mutex * Fixed bug in loop_control_ioctl() where it failed to return error properly Honza [1] https://syzkaller.appspot.com/bug?id=f3cfe26e785d85f9ee259f385515291d21bd80a3 [2] https://syzkaller.appspot.com/bug?id=bf154052f0eea4bc7712499e4569505907d15889