There is a bug in the Linux kernel capability model for versions through 2.2.15 that allows local users to get root. Sendmail is one of the programs that can be attacked this way. This problem may occur in other capabilities-based kernels.
Solution:
The correct fix is to update your Linux kernel to version 2.2.16. This is the only way to ensure that other programs running on your Linux machine cannot be attacked by this bug.
Workaround:
Sendmail 8.10.2 has added a check to see if the kernel has this bug, and if so will refuse to run. This version also does more detailed checks on certain system calls, notably setuid(2), to detect other possible attacks. Although there are no known attacks, this version is strongly recommended, whether or not you have a vulnerable kernel.
You only need one of the first two files (either the gzip'ed version or the compressed version). The .sig file is a PGP signatures of the tar file (after uncompressing it). It is signed with the Sendmail Signing Key/2000, available on the web site (http://www.sendmail.org/) or on the public key servers.
Note however that installing this Sendmail patch does not fully protect you from attack. Other programs are probably vulnerable.
Details of vulnerability:
The problem lies in the setcap(2) call, which is not documented on most Linux-based systems. This call, based on the unratified Posix 1e draft, attempts to break down root permissions into a series of capabilities. Normally root has all capabilities and normal users have none of the capabilities.
One such capability is the ability of a process to do an arbitrary setuid(2) call. As documented in ISO/IEC 9945-1 (ANSI/IEEE Std 1003.1) POSIX Part 1:
4.2.2.2 Description
...
If {_POSIX_SAVED_IDS} is defined:
(1) If the process has appropriate privileges, the setuid() function sets the real user ID, effective user ID, and the saved set-user-ID to uid.
(2) If the process does not have the appropriate privileges, but uid is equal to the real user ID or the saved set-user-ID, the setuid() function sets the effective user ID to uid; the real user ID and saved set-user-ID remain unchanged by this function call.
The CAP_SETUID capability represents the "appropriate privileges".
Normally this would not be an issue, since a setuid root program would simply have capability reinstated. However, Linux has an added capability CAP_SETPCAP that controls the ability of a process to inherit capabilities; this capability does affect setuid programs. It is possible to set the capabilities such that a setuid program does not have "appropriate privileges." The effect of this is that a root program cannot fully give up its root privileges (since the saved set-user-ID cannot be reset).
Note that checking the return value from setuid() is insufficient; the setuid(getuid()) succeeds even when the process does not have "appropriate privileges."
The sendmail patch attempts a setuid(0) after a setuid(getuid()); under normal circumstances this should fail (unless of course the real uid is root). If this setuid(0) succeeds, then the kernel has failed to properly give up permissions and sendmail will refuse to continue running.
This problem can, of course, appear in any setuid root program that attempts to cede special permissions.