Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
audit: added capacity and reserve() to nlmsg
There are now two (permitted) ways to add data to netlink message: 1. put_xxx() 2. call nlmsg_reserve() to get a pointer to newly reserved room within the original netlink message, then write or memcpy data to that area. Both of them guarantee adding requested length data do not overflow the pre-allocated message buffer by checking against its cap field first. And there may be no need to access nlmsg_len outside nl module, because both put_xxx() and nlmsg_reserve() have alread did that for us. Signed-off-by: Shuai Zhang <zs.broccoli@gmail.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
- Loading branch information