Patch Name: PHKL_22677

Patch Description: s700_800 11.00 fix of getdirentries, MVFS, rcp, mmap & IDS

Creation Date: 00/11/15

Post Date: 00/11/21

Hardware Platforms - OS Releases:
	s700: 11.00
	s800: 11.00

Products: N/A

Filesets:
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP

Automatic Reboot?: Yes

Status: General Release

Critical:
	No (superseded patches were critical)
	PHKL_22097: MEMORY_LEAK
	PHKL_22022: HANG
	PHKL_21885: CORRUPTION
		A clean file on VxFS can be marked bad.
	PHKL_19311: OTHER
		Loss of coherency between IO and mmap
	PHKL_17543: PANIC
	PHKL_16983: CORRUPTION

Category Tags:
	defect_repair enhancement general_release critical panic
	halts_system corruption memory_leak

Path Name: /hp-ux_patches/s700_800/11.X/PHKL_22677

Symptoms:
	PHKL_22677:
	( SR: 8606166417 CR: JAGad35704 )
	When getdents() is incorrectly called with a regular
	file in a VxFS(JFS) file system, the following message
	will be reported and the clean file can be marked bad:

	"vxfs: mesg 008: vx_direrr-<FS> file system inode \
					X block Y error 6"
	or
	"vxfs: mesg 017: vx_dirbread - <FS> file system inode \
						X marked bad"
	or
	"vxfs: mesg 016: vx_ilisterr - <FS> file system error \
						reading inode X"

	PHKL_22097:
	( SR: 8606141023 CR: JAGad10384 )
	The stat() routine does not return a valid inode when
	used on a MVFS filesystem with a 64-bit executable.

	PHKL_22022:
	( SR: 8606143417 CR: JAGad12747 )
	rcp(1) command hangs on 11.00 while copying sparse file
	from local HFS file system to remote node.

	PHKL_21885:
	( SR: 8606140236 CR: JAGad09558 )
	When getdirentries() is incorrectly called with a regular
	file in a VxFS(JFS) file system, the following message will
	be reported and the clean file can be marked bad:

	   "vxfs: mesg 008: vx_direrr - <FS> file system inode X
	    block Y error 6"   or
	   "vxfs: mesg 017: vx_dirbread - <FS> file system inode X
	    marked bad"        or
	   "vxfs: mesg 016: vx_ilisterr - <FS> file system error
	    reading inode X"

	PHKL_21349:
	( SR: 8606132612 CR: JAGad01761 )
	The Praesidium IDS/9000 product requires this patch in order
	to run.  This patch has no impact on systems without the
	Praesidium IDS/9000 product installed and enabled.

	PHKL_19991:
	SR: 5003448100 CR: JAGaa72900
	The HP-UX 11.00 base kernel does not have full support
	for JFS ACLs.

	PHKL_19311:
	When a user mmap's a file and also does reads/writes to it,
	under rare conditions the contents written through "normal
	I/O" will not be seen by mmap, thus losing coherency.  (It
	should be noted that HP-UX provides *limited* support for
	coherency.)

	PHKL_18797:
	SR: 1653138164 DTS: DSDe425274
	Setting a negative timestamp with utime(2) fails.

	PHKL_17543:
	Data page fault Panic caused from lbcopy_gr_method
	Whole disc configuration of 11.00 hp-ux crashed
	with datapage fault several minutes after
	installation/running.

	PHKL_16983:
	The open system call() when done on an NFS mount
	occasionally returns errno=0 and r_val1 = 0. Subsequent
	use of the FD will return EBADF or unintentionally
	send data to the stdin FD...ie 0.

Defect Description:
	PHKL_22677:
	( SR: 8606166417 CR: JAGad35704 )
	getdents() system call did not check if the argument is a
	directory file or a regular file. When it is called
	on a VxFS(JFS) file systems with a regular file,
	VxFS reports an error such as "vxfs:  mesg 008:..."  and
	the clean file can be marked bad.

	Resolution:
	VNODE type check codes have been added in  getdents() to
	verify the argument passed is a directory or a regular file.

	PHKL_22097:
	( SR: 8606141023 CR: JAGad10384 )
	The casting of a variable is not correct for MVFS with
	a 64-bit executable.

	Resolution: A mandatory casting is added before
	assignment to stat from vnode attributes.

	PHKL_22022:
	( SR: 8606143417 CR: JAGad12747 )
	In HFS when there is a hole in a file, ufs_bread() returns a
	buffer filled with 0's and the b_flags field is incorrectly
	set to B_INVAL.  The caller checks this flag before using
	the buffer and considers the buffer to be invalid.

	Resolution:
	To resolve this we reset the B_INVAL flag for this buffer
	so that the caller will use this buffer with 0's instead of
	thinking it is invalid.

	PHKL_21885:
	( SR: 8606140236 CR: JAGad09558 )
	getdirentries() and getdents() system calls did not check if
	the argument is a directory file.  When either were called
	on a VxFS(JFS) file systems with a regular file, VxFS
	reports an error such as "vxfs:  mesg 008:..."  and the
	clean file can be marked bad.

	Resolution:
	VNODE type check codes have been added in getdirentries()
	and getdents().

	PHKL_21349:
	( SR: 8606132612 CR: JAGad01761 )
	This patch is one of 16 patches (PHKL_21348-PHKL_21363)
	required by the Praesidium IDS/9000 product.  These patches
	enable the collection and tracking of information from
	various system calls.  Unless all of the enabling patches
	(or their successors) and the product are installed, and the
	product is enabled, this patch has no impact on the system.

	Resolution:
	This patch enables the gathering of information from the
	filesystem system calls.

	PHKL_19991:
	SR: 5003448100 CR: JAGaa72900

	Support for the 'acl()' system call (for JFS ACLs) was not
	complete in the VFS layer of the filesystem. Add the
	support so that JFS ACLs can be fully enabled in a new JFS
	product.

	PHKL_19311:
	When doing writes in vno_rw(), changes were introduced to
	provide at least some limited support for coherency.  When
	vno_rw() is called during writes, if the vnode is mmap'ed,
	the page cache is flushed, the I/O is completed, and the
	page cache is purged.  The purge is necessary since somebody
	could bring in a stale copy from disk while I/O is not yet
	complete.  But the VOP_RDWR is advancing the uio_offset that
	is used in the purge operation.  This results in incorrect
	purge, and thus a loss of coherency.
	Resolution:
	Save the uio_offset before performing the VOP_RDWR and use
	it during the purge.

	PHKL_18797:
	SR: 1653138164 DTS: DSDe425274
	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.

	Resolution:
	Allow negative timestamps again.

	PHKL_17543:
	The panic is caused by passing a NULL pointer to lbcopy().

	The stack trace looks like:

	Stack trace from the first crash event:
	  stack trace for event 0
	  crash event was a panic
	       FMP              SSP
	  panic+0x14
	                n/a
	  report_trap_or_int_and_panic+0x4c
	  trap+0xe8c
	  $RDB_trap_patch+0x20
	  lbcopy_gr_method+0x36c
	  uiomove+0x220
	  ufs_readdir+0x17c
	  generic_readdir2+0xc8
	  ufs_readdir2+0x14
	  rfs_readdir+0x184
	  rfsexp_dispatch+0x5b4
	  svc_getreq+0x1f8
	  svc_run+0x664
	  nfsexp_svc+0x3f8
	  nfs_stub_svc+0x1c4
	  coerce_scall_args+0x9c
	  syscall+0x1c8
	  $syscallrtn+0x0

	Actually, there was a change done in 'generic_readdir2'
	in 11.00 to make a variable 'count' a multiple of 8
	to avoid trap 18.  But, a mismatch between count and
	uio_resid was created when the above change was made.
	That mismatch resulted in this defect.

	There is no easy way of re-producing this defect.

	PHKL_16983:
	The return value for the system call (the file descriptor)
	is kept in u.u_r.r_val1. This variable sometimes gets
	changed if the file is on NFS. Now the value is saved and
	restored in u.u_r.r_val1 before returning from copen().

SR:
	1653138164 4701413302 5003425678 5003448100 8606100288
	8606132612 8606140236 8606141023 8606143417 8606166417

Patch Files:
	
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP:
	/usr/conf/lib/libhp-ux.a(vfs_io.o)
	/usr/conf/lib/libhp-ux.a(vfs_scalls.o)
	/usr/conf/lib/libufs.a(ufs_vnops.o)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	/usr/conf/lib/libhp-ux.a(vfs_io.o)
	/usr/conf/lib/libhp-ux.a(vfs_scalls.o)
	/usr/conf/lib/libufs.a(ufs_vnops.o)

what(1) Output:
	
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP:
	/usr/conf/lib/libhp-ux.a(vfs_io.o):
		vfs_io.c $Date: 2000/07/27 07:45:55 $Revision: r11ro
			s/10 PATCH_11.00 (PHKL_22097)
	/usr/conf/lib/libhp-ux.a(vfs_scalls.o):
		vfs_scalls.c $Date: 2000/11/03 08:29:56 $Revision: r
			11ros/12 PATCH_11.00 (PHKL_22677)
	/usr/conf/lib/libufs.a(ufs_vnops.o):
		ufs_vnops.c $Date: 2000/07/12 07:30:09 $Revision: r1
			1ros/14 PATCH_11.00 (PHKL_22022)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	/usr/conf/lib/libhp-ux.a(vfs_io.o):
		vfs_io.c $Date: 2000/07/27 07:45:55 $Revision: r11ro
			s/10 PATCH_11.00 (PHKL_22097)
	/usr/conf/lib/libhp-ux.a(vfs_scalls.o):
		vfs_scalls.c $Date: 2000/11/03 08:29:56 $Revision: r
			11ros/12 PATCH_11.00 (PHKL_22677)
	/usr/conf/lib/libufs.a(ufs_vnops.o):
		ufs_vnops.c $Date: 2000/07/12 07:30:09 $Revision: r1
			1ros/14 PATCH_11.00 (PHKL_22022)

cksum(1) Output:
	
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP:
	3728388624 8208 /usr/conf/lib/libhp-ux.a(vfs_io.o)
	3312870496 42060 /usr/conf/lib/libhp-ux.a(vfs_scalls.o)
	3322196295 37972 /usr/conf/lib/libufs.a(ufs_vnops.o)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	3347290911 15792 /usr/conf/lib/libhp-ux.a(vfs_io.o)
	1128979454 102880 /usr/conf/lib/libhp-ux.a(vfs_scalls.o)
	551276515 75592 /usr/conf/lib/libufs.a(ufs_vnops.o)

Patch Conflicts: None

Patch Dependencies:
	s700: 11.00: PHKL_18543
	s800: 11.00: PHKL_18543

Hardware Dependencies: None

Other Dependencies: None

Supersedes:
	PHKL_22097 PHKL_22022 PHKL_21885 PHKL_21349 PHKL_19991 PHKL_19311
	PHKL_18797 PHKL_17543 PHKL_16983

Equivalent Patches: None

Patch Package Size: 320 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_22677

	5. Run swinstall to install the patch:

		swinstall -x autoreboot=true -x patch_match_target=true \
			  -s /tmp/PHKL_22677.depot

	By default swinstall will archive the original software in 
	/var/adm/sw/save/PHKL_22677.  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_22677.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_22677.text file is 
	available in the product readme:

		swlist -l product -a readme -d @ /tmp/PHKL_22677.depot

	To put this patch on a magnetic tape and install from the
	tape drive, use the command:

		dd if=/tmp/PHKL_22677.depot of=/dev/rmt/0m bs=2k

Special Installation Instructions:
	This patch depends on base patch PHKL_18543.
	For successful installation please insure that PHKL_18543
	is already installed, or that PHKL_18543 is included
	in the same depot with this patch and PHKL_18543
	is selected for installation.

