Patch Name: PHKL_23329

Patch Description: s700_800 11.00 panic, fails for coredump, drivers

Creation Date: 01/02/08

Post Date: 01/02/15

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:
	Yes
	PHKL_23329: PANIC
	PHKL_22968: PANIC
	PHKL_16807: PANIC

Category Tags:
	defect_repair hardware_enablement enhancement
	general_release critical panic

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

Symptoms:
	PHKL_23329:
	( SR: 8606165604 CR: JAGad34895 )
	system panic with the following stack trace:

	0) panic+0x14
	1) report_trap_or_int_and_panic+0x4c
	2) trap+0xea8
	3) $RDB_trap_patch+0x38
	4) psema+0xc
	5) reaquire_semas+0x28
	6) fifo_open+0x2a4

	PHKL_23072:
	( SR:8606168368 CR:JAGad37649 )
	Can not mount the Magneto Optical (MO) device with a 4096
	bytes/sector media. An "unrecognized file system" error
	message will be received when attempting to mount such a
	device.

	PHKL_22968:
	( SR:8606162678 CR:JAGad31994 )
	A DLKM load failure on automatic loading by
	open(2) can result in non-standard error codes
	being returned by open(2).

	( SR:8606170779 CR:JAGad40043 )
	The system will panic if the text and data size of
	a module hits a certain window.

	( SR:8606154498 CR:JAGad23815 )
	None.

	( SR:8606137247 CR:JAGad06365 )
	None

	( SR:8606171142 CR:JAGad40406 )
	If a customer were to use a load/stress script to repeatedly
	register, load, unload, and unregister a single module, AND
	if the customer were to run several copies of this script
	asynchronously, the customer might hit a window in which
	(for WSIO modules) the system panicked.

	PHKL_21029:
	(SR: 8606128506   CR: JAGaa52779)
	When a driver with a long (>15 characters) name is
	configured on the system, kmadmin -k will truncate the
	name while displaying it ("strtelnet_included" is one
	such driver). SAM uses kmadmin -k to assemble the list of
	drivers configured into the system for reconfiguration
	of the kernel, so the user is unable to reconfigure a
	kernel using SAM if a driver with a long name is
	built into the current running kernel.

	PHKL_16807:
	The system may panic.

	PHKL_15552:
	Optimization helps eliminate excess I-cache pre-fetch which
	reduces performance.

Defect Description:
	PHKL_23329:
	( SR: 8606165604 CR: JAGad34895 )
	Two different internal functions usually called by
	different syscalls were instead called sequentially
	by one syscall. Because the first internal function
	changed a global variable but did not restore it
	before it returned, the second function (which
	referenced the same global variable) jumped to an
	invalid place. This causes a system panic.

	Resolution:
	Have each internal function restore the global
	variable before it returns.

	PHKL_23072:
	( SR:8606168368 CR:JAGad37649 )
	When mounting a file system, the drive is considered as a
	block device and is accessed via specfs using fixed block
	io size of 2K. This is ok for all the drives with less or
	equal to 2K bytes sectors. But it is not big enough for
	the devices with the sector size greater then 2K.

	Resolution:
	The block io size for specfs has been changed to 4096 bytes.

	PHKL_22968:
	( SR:8606162678 CR:JAGad31994 )
	DLKM load failure as part of automatic loading when
	open(2) is called results in possibly returning non-standard
	error return codes to open(2).

	Resolution:
	Print errors returned to automatic loading code by
	modld(), then mask the errors by returning ENODEV.

	( SR:8606170779 CR:JAGad40043 )
	If the text and data size of the module combine to be just
	slightly under an integral number of pages, AND the module
	has enough text to require a second long-branch stubs table,
	and the module has a zero-length PROGBITS section (such
	as millicode) before the .text section in the ELF image
	file, an (erroneous) additional second long-branch stubs
	table will be placed after the correct one, overflowing
	the allocated memory and causing a system panic when
	an address in the erroneous additional table is
	dereferenced.

	Resolution:
	Avoid performing actions for zero-length sections of the
	ELF image file.

	( SR:8606154498 CR:JAGad23815 )
	In the debug kernel, the assert treats 0 as an invalid
	major number.

	Resolution:
	Treat 0 as a valid major number.

	( SR:8606137247 CR:JAGad06365 )
	We don't test for a NULL return after a memory allocation
	with M_NOWAIT specified.

	Resolution:
	Check for NULL.  This is largely a non-problem, since,
	if the allocation were to fail, we would have been in
	severe trouble long before reaching this point.

	( SR:8606171142 CR:JAGad40406 )
	There is a window in which it is possible to invalidate
	the drv_info_t structure while another process is
	using it.

	Resolution:
	Close the window by copying the drv_info_t information while
	the device switch table (and hence, the drv_info_t) is
	locked.
	There is a kmalloc with the M_NOWAIT flag set without a
	check for a NULL return.  Since this is a small allocation
	that occurs early in the boot sequence, any memory shortage
	here would have caused a panic long before this point.

	PHKL_21029:
	(SR: 8606128506   CR: JAGaa52779)
	kmadmin -k truncates the names of long (>15 chars) driver
	names.  Several HP driver names are too long.  This patch,
	when used with the commands patch to kmadmin (PHCO_21040),
	will allow the system to have driver names of up to 40
	characters, with support in the kernel (NOT at the
	command level) for names of up to 50 characters (51 with
	terminating NULL included).

	Resolution:
	Define a new structure in modadm.c (to avoid header file
	changes) that is identical to struct mod_smod, except that
	the character array for the module name is 51 characters
	rather than 15.  The same structure must be defined in
	the command file kmtools/kmadmin.c as part of a commands
	patch (PHCO_21040).

	PHKL_16807:
	1) Unloading problem due to incorrect hold count:
	Some drivers may not be unloaded when they do mount/umount
	operations. The hold count is increased by mount, but not
	decreased by umount.  In this case, the module
	unregistration fails, but the module is no longer
	in the registered list. If the system admin attempted
	to unregister the driver again, (because they saw the
	failure), the system may panic.
	2) Open failure with autoloading
	May run into a problem when autoloading some drivers.
	The gio_mod_cdev_open() function ignores 2 of the 4
	arguments that drivers can get on open. If the driver
	being autoloaded was expecting the third or fourth
	argument to be a valid pointer to be used for cloning,
	the driver may dereference an invalid pointer leading
	to a system panic.

	PHKL_15552:
	I-cache pre-fetching beyond end of procedures creates
	unnecessary load on the bus.

SR:
	4701394890 4701402479 8606128506 8606137247 8606154498
	8606162678 8606165604 8606168368 8606170779 8606171142

Patch Files:
	
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP:
	/usr/conf/lib/libdlkm.a(mod_objmd.o)
	/usr/conf/lib/libdlkm.a(modadm.o)
	/usr/conf/lib/libdlkm.a(modctl.o)
	/usr/conf/lib/libdlkm.a(modinit.o)
	/usr/conf/lib/libhp-ux.a(fifo_vnops.o)
	/usr/conf/lib/libhp-ux.a(gio_modfuncs.o)
	/usr/conf/lib/libhp-ux.a(spec_vnops.o)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	/usr/conf/lib/libdlkm.a(mod_objmd.o)
	/usr/conf/lib/libdlkm.a(modadm.o)
	/usr/conf/lib/libdlkm.a(modctl.o)
	/usr/conf/lib/libdlkm.a(modinit.o)
	/usr/conf/lib/libhp-ux.a(fifo_vnops.o)
	/usr/conf/lib/libhp-ux.a(gio_modfuncs.o)
	/usr/conf/lib/libhp-ux.a(spec_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/libdlkm.a(modadm.o):
		modadm.c $Date: 2000/12/14 08:25:50 $Revision: r11ro
			s/4 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(modctl.o):
		modctl.c $Date: 2000/12/14 08:25:50 $Revision: r11ro
			s/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(modinit.o):
		modinit.c $Date: 2000/12/14 08:25:50 $Revision: r11r
			os/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libhp-ux.a(gio_modfuncs.o):
		gio_modfuncs.c $Date: 2000/12/14 08:25:50 $Revision:
			 r11ros/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(mod_objmd.o):
		mod_objmd.c $Date: 2000/12/14 08:25:50 $Revision: r1
			1ros/3 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libhp-ux.a(fifo_vnops.o):
		fifo_vnops.c $Date: 2001/02/06 08:20:12 $Revision: r
			11ros/1 PATCH_11.00 (PHKL_23329)
	/usr/conf/lib/libhp-ux.a(spec_vnops.o):
		spec_vnops.c $Date: 2001/02/06 08:20:12 $Revision: r
			11ros/7 PATCH_11.00 (PHKL_23329)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	/usr/conf/lib/libdlkm.a(modadm.o):
		modadm.c $Date: 2000/12/14 08:25:50 $Revision: r11ro
			s/4 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(modctl.o):
		modctl.c $Date: 2000/12/14 08:25:50 $Revision: r11ro
			s/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(modinit.o):
		modinit.c $Date: 2000/12/14 08:25:50 $Revision: r11r
			os/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libhp-ux.a(gio_modfuncs.o):
		gio_modfuncs.c $Date: 2000/12/14 08:25:50 $Revision:
			 r11ros/2 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libdlkm.a(mod_objmd.o):
		mod_objmd.c $Date: 2000/12/14 08:25:50 $Revision: r1
			1ros/3 PATCH_11.00 (PHKL_22968)
	/usr/conf/lib/libhp-ux.a(fifo_vnops.o):
		fifo_vnops.c $Date: 2001/02/06 08:20:12 $Revision: r
			11ros/1 PATCH_11.00 (PHKL_23329)
	/usr/conf/lib/libhp-ux.a(spec_vnops.o):
		spec_vnops.c $Date: 2001/02/06 08:20:12 $Revision: r
			11ros/7 PATCH_11.00 (PHKL_23329)

cksum(1) Output:
	
	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP:
	2887428754 6120 /usr/conf/lib/libdlkm.a(modadm.o)
	2067793178 16756 /usr/conf/lib/libdlkm.a(modctl.o)
	3959045212 5012 /usr/conf/lib/libdlkm.a(modinit.o)
	1860554528 13312 /usr/conf/lib/libhp-ux.a(gio_modfuncs.o)
	3896875245 13360 /usr/conf/lib/libdlkm.a(mod_objmd.o)
	2032368983 12556 /usr/conf/lib/libhp-ux.a(fifo_vnops.o)
	1389474586 20884 /usr/conf/lib/libhp-ux.a(spec_vnops.o)

	OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP:
	3257028217 14096 /usr/conf/lib/libdlkm.a(modadm.o)
	88587460 39320 /usr/conf/lib/libdlkm.a(modctl.o)
	2635290223 10240 /usr/conf/lib/libdlkm.a(modinit.o)
	1354799622 29800 /usr/conf/lib/libhp-ux.a(gio_modfuncs.o)
	2074442614 30448 /usr/conf/lib/libdlkm.a(mod_objmd.o)
	832782502 31816 /usr/conf/lib/libhp-ux.a(fifo_vnops.o)
	61425481 49528 /usr/conf/lib/libhp-ux.a(spec_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_23072 PHKL_22968 PHKL_21029 PHKL_16807 PHKL_15552

Equivalent Patches: None

Patch Package Size: 340 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_23329

	5. Run swinstall to install the patch:

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

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

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

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

		dd if=/tmp/PHKL_23329.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.

