Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp921105imm; Sat, 22 Sep 2018 13:59:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY3sGfK0a8CsBa0bfYVdmCqpInD7SvKKtZfGopPMQytZBCWcwfA6IMCdBAzuPXS3XfK/uID X-Received: by 2002:a62:41d6:: with SMTP id g83-v6mr2870142pfd.44.1537649940967; Sat, 22 Sep 2018 13:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537649940; cv=none; d=google.com; s=arc-20160816; b=qQrFLXXbp+MhoDJKVE7jMUmfZ/LJfSC4AwloH5KqH45F+YJwBfrLh92j+i+jONHbFF QaXlcdWHQLWpMRDss+wDOJCKaVoBj2f4LoI4F0x01HcuEy7up+yXF/p43m5F6oVQmKlv kceto6YFQyhfv+ZGgwtBvAL77zdIPPngtkrbRxLUmviS+waYx/v8g6vrieJFMhVqPNBJ VHBLPlK1xh9wh1f/yll6k8HDJT90ODh/5oXmqtOo8oZ0SkBzbYmHG8EpDUY9Usz3FozC 9YQavivrGnMfsgzl8JVeRgflbwM8o+hYWH9sluI6pP5j7i9WxG32thmznqiTz42dGtWe Abuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=VH4/zjEKil6S8G4y4QwJUB7C6lrVCn94lr9s2xN4e5s=; b=tKMwwwh1PwNwZ4WxOe97nQG0qm1Wm7KggJpW/FDAT+n99zSgjaSHXhA3JpYm1tMcUs guKpe8yfkzKVjlc05Qaf7r1VyOdFQAflYsiAaQBS+sEPZl7lzmxW377w/6YyiGTv1iEM FDtDSEFXtK9FRNPxw80CnYArOqcl599SaCO1RE8Z839b8bewWmXgGH1j08FjzOsxGJzv lyMtOvV191DZrgZCCE1YaPfkweiLSkrEZp6Dqx1K0bJXECflSVDOX7w1RVxkQh2QbcRP GH/E5ncbwbPcbqswcu7yOI6CohNzqQU3MmZM6N9n+clDabCPb5lQS+osCJrhH++L8OQb I6BQ== ARC-Authentication-Results: i=1; mx.google.com; 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 a31-v6si29304439pgm.114.2018.09.22.13.58.45; Sat, 22 Sep 2018 13:59:00 -0700 (PDT) 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; 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 S1728281AbeIWCw7 (ORCPT + 99 others); Sat, 22 Sep 2018 22:52:59 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:47618 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbeIWCw6 (ORCPT ); Sat, 22 Sep 2018 22:52:58 -0400 Received: from [2a02:8011:400e:2:cbab:f00:c93f:614] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1g3oyY-000402-EM; Sat, 22 Sep 2018 21:58:02 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1g3oyT-0005Iq-7M; Sat, 22 Sep 2018 21:57:57 +0100 Message-ID: <70a0edd73c78c1610df0282704687ea2c896d4fa.camel@decadent.org.uk> Subject: Re: [PATCH 3.16 52/63] xfs: validate cached inodes are free when allocated From: Ben Hutchings To: Dave Chinner Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, akpm@linux-foundation.org, Christoph Hellwig , Wen Xu , Carlos Maiolino , "Darrick J. Wong" Date: Sat, 22 Sep 2018 21:57:56 +0100 In-Reply-To: <20180922052659.GC19103@rh> References: <20180922052659.GC19103@rh> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-jeGOF+P3q9mubOyUck56" User-Agent: Evolution 3.29.92-1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:8011:400e:2:cbab:f00:c93f:614 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-jeGOF+P3q9mubOyUck56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2018-09-22 at 15:26 +1000, Dave Chinner wrote: > On Sat, Sep 22, 2018 at 01:15:42AM +0100, Ben Hutchings wrote: > > 3.16.58-rc1 review patch. If anyone has any objections, please let me = know. > >=20 > > ------------------ > >=20 > > From: Dave Chinner > >=20 > > commit afca6c5b2595fc44383919fba740c194b0b76aff upstream. > >=20 > > A recent fuzzed filesystem image cached random dcache corruption > > when the reproducer was run. This often showed up as panics in > > lookup_slow() on a null inode->i_ops pointer when doing pathwalks. >=20 > ..... > > [bwh: Backported to 3.16: > > - Look up mode in XFS inode, not VFS inode > > - Use positive error codes, and EIO instead of EFSCORRUPTED] >=20 > Again, why EIO? I'll change this back to EFSCORRUPTED. Ben. > And .... > > Signed-off-by: Ben Hutchings > > --- > > fs/xfs/xfs_icache.c | 73 +++++++++++++++++++++++++++++---------------- > > 1 file changed, 48 insertions(+), 25 deletions(-) > >=20 > > --- a/fs/xfs/xfs_icache.c > > +++ b/fs/xfs/xfs_icache.c > > @@ -133,6 +133,46 @@ xfs_inode_free( > > } > > =20 > > /* > > + * If we are allocating a new inode, then check what was returned is > > + * actually a free, empty inode. If we are not allocating an inode, > > + * then check we didn't find a free inode. > > + * > > + * Returns: > > + * 0 if the inode free state matches the lookup context > > + * ENOENT if the inode is free and we are not allocating > > + * EFSCORRUPTED if there is any state mismatch at all >=20 > You changed the code but not the comment. >=20 > Cheers, >=20 > Dave. --=20 Ben Hutchings Any sufficiently advanced bug is indistinguishable from a feature. --=-jeGOF+P3q9mubOyUck56 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCspvTSmr92z9o8157/I7JWGEQkFAlumrNQACgkQ57/I7JWG EQk5whAA0seMSZbrpZZ255yHcqFKxMBSkJ8S/UypCYV58ebI4HYmQNiyUVkRL6Mo rqCvxVA+BfeLOtEZKj9no8Tam73R7/byuQfoEbjcXWth6pZK6WRAq06+mfgzAJg8 +xFnRLTojvECG/68PNEkMX3lt2OmqevClUQZpXV/jWAhLCAehN3b7wK5xrulcWxi VTHvm/7jPpvgenme7TeX2Ye0pKMDyyAKaJaoX2Och89IVcA948DDpPfvhrlZp1KV xJvXGs7ne62ti68pCyWPGPCqdkowf3WP8D64mQUoxS+ucZSbEPPcDu/iHrERlynj syq/3ORmPzxNW92ywaxaa7WhzieUAeBdp1VOT8fAhXmDgF/XIrYZtvko7bi4S3D3 u/t93NJ75CyHTocL0frEChNXgv2itoEpG61tgmh5WneapsbWbBci6unNksrYnbOe 20FsZ7ZZDuYl6tb3HBSSXzT5pzSwCYQm065pAJq5RUxTVY79Zva6RbRWTMfeCdo0 ThJBTMEmqs1CdwlTM2HaZPpiPSq5J+PJ7YVCUmwFilnEqTjN+MHGhMkIptBuzExO xW+5CwGEawY+IpXiy/WEil7OFvRVrB6PSSNyH5J6hG5rL9q6jfvJtJg3fF6QHyQ5 kmMqevguDVdVpJdxYVx1UUFUII8DQWGCdt/za561S/ce85godnU= =rDZm -----END PGP SIGNATURE----- --=-jeGOF+P3q9mubOyUck56--