simple_write_to_buffer() is complicated
The simple_write_to_buffer() function is complicated and should mostly be avoided.
(mostly Smatch stuff)
The simple_write_to_buffer() function is complicated and should mostly be avoided.
AI is a powerful tool and the kernel community uses AI. However, if an AI writes something for you and you can't be bothered to read it then don't send it. Just delete it.
How to review Magical One Function Cleanup.
An investigation into whether Smatch would have prevented a recent security issue in rsync.
Bloviations on the topic of static analysis and style debates.
TL/DR; Smatch has a warning "warn: sleeping in atomic context". People sometimes want to know why they don't see these warnings when they run Smatch. It requires the cross function database. Generating the cross function database is really time consuming and probably not worth it. Instead try to reproduce the warning at runtime by enabling the CONFIG_DEBUG_ATOMIC_SLEEP=y option.
There are a lot of people who write "return ret;" when they mean "return 0;" I feel like I'm the person who cares about this the most in the world, but hopefully after reading this blog you will notice it as well and it will annoy you.
This is no longer a debate in the Linux kernel, but I saw some code written in out of date style recently and it was a moment of reminiscing. You used to see code like this: You should never use == NULL or != NULL. This rule is enforced by checkpatch. Comparing against zero is […]
The kernel has a number of strcpy() functions that copy a string from one pointer to another. This blog is a short guide. strcpy() is dangerous because it has no bounds checking and can lead to a buffer overflow. strncpy() will not overflow the destination buffer. But the problem is that if it has to […]
I really believe in static checkers but sometimes static checker advice is wrong and harmful. For example, earlier in the week we made a buffer 16 bytes larger to silence checker false positive. Another time we got into a pointless argument about how to silence a different checker false positive. The best way to deal […]