Patch Name: PHKL_23335 Patch Description: s700_800 11.11 solve inode deadlock with mmap and pagefault Creation Date: 01/02/15 Post Date: 01/05/01 Hardware Platforms - OS Releases: s700: 11.11 s800: 11.11 Products: N/A Filesets: OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_32,v=HP OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_64,v=HP Automatic Reboot?: Yes Status: General Release Critical: Yes PHKL_23335: HANG Category Tags: defect_repair general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHKL_23335 Symptoms: PHKL_23335: ( SR:8606176542 CR:JAGad45781 ) 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_23335: ( SR:8606176542 CR:JAGad45781 ) 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 read mode. Ignoring the second locking is good enough to avoid the deadlock and does not break any protection. SR: 8606176542 Patch Files: OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_32,v=HP: /usr/conf/lib/libvm.a(ufs_vm.o) OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_64,v=HP: /usr/conf/lib/libvm.a(ufs_vm.o) what(1) Output: OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_32,v=HP: /usr/conf/lib/libvm.a(ufs_vm.o): ufs_vm.c $Date: 2001/02/06 16:51:53 $Revision: r11.1 1/1 PATCH_11.11 (PHKL_23335) OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_64,v=HP: /usr/conf/lib/libvm.a(ufs_vm.o): ufs_vm.c $Date: 2001/02/06 16:51:53 $Revision: r11.1 1/1 PATCH_11.11 (PHKL_23335) cksum(1) Output: OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_32,v=HP: 1351244775 13032 /usr/conf/lib/libvm.a(ufs_vm.o) OS-Core.CORE2-KRN,fr=B.11.11,fa=HP-UX_B.11.11_64,v=HP: 1938131951 23504 /usr/conf/lib/libvm.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_23335 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHKL_23335.depot By default swinstall will archive the original software in /var/adm/sw/save/PHKL_23335. 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_23335.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_23335.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHKL_23335.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHKL_23335.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None