From nobody Tue Dec 16 16:39:01 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 073C523EA95 for ; Wed, 10 Dec 2025 19:37:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765395463; cv=none; b=IispYArwrArim41KoQOp1I8yXeIBu/szRHlAteVCJkPdbcQodZ1czqpDUH1K2Q4o1pSWEPtc72Bs/qGezcxIRcSTkXrYv2R+wcUx1Kt0t6LIHf4nm53H0HyGAjYuKTyePiLkWREjRX7LHolco4WOTYGFcmaQnayR3NCwV7zBbh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765395463; c=relaxed/simple; bh=HLoBiCbdayg8MIdKPvat1whHnYkHw7ImC1pu7OAayTo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hmE25sSa3yOrcENIlaNqcqRMW2c3H/zp1jxLVfi9NydQu64OLzeZgYdz1KmbuYw2ZiHRYQRfOpO7lWC/F2vAlgpWOtcFYgJUqOeZWo2AtBgVzkMw2nK5rIcd8/pUTaXuUuNQT9PJjGpkEyrwIWnBeL3ubRbcsOBDY7Gdxq4hpvw= 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=iac5HUG2; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=hHXeh1ft; arc=none smtp.client-ip=170.10.129.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="iac5HUG2"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="hHXeh1ft" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765395460; 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; bh=cL3vA5ao4A1BxUDdyE9xf5AFHlXH/HMbZCORYve6bO8=; b=iac5HUG2u9HWdod5l9X9lwG0egUj2P0QYuX2Y73ybhyRt9Vi4z8jZMmv6U2/lKuSWdfvGx HJv7HpWKmxuyTLNTsZOQ8rq2muaNAgoVhe6W3s4TWfz3ZXnmzTZJmcyaDwpDABBmsKljIU h6zyFQsdDjPOV3T3PVbUx2Z1B7b5Ic4= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-ZZCl4SNMMOKEZBMLtcODHw-1; Wed, 10 Dec 2025 14:37:39 -0500 X-MC-Unique: ZZCl4SNMMOKEZBMLtcODHw-1 X-Mimecast-MFC-AGG-ID: ZZCl4SNMMOKEZBMLtcODHw_1765395459 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-29b760316a8so2690095ad.2 for ; Wed, 10 Dec 2025 11:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1765395459; x=1766000259; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cL3vA5ao4A1BxUDdyE9xf5AFHlXH/HMbZCORYve6bO8=; b=hHXeh1ftBzWZcoP2c/9461XK28bNiVj/hNEeWOJM/UFDbHGtwF+skduBfQ2ivAu/U0 N3bCdtfBaeUbX57Wu7quW+xNrqKK8r+U7JC4MlDfl8SxvjhO3uzSoSyuu46GU/xKO1WR VCKPavqCQ/xDCoIhPKJFyi7RFA2dsd/fJQCyiOV6/5kkwFstHKcH46vJqhWA8aZ0jOJt vQdsicvj4xcPBksuZPNdnCsniZjF/0TJqy5jYH6kxTYaqEbVGrArIieDq07HBTVLt5+G Kyz+6pEZDimw9LQoSwiBwZREHl2LDu5l5lOD7UbBY73PjUNBnn2Vifq1lMiQxF6RkTdE I/Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765395459; x=1766000259; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cL3vA5ao4A1BxUDdyE9xf5AFHlXH/HMbZCORYve6bO8=; b=wCbcD8ZEE2Sry6Vb9K3fYXXBuZSS8gseJEwHrzWmf+k9rKhCEUeiyYXlNKY44oF6dA ABWYjqc3t55BSqKwaPbJWBGTe2p1j6Z5K/BsxHwOia79LlOrZ71Q6kGkcnq68Loh8dzX rG0L4CqTqliWZOIVSSn/7/GcpRZ22rfoeuP8uKInXXIsZbFjEag+aHS1yCLXQv4Wu/Cg qxQC1kXirLNCfzMbh4tIOZFdpY2ZikT5PVYFv1FhKuvm5jLnIwyfbW74C9wVd9Vn0tXG C6Q4Yl48EvnM1SsLNEIStXqewHwH7q//gYW9OBuqaZj3WcRtLIWyeP9vL56k810Sp04S Ta1w== X-Forwarded-Encrypted: i=1; AJvYcCWjGKBG8GbtvqW6V/PAyrB6+o54V2hsbXKKGrKBqc73etxoODGbvT73/YpqgpmaQNx8qOPcqXoqMY8Empk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2WI89yUKdag3txGbA/4ldS6Y9IthuUpwdgE5KIBLCLGkoBGhp fADfY86cupFAj4UzwfMOHBLve3cQb8DK8LV1htrK64kBdYe1ONpMRDNLk9tpByw4paTaOfImef1 4955fOizUCKhJlNqldFEP3t9x2CDbzC7k2ijrAE5SZiPlVeH1sKaXa5B9TKUU4A4c X-Gm-Gg: AY/fxX5+fTz3pDgUEJcQxzJBTD4cVy0T+ogEWI8dFb4NbciXJTaWVqVdT+c/emgOlDY Yor7Mv3tZgNYOHut9LJkZkQKQgVUfIgiynogk1IdyPJJgyEiDLLvUlEx5u+iGClSNYgsC/0c/GL c39rJ+yzey/3oR6W5d0/YhsblqPduvNM0QQoYJdVgeb/2llPCMBjCMPiVQmGaA0wY/0NPiIiEBr /BRbNzXghjzaGLyu4ZKTQb8+jCw4HwZ1Yr2FWNaq0enkmrK2SRL7ytUjqhVq2FCdtOLVfMaOEeV BLl0uJ1+jtLNx4oMLf+4Uop6al33TdyfrHGvtuB8u1SmjV/7ebSoWPDPicOi6nA4cyZqy2bebSr Yd8GNvWkkMOhU2In5e9dzyddJDDyo9GUzQfPE4A== X-Received: by 2002:a17:903:2a86:b0:24c:965a:f94d with SMTP id d9443c01a7336-29ec27bb262mr31090095ad.46.1765395458649; Wed, 10 Dec 2025 11:37:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGunSElmEwDXvhIXm1CZzrpsq104uGZ1THJ+ZfVQu5et7O3ym86o0bALl0VO7ob96pVketNRA== X-Received: by 2002:a17:903:2a86:b0:24c:965a:f94d with SMTP id d9443c01a7336-29ec27bb262mr31089875ad.46.1765395458233; Wed, 10 Dec 2025 11:37:38 -0800 (PST) Received: from dkarn-thinkpadp16vgen1.punetw6.csb ([2402:e280:3e0d:a45:3861:8b7f:6ae1:6229]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29eea064e8esm1347885ad.90.2025.12.10.11.37.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 11:37:37 -0800 (PST) From: Deepakkumar Karn To: David Howells Cc: Marc Dionne , Christian Brauner , Jan Kara , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Deepakkumar Karn Subject: [PATCH] afs: Remove setting of AS_RELEASE_ALWAYS for symlinks and mountpoints Date: Thu, 11 Dec 2025 01:07:28 +0530 Message-ID: <20251210193728.251147-1-dkarn@redhat.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 viaafs_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 c= ached") Signed-off-by: Deepakkumar Karn --- fs/afs/inode.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index dde1857fcabb..463159f941fc 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -216,7 +216,6 @@ static int afs_inode_init_from_status(struct afs_operat= ion *op, } inode->i_mapping->a_ops =3D &afs_dir_aops; inode_nohighmem(inode); - mapping_set_release_always(inode->i_mapping); break; default: dump_vnode(vnode, op->file[0].vnode !=3D vnode ? op->file[0].vnode : NUL= L); --=20 2.52.0