From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A67DEC433EF for ; Fri, 20 May 2022 03:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344958AbiETDXY (ORCPT ); Thu, 19 May 2022 23:23:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343795AbiETDXX (ORCPT ); Thu, 19 May 2022 23:23:23 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D55C11AFC0 for ; Thu, 19 May 2022 20:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=04ALj0I47W7dDUBtT9vhcc/md8Jaw1rvMJ6LElze67U=; b=dBYAToFDOi+5/UDZI90Y6Xek+1 0HAfHaQ9QzhOR7A1DQX+7tXe1rNrm4Dv+F+XTrsDM4zjKkx/LHZL30mj2Igi/RwBjwEYy6XHG/+Yp KvNPQaiPenqXhM49X2qyDWtxP8aVEeLDUZwjQLJgrd3XxTadBTsnuujOofrDbCp/ZsVc3pMQsCpCK cLCC5n7EY6TBo25JdtHP3TsQkAUNxQd4mGcnPLUT2rM3DFEQstkPwDz7qvYAKes8mEGorItKU4uAJ NO20Aw75FJ3Jaz73cCZy7mOggIfHHNympGch/yIJkeMFxtxm2KPCUqRhia9r0qYUkfeoEqZ2iNcv1 F35A1T3g==; Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrtEW-00GUBg-UO; Fri, 20 May 2022 03:23:21 +0000 Date: Fri, 20 May 2022 03:23:20 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Eric Biederman Subject: [PATCH] blob_to_mnt(): kern_unmount() is needed to undo kern_mount() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org plain mntput() won't do. Signed-off-by: Al Viro --- kernel/usermode_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/usermode_driver.c b/kernel/usermode_driver.c index 9dae1f648713..8303f4c7ca71 100644 --- a/kernel/usermode_driver.c +++ b/kernel/usermode_driver.c @@ -28,7 +28,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na file = file_open_root_mnt(mnt, name, O_CREAT | O_WRONLY, 0700); if (IS_ERR(file)) { - mntput(mnt); + kern_unmount(mnt); return ERR_CAST(file); } @@ -38,7 +38,7 @@ static struct vfsmount *blob_to_mnt(const void *data, size_t len, const char *na if (err >= 0) err = -ENOMEM; filp_close(file, NULL); - mntput(mnt); + kern_unmount(mnt); return ERR_PTR(err); } -- 2.30.2