From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934157AbbBCXah (ORCPT ); Tue, 3 Feb 2015 18:30:37 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55370 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933745AbbBCXZc (ORCPT ); Tue, 3 Feb 2015 18:25:32 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aruna Balakrishnaiah , Kees Cook , Tony Luck , HuKeping Subject: [PATCH 3.10 31/51] pstore: Fail to unlink if a driver has not defined pstore_erase Date: Tue, 3 Feb 2015 15:17:13 -0800 Message-Id: <20150203231725.535728337@linuxfoundation.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <20150203231724.582537862@linuxfoundation.org> References: <20150203231724.582537862@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aruna Balakrishnaiah commit bf2883339a33b7544b92ea465b90c3de55082032 upstream. pstore_erase is used to erase the record from the persistent store. So if a driver has not defined pstore_erase callback return -EPERM instead of unlinking a file as deleting the file without erasing its record in persistent store will give a wrong impression to customers. Signed-off-by: Aruna Balakrishnaiah Acked-by: Kees Cook Signed-off-by: Tony Luck Cc: HuKeping Signed-off-by: Greg Kroah-Hartman --- fs/pstore/inode.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -178,6 +178,8 @@ static int pstore_unlink(struct inode *d if (p->psi->erase) p->psi->erase(p->type, p->id, p->count, dentry->d_inode->i_ctime, p->psi); + else + return -EPERM; return simple_unlink(dir, dentry); }