Patch Name: PHKL_14530 Patch Description: s700 10.01 chown() limit, auditing, utime cumulative patch Creation Date: 98/03/16 Post Date: 98/03/26 Hardware Platforms - OS Releases: s700: 10.01 Products: N/A Filesets: OS-Core.CORE-KRN ProgSupport.C-INC Automatic Reboot?: Yes Status: General Release Critical: No (superseded patches were critical) PHKL_6685: OTHER enh Path Name: /hp-ux_patches/s700/10.X/PHKL_14530 Symptoms: PHKL_14530: Software installed from CD gives errors like: "invalid argument and database commit failed" PHKL_11856: audsys(1) shows "** no data available **" in the "next file:" row. PHKL_11645: 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_8841: The auditing commands would not function for system calls past number 314. User would see an error such as "Event=????????". Note: in order to take advantage of this change, the commands patch PHCO_8839 must also be installed. PHKL_6685: utime(2) does not accept negative values PHKL_5836: In 9.X releases, the performance and semantics of O_SYNC were the same as the 10.01 O_DSYNC. Unfortunately, this was a violation of the POSIX standard which was fixed for the 10.0 releases. The consequence of the change was to make O_SYNC more robust but also slower than in the 9.0X releases. You could argue that it is now behaving as per POSIX and you could also argue that HP broke binary compatibility. So... if you have applications that use O_SYNC and you want them to behave is in 9.0X, then you should install this patch. IN ADDITION, you should manually modify the global variable o_sync_is_o_dsync using adb as follows: echo "o_sync_is_o_dsync?W 1" | \ adb -k -w /stand/vmunix /dev/mem echo "o_sync_is_o_dsync/W 1" | \ adb -k -w /stand/vmunix /dev/mem You can do this after the system is up and running without any problems. You can also go back to the 10.01 behavior by re-executing the command lines using a 0 instead of a 1 If you rebuild the kernel, you'll have to re-execute the commands using a 1, since the default value is 0. Defect Description: PHKL_14530: Some CDROMs have files which default to UID -1, so we get into a problem when SD tries to copy a file from CDROM to the filesystem and set the UID as it is on the CD. The copy succeeds, but the CDROM's default -1 UID gets translated to a 16-bit unsigned number (65535). When SD tries to chown() the copy of the file to 65535, however, this is flagged as an invalid UID. PHKL_11856: A code change, using the 10.20 calling profile for fubyte() (which changed at 10.20), was incorrectly backported from 10.20 to 10.01. PHKL_11645: 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_8841: The system constant MAX_SYSCALL, used by auditing, was set to 315, rather then 371 as needed. PHKL_6685: Well, it isn't a defect. According to SVID3 negative values are undefined. HP is allowed to return EINVAL for a negative argument. However, current applications are incorrectly depending on HP-UX to accept a negative value PHKL_5836: This patch provides the 9.0X O_SYNC behavior on a 10.01 system. On a 10.01 system, this is called O_DSYNC. The patch is primarily intended for customers that are running 9.0X applications on their 10.01 systems. SR: 1653134924 1653138164 1653185116 1653222380 4701293142 4701371435 5003374389 Patch Files: /usr/conf/h/audit.h /usr/conf/h/audparam.h /usr/conf/lib/libhp-ux.a(audctl.o) /usr/conf/lib/libhp-ux.a(audit.o) /usr/conf/lib/libhp-ux.a(getevent.o) /usr/conf/lib/libhp-ux.a(kern_dscrp.o) /usr/conf/lib/libhp-ux.a(vfs_scalls.o) /usr/include/sys/audit.h /usr/include/sys/audparam.h what(1) Output: /usr/conf/h/audit.h: audit.h $Date: 96/10/10 15:27:29 $ $Revision: 1.8.72.6 $ PATCH_10.01 (PHKL_8841) /usr/conf/h/audparam.h: audparam.h $Date: 96/10/24 14:42:03 $ $Revision: 1.6.71.5 $ PATCH_10.01 (PHKL_8841) /usr/conf/lib/libhp-ux.a(audctl.o): audctl.c $Date: 97/07/18 16:03:27 $ $Revision: 1.11.72.8 $ PATCH_10.01 (PHKL_11856) /usr/conf/lib/libhp-ux.a(audit.o): audit.c $Date: 96/10/10 15:44:59 $ $Revision: 1.9.72.8 $ PATCH_10.01 (PHKL_8841) /usr/conf/lib/libhp-ux.a(getevent.o): getevent.c $Date: 96/10/10 15:57:57 $ $Revision: 1.7.72.6 $ PATCH_10.01 (PHKL_8841) /usr/conf/lib/libhp-ux.a(kern_dscrp.o): kern_dscrp.c $Date: 95/07/20 17:43:46 $ $Revision: 1.58.72.17 $ PATCH_10.01 (PHKL_5836) /usr/conf/lib/libhp-ux.a(vfs_scalls.o): vfs_scalls.c $Date: 98/03/16 10:38:31 $ $Revision: 1 .13.72.47 $ PATCH_10.01 (PHKL_14530) /usr/include/sys/audit.h: audit.h $Date: 96/10/10 15:27:29 $ $Revision: 1.8.72.6 $ PATCH_10.01 (PHKL_8841) /usr/include/sys/audparam.h: audparam.h $Date: 96/10/24 14:42:03 $ $Revision: 1.6.71.5 $ PATCH_10.01 (PHKL_8841) cksum(1) Output: 4091133304 12921 /usr/conf/h/audit.h 1663996508 15554 /usr/conf/h/audparam.h 3290075400 10148 /usr/conf/lib/libhp-ux.a(audctl.o) 3247252248 12468 /usr/conf/lib/libhp-ux.a(audit.o) 3954057306 3364 /usr/conf/lib/libhp-ux.a(getevent.o) 3880007148 11128 /usr/conf/lib/libhp-ux.a(kern_dscrp.o) 3222672762 22488 /usr/conf/lib/libhp-ux.a(vfs_scalls.o) 4091133304 12921 /usr/include/sys/audit.h 1663996508 15554 /usr/include/sys/audparam.h Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHKL_5836 PHKL_6685 PHKL_8841 PHKL_11645 PHKL_11856 Equivalent Patches: PHKL_13972: s700: 10.10 PHKL_13973: s800: 10.10 PHKL_14531: s800: 10.01 Patch Package Size: 160 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_14530 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHKL_14530.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_14530.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_14530. 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_14530.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_14530.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None