From patchwork Tue Sep 17 15:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11148959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 417AA112B for ; Tue, 17 Sep 2019 15:06:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E78082067B for ; Tue, 17 Sep 2019 15:06:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="L4MGQ8vd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E78082067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 801386B0003; Tue, 17 Sep 2019 11:06:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 78C616B0005; Tue, 17 Sep 2019 11:06:12 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 67A396B0006; Tue, 17 Sep 2019 11:06:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 42FD26B0003 for ; Tue, 17 Sep 2019 11:06:12 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id C828555F88 for ; Tue, 17 Sep 2019 15:06:11 +0000 (UTC) X-FDA: 75944738142.22.veil16_702f96080e72a X-Spam-Summary: 2,0,0,29c47dca5bdde8d8,d41d8cd98f00b204,djwong@kernel.org,:torvalds@linux-foundation.org:djwong@kernel.org:linux-fsdevel@vger.kernel.org:linux-xfs@vger.kernel.org:hch@infradead.org:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:viro@zeniv.linux.org.uk::tytso@mit.edu,RULES_HIT:41:69:355:379:421:973:988:989:1260:1277:1312:1313:1314:1345:1437:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:3873:3874:4250:4321:4387:4605:5007:6261:6653:7875:8784:10004:10400:10450:10455:10967:11232:11658:11914:12043:12291:12297:12438:12517:12519:12555:12679:12683:12740:12895:13069:13071:13161:13229:13311:13357:13439:13895:14095:14096:14180:14181:14721:14819:19904:19999:21060:21080:21611:21627:30054,0,RBL:198.145.29.99:@kernel.org:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutra l,Custom X-HE-Tag: veil16_702f96080e72a X-Filterd-Recvd-Size: 2916 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Sep 2019 15:06:10 +0000 (UTC) Received: from localhost (c-67-169-218-210.hsd1.or.comcast.net [67.169.218.210]) (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 5BA7D20665; Tue, 17 Sep 2019 15:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568732769; bh=SDG5YpF85LDl7cxtILkzcLro5V+SIvuaeeWO/xetNPc=; h=Date:From:To:Cc:Subject:From; b=L4MGQ8vdegQAMJWZvefCan9LNmZ58YKbkSOalMHxvO0HWyV0pmFh1Ux7JqwFOW68O mCGBhYjjy1+ryMK52xSHfJQua12b18hMCxbKZNbPuOyslbAj0VL4Avpn+vFS73QMQF zChusAZY9pyCaARcI1IJL6QMmjaAJ3A8JgTG6/KI= Date: Tue, 17 Sep 2019 08:06:09 -0700 From: "Darrick J. Wong" To: Linus Torvalds Cc: "Darrick J. Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, hch@infradead.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, linux-mm@kvack.org, Theodore Ts'o Subject: [GIT PULL] vfs: prohibit writes to active swap devices Message-ID: <20190917150608.GT2229799@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Linus, Please pull this short series that prevents writes to active swap files and swap devices. There's no non-malicious use case for allowing userspace to scribble on storage that the kernel thinks it owns. The branch merges cleanly against this morning's HEAD and survived an overnight run of xfstests. The merge was completely straightforward, so please let me know if you run into anything weird. --D The following changes since commit 609488bc979f99f805f34e9a32c1e3b71179d10b: Linux 5.3-rc2 (2019-07-28 12:47:02 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/vfs-5.4-merge-1 for you to fetch changes up to dc617f29dbe5ef0c8ced65ce62c464af1daaab3d: vfs: don't allow writes to swap files (2019-08-20 07:55:16 -0700) ---------------------------------------------------------------- Changes for 5.4: - Prohibit writing to active swap files and swap partitions. ---------------------------------------------------------------- Darrick J. Wong (2): mm: set S_SWAPFILE on blockdev swap devices vfs: don't allow writes to swap files fs/block_dev.c | 3 +++ include/linux/fs.h | 11 +++++++++++ mm/filemap.c | 3 +++ mm/memory.c | 4 ++++ mm/mmap.c | 8 ++++++-- mm/swapfile.c | 41 +++++++++++++++++++++++++---------------- 6 files changed, 52 insertions(+), 18 deletions(-)