Patch Name: PHKL_11825 Patch Description: s700 10.10 chown() limit, mknod and utime cumulative patch Creation Date: 97/07/16 Post Date: 97/07/25 Hardware Platforms - OS Releases: s700: 10.10 Products: N/A Filesets: OS-Core.CORE-KRN Automatic Reboot?: Yes Status: General Superseded Critical: No Path Name: /hp-ux_patches/s700/10.X/PHKL_11825 Symptoms: PHKL_11825: When a user specifies the owner and group value of a file to be 60,000 (Decimal), the chown command fails. But when he specifies a value of 100,000, the chown command takes the last 16 bits and modifies the ownership of the file. (in this case chown command should fail). According to chown man page, the maximum value for uid and gid should be less than 60,000 and any specified value which is greater than or equal to UID_MAX (60,000) is INVALID and chown should return an error code (EINVAL). PHKL_7761: Setting a negative timestamp with utime() fails PHKL_6486: mknod with mode S_IFSOCK appears to succeed, though the file it makes doesn't actually do anything. According to XPG4v2 mknod S_IFSOCK should return EINVAL. Defect Description: PHKL_11825: There is NO check in chown() system call for values of uid/gid which are greater or equal to UID_MAX (60,000). uid and gid are of type int (signed) and when they are assigned to va_uid and va_gid for doing a vnode operation, they are casted to 16-bit shorts. So the truncated values are passed onto the file system. uid and gid are defined as: register struct a { char *fname; int uid; int gid; } *uap; And va_uid and va_uid are defined as: u_short va_uid; /* owner user id */ u_short va_gid; /* owner group id */ Now in chown() we are assigning va_uid to uid thus truncating those values to 16-bits. vattr.va_uid = uap->uid; vattr.va_gid = uap->gid; NOTE: Some signed uid/gids are valid. e.g. -2 is used by NFS for "nobody" or "anonymous". We should not be truncating this information by only allowing positive values. All valid negative values fall as unsigned positive values above 60000 and below 65536 (-1 translates to 65535 in 16-bit signed/unsigned conversion). PHKL_7761: Negative time values for file modtimes are not defined in standards. Release 10.0 opted to make such values invalid. Unfortunately, some vendors were using negative times as flags rather than timestamps, and disallowing such values broke the application. The fix was to allow negative timestamps again. PHKL_6486: see above SR: 1653138164 4701311407 5003374389 Patch Files: /usr/conf/lib/libhp-ux.a(vfs_scalls.o) what(1) Output: /usr/conf/lib/libhp-ux.a(vfs_scalls.o): vfs_scalls.c $Date: 97/07/16 15:55:35 $ $Revision: 1.14.89.28 $ PATCH_10.10 (PHKL_11825) cksum(1) Output: 1591236260 25176 /usr/conf/lib/libhp-ux.a(vfs_scalls.o) Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHKL_6486 PHKL_7761 Equivalent Patches: PHKL_11826: s800: 10.10 Patch Package Size: 90 KBytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHKL_11825 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHKL_11825.depot 5b. For a homogeneous NFS Diskless cluster run swcluster on the server to install the patch on the server and the clients: swcluster -i -b This will invoke swcluster in the interactive mode and force all clients to be shut down. WARNING: All cluster clients must be shut down prior to the patch installation. Installing the patch while the clients are booted is unsupported and can lead to serious problems. The swcluster command will invoke an swinstall session in which you must specify: alternate root path - default is /export/shared_root/OS_700 source depot path - /tmp/PHKL_11825.depot To complete the installation, select the patch by choosing "Actions -> Match What Target Has" and then "Actions -> Install" from the Menubar. 5c. For a heterogeneous NFS Diskless cluster: - run swinstall on the server as in step 5a to install the patch on the cluster server. - run swcluster on the server as in step 5b to install the patch on the cluster clients. By default swinstall will archive the original software in /var/adm/sw/patch/PHKL_11825. If you do not wish to retain a copy of the original software, you can create an empty file named /var/adm/sw/patch/PATCH_NOSAVE. Warning: If this file exists when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. It is recommended that you move the PHKL_11825.text file to /var/adm/sw/patch for future reference. To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHKL_11825.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None