aboutsummaryrefslogtreecommitdiff
path: root/net/unix/sysctl_net_unix.c
diff options
context:
space:
mode:
authorAndrew G. Morgan <[email protected]>2008-05-27 22:05:17 -0700
committerChris Wright <[email protected]>2008-05-31 16:36:16 -0700
commitca05a99a54db1db5bca72eccb5866d2a86f8517f (patch)
treeb39fba6604da4b4f77103d2769bb783118b9b508 /net/unix/sysctl_net_unix.c
parentcc94bc37d5e02aaf8a6409a28e3c62bbd479b9a8 (diff)
capabilities: remain source compatible with 32-bit raw legacy capability support.
Source code out there hard-codes a notion of what the _LINUX_CAPABILITY_VERSION #define means in terms of the semantics of the raw capability system calls capget() and capset(). Its unfortunate, but true. Since the confusing header file has been in a released kernel, there is software that is erroneously using 64-bit capabilities with the semantics of 32-bit compatibilities. These recently compiled programs may suffer corruption of their memory when sys_getcap() overwrites more memory than they are coded to expect, and the raising of added capabilities when using sys_capset(). As such, this patch does a number of things to clean up the situation for all. It 1. forces the _LINUX_CAPABILITY_VERSION define to always retain its legacy value. 2. adopts a new #define strategy for the kernel's internal implementation of the preferred magic. 3. deprecates v2 capability magic in favor of a new (v3) magic number. The functionality of v3 is entirely equivalent to v2, the only difference being that the v2 magic causes the kernel to log a "deprecated" warning so the admin can find applications that may be using v2 inappropriately. [User space code continues to be encouraged to use the libcap API which protects the application from details like this. libcap-2.10 is the first to support v3 capabilities.] Fixes issue reported in https://bugzilla.redhat.com/show_bug.cgi?id=447518. Thanks to Bojan Smojver for the report. [[email protected]: s/depreciate/deprecate/g] [[email protected]: be robust about put_user size] [[email protected]: coding-style fixes] Signed-off-by: Andrew G. Morgan <[email protected]> Cc: Serge E. Hallyn <[email protected]> Cc: Bojan Smojver <[email protected]> Cc: [email protected] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Chris Wright <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions