From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEC1E3EDAD7 for ; Tue, 9 Jun 2026 08:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780993091; cv=none; b=lsDqiIs+UCmgJweLcqLTr0bJua7Hf816AYsQRYjtjVrjruqFRqChEW6Q/IO3uy5tzOm+XzT9UowfAu8oUUR6R6V/thxveNJp8aVO6XYsCfYyA6beF2NS+A4qIGtG/c85VzgGyv/2JaZF71t8K8ugbUXywAb6UaZH1Izj11ArNcY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780993091; c=relaxed/simple; bh=rEAJILyxD7sMPEejWjVgehmQCWVRSy8KW1d0CkA5HEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EkbvJX22U4n7mh77bDZ3iNQPodqta7BbRYl5mUEbg4XdQ+TeYJg32Wq+Ar5XrBrKfAkW/KSAzdMPhHt4G/PlMKCDthC6GiA6KosQBcd5PfRmRWSoMyYfzZkNTjfSo7+vxK1A3Vxjq0X3VSwqTQ5ZDJD7K72se2n/pVWP8CdRmfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ZNdo4+qz; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZNdo4+qz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780993088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ad4bOx2SpIIPU8J+eqnXFfIiUmSYQ9scsCpmfgKcDgY=; b=ZNdo4+qzWStDBQfmny1o+3OspABqrgjVxMnMqhb2sMHOk0rdOt5Wmko1EY1jWfa5Vl6xIE 1FkJrqQpNe8UQbB84fTT108LPeYa87AlJfHKx8fLpkv6mUmc6sYfp5ddC0Oi+VFz3d9FLZ 1XuTXK13temtnMqyqaXNF69YNeZ1xq4= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-_7Ec7Hg3Op2gAEubp4p-zw-1; Tue, 09 Jun 2026 04:18:04 -0400 X-MC-Unique: _7Ec7Hg3Op2gAEubp4p-zw-1 X-Mimecast-MFC-AGG-ID: _7Ec7Hg3Op2gAEubp4p-zw_1780993083 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6D9CE1944F0C; Tue, 9 Jun 2026 08:18:03 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.44.32.43]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 48F8A19560A2; Tue, 9 Jun 2026 08:18:01 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Marc Dionne , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Deepakkumar Karn Subject: [PATCH 4/7] afs: Remove setting of AS_RELEASE_ALWAYS for symlinks and mountpoints Date: Tue, 9 Jun 2026 09:17:34 +0100 Message-ID: <20260609081738.770127-5-dhowells@redhat.com> In-Reply-To: <20260609081738.770127-1-dhowells@redhat.com> References: <20260609081738.770127-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Regular AFS files correctly use afs_file_aops which have release_folio set as netfs_release_folio, so AS_RELEASE_ALWAYS is valid for them when fscache is enabled (set via afs_vnode_set_cache()). Symlinks and mountpoints in AFS use afs_dir_aops, which does not provide a release_folio callback. However, afs_apply_status() unconditionally calls mapping_set_release_always() for these. In such case when memory management code attempts to release folios, filemap_release_folio() checks folio_needs_release() which returns true due to AS_RELEASE_ALWAYS being set. Since there is no release_folio callback, it falls through to try_to_free_buffers(), which at present expects buffer_heads to be not null. For symlinks and mountpoints without buffer_heads, this causes pointer dereference. Fixes: eae9e78951bb ("afs: Use netfslib for symlinks, allowing them to be cached") Signed-off-by: Deepakkumar Karn Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 3f48458694ba..21ac098d03ef 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -126,7 +126,6 @@ static int afs_inode_init_from_status(struct afs_operation *op, } inode->i_mapping->a_ops = &afs_symlink_aops; inode_nohighmem(inode); - mapping_set_release_always(inode->i_mapping); break; default: dump_vnode(vnode, op->file[0].vnode != vnode ? op->file[0].vnode : NULL);