Oren Laadan's Top 10 Programming
Mistakes Made By COMS W4118 Students
- Incorrect syscall prototypes: (use: "asmlinkage long", "__user")
- Missing validation of syscall arguments
- Incorrect error reporting (use: "return -EINVAL;")
- Incorrect/incomplete error path (e.g., no cleanup, memory leaks)
- Sleeping while holding a spinlock (e.g., semaphore, memory alloc)
- Access to volatile pointers w/o a lock and w/o holding a reference
- Access to static/global variables without locking
- Missing test for success of operations (or of proper setup)
- Emitting debug messages or other unnecessary messages
- Using C++ code constructs (when told to use "C")