From patchwork Thu Nov 8 13:01: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: 10674139 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 616971923 for ; Thu, 8 Nov 2018 13:01:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5134D2D248 for ; Thu, 8 Nov 2018 13:01:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F78D2D3E6; Thu, 8 Nov 2018 13:01: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 738DA2D248 for ; Thu, 8 Nov 2018 13:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726924AbeKHWgn (ORCPT ); Thu, 8 Nov 2018 17:36:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:33982 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726811AbeKHWgn (ORCPT ); Thu, 8 Nov 2018 17:36:43 -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 D6053B03D; Thu, 8 Nov 2018 13:01:18 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 119AA1E09A5; Thu, 8 Nov 2018 14:01:18 +0100 (CET) From: Jan Kara To: Jens Axboe Cc: , Tetsuo Handa , Jan Kara Subject: [PATCH 0/16 v3] loop: Fix oops and possible deadlocks Date: Thu, 8 Nov 2018 14:01:00 +0100 Message-Id: <20181108130116.12140-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 tested the patches by creating, deleting, modifying loop devices, and by running loop blktests (as well as creating new ones with the load syzkaller has used to detect the problem). Review is welcome but I think the patches are fine to go as far as I'm concerned! Jens, can you please pick them up? 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 Changes since v2: * Rebase on top of 4.20-rc1 * Add patch to stop fooling lockdep about loop_ctl_mutex Honza [1] https://syzkaller.appspot.com/bug?id=f3cfe26e785d85f9ee259f385515291d21bd80a3 [2] https://syzkaller.appspot.com/bug?id=bf154052f0eea4bc7712499e4569505907d15889