From nobody Fri Dec 19 20:37:31 2025 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23FB61F1303 for ; Wed, 8 Jan 2025 09:16:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327798; cv=none; b=jEMUTQ07JHh27wgXhLSAsZt9zLdqGDBfD2hlQ/os4THqIupM8qTS4S3bXcpnuVIsI+5E+3fZEdR2IkEOSHIp0JvEqegeBsQYuktKa+RQRAVrL/OnmALh72XlkXFcA0MxIzbOY9KXAo25sLZZ4xy8MlcTVjbzLpBCvfwOJNkPNfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327798; c=relaxed/simple; bh=dV4S8HOppsFcgVGC7QiJizQ4Lj1XGOeykTyv7xK55N0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=FvSAsC5p2Ok9Bbop1ih8XXpDleJJqG/NLuAtGYjvOOaCsZOBvLoNeMGISbHUX5jOg8RP5rzbWjRHcm9c3CS/NRwMlnxspJHfI4+G67L44xYHs35ulAHS+AyQyWm8khZy0Os5NB8CihC6PkcDo2Ke5oaZubIgo0eSpul/j618MZc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uZcCtTwS; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uZcCtTwS" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-385eed29d17so7846023f8f.0 for ; Wed, 08 Jan 2025 01:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736327794; x=1736932594; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=PvlBj2WN6a6L2RUlTgyxwxKr5oxzoi756bQqygCmbRQ=; b=uZcCtTwSjYooB2860iW+q+xq4ObC7GCz0xj9H30Q6Y7qk/x23Lp5agEGInxwEEi5nM yNn3K3B0ww1WCjWfwalAOZx3VSz9flLqrvYTYF5938QrObffjuPsFC79UAylc51zDhMF 6uzEQRCcUscAwuisoBmqP5lIUwcBA6L7Ras/Hujt8GQw4pMnlbCueYbPD300MYda7b6N PavTDkqN5VZuRdCW9OvNlUOPDbrnwzYIE6d2ifBy1nHY2CEdwrGZ6MyDj0B6yExdIcn9 qiOZNT7gUXwMidIhGWumScuiONrrOHuisraVr3P92V8R7CdM9eAakRut3FLwxZFeIhwP wDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736327794; x=1736932594; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PvlBj2WN6a6L2RUlTgyxwxKr5oxzoi756bQqygCmbRQ=; b=tR3YNBxYKrO18RkROLBSWyJDLcbX1ASmVvw577a/kBjDLbwKodADX+iAmgbs7Cs8qb RlSKsDmTKRCuhYfJYqtBRETbb+3G5OsnwXVquMvPZvqT30WHNR9u47NcjT6P1mwrl91C 5YAzX3rUCmKx99Fg/2OaVRjOhAVBM+ZZ9lxces0an9SZSG4mLVgYjrVYkqN6wWKyJXh/ sGGX0/Ql+uRIubtNyou6nMCy2x2uQEnOXXDFj8X2/A7yNE5d3kA9tC9lj+n2Es6RluyR p2bHUJthIgSY1Zcas/VCtKjd5U8Rjs7oxMCTO0rPsl6u7HN6Xa0N4pVXHqUJkfXFIQqf q3HQ== X-Forwarded-Encrypted: i=1; AJvYcCVLM0+6ah4qfLbyaLHeeOPQ57y+u6U7M0WI1FZ5DPXu3kfZ5YhfdaRg0omPlFHVt8hD59oPsDMusEcPoAI=@vger.kernel.org X-Gm-Message-State: AOJu0YzHNOboJVg/Nsa8RSGVhRBF9KWr/IRdR1LN0gJ6MGzZGM39gHu2 SQaAfbdJBzMMH6AJppgeyeB3A0B6lO8iksTxvNpGZcY8W2zPnzY0ZcGxSGwGZ5w= X-Gm-Gg: ASbGnctAFeTlyfzbhmizKJw4mXG3ZrrnTEP+nk+9ptK8QX7trCcsSGQmBI/+crVDZNK btLAasddAn8GrXVDyRTLDRkh5yrIbKPnOYfIi4uhgEz5CQTQfSvbvUVQShgQY6gqTP6gisJcdn7 7WQNYvJTxZFNCJvRH70b9R9eR/yE1PE2EPn8j5ttOhfcFjTBZ/696TWIxFtcaNv21TAS2sIIo+7 evs9C6JXAQHAF88DjqQ+aRTCFbP6keEFtSKbZfN/He/KCEHCttfD/k5S1+GIw== X-Google-Smtp-Source: AGHT+IEjLSiUbnxzBVHorfr2BhZyDJueASVdBNF9i3EuS8moSquAx10MsoZpGiupe/eVUlbWfTnYmg== X-Received: by 2002:a5d:6d09:0:b0:386:1c13:30d5 with SMTP id ffacd0b85a97d-38a872f6ebfmr1477142f8f.7.1736327794371; Wed, 08 Jan 2025 01:16:34 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da70easm13947315e9.1.2025.01.08.01.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 01:16:34 -0800 (PST) Date: Wed, 8 Jan 2025 12:16:30 +0300 From: Dan Carpenter To: Matthew Wilcox Cc: Phillip Lougher , Andrew Morton , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] squashfs: Fix a NULL vs IS_ERR() bug Message-ID: <7b7f44d6-9153-4d7c-b65b-2d78febe6c7a@stanley.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The __filemap_get_folio() functoin never returns NULL, it returns error pointers. This incorrect check would lead to an Oops on the following line when we pass "push_folio" to folio_test_uptodate(). Fixes: 43c73ba98b2c ("squashfs; convert squashfs_copy_cache() to take a fol= io") Signed-off-by: Dan Carpenter Reviewed-by: Phillip Lougher --- fs/squashfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c index da25d6fa45ce..eef1dd462592 100644 --- a/fs/squashfs/file.c +++ b/fs/squashfs/file.c @@ -409,7 +409,7 @@ void squashfs_copy_cache(struct folio *folio, FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT, mapping_gfp_mask(mapping)); =20 - if (!push_folio) + if (IS_ERR(push_folio)) continue; =20 if (folio_test_uptodate(push_folio)) --=20 2.45.2