Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Helge Deller" <deller@gmx.de>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	"Kees Cook" <kees@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	kernel-janitors@vger.kernel.org, linux-hardening@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init()
Date: Mon, 20 Jul 2026 11:52:24 +0200	[thread overview]
Message-ID: <e624499c-7fff-4c77-8f4d-0fb8c0d0814c@web.de> (raw)
In-Reply-To: <5a13f19d-4ba0-40d4-b061-0d17156b1686@gmx.de>

>>>> The address of a data structure member was determined before
>>>> a corresponding null pointer check in the implementation of
>>>> the function “ics5342_init”.
>>>>
>>>> Thus avoid the risk for undefined behaviour by moving the assignment
>>>> for the variable “info” behind a condition check.
>>>>
>>>> This issue was detected by using the Coccinelle software.
>>>
>>> There is no "risk" here.
>>> It just adds an offset to a potential NULL value (which isn't then used afterwards).
>> Does your understanding of programming language details differ from the view of
>> SEI CERT C Coding Standard (from the Carnegie Mellon University)?
>> https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/rules/expressions-exp/exp34-c/
> My statement still stands.
> Try to find the difference between the code and the examples on that website yourself.
> Tip: The relevant part is the "&" and in doubt look at the generated assembly code.
Do any more code reviewers take another look at results from undefined behaviour sanitizers?

* https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#introduction

* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/ubsan.rst?h=v7.2-rc3#n6


See also:
https://stackoverflow.com/questions/79662603/why-do-compilers-not-warn-about-this-null-dereferencing-even-when-they-detect-i#answer-79663272

Regards,
Markus

  parent reply	other threads:[~2026-07-20  9:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 10:18 [PATCH] fbdev: arkfb: Move a variable assignment behind a condition check in ics5342_init() Markus Elfring
2026-07-18 18:17 ` Helge Deller
2026-07-18 20:34   ` Markus Elfring
2026-07-18 20:59     ` Helge Deller
2026-07-19  6:50       ` Markus Elfring
2026-07-20  9:52       ` Markus Elfring [this message]
2026-07-18 21:47     ` Uwe Kleine-König
2026-07-19  7:24       ` 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=e624499c-7fff-4c77-8f4d-0fb8c0d0814c@web.de \
    --to=markus.elfring@web.de \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kees@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox