136 ASSERT_EQ(total_ticks, TICKS_COUNT);
137 pclose(rfp);
138 }
regards,
dan carpenter
On Wed, Aug 21, 2024 at 03:07:27PM -0700, Alexei Starovoitov wrote:
> On Wed, Aug 21, 2024 at 2:50 PM Dan Carpenter
> wrote:
> >
> > On Wed, Aug 21, 2024 at 02:03:17PM -0700, Yonghong Song wrote:
> > >
> > > On 8/19/24 7:34 PM, Hao Ge wrote:
> > > &g
t_xlated_program()") fixed an issue in the test_verifier.c
> > once,but it was reverted this time.
> >
> > Let's solve this issue with the minimal changes possible.
> >
> > Reported-by: Dan Carpenter
> > Closes:
> > https://lore.kernel.org/all/1eb3732f-6
;
>
> and the following (mssind > ARRAY_SIZE()) is just to make verifier happy.
In this case, I was testing code that Smatch couldn't parse completely.
But also I have a different check for "> ARRAY_SIZE()" which deliberately
ignores the value of mssind since I was missing "false positive" bugs like this.
regards,
dan carpenter
^^^
This should be *buf.
456 perror("can't allocate xlated program buffer");
457 return -ENOMEM;
regards,
dan carpenter
bpf_printk("sk=%d\n", sk ? 1 : 0);
76 if (sk)
77 bpf_sk_release(sk);
78 return sk ? TC_ACT_OK : TC_ACT_UNSPEC;
79 }
regards,
dan carpenter
On Mon, Aug 19, 2024 at 09:54:00PM +0300, Dan Carpenter wrote:
> Hello Kuniyuki Iwashima,
>
> Commit a74712241b46 ("selftest: bpf: Test
> bpf_sk_assign_tcp_reqsk().") from Jan 15, 2024 (linux-next), leads to
> the following Smatch static checker warning:
>
>
IE_WSCALE_MASK;
504 ctx->attrs.sack_ok = cookie & BPF_SYNCOOKIE_SACK;
505 ctx->attrs.ecn_ok = cookie & BPF_SYNCOOKIE_ECN;
506
507 return 0;
508 err:
509 return -1;
510 }
regards,
dan carpenter
On Fri, Aug 09, 2024 at 10:19:54AM -0700, Andrii Nakryiko wrote:
> On Fri, Aug 9, 2024 at 4:23 AM Dan Carpenter wrote:
> >
> > Hello Andrii Nakryiko,
> >
> > This is a semi-automatic email about new static checker warnings.
> >
> > Commit 8863238993e2 (&q
On Fri, Aug 09, 2024 at 11:20:48AM -0600, Shuah Khan wrote:
> On 8/9/24 06:32, Dan Carpenter wrote:
> > The "initial_nr_hugepages" variable is unsigned long so it takes up to
> > 20 characters to print, plus 1 more character for the NUL terminator.
> > Unfortunately,
9293b6b015 ("selftests/mm: compaction_test: fix bogus test success and
reduce probability of OOM-killer invocation")
Signed-off-by: Dan Carpenter
---
tools/testing/selftests/mm/compaction_test.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/
ask_nonnull(nullable);
This is dereferenced
87
88 if (nullable)
NULL check is too late
89 bpf_task_release(nullable);
90
regards,
dan carpenter
1 if (p)
Was this NULL check supposed to be checking for the NUL terminator?
1122 p++;
1123 }
regards,
dan carpenter
ot;unknown feature");
> - else if (KNOWN_FEATURES & (1u << i))
> + else if (KNOWN_FEATURES & BIT_ULL(u))
^
Should be i. How does this build? :P
regards,
dan carpenter
gt; > > __ret;
> > > })
> >
> > Sounds good to me, but I'd call them test_malloc, test_calloc, etc. and
> > put them in include/test_util.h
>
> Possibly terrible idea: what if we used kmalloc() and kcalloc()? K is for
> KVM :-)
That's a legit terrible idea... It probably would trigger more static
checker warnings because the general policy is kmalloc() is kernel code
and we *have* to test for errors.
To be honest, I would have just rejected the first patch. You
obviously know this and have said this earlier in the thread but just
for the other people, this is a userspace test that runs for a short
time and then exits. If it gets killed because we don't have enough
memory that's fine. It would be better to just fix the static checker
to not print pointless warnings or educate people to ignore warnings
like this.
Creating the test_malloc() to silence the warning also seems like an
okay idea as well.
regards,
dan carpenter
Thanks!
Acked-by: Dan Carpenter
regards,
dan carpenter
-...@intel.com/config)
compiler: m68k-linux-gcc (GCC) 13.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot
| Reported-by: Dan Carpenter
| Closes: https://lore.kernel.org/r
On Fri, Jan 12, 2024 at 07:39:14AM +0800, David Gow wrote:
> On Thu, 11 Jan 2024 at 02:55, Dan Carpenter wrote:
> >
> > The kunit_device_register() function doesn't return NULL, it returns
> > error pointers. Change the KUNIT_ASSERT_NOT_NULL() to check for
> &
The kunit_device_register() function doesn't return NULL, it returns
error pointers. Change the KUNIT_ASSERT_NOT_NULL() to check for
ERR_OR_NULL().
Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
Signed-off-by: Dan Carpenter
---
It's a pit
The root_device_register() function does not return NULL, it returns
error pointers. Fix the check to match.
Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
Signed-off-by: Dan Carpenter
---
lib/kunit/device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
di
Life hack: Don't put RFC in the subject. Especially if it's a v2 or
higher. No one reads RFC patches.
This patchset seems like a low risk patch to apply.
regards,
dan carpenter
wrong thing. There are between 2-5 places which do this in the kernel.
2) If it's a API that used to return NULL and it's changed to returning
error pointers. I've never seen anyone do this, but I've proposed it as
a solution to make backporting easier.
regards,
dan carpenter
here other kinds of devices which can
be probed?
I feel like you're not valuing your stuff at the right level. This
shouldn't be in debugfs. It should be a first class citizen in sysfs.
The exact format for this information is slightly tricky and people will
probably debate that. But I think most people will agree that it's
super useful.
regards,
dan carpenter
Your talk was interesting at Linux Plumbers.
https://www.youtube.com/watch?v=oE73eVSyFXQ [time +2:35]
This is probably a stupid question, but why not just add something to
call_driver_probe() which creates a sysfs directory tree with all the
driver information?
regards,
dan carpenter
On Tue, Nov 21, 2023 at 01:32:38AM -0800, Zhu Jun wrote:
> From: zhujun2
>
> The opened file should be closed in main(), otherwise resource
> leak will occur that this problem was discovered by code reading
>
> Signed-off-by: zhujun2
> ---
>
> Hi Dan Carpenter
>
in short
running programs. It's different for an operating system or a web
server which is expected to have a long uptime. But these programs are
going to run quickly and then exit so resource leaks are not an issue.
regards,
dan carpenter
now I know
to look for WARN(), lockdep, and KASAN. What other bugs formats do we
have? Probably someone like the syzbot devs have already has written a
script like this?
regards,
dan carpenter
Let me add Richard to the CC list. See lore for more details.
https://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/
On Tue, Oct 31, 2023 at 09:57:48PM +0530, Naresh Kamboju wrote:
> On Mon, 30 Oct 2023 at 14:33, Dan Carpenter wrote:
> >
&g
onal warning finished\n" message at the end.
I haven't actually tested this patch... Daniel, do you have a
list of intentional stack traces we could annotate?
Signed-off-by: Dan Carpenter
---
drivers/gpu/drm/tests/drm_rect_test.c | 2 ++
include/kunit/test.h | 3 +++
kunit_add_action(test, free_suite_set, (void *)free);
279 }
regards,
dan carpenter
bugfs_create_suite() error: 'test_case->log'
> dereferencing possible ERR_PTR()
>
> Signed-off-by: Richard Fitzgerald
> Reported-by: Dan Carpenter
> Fixes: 05e2006ce493 ("kunit: Use string_stream for test log")
> ---
> lib/kunit/debugfs.c | 29 ++
On Tue, Sep 19, 2023 at 02:49:43PM -0400, Rae Moar wrote:
> On Fri, Sep 15, 2023 at 8:58 AM Dan Carpenter
> wrote:
> >
> > Smatch complains that the missing error checks would lead to a crash:
> >
> > lib/kunit/executor_test.c:40 parse_filter_test()
Smatch complains that the missing error checks would lead to a crash:
lib/kunit/executor_test.c:40 parse_filter_test()
error: double free of 'filter.test_glob'
We may as well do it right...
Fixes: a127b154a8f2 ("kunit: tool: allow filtering test cases via glob"
33 matches
Mail list logo