Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4774798pxb; Thu, 14 Oct 2021 11:41:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1qFNHPrRtBUt5FjNU2W2lQZtEx2SOdySfmreVVO25Y6s0BsH0cXpceekDkI5HrINI9Ryc X-Received: by 2002:a05:6402:2787:: with SMTP id b7mr10783598ede.238.1634236890342; Thu, 14 Oct 2021 11:41:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634236890; cv=none; d=google.com; s=arc-20160816; b=yvdY9Qxx3AB/5rLARStts8m9alErY0xrvObcGeRoT2klXn4EZq8j1DlsYzJ39TNW9j RF5WaNI0KC0/+VFllknqONKTdSY4D8GtRnF3sXYgJevSigrjCEPFqVuSYrUETTyG0DXJ 2SYMZ9g+RSHQBmm3ugbSrlF22E6+B1c6MuR1CcM7hxXOYlW/+vnZ9GyW8oB0+yeVQ/HG O251a/jNSfk6++mYOxdn3iWQCRv9e+/hTbcxG7XeJUvIIzF//4/txGouQRltdcfOUk/f sXOjrrtyQ8/M1OIRxMZll4+ByhJ9ZE6HjfaoY3CpArDhM5N25/dE1S4rRmx1ZmyNqLfx xkeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2ZP87Y7Y/Xl80Yb+wN2SlaKKVRX2uuOIAtLidAc+bu4=; b=EtNdhGczVWfW6UBNaIg35u0n2nwcDg4Qfi++F2sW7zGkU+BKjRjAUgz4vyZgTXNqvG FosvybP04verjNsmZsOgxACKKZ3VrSBPCz/WTgdGAlUc1xS41RtBM6ysvwAPWNDWgGx9 +Ug/x/66cMgEPVLpYyrgrZplf2BHlXnIGmGQT8w2vTsJsCpwyEqEVY+qNzJ63cz+PKIj p6siwmtL24Bitj60rgmu+JjlsgdaxwvYB3m6C/M9jLoP0F/qBvfufpD9IXUdVY2gPl// LroFHGpz5hYF90yde+7zU0tLOATDspM6br2OG47VrdY/iXTWsSDkbr/kdk0QOApY2szK 0mdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si5220370edm.143.2021.10.14.11.40.56; Thu, 14 Oct 2021 11:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbhJNQFV convert rfc822-to-8bit (ORCPT + 99 others); Thu, 14 Oct 2021 12:05:21 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:21598 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbhJNQFU (ORCPT ); Thu, 14 Oct 2021 12:05:20 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-599-NsPe3kEsMZu8l-KmWgXMtQ-1; Thu, 14 Oct 2021 12:03:12 -0400 X-MC-Unique: NsPe3kEsMZu8l-KmWgXMtQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9547C801AA7; Thu, 14 Oct 2021 16:03:10 +0000 (UTC) Received: from comp-core-i7-2640m-0182e6.redhat.com (unknown [10.36.110.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D7805D6B1; Thu, 14 Oct 2021 16:03:08 +0000 (UTC) From: Alexey Gladkov To: LKML , "Eric W . Biederman" , linux-nfs@vger.kernel.org Cc: Trond Myklebust , Anna Schumaker , Sargun Dhillon Subject: [PATCH] Fix user namespace leak Date: Thu, 14 Oct 2021 18:02:30 +0200 Message-Id: <20211014160230.106976-1-legion@kernel.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kernel.org Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=WINDOWS-1252 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Fixes: 61ca2c4afd9d ("NFS: Only reference user namespace from nfs4idmap struct instead of cred") Signed-off-by: Alexey Gladkov --- fs/nfs/nfs4idmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4idmap.c b/fs/nfs/nfs4idmap.c index 8d8aba305ecc..f331866dd418 100644 --- a/fs/nfs/nfs4idmap.c +++ b/fs/nfs/nfs4idmap.c @@ -487,7 +487,7 @@ nfs_idmap_new(struct nfs_client *clp) err_destroy_pipe: rpc_destroy_pipe_data(idmap->idmap_pipe); err: - get_user_ns(idmap->user_ns); + put_user_ns(idmap->user_ns); kfree(idmap); return error; } -- 2.33.0