Fix several issues with parsing the notes for ELF objects.
Badly formed ELF note may cause the caclulated pointer to the next note
to point both after the note region, that was checked in the code, but
also to point before the region, that was not checked [1]. Remember the
first note location in note0 and leap out if the note is not between
note0 and note_end.
In the similar way, badly formed note may cause infinite loop by
pointing next note into the same or previous note. Guard against this by
limiting amount of loop iterations by arbitrary choosen big number.
For clarity, check the calculated note alignment in each iteration.
Reported by: Chris Palmer <chris noncombatant org> [1]
PR: kern/132886
Reviewed and tested by: dchagin
MFC after: 3 days
Warner Losh [Sun, 22 Mar 2009 13:17:46 +0000 (13:17 +0000)]
NO_INQUIRY is wrong for this device. Alternatively, if it is right,
it is right for only a tiny fraction of these devices and this
wild-card entry is too broad.
# I run a kernel without this entry at all without ill effects...
Alan Cox [Sun, 22 Mar 2009 04:32:05 +0000 (04:32 +0000)]
In general, the kernel virtual address of the pml4 page table page that is
stored in the pmap is from the direct map region. The two exceptions have
been the kernel pmap and the swapper's pmap. These pmaps have used a
kernel virtual address established by pmap_bootstrap() for their shared
pml4 page table page. However, there is no reason not to use the direct
map for these pmaps as well.
Alan Cox [Sun, 22 Mar 2009 02:33:48 +0000 (02:33 +0000)]
Eliminate the recomputation of pcb_cr3 from cpu_set_upcall(). The
bcopy()ed value from the old thread is the correct value because the new
thread and the old thread will share a page table.
Juli Mallett [Sun, 22 Mar 2009 00:45:47 +0000 (00:45 +0000)]
Remove local in6_addr variables for local and foreign addresses in sysctl_drop,
they were passed uninitialized to in6_pcblookup_hash. Instead, do as is done
for IPv4 and use the addresses within the sockaddr structure, which are
correctly populated.
Robert Watson [Sat, 21 Mar 2009 21:49:07 +0000 (21:49 +0000)]
In nfs_request(), always exit using the nfsmout label once we're
definitely doing an NFSv2 or NFSv3 RPC, rather than sometimes doing
so and sometimes not. This makes it easier to add a DTrace return
probe at a single point in the function.
Fix a bug in the recent update to the Chelsio driver.
The tick routine was not being restarted in the init_locked routine
which could resulted in loss of carrier when updating the MTU.
Submitted by: Navdeep Parhar at Chelsio
MFC after: 3 weeks
Marius Strobl [Sat, 21 Mar 2009 00:23:07 +0000 (00:23 +0000)]
- In bge_ifmedia_upd_locked() take advantrage of LIST_FOREACH().
- If boot verbose, print asicrev, chiprev and bus type on attach.
- For PCI Express devices:
1) Adjust max read request size to 4Kbytes
2) Turn on FIFO_LONG_BURST in RDMA during bge_blockinit()
Though 1) does not seem to have much to do with the poor TX performance
observed on PCI Express bge(4), 2) does fix the problem. [1]
- Nuke the RX CPU self-diag, which prevents working cards from working
(Linux tg3 does not have this diag neither does OpenBSD's bge(4)).
The increasing of the firmware handshaking timeout to 20000 retries
done as part of the original commit isn't merged as way already have a
way higher BGE_TIMEOUT of 100000.
PR: 119361 [1]
Obtained from: tg3 via DragonflyBSD [1], DragonflyBSD
Workaround for buggy USB hardware not handling new SETUP packet before STATUS
stage is complete, this allows xfers to endpoint0 to return a short frame.
Workaround for buggy USB hardware not handling new SETUP packet before STATUS
stage is complete, this allows xfers to endpoint0 to return a short frame.
John Baldwin [Fri, 20 Mar 2009 21:12:38 +0000 (21:12 +0000)]
Expand the per-node access cache to cache permissions for multiple users.
The number of entries in the cache defaults to 8 but is easily changed in
nfsclient/nfs.h. When the cache is filled, the oldest cache entry is
evicted when space is needed.
I mirrored the changes to the NFSv[23] client in the NFSv4 client to fix
compile breakage. However, the NFSv4 client doesn't actually use the
access cache currently.
Andrew Thompson [Fri, 20 Mar 2009 19:04:31 +0000 (19:04 +0000)]
MFp4 //depot/projects/usb @159430
- Move tunable defines into usb_core.h and dependancy towards usb_defs.h
- Leave hardcoded defines in "usb_defs.h".
- Allow overriding all tunable defines.
- Add more customisable typedefs.
- Correct maximum device number.
Tim Kientzle [Fri, 20 Mar 2009 17:11:45 +0000 (17:11 +0000)]
Act like ranlib if our name ends in ranlib. In particular,
this works with some recent cross-building changes by Warner
that install ranlib as, e.g., "arm-freebsd7.1-ranlib".
Marius Strobl [Fri, 20 Mar 2009 17:10:50 +0000 (17:10 +0000)]
Revert r190105 so that removing options KDB but DDB or GDB being
available will cause the kernel to not respect -d and boot_kdb=1
for consistency with the other platforms as pointed out by marcel@.
Ed Schouten [Fri, 20 Mar 2009 14:31:08 +0000 (14:31 +0000)]
Just use default behaviour on tabstops when using too many columns.
It seems I didn't fix this issue before committing teken to the tree. My
initial idea was to somehow add an error mechanism to instruct the video
driver author to increase T_NUMCOL when using very big terminals. It
turns out we have platforms where we have gigantic consoles on systems
like the Apple PowerMac G5, which means we crash there right now.
Just ignore tabstops placed beyond column 160. Just force tabs to be
placed on each 8 columns.
Jamie Gritton [Fri, 20 Mar 2009 13:41:23 +0000 (13:41 +0000)]
Call the interface's if_ioctl from ifioctl(), if the protocol didn't
handle the ioctl. There are other paths that already call it, but this
allows for a non-interface socket (like AF_LOCAL which ifconfig now
uses) to use a broader class of interface ioctls.
Do not underflow the buffer and then report the problem. Check for the
condition before the buffer write.
Also, since buflen is unsigned, previous check was ignored.
Marius Strobl [Thu, 19 Mar 2009 22:34:55 +0000 (22:34 +0000)]
- Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't
supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers
nothing but hopefully will be respected by mii_phy_setmedia() later on.
- Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs.
- Use mii_phy_add_media() instead of mii_add_media() so the latter can
be eventually retired.
Marius Strobl [Thu, 19 Mar 2009 21:02:36 +0000 (21:02 +0000)]
- As suggested by OpenSolaris use up-burst-sizes for determining the
supported burst sizes.
- Add support for 64-bit burst sizes (required for SBus GEM).
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.
Marius Strobl [Thu, 19 Mar 2009 20:52:46 +0000 (20:52 +0000)]
- Ensure we find no unexpected partner.
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Disable rerun of the streaming cache as workaround for a silicon bug
of certain Psycho versions.
- Remove the comment regarding lack of newbus'ified bus_dma(9) as being
able to associate a DMA tag with a device would allow to implement
CDMA flushing/syncing in bus_dmamap_sync(9) but that would totally
kill performance. Given that for devices not behind a PCI-PCI bridge
the host-to-PCI bridges also only do CDMA flushing/syncing based on
interrupts there's no additional disadvantage for polling(4) callbacks
in the case schizo(4) has to do the CDMA flushing/syncing but rather a
general problem.
- Don't panic if the power failure, power management or over-temperature
interrupts doesn't exist as these aren't mandatory and not available
with all controllers (not even Psychos). [1]
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.
- Add missing const.
Marius Strobl [Thu, 19 Mar 2009 20:48:47 +0000 (20:48 +0000)]
- Take advantage of KOBJMETHOD_END.
- Hook up the streaming buffer (not used by iommu(4) by default, yet)
if available and usable. [1]
- Move the message regarding belated registration as interrupt control
under bootverbose as this isn't something the user should worry about.
Marius Strobl [Thu, 19 Mar 2009 20:46:51 +0000 (20:46 +0000)]
- There's no need to wrap kdb_active and kdb_trap() in #ifdef KDB as
they're always available.
- Remove unused variable. [1]
- Add a missing const.
- Sort includes.
Marius Strobl [Thu, 19 Mar 2009 20:43:01 +0000 (20:43 +0000)]
- Remove the delay in cpu_mp_shutdown() which is no longer necessary since
we have stopped using SUNW,stop-self with r186395.
- There's no need to wrap kdb_active in #ifdef KDB as it's always available.
Andrew Thompson [Thu, 19 Mar 2009 20:33:26 +0000 (20:33 +0000)]
Remove the uscanner(4) driver, this follows the removal of the kernel scanner
driver in Linux 2.6. uscanner was just a simple wrapper around a fifo and
contained no logic, the default interface is now libusb (supported by sane).
Marius Strobl [Thu, 19 Mar 2009 20:29:23 +0000 (20:29 +0000)]
- Failing to register as interrupt controller during attach shouldn't
be fatal so just inform about this instead of panicing.
- Sort device methods.
- Take advantage of KOBJMETHOD_END.
- Remove some redundant variables.