3 ms·
When you see something like this: /* args points to a PAGE_SIZE buffer, AppArmor requires that * the buffer must be null terminated or have size <= PA
by Animats 10y ago
When you see something like this:
/* args points to a PAGE_SIZE buffer, AppArmor requires that
* the buffer must be null terminated or have size <= PAGE_SIZE -1
* so that AppArmor can null terminate them
*/
you just have to expect exploits.
This is a problem that comes up repeatedly in the Linux kernel. When some kernel call accepts or returns variable-length data, the details are handled locally, not in some general-purpose functions for moving variable-sized data in and out of the kernel safely. That's likely to lead to some checks not being made.
- qb45 10y agoNitpick: it's an internal kernel function being called by another kernel function, not a user-kernel interface. What you seem to want is a general-purpose string implementation for shuffling data around. With a safe append() preferably.
- Animats 10y agoYes. That's why we have collections in most languages now.