From: Dan Carpenter <error27@gmail.com>
To: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: Markus Elfring <Markus.Elfring@web.de>,
ceph-devel@vger.kernel.org, Alex Markuze <amarkuze@redhat.com>,
Helge Deller <deller@gmx.de>, Ilya Dryomov <idryomov@gmail.com>,
Kees Cook <kees@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ceph: Move a variable assignment behind a condition check in __ceph_remove_cap()
Date: Tue, 14 Jul 2026 10:19:11 +0300 [thread overview]
Message-ID: <alXi78mFuDLaVQ4b@stanley.mountain> (raw)
In-Reply-To: <bd15b4d5ccdcf01a8730380c4d974afaab2c782a.camel@dubeyko.com>
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 <elfring@users.sourceforge.net>
> > 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 <elfring@users.sourceforge.net>
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
next prev parent reply other threads:[~2026-07-14 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 11:35 [PATCH] ceph: Move a variable assignment behind a condition check in __ceph_remove_cap() Markus Elfring
2026-07-13 22:10 ` Viacheslav Dubeyko
2026-07-14 7:19 ` Dan Carpenter [this message]
2026-07-14 7:33 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alXi78mFuDLaVQ4b@stanley.mountain \
--to=error27@gmail.com \
--cc=Markus.Elfring@web.de \
--cc=amarkuze@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=deller@gmx.de \
--cc=idryomov@gmail.com \
--cc=kees@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=slava@dubeyko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.