From patchwork Fri Jul 18 12:10:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 4585041 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ED7FD9F26C for ; Fri, 18 Jul 2014 14:02:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C6B420117 for ; Fri, 18 Jul 2014 14:02:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5466620179 for ; Fri, 18 Jul 2014 14:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935026AbaGROCi (ORCPT ); Fri, 18 Jul 2014 10:02:38 -0400 Received: from bband-dyn38.178-41-141.t-com.sk ([178.41.141.38]:19049 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933454AbaGROCh (ORCPT ); Fri, 18 Jul 2014 10:02:37 -0400 X-Greylist: delayed 2874 seconds by postgrey-1.27 at vger.kernel.org; Fri, 18 Jul 2014 10:02:37 EDT Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.82) (envelope-from ) id 1X8720-0004sY-Al; Fri, 18 Jul 2014 14:12:56 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Mateusz Guzik , linux-nfs@vger.kernel.org, Trond Myklebust , Jiri Slaby Subject: [PATCH 3.12 037/170] NFS: populate ->net in mount data when remounting Date: Fri, 18 Jul 2014 14:10:42 +0200 Message-Id: <708fc7633ef80d411ab112d2ec64dd5826c9863a.1405685481.git.jslaby@suse.cz> X-Mailer: git-send-email 2.0.0 In-Reply-To: <48e8cad86bb1241c08bdaa80db022c25068ff8e0.1405685481.git.jslaby@suse.cz> References: <48e8cad86bb1241c08bdaa80db022c25068ff8e0.1405685481.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mateusz Guzik 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit a914722f333b3359d2f4f12919380a334176bb89 upstream. Otherwise the kernel oopses when remounting with IPv6 server because net is dereferenced in dev_get_by_name. Use net ns of current thread so that dev_get_by_name does not operate on foreign ns. Changing the address is prohibited anyway so this should not affect anything. Signed-off-by: Mateusz Guzik Cc: linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Trond Myklebust Signed-off-by: Jiri Slaby --- fs/nfs/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index a03b9c6f9489..64940b5286db 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -2197,6 +2197,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data) data->timeo = 10U * nfss->client->cl_timeout->to_initval / HZ; data->nfs_server.port = nfss->port; data->nfs_server.addrlen = nfss->nfs_client->cl_addrlen; + data->net = current->nsproxy->net_ns; memcpy(&data->nfs_server.address, &nfss->nfs_client->cl_addr, data->nfs_server.addrlen);