Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8370876ybl; Thu, 16 Jan 2020 15:31:58 -0800 (PST) X-Google-Smtp-Source: APXvYqx4e5qjnUUFEjroZpn0qvB40WUojsj7npT0ax+aqIuCoWi2Vg6Qr016o2RCb/CD3prKFxgH X-Received: by 2002:a9d:6f07:: with SMTP id n7mr4082894otq.112.1579217517908; Thu, 16 Jan 2020 15:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579217517; cv=none; d=google.com; s=arc-20160816; b=scIntL920dCT4Iwm/lWTaAStzHC16J+Nh0HcUBEV58KcsWswxtUF3iPMS/wwKv8cGZ OFn3JIBZcBwgVX6+K4O9DB+bv3vEWlTtjhuf9C5IKwOUW9VqdDSXBnM7hFcoOGhDzdQP U0hcc+rOItkxAxdTP5b59pFlEvAqTCrhw8NxP5J4BDaWOXLed8XW7QQkIGHDrsg02vhP +hcUEE0WsD7TqkWHL+0tpz4H5Wea37z0Fxc2kr1IrEtdaQj7tib0nyxLIUrbTQK2QyFw 6g+y+M8+6UHkVUAG16pylzo0vRYtgl33oJJgtxuzjvJFRUsDUFJNNYTfiN1zm+2hsv1z d8lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/t1641mOz7L/P1bShxvIgEhgrtlf2emfw/YIHcnotv4=; b=uxdb1y0IEpkdR8rcioSvM9896K4VEuxKAridGbz7JV+oWIGlrMMaYFjgqcliY7hCUu 04X89ySv00FrfBqXWc3Pk7ppiaOc0tgHaFEKeNaYJvZcrZ9QJ2tPgPR53hzkFlF/1Dut Aw2sE3yrZQxxcbkovtxqwPZn954idd/lTpjr8VkLGndw5NfPw9qY3iERokqaI0xvm8kZ R3G4BDD8MYtwdq7cJRFKFOXu1AaiSFpNDhXW1f8fFqrlMJ7BsxmQbBdsqKLIsdlq0L6j XoaXtOag1988MOj3cEcinK7htDUbku4WQXrQ2FicXZJc4xj7R6un0g+ihn7j0uTEcJZu zcbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=opHpqAup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si11744575oib.170.2020.01.16.15.31.46; Thu, 16 Jan 2020 15:31:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=opHpqAup; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388835AbgAPX3k (ORCPT + 99 others); Thu, 16 Jan 2020 18:29:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391305AbgAPX3h (ORCPT ); Thu, 16 Jan 2020 18:29:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0555920748; Thu, 16 Jan 2020 23:29:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217376; bh=KGDcDbAGyfFPVnBKXB4mUdrlWdRDNcL4M6TEXQLB4eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opHpqAupR0jO+1ozatLWkcLHWetf6Z520TkjvgNKVARQlyAmI9+auPmb0ROqnuLRc mHKSUqG9t2/rwbm3QzAKOqjWhpAlLaGMQZgInBf4ZTavrbK8aHgy6s0co3TAhymVS0 A4GwAdGA/qMHNgRJfKHCImcfBYMdQQ+bIaOWRmaM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Carsten Jacobi , David Howells , Marc Dionne , Jonathan Billings , Todd DeSantis Subject: [PATCH 4.19 31/84] afs: Fix missing cell comparison in afs_test_super() Date: Fri, 17 Jan 2020 00:18:05 +0100 Message-Id: <20200116231717.380111014@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231713.087649517@linuxfoundation.org> References: <20200116231713.087649517@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Howells commit 106bc79843c3c6f4f00753d1f46e54e815f99377 upstream. Fix missing cell comparison in afs_test_super(). Without this, any pair volumes that have the same volume ID will share a superblock, no matter the cell, unless they're in different network namespaces. Normally, most users will only deal with a single cell and so they won't see this. Even if they do look into a second cell, they won't see a problem unless they happen to hit a volume with the same ID as one they've already got mounted. Before the patch: # ls /afs/grand.central.org/archive linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # ls /afs/kth.se/ linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # cat /proc/mounts | grep afs none /afs afs rw,relatime,dyn,autocell 0 0 #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0 #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0 #grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0 After the patch: # ls /afs/grand.central.org/archive linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # ls /afs/kth.se/ admin/ common/ install/ OldFiles/ service/ system/ bakrestores/ home/ misc/ pkg/ src/ wsadmin/ # cat /proc/mounts | grep afs none /afs afs rw,relatime,dyn,autocell 0 0 #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0 #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0 #kth.se:root.cell /afs/kth.se afs ro,relatime 0 0 Fixes: ^1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Carsten Jacobi Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Jonathan Billings cc: Todd DeSantis Signed-off-by: Greg Kroah-Hartman --- fs/afs/super.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -356,6 +356,7 @@ static int afs_test_super(struct super_b return (as->net_ns == as1->net_ns && as->volume && as->volume->vid == as1->volume->vid && + as->cell == as1->cell && !as->dyn_root); }