From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (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 17D2F3ED3B3 for ; Tue, 14 Jul 2026 07:19:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784013560; cv=none; b=HmpsF4thTMPfL7MwHG6DrksP59PS7rn6g8uFgUQfizVtObF5mD7trS+nl+bfVYg09+zG1MRM852/yJh9EHyYd2/nwpu+Ozsor+HX7mR/xOK+w1bMAdLxpCyX+4Vq4eWPmiXwNIGW0slUWgFKCjNd1Yew+cJ19obovRlEKqMoaVc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784013560; c=relaxed/simple; bh=kIERie8dbqx2+eAvdsr037DRwXWzmtXALWanJlNJzi4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l7ubf4miLvLUW9dwUDe8i0410DS8jHSJiOjmWj3BxEd+/KYdib2vjYdZyINkQ4JWmX4Gi6FelYwvGjQFyXZ9RE1zuWRq6jARP9fPfoz20FXM8Ab2/MGf10B+NQpTuN779pyp7lYEuYnepe26gPaBqEtXKf1vUj5FIngmv6KSbD4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l9Ty8bRM; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l9Ty8bRM" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-7ebd88be784so334377a34.2 for ; Tue, 14 Jul 2026 00:19:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784013558; x=1784618358; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/lycI0z8Y1t9+PubOdFL76Fa/oKSxmR3LtUe6RN9X5A=; b=l9Ty8bRMZ40fguL72C53R45aZma+3XUfdp1+oyWyLdLSpl6D4C19CO5zGNDenqXBA6 BJFBTqlnwiQDe2FZZQEI+7POWvE/QpgaJ1FVcxqoR5JwpKq4hpWIMgDL2RVl5NTZwQtD FhySSE6dSng+C2FsveUkpRjryk2W9p523f9Jf2s2GtNcV8i6NxDR1dbviFrnE4dCc6uV EAONsTw/CJyvOfMrS2OOF2uzbr3/uCExtYIplMQ8/CLOknMYtaZHhBBmcSriFVVDvHgZ W8rkDjs7oieEilvbNCfz+YasMoZrTdAGQlerxfioFmE7PTPKHf5kelbKLHDbF8yXQO32 UiJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784013558; x=1784618358; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=/lycI0z8Y1t9+PubOdFL76Fa/oKSxmR3LtUe6RN9X5A=; b=B+CDSxIvTQNjFoAgLrDg2roY9tvi5MFsM1r//gfnBlFcWKwk9o9ODX0ufWDHB1B5Cp tI3KfdeVdrMTGxWs5z1sn9wprP7ZhwbjxXclh0lM7pVjG6zr0MknjzrJbt6RTgeBzJmK jvPSwCWzdHoNjP1M5Fvi0EzNG2KVam5996dJwk9aZf+7WRSgG9/nDGb5DreLuYo+1i2k b0R/jurP76gxcAUW/qMfAfhc6aXhaQMh7MV0koauK18pp3i3Vmb8jbBHI97+uAlDUN0j nzl2zPFHFRjXpPEbAbjQ5nVQOPXeIm5U7Wo5pQPiOYXWMXsTSoeBIoqeYro/kDDpJVDs 6lyw== X-Forwarded-Encrypted: i=1; AFNElJ+tY/FSrDG5r1DSIeKFCGsa+7r2wxMm5rqOkV7uHmaDrxrS3MRDLMQKC4mrOYj97pY3Cq+Sa1UAKV2kP0I=@vger.kernel.org X-Gm-Message-State: AOJu0YzvNisIWV+eKTxXmCUbKMdQMv4GRZ/e4vGogM/guck9mS/0Blw7 qHIUR5xzILkZWV02NiihOhmwpBC+P+QuNKFnJq7zneZLqM61MAMefKFu X-Gm-Gg: AfdE7clNQD0p2VbdlA33pHe6yOL/hdgIhSSLXfLUzeb/W5GJRqv5At4BKhkCgQHvY3J ZENijgKogRZHstGSV3ffBL8w3gRptNmrXNZZuZRbv+KPpTo7RA3QRyTibfS5jbreM8gRzG5fdWL MWbS2xUzKOHvsJveCqyyjz7qQV/aJivgky8F2u63An3nQpE4aEpZO7c+MWvzxycVKffPrK6wxAe asZDQcYKLzX0P4Z0XVhwdVgdMTAd4cCa+rhOycUOhPQuGgxXAuFU6TefAJgUOxQkvYeV4Bchj/t K+BV0/TASYDQgGZ/SfgWrqlNv+zsDSYWQsNXV3YDH02MEL36Ztwp8F2DdIpd6kR1v82Uy44Qrnm deOZu7y0YsOp4eRUkIT0DejSxRShxcKx5kh/EI/UmV1rs/CcCjiPc4i8wyWDovHTF5LA2iN/7MY RT8+nz X-Received: by 2002:a05:6820:4cc1:b0:6a3:916a:1d26 with SMTP id 006d021491bc7-6a39a8561bemr7965231eaf.61.1784013557982; Tue, 14 Jul 2026 00:19:17 -0700 (PDT) Received: from localhost ([74.80.182.78]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7ec14489139sm6783167a34.5.2026.07.14.00.19.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 00:19:16 -0700 (PDT) Date: Tue, 14 Jul 2026 10:19:11 +0300 From: Dan Carpenter To: Viacheslav Dubeyko Cc: Markus Elfring , ceph-devel@vger.kernel.org, Alex Markuze , Helge Deller , Ilya Dryomov , Kees Cook , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] ceph: Move a variable assignment behind a condition check in __ceph_remove_cap() Message-ID: References: <5010d7d4-e321-4999-aca6-1caa040f3037@web.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Jul 13, 2026 at 03:10:40PM -0700, Viacheslav Dubeyko wrote: > On Mon, 2026-07-13 at 13:35 +0200, Markus Elfring wrote: > > From: Markus Elfring > > Date: Mon, 13 Jul 2026 13:21:29 +0200 > > > > The address of a data structure member was determined before > > a corresponding null pointer check in the implementation of > > the function “__ceph_remove_cap”. > > > > Thus avoid the risk for undefined behaviour by moving the assignment > > for the variable “inode” behind a condition check. > > > > This issue was detected by using the Coccinelle software. > > > > Fixes: 38d46409c4639a1d659ebfa70e27a8bed6b8ee1d ("ceph: print cluster > > fsid and client global_id in all debug logs") > > Cc: stable@vger.kernel.org > > Signed-off-by: Markus Elfring I have explained to Markus many times that these are not dereferences, they are just pointer math. So the original code works fine and does not need a Fixes tag or a CC to stable. And then Markus responds, "the C standard says we are not allowed to dereference NULL pointers"... Which is true, but again, it's not a dereference. regards, dan carpenter