Patch Name: PHKL_25033 Patch Description: s700_800 11.04 (VVOS) ufs(hfs) deadlock causes system hang Creation Date: 01/08/24 Post Date: 01/08/29 Hardware Platforms - OS Releases: s700: 11.04 s800: 11.04 Products: N/A Filesets: OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP Automatic Reboot?: Yes Status: General Release Critical: Yes PHKL_25033: HANG Based on HP-UX Patch PHKL_22932: HANG Category Tags: defect_repair general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHKL_25033 Symptoms: PHKL_25033: Ported HP-UX patch PHKL_22932 to VVOS Based on HP-UX patch PHKL_22932: (SR:8606160762 CR:JAGad30082) A deadlock occurs while mmaping part of a file into a buffer, and when that buffer is used to do a read or write call to the very same file. If the file is opened with file descriptor "fd", and the same file is memory mapped to the region starting at address "addr", I/O to that file done with system call write/read will cause the system to hang. The problem occurs with UFS and some versions of netscape mail server. The thread will deadlock itself with the stack trace: ilock_reader+0x170 ufs_lock_inode+0x14 ufs_pagein+0x60 virtual_fault+0x378 vfault+0x118 trap+0x590 nokgdb+0x8 copyin+0x104 uiomove+0xc0 rwip+0x380 ufs_rdwr+0xe0 vno_rw+0x80 write+0x104 syscall+0x480 Defect Description: PHKL_25033: Ported HP-UX patch PHKL_22932 to VVOS Based on HP-UX patch PHKL_22932: (SR:8606160762 CR:JAGad30082) A deadlock occurs because write to a rwip requires an inode lock in ilock() and later uiomove (copying from the user buffer to the buffer cache) can trigger a vfault which requires a read lock on the same inode. The deadlock occurs on the inode between read/write and ufs_pagein() when a page fault occurs on a mmaped buffer during the uiomove called by the read/write system call. Resolution: In ufs_pagein(), if the inode lock is already owned by the current thread, it is not locked again. This is the only path were a inode lock is tried to be locked twice, first in write mode then in reade mode. Ignoring the second locking is good enough to avoid the deadlock and does not break any protection. SR: 8606160762 Patch Files: OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: /usr/conf/lib/libhp-ux.a(ufs_vm.o) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: /usr/conf/lib/libhp-ux.a(ufs_vm.o) what(1) Output: OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: /usr/conf/lib/libhp-ux.a(ufs_vm.o): ufs_vm.c $Date: 2000/12/11 16:04:11 $Revision: r11ro s/3 PATCH_11.00 (PHKL_22932) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: /usr/conf/lib/libhp-ux.a(ufs_vm.o): ufs_vm.c $Date: 2000/12/11 16:04:11 $Revision: r11ro s/3 PATCH_11.00 (PHKL_22932) cksum(1) Output: OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_32,v=HP: 3329501374 14136 /usr/conf/lib/libhp-ux.a(ufs_vm.o) OS-Core.CORE2-KRN,fr=B.11.04,fa=HP-UX_B.11.04_64,v=HP: 120643841 24816 /usr/conf/lib/libhp-ux.a(ufs_vm.o) Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: PHKL_22932: s700: 11.00 s800: 11.00 Patch Package Size: 60 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_25033 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHKL_25033.depot By default swinstall will archive the original software in /var/adm/sw/save/PHKL_25033. If you do not wish to retain a copy of the original software, use the patch_save_files option: swinstall -x autoreboot=true -x patch_match_target=true \ -x patch_save_files=false -s /tmp/PHKL_25033.depot WARNING: If patch_save_files is false when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. For future reference, the contents of the PHKL_25033.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHKL_25033.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHKL_25033.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None