From patchwork Fri Jul 18 07:25:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 4581191 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91CB1C0514 for ; Fri, 18 Jul 2014 07:28:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB1542017D for ; Fri, 18 Jul 2014 07:28:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5320420176 for ; Fri, 18 Jul 2014 07:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759334AbaGRH2c (ORCPT ); Fri, 18 Jul 2014 03:28:32 -0400 Received: from ip4-83-240-18-248.cust.nbox.cz ([83.240.18.248]:45639 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755936AbaGRH1d (ORCPT ); Fri, 18 Jul 2014 03:27:33 -0400 Received: from ku by ip4-83-240-18-248.cust.nbox.cz with local (Exim 4.82) (envelope-from ) id 1X82Zn-0003Y6-G3; Fri, 18 Jul 2014 09:27:31 +0200 From: Jiri Slaby To: stable@vger.kernel.org Cc: Mateusz Guzik , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Trond Myklebust , Jiri Slaby Subject: [patch added to the 3.12 stable tree] NFS: populate ->net in mount data when remounting Date: Fri, 18 Jul 2014 09:25:18 +0200 Message-Id: <1405668451-13298-37-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1405668451-13298-1-git-send-email-jslaby@suse.cz> References: <1405668451-13298-1-git-send-email-jslaby@suse.cz> 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 This patch has been added to the 3.12 stable tree. If you have any objections, please let us 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);