All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] fs/ntfs3: Add initialization of super block
@ 2021-08-24  7:58 Dan Carpenter
  2021-08-24 10:33 ` Kari Argillander
  2026-02-09 15:24 ` [PATCH] fs/ntfs3: avoid calling run_get_entry() when run == NULL in ntfs_read_run_nb_ra() Konstantin Komarov
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-08-24  7:58 UTC (permalink / raw)
  To: almaz.alexandrovich; +Cc: ntfs3

Hello Konstantin Komarov,

The patch 82cae269cfa9: "fs/ntfs3: Add initialization of super block"
from Aug 13, 2021, leads to the following
Smatch static checker warning:

	fs/ntfs3/index.c:238 bmp_buf_get()
	warn: 'bh' could be an error pointer

fs/ntfs3/index.c
    229 	data_size = le64_to_cpu(b->nres.data_size);
    230 	if (WARN_ON(off >= data_size)) {
    231 		/* looks like filesystem error */
    232 		return -EINVAL;
    233 	}
    234 
    235 	valid_size = le64_to_cpu(b->nres.valid_size);
    236 
    237 	bh = ntfs_bread_run(sbi, &indx->bitmap_run, off);
--> 238 	if (!bh)
    239 		return -EIO;
    240 
    241 	if (IS_ERR(bh))

This is not a bug, but it is wrong style.  When a function returns both
error pointers and NULL then the NULL return is means the feature is
disabled.  It's not an error.  Just that the feature is turned off
deliberately in the Kconfig or whatever.  Don't print an error message,
just continue with the feature disabled as the admin has requested.

But here NULL is just an error.  The ntfs_bread_run() should do:

	bh = ntfs_bread();
	if (!bh)
		return ERR_PTR(-EIO);
	return bh;

    242 		return PTR_ERR(bh);
    243 
    244 	bbuf->bh = bh;
    245 

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Support needed to continue Smatch work
@ 2026-02-06 13:38 Dan Carpenter
  2026-02-06 13:41 ` [bug report] fs/ntfs3: Add initialization of super block Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2026-02-06 13:38 UTC (permalink / raw)
  To: linux-kernel, ksummit, Bill Fletcher, Randy Linnell,
	Brad Spengler
  Cc: vincent.guittot, lina.iyer

I need to post an update on the current situation with Smatch.

First of all, I want to start by thanking Brad Spengler from grsecurity
who reached out to me on this, offered some funding, and has been
trying to push the Smatch work forward.  It really means a lot to me.

Unfortunately, we haven't been able to raise enough support to continue
my Smatch work.  I have still been filtering zero day bot warnings and
I am a bit worried that people have the impression that I'm reviewing
static checker warnings when I am not.

The situation isn't great.  The zero day bot can't do cross function
analsysis and it only looks at checks with a low false positive rate.
We're missing out on a bunch of bugs.  I'm going to add some of the
those missed warnings to this thread so people have a better picture of
what we're missing.  There are some buffer overflows in there.  A bunch
of off by one bugs.  A missing error code in fork().  And random other
minor things as well.

https://lore.kernel.org/all/caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain/

I am still trying to figure out a way to restart Smatch checking.  The
funding model would be that several companies would support this project
by paying a proportion of my salary.  Part of that goes to reporting
bugs like the ones above and part of that goes to developing Smatch and
writing new checks.  Please, contact
Bill Fletcher <bill.fletcher@linaro.org> if you would like to support
this work.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-09 15:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-24  7:58 [bug report] fs/ntfs3: Add initialization of super block Dan Carpenter
2021-08-24 10:33 ` Kari Argillander
2026-02-09 15:24 ` [PATCH] fs/ntfs3: avoid calling run_get_entry() when run == NULL in ntfs_read_run_nb_ra() Konstantin Komarov
  -- strict thread matches above, loose matches on Subject: below --
2026-02-06 13:38 Support needed to continue Smatch work Dan Carpenter
2026-02-06 13:41 ` [bug report] fs/ntfs3: Add initialization of super block Dan Carpenter
2026-02-09 10:20   ` Konstantin Komarov

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.