All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, willy@infradead.org,
	hdanton@sina.com, ebiggers@kernel.org, axelrasmussen@google.com,
	rppt@linux.ibm.com, akpm@linux-foundation.org
Subject: [folded-merged] secretmem-fix-unhandled-fault-in-truncate-v3.patch removed from -mm tree
Date: Sat, 16 Jul 2022 21:32:44 -0700	[thread overview]
Message-ID: <20220717043244.CE224C3411E@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: secretmem: fix unhandled fault in truncate
has been removed from the -mm tree.  Its filename was
     secretmem-fix-unhandled-fault-in-truncate-v3.patch

This patch was dropped because it was folded into secretmem-fix-unhandled-fault-in-truncate.patch

------------------------------------------------------
From: Mike Rapoport <rppt@linux.ibm.com>
Subject: secretmem: fix unhandled fault in truncate
Date: Thu, 14 Jul 2022 12:13:37 +0300

v3: use invalidate_lock rather than inode_lock
v2: use inode_lock_shared() rather than add a new rw_sem to secretmem

Link: https://lkml.kernel.org/r/20220714091337.412297-1-rppt@kernel.org
Reported-by: syzbot+9bd2b7adbd34b30b87e4@syzkaller.appspotmail.com
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Suggested-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/secretmem.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- a/mm/secretmem.c~secretmem-fix-unhandled-fault-in-truncate-v3
+++ a/mm/secretmem.c
@@ -61,7 +61,7 @@ static vm_fault_t secretmem_fault(struct
 	if (((loff_t)vmf->pgoff << PAGE_SHIFT) >= i_size_read(inode))
 		return vmf_error(-EINVAL);
 
-	inode_lock_shared(inode);
+	filemap_invalidate_lock_shared(mapping);
 
 retry:
 	page = find_lock_page(mapping, offset);
@@ -104,7 +104,7 @@ retry:
 	ret = VM_FAULT_LOCKED;
 
 out:
-	inode_unlock_shared(inode);
+	filemap_invalidate_unlock_shared(mapping);
 	return ret;
 }
 
@@ -173,12 +173,20 @@ static int secretmem_setattr(struct user
 			     struct dentry *dentry, struct iattr *iattr)
 {
 	struct inode *inode = d_inode(dentry);
+	struct address_space *mapping = inode->i_mapping;
 	unsigned int ia_valid = iattr->ia_valid;
+	int ret;
+
+	filemap_invalidate_lock(mapping);
 
 	if ((ia_valid & ATTR_SIZE) && inode->i_size)
-		return -EINVAL;
+		ret = -EINVAL;
+	else
+		ret = simple_setattr(mnt_userns, dentry, iattr);
 
-	return simple_setattr(mnt_userns, dentry, iattr);
+	filemap_invalidate_unlock(mapping);
+
+	return ret;
 }
 
 static const struct inode_operations secretmem_iops = {
_

Patches currently in -mm which might be from rppt@linux.ibm.com are

secretmem-fix-unhandled-fault-in-truncate.patch
csky-drop-definition-of-pte_order.patch
csky-drop-definition-of-pgd_order.patch
mips-rename-pud_order-to-pud_table_order.patch
mips-drop-definitions-of-pte_order.patch
mips-rename-pgd_order-to-pgd_table_order.patch
nios2-drop-definition-of-pte_order.patch
nios2-drop-definition-of-pgd_order.patch
loongarch-drop-definition-of-pte_order.patch
loongarch-drop-definition-of-pmd_order.patch
loongarch-drop-definition-of-pud_order.patch
loongarch-drop-definition-of-pgd_order.patch
loongarch-drop-definition-of-pgd_order-v2.patch
parisc-rename-pgd_order-to-pgd_table_order.patch
xtensa-drop-definition-of-pgd_order.patch
arm-heads-rename-pmd_order-to-pmd_entry_order.patch


                 reply	other threads:[~2022-07-17  4:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220717043244.CE224C3411E@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=ebiggers@kernel.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rppt@linux.ibm.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.