Compare commits

...
Author SHA1 Message Date
Peter Wemm 1ebb47c83a Mention FreeBSD-SA-05:03.amd64, bump patchlevel.
Approved by:  so (cperciva)
2005-04-06 02:10:53 +00:00
Peter Wemm a940444601 MFC: initialize the tss iobase properly
Approved by:  so (cperciva)
2005-04-06 01:44:36 +00:00
Colin Percival a225d5f34e FreeBSD-SA-04:17.procfs:
MFC revision 1.54 of src/sys/fs/procfs/procfs_status.c
MFC revision 1.86 of src/sys/compat/linprocfs/linprocfs.c

Approved by:	so (nectar)
2004-12-01 21:34:43 +00:00
Colin Percival 64f548f29d FreeBSD-SA-04:16.fetch:
MFC revision 1.75 of src/usr.bin/fetch/fetch.c
Bump newvers.sh and document in UPDATING.

Approved by:	so
2004-11-18 12:06:51 +00:00
Jacques Vidrine a437630a8c MFC 1.429: Disallow negative coordinates and sizes in the syscons
CONS_SCRSHOT ioctl.

Approved by:	so
2004-10-04 17:04:25 +00:00
Jacques Vidrine c92cfee45d Correct several vulnerabilities in CVS 1.11.5 (CAN-2004-0414,
CAN-2004-0416, CAN-2004-0417, CAN-2004-0418, CAN-2004-0778 and
others).

Approved by:	so
2004-09-19 22:37:11 +00:00
Colin Percival 9ff423a7d9 FreeBSD-SA-04:13.linux:
MFC revision 1.116 of sys/compat/linux/linux_ioctl.c
Bump newvers.sh and document in UPDATING.

Approved by:	so (des)
2004-06-30 17:34:38 +00:00
cvs2svn 8572a12667 This commit was manufactured by cvs2svn to create branch 'RELENG_5_2'. 2004-06-10 19:05:40 +00:00
Dag-Erling Smørgrav 4c783325c1 Bump patch level and document the change.
Approved by:	so
2004-05-26 06:44:34 +00:00
Dag-Erling Smørgrav 044fa52655 MFS: msync(2) with the MS_INVALIDATE flag should not delete dirty pages.
Approved by:	so
2004-05-25 23:07:55 +00:00
Dag-Erling Smørgrav 3ea2671c8d Merge updated patch from vendor branch (1.1.1.17)
Approved by:	so
2004-05-20 13:18:10 +00:00
Dag-Erling Smørgrav 19a7f1a9de Bump and document patch level.
Approved by:	so
2004-05-19 06:40:56 +00:00
Dag-Erling Smørgrav a2bc8b03d8 Merge parser fix from vendor branch (rev 1.1.1.16)
Approved by:	so
2004-05-19 06:19:57 +00:00
Jacques Vidrine 615a439a9e Correctly validate the transited field in Kerberos tickets.
http://vuxml.freebsd.org/bfb36941-84fa-11d8-a41f-0020ed76ef5a.html

Obtained from:	Heimdal 0.6.1
Approved by:	so
2004-05-05 19:55:46 +00:00
Jacques Vidrine 1a15dd91ff Merge from 4-STABLE client.c 1.2.2.7, modules.c 1.1.1.5.2.4:
Correct some path validation errors in CVS.

Approved by:	so
2004-04-15 15:42:50 +00:00
Jacques Vidrine 299c870ea6 MFC ip6.h 1.11, ip6_output.c 1.79:
Validate IPv6 socket options more carefully.
2004-03-29 14:01:33 +00:00
Jacques Vidrine 6ab589eba7 MFC s3_pkt.c 1.1.1.9:
Correct a denial-of-service vulnerability in OpenSSL (CAN-2004-0079).
2004-03-17 12:18:23 +00:00
Jacques Vidrine 56d478fbea Bump patch level for update of FreeBSD-SA-04:04.tcp fix. 2004-03-16 13:47:33 +00:00
Max Khon 1c464c822e The tcp_reass_qsize increment should occur only after we have
checked for memory allocation failure.  On systems that frequently
have a memory shortage, this could result in an effectively smaller
reassembly queue than was configured.

Approved by:	security-officer
2004-03-15 18:17:10 +00:00
Hideyuki KURASHINA 7cd945dd92 Merge the following from the English version:
1.3       -> 1.3.6.1    relnotes/common/relnotes.ent
  1.7       -> 1.7.4.1    share/sgml/release.dsl
  1.663.2.5 -> 1.663.2.13 relnotes/common/new.sgml

Approved by:	so (nectar)
Refined by:	hrs
2004-03-05 04:11:23 +00:00
Jacques Vidrine 2ccb8fa10b MFC in part tcp_input.c 1.228, tcp_subr.c 1.182, tcp_var.h 1.98:
Limit TCP segment reassembly queue size and use UMA for it.

Submitted by:	andre
2004-03-02 17:24:46 +00:00
Andrey A. Chernov d02dfb867e Back out prev. commit, because not approved. 2004-03-01 16:49:38 +00:00
Andrey A. Chernov c07f4f5d50 MFC important bugfixes from v1.49-1.50 2004-03-01 11:43:50 +00:00
Pawel Jakub Dawidek a28c3ad292 MFC ucred structure leak fix.
Approved by:	re@ (scottl), scottl (mentor)
2004-02-23 15:32:55 +00:00
Scott Long 4d78a30641 Update the BSD family tree for 5.2 and 5.2.1 2004-02-23 05:44:37 +00:00
Scott Long 02a0c16458 Point the pkg tools to the 5.2.1 packages. 2004-02-23 05:35:58 +00:00
Scott Long df2804f090 Change 502001 to 50201. The more I think about it, the more the latter
makes sense.  Sorry for the churn.
2004-02-23 05:34:20 +00:00
Scott Long 7e616136ed Bump __FreeBSD_version to 502001 for the 5.2.1-RELEASE 2004-02-23 05:24:25 +00:00
Scott Long 820b5929c3 Update for 5.2.1-RELEASE 2004-02-23 05:20:41 +00:00
Robert Watson b0b7475582 MFC r127_state.c:1.9 to RELENG_5_2 for inclusion in 5.2.1-RELEASE:
Limit the amount of memory userspace processes can cause the kernel to
  allocate via DRI on r128 devices.

  Obtained from:  Thomas Biege <[email protected]>
  Reviewed by:    scottl

Approved by:	scottl
2004-02-23 05:19:46 +00:00
Scott Long 7b05829164 Update the release makefile for 5.2.1 2004-02-23 05:18:26 +00:00
Scott Long b632a5e7e3 Update the man pages for 5.2.1 2004-02-23 05:13:38 +00:00
Scott Long 3b6214f90e Update for 5.2.1 and note that 5.2.1 is on the 5.2 release branch. 2004-02-23 05:11:00 +00:00
Scott Long 346046f21f Add a hack to allow sysisntall to handle mixing 5.2 vs. 5.2.1 cds.
Submitted by:	murray
Approved by:	re
2004-02-20 17:00:57 +00:00
Jacques Vidrine ff56d0c29d MFC 1.40: Rework jail_attach(2) so that an already jailed process cannot hop to
another jail.

Approved by:	re
2004-02-19 23:26:39 +00:00
Scott Long 1f3668b5ee Reduce AAC_MAX_FIBS a little so that we don't exhaust the queue. This is a
workaround for the lost command problem in RELENG_5_2.

Approved by:	re (implicit)
2004-02-18 06:20:50 +00:00
Bruce A. Mah 826afe135d Version number bumps for the upcoming 5.2.1-RELEASE.
Approved by:	re (implicitly)
2004-02-16 21:21:59 +00:00
Don Lewis 6a3d65c7ce Forced commit to add a notice that the previous commit was ...
Approved by: re (scottl)
2004-02-15 00:16:53 +00:00
Don Lewis 1d2fcd09b3 Partial MFC of revision 1.16.
Change KASSERT() in feed_vchan16() into an explicit test and call to
  panic() so that the buffer overflow just beyond this point is always
  caught, even when the code is not compiled with INVARIANTS.

This will cause a deterministic panic if a particular combination of
sound hardware and client software triggers the buffer overflow in the
vchan code.  This is better than letting the system panic in some
unrelated part of the kernel because of heap corruption.
2004-02-15 00:15:44 +00:00
Marcel Moolenaar adf2588c55 MFC rev 1.351 (no disklabel on ia64).
Approved: re (scottl)
2004-02-14 22:31:04 +00:00
Marcel Moolenaar 1d61c4475f MFC rev 1.14 (uninitialized variable) and 1.15 (non-close of disk
device).

Approved: re (scottl)
2004-02-14 22:29:02 +00:00
Nate Lawson 77270ff3e0 MFC: os_name -> osname fixes the OS override directive for ACPI 2004-02-14 21:46:55 +00:00
Scott Long 621e820c2d MFC: If deferring a command due to lack of card resources, unmap it so that
it will be marked appropriately the next time the queue is run.

Approved by:	re (implicit)
2004-02-11 10:34:24 +00:00
Scott Long d83253a5eb Use 'strip -g' instead of 'strip -x' on the boot floppy modules. Hopefully
this will allows them to work again.

Approved by:	re (implicit)
2004-02-11 10:26:17 +00:00
Scott Long 002de175b5 MFC many more fixes for the ata driver.
Approved by:	re (implicit)
2004-02-11 08:47:22 +00:00
Scott Long b819ed1942 MFC the geom_taskqueue addition so that the pending ATA MFC can use it.
Approved by:	re (implicit)
2004-02-11 08:31:23 +00:00
Jacques Vidrine 97a0e95990 MFC pseudofs_vnops.c 1.43: Fix a panic in pseudofs(9).
Approved by:	re
2004-02-10 21:08:01 +00:00
Jacques Vidrine 410f2d5521 Get ready for 5.2.1-RC2. 2004-02-10 14:13:39 +00:00
Jacques Vidrine 2f81f996d8 MFC vfs_mount.c 1.117: Fix issues related to mount/unmount.
Submitted by:	pjd
Approved by:	re
2004-02-10 14:11:32 +00:00
Bruce A. Mah e0d79e7d14 MFC: SA-04:02.
Approved by:	re (implicitly)
2004-02-06 21:37:54 +00:00
Jacques Vidrine 3aee9b7f32 MFC sysv_shm.c 1.90: Correct a reference counting bug in shmat(2). 2004-02-05 18:01:26 +00:00
Doug Barton 9b9625967a MFC 1.11, the latest from InterNIC.
Approved by:	re (scottl)
2004-02-03 17:12:58 +00:00
Bruce A. Mah 9549d08078 MFC: SA-04:01, devfs(5) path rules, pc98 libdisk bugfix.
Approved by:	re (implicitly)
2004-02-03 06:14:32 +00:00
Scott Long d0cead40a3 Run 'strip -x' on the kernel modules on the mfsroot floppy to reclaim some
space.  This appears to be safe for what we need here.  This is needed now
because the slight addition to the readme files has caused the mfsroot
floppy to overflow again.

Approved by:	re (implicit)
2004-01-31 16:30:45 +00:00
Scott Long 9b32ccbcbf Shift into RC mode for 5.2.1
Approved by:	re (implicit)
2004-01-30 16:24:12 +00:00
Jacques Vidrine 60725be8a2 5.2-RELEASE-p1 is a security branch release to address an issue in
mksnap_ffs(8).  Because release engineering for 5.2.1-RELEASE is
currently in process, 5.2-RELEASE-p1 also includes several other bug
fixes which are not security related.  The additional fixes are
documented in UPDATING and in the release notes.

Approved by:	re
2004-01-29 22:54:31 +00:00
Colin Percival 2256e90431 MFC rev 1.9-1.10: Allow path rules to work on directories.
Approved by:	rwatson (mentor), re (scottl)
2004-01-29 19:32:43 +00:00
Colin Percival 0995c3896a MFC 1.3: If we're going to unhide fd/*, we'd better unhide fd as well.
Approved by:	rwatson (mentor), re (scottl)
2004-01-29 19:28:57 +00:00
Yoshihiro Takahashi 7ec68c7a70 MFC: revision 1.25 (Fixed pc98 partition type.)
Approved by:	re (scottl)
2004-01-28 04:12:20 +00:00
Dag-Erling Smørgrav 7f8cc3a8e5 MFC (1.6): preserve existing options on the mountpoint we're snapshotting. 2004-01-27 19:33:16 +00:00
Bruce A. Mah a71f8d7614 MFC: IPsec fixes, ata(4) fixes.
Approved by:	re (implicitly)
2004-01-27 16:24:21 +00:00
Hajimu UMEMOTO feb160a56f MFC 1.65: avoid duplicate free.
Approved by:	re (scott)
2004-01-27 16:06:22 +00:00
Hajimu UMEMOTO 31ed7881ff MFC 1.64: invalidate secpolicy pcb cache on key_timehandler.
Approved by:	re (scott)
2004-01-27 16:04:52 +00:00
Hajimu UMEMOTO 0db9ecbc9a MFC 1.63: add missing key_freesp()s.
Approved by:	re (scott)
2004-01-27 16:03:30 +00:00
Hajimu UMEMOTO 0b783ecd8b MFC 1.62: don't touch after free.
Approved by:	re (scott)
2004-01-27 16:01:52 +00:00
Hajimu UMEMOTO 9246cdb43e MFC 1.31: fix potential 'cannot-happen' memory leak
Approved by:	re (scott)
2004-01-27 15:59:26 +00:00
Hajimu UMEMOTO 0e55c4f224 MFC 1.47: call ipsec_pcbconn()/ipsec_pcbdisconn() from in6_pcbconnect().
Approved by:	re (scott)
2004-01-27 15:57:16 +00:00
Hajimu UMEMOTO ec5e6a3a56 MFC 1.136: do not deref freed pointer
Approved by:	re (scottl)
2004-01-27 15:54:05 +00:00
Scott Long fd667ad630 Bring the ata man page up to HEAD to stay in sync with the ata driver. 2004-01-27 15:21:30 +00:00
Scott Long 84067e9544 Remove local changes to ata that accidentally crept in. 2004-01-27 15:11:35 +00:00
Scott Long 6599de8adc Don peril-senstive goggles and update the ata driver to HEAD.
Approved by:	re
2004-01-27 05:53:19 +00:00
Bruce A. Mah 6f7b4016c0 MFC: Make CVS update release note match reality.
Submitted by:	nectar
Approved by:	re (implicitly)
2004-01-27 00:53:22 +00:00
Bruce A. Mah ad0c026ca4 MFC: PFIL_HOOKS now enabled in GENERIC.
Move KUser note from ports/packages section to releng section so that
it sits next to other KDE-related text.

Approved by:	re
2004-01-26 20:03:53 +00:00
Jacques Vidrine 2a342ab5f2 MFC: Add PFIL_HOOKS to the GENERIC kernel configuration.
Requested by:	re
2004-01-26 19:42:13 +00:00
Bruce A. Mah c7203ee0d7 Bring the 5.2.1 release notes up to date with the state of the
RELENG_5_2 branch thus far.

MFC:  cdboot BIOS bug workaround, dc(4) on sparc64 update, sk(4)
multicast fix, GEOM I/O hang fix, NFSv4 panic fix, NSS bugfix, CVS
security fixes.

New release note:  kdeadmin3 update.

Approved by:	re (implicitly)
2004-01-26 16:52:54 +00:00
Scott Long 08b79a8d0c Merge rev 1.46 of geom_event.c. This prevents deleted events from getting
lost and hanging I/O.

Approved by:	re
2004-01-26 05:18:35 +00:00
Scott Long a20338c1ae Bring rpcclnt.c up to HEAD in order to fix several potential panics when
mixing NFS protocols.

Approved by:	re
2004-01-26 04:38:17 +00:00
Jacques Vidrine 6aec46cdbd MFC 1.1.1.14: Do not allow pserver to be run as root. 2004-01-26 00:08:38 +00:00
Jacques Vidrine fa7de625b8 MFC 1.1.1.9: Reject malformed module requests.
Approved by:	re
2004-01-26 00:07:36 +00:00
Bruce A. Mah 1362efe4e9 Add a few sentences to the readme and release notes describing this
point release.

Approved by:	re
2004-01-25 18:50:50 +00:00
Bruce A. Mah 79d0299ece Fix up some release notes glitches that didn't make it for
5.2-RELEASE: Fix a repeated word [1], fix GCC-related typo (was in
errata) [2], add missing note on TCP mss limiting (was in errata).

Submitted by:	jens [1], gerald [2]
Approved by:	re
2004-01-25 18:36:00 +00:00
Bruce A. Mah 46a7e7465d Infrastructure commits for the release documentation for a probable
5.2.1-RELEASE.  The main changes will be to the release notes, which
will be based on the 5.2-RELEASE notes with the 5.2 -> 5.2.1 changes
added and emphasized.

Approved by:	re
2004-01-25 18:28:11 +00:00
Scott Long 4e826732fd Bring the NSS files up to HEAD to fix the problem with 3rd party modules
accessing large groups.

Approved by:	re
2004-01-25 06:00:42 +00:00
Scott Long 4beb8d28f8 MFC the if_dc fix for sparc64 Davicom cards that store thier MAC in
OFW instead in SEEPROM.

Approved by:	re
2004-01-25 05:23:21 +00:00
Scott Long ba82adac64 Bring if_sk.c to HEAD to fix the multicast problem with newer chips.
Approved by: re
2004-01-25 05:06:48 +00:00
John Baldwin 8beaf2008c MFC: Save %cx around calls to the BIOS to read data to workaround bugs in
certain BIOSs when booting from a USB CD-ROM.  Also, fix the twiddle to
actually twiddle.

Approved by:	re
2004-01-25 01:20:36 +00:00
Hiroki Sato f7a0e21612 MFC: merge Japanese translation of 5.2R release docs into RELENG_5_2.
Approved by:	re (bmah)
2004-01-17 03:34:33 +00:00
Hiroki Sato 8715aa0832 MFC: merge Japanese translation of 5.2R release docs into RELENG_5_2.
Approved by:	re (bmah)
2004-01-17 03:24:56 +00:00
111 changed files with 2662 additions and 2079 deletions

No files matched your search

+132 -1
View File
@@ -1,9 +1,140 @@
Updating Information for FreeBSD 5.2 users
Updating Information for FreeBSD 5.2.1 users
This file is maintained and copyrighted by M. Warner Losh
<[email protected]>. See end of file for further details. For commonly
done items, please see the COMMON ITEMS: section later in the file.
This is for the 5.2 release branch. FreeBSD 5.2.1 is part of the 5.2
release branch and has no branch of its own. All entries since 5.0 are an
itemized list of commits to this branch, numbered from the beginning.
The security advisories related to various patches contain information
on how to build/install a minimal set of binaries and start/stop a
minimal number of processes, if possible, for that patch. For those
updates that don't have an advisory, or to be safe, you can do a full
build and install as described in the COMMON ITEMS section.
20050406: p14 FreeBSD-SA-05:03.amd64
Correctly initialize the I/O permission bitmap on amd64.
20041201: p13 FreeBSD-SA-04:17.procfs
Fix a tainted pointer dereference in procfs(5) and linprocfs(5)
which could allow a local attacker to panic a system and/or read
from kernel memory.
20041118: p12 FreeBSD-SA-04:16.fetch
Correct a buffer overflow in fetch(1) which could allow a
mallicious server to execute arbitrary code on the client.
20041003: p11 FreeBSD-SA-04:15.syscons
Correct a kernel memory disclosure vulnerability in syscons(4).
20040919: p10 FreeBSD-SA-04:14.cvs
Correct several vulnerabilities in CVS (CAN-2004-0414,
CAN-2004-0416, CAN-2004-0417, CAN-2004-0418, CAN-2004-0778).
20040630: p9 FreeBSD-SA-04:13.linux
Correct an input validation error in the linux binary
compatibility code.
20040526: p8 FreeBSD-SA-04:11.msync
Fix a bug in msync(2) which could cause it to discard dirty
pages.
NOTE: In some cases involving NFS, the incorrect behaviour may
actually be preferrable. Setting the vm.old_msync sysctl
variable to 1 will revert msync(2) to its old behaviour.
20040519: p7 FreeBSD-SA-04:10.cvs
Correct a heap overflow in cvs's pserver protocol parser.
20040505: p6 FreeBSD-SA-04:08.heimdal
Correctly validate the transited field in Kerberos tickets.
20040415: p5 FreeBSD-SA-04:07.cvs
Correct some path validation errors in CVS.
20040329: p4 FreeBSD-SA-04:06.ipv6
Correct an input validation error involving setsockopt and
IPv6 sockets.
20040317: p3 FreeBSD-SA-04:05.openssl
Correct a denial-of-service vulnerability in OpenSSL.
20040316: p2
Improvement of FreeBSD-SA-04:04.tcp fix.
20040302: p1 FreeBSD-SA-04:04.tcp
Limit TCP segment reassembly queue size.
20040222:
FreeBSD 5.2.1 RELEASE
20040210:
Fixed bugs in vfs_mount(9) that could allow jailed processes
to mount or unmount file systems outside of the jail and
in some cases allow a normal user to unmount a file system
when usermounts have been changed from enabled to disabled.
Fix a panic in pseudofs(9).
20040205: p2 FreeBSD-SA-04:02.shmat
Correct a reference counting bug in shmat(2).
20040127: p1 FreeBSD-SA-04:01.mksnap_ffs
Fixed mksnap_ffs to preserve existing file system flags.
NOTE WELL:
Due to release engineering in progress, 5.2-RELEASE-p1 also
includes numerous other critical bug fixes, most of which
are not security related.
- (i386) `cdboot' now works around a BIOS problem observed on
some systems when booting from USB CDROM drives.
- (sparc64) The dc(4) driver now supports sparc64 Davicom
cards that store their MAC address in OpenFirmware.
- Several bugs related to multicast and promiscuous mode
handling in the sk(4) driver have been fixed.
- A bug in GEOM(4) that could result in I/O hangs in some
rare cases has been fixed.
- A panic in the NFSv4 client has been fixed; this occurred
when attempting operations against an NFSv3/NFSv2-only
server.
- A bugfix has been applied to NSS support, which fixes
problems when using third-party NSS modules (such as
`net/nss_ldap') and groups with large membership lists.
- Security improvements from CVS 1.11.10 and 1.11.11 have
been backported. Specifically, certain malformed module
requests are now rejected, and when using `cvs pserver'
mode, attempts to authenticate as `root' are rejected and
recorded via syslog(3).
- The `PFIL_HOOKS' option is now enabled by default in the
GENERIC kernel. The most notable effect of this change is
to make IPFilter work correctly when loaded as a kernel
module.
- Some bugs in the IPsec implementation from the KAME Project
have been fixed. These bugs were related to freeing memory
objects before all references to them were removed, and
could cause erratic behavior or kernel panics after flushing
the Security Policy Database (SPD).
- A number of bugs in the ata(4) driver have been fixed. Most
notably, master/slave device detection should work better,
and some problems with timeouts should be resolved.
- (pc98) The partition type used for new partitions on the pc98
platform was corrected.
- Allow devfs path rules to work on directories.
20031206:
FreeBSD 5.2 branched
+110
View File
@@ -0,0 +1,110 @@
/* xsize.h -- Checked size_t computations.
Copyright (C) 2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _XSIZE_H
#define _XSIZE_H
/* Get size_t. */
#include <stddef.h>
/* Get SIZE_MAX. */
#include <limits.h>
#if HAVE_STDINT_H
# include <stdint.h>
#else
#define SIZE_MAX UINT_MAX /* XXX */
#endif
/* The size of memory objects is often computed through expressions of
type size_t. Example:
void* p = malloc (header_size + n * element_size).
These computations can lead to overflow. When this happens, malloc()
returns a piece of memory that is way too small, and the program then
crashes while attempting to fill the memory.
To avoid this, the functions and macros in this file check for overflow.
The convention is that SIZE_MAX represents overflow.
malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
implementation that uses mmap --, it's recommended to use size_overflow_p()
or size_in_bounds_p() before invoking malloc().
The example thus becomes:
size_t size = xsum (header_size, xtimes (n, element_size));
void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
*/
/* Convert an arbitrary value >= 0 to type size_t. */
#define xcast_size_t(N) \
((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
/* Sum of two sizes, with overflow check. */
static inline size_t
#if __GNUC__ >= 3
__attribute__ ((__pure__))
#endif
xsum (size_t size1, size_t size2)
{
size_t sum = size1 + size2;
return (sum >= size1 ? sum : SIZE_MAX);
}
/* Sum of three sizes, with overflow check. */
static inline size_t
#if __GNUC__ >= 3
__attribute__ ((__pure__))
#endif
xsum3 (size_t size1, size_t size2, size_t size3)
{
return xsum (xsum (size1, size2), size3);
}
/* Sum of four sizes, with overflow check. */
static inline size_t
#if __GNUC__ >= 3
__attribute__ ((__pure__))
#endif
xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
{
return xsum (xsum (xsum (size1, size2), size3), size4);
}
/* Maximum of two sizes, with overflow check. */
static inline size_t
#if __GNUC__ >= 3
__attribute__ ((__pure__))
#endif
xmax (size_t size1, size_t size2)
{
/* No explicit check is needed here, because for any n:
max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
return (size1 >= size2 ? size1 : size2);
}
/* Multiplication of a count with an element size, with overflow check.
The count must be >= 0 and the element size must be > 0.
This is a macro, not an inline function, so that it works correctly even
when N is of a wider tupe and N > SIZE_MAX. */
#define xtimes(N, ELSIZE) \
((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
/* Check for overflow. */
#define size_overflow_p(SIZE) \
((SIZE) == SIZE_MAX)
/* Check against overflow. */
#define size_in_bounds_p(SIZE) \
((SIZE) != SIZE_MAX)
#endif /* _XSIZE_H */
+13
View File
@@ -1054,6 +1054,19 @@ call_in_directory (pathname, func, data)
char *rdirp;
int reposdirname_absolute;
/* For security reasons, if PATHNAME is absolute or attemps to ascend
* outside of the current sanbbox, we abort. The server should not send us
* anything but relative paths which remain inside the sandbox here.
* Anything less means a trojan CVS server could create and edit arbitrary
* files on the client.
*/
if (isabsolute (pathname) || pathname_levels (pathname) > 0)
{
error (0, 0,
"Server attempted to update a file via an invalid pathname:");
error (1, 0, "`%s'.", pathname);
}
reposname = NULL;
read_line (&reposname);
assert (reposname != NULL);
+6 -1
View File
@@ -481,7 +481,12 @@ commit (argc, argv)
operate on, and only work with those files in the future.
This saves time--we don't want to search the file system
of the working directory twice. */
find_args.argv = (char **) xmalloc (find_args.argc * sizeof (char **));
if (size_overflow_p (xtimes (find_args.argc, sizeof (char **))))
{
find_args.argc = 0;
return 0;
}
find_args.argv = xmalloc (xtimes (find_args.argc, sizeof (char **)));
find_args.argc = 0;
walklist (find_args.ulist, copy_ulist, &find_args);
+4
View File
@@ -41,6 +41,10 @@
#include "popen.h"
#endif
/* Begin GNULIB headers. */
#include "xsize.h"
/* End GNULIB headers. */
#ifdef STDC_HEADERS
#include <stdlib.h>
#else
+7 -1
View File
@@ -988,8 +988,14 @@ expand_wild (argc, argv, pargc, pargv)
char ***pargv;
{
int i;
if (size_overflow_p (xtimes (argc, sizeof (char *)))) {
*pargc = 0;
*pargv = NULL;
error (0, 0, "expand_wild: too many arguments");
return;
}
*pargc = argc;
*pargv = (char **) xmalloc (argc * sizeof (char *));
*pargv = xmalloc (xtimes (argc, sizeof (char *)));
for (i = 0; i < argc; ++i)
(*pargv)[i] = xstrdup (argv[i]);
}
+24 -9
View File
@@ -414,8 +414,11 @@ history (argc, argv)
working = 1;
break;
case 'X': /* Undocumented debugging flag */
#ifdef DEBUG
histfile = optarg;
#endif
break;
case 'D': /* Since specified date */
if (*since_rev || *since_tag || *backto)
{
@@ -890,9 +893,13 @@ save_user (name)
{
if (user_count == user_max)
{
user_max += USER_INCREMENT;
user_list = (char **) xrealloc ((char *) user_list,
(int) user_max * sizeof (char *));
user_max = xsum (user_max, USER_INCREMENT);
if (size_overflow_p (xtimes (user_max, sizeof (char *))))
{
error (0, 0, "save_user: too many users");
return;
}
user_list = xrealloc (user_list, xtimes (user_max, sizeof (char *)));
}
user_list[user_count++] = xstrdup (name);
}
@@ -920,9 +927,13 @@ save_file (dir, name, module)
if (file_count == file_max)
{
file_max += FILE_INCREMENT;
file_list = (struct file_list_str *) xrealloc ((char *) file_list,
file_max * sizeof (*fl));
file_max = xsum (file_max, FILE_INCREMENT);
if (size_overflow_p (xtimes (file_max, sizeof (*fl))))
{
error (0, 0, "save_file: too many files");
return;
}
file_list = xrealloc (file_list, xtimes (file_max, sizeof (*fl)));
}
fl = &file_list[file_count++];
fl->l_file = cp = xmalloc (strlen (dir) + strlen (name) + 2);
@@ -961,9 +972,13 @@ save_module (module)
{
if (mod_count == mod_max)
{
mod_max += MODULE_INCREMENT;
mod_list = (char **) xrealloc ((char *) mod_list,
mod_max * sizeof (char *));
mod_max = xsum (mod_max, MODULE_INCREMENT);
if (size_overflow_p (xtimes (mod_max, sizeof (char *))))
{
error (0, 0, "save_module: too many modules");
return;
}
mod_list = xrealloc (mod_list, xtimes (mod_max, sizeof (char *)));
}
mod_list[mod_count++] = xstrdup (module);
}
+37
View File
@@ -159,6 +159,43 @@ do_module (db, mname, m_type, msg, callback_proc, where, shorten,
}
#endif
/* Don't process absolute directories. Anything else could be a security
* problem. Before this check was put in place:
*
* $ cvs -d:fork:/cvsroot co /foo
* cvs server: warning: cannot make directory CVS in /: Permission denied
* cvs [server aborted]: cannot make directory /foo: Permission denied
* $
*/
if (isabsolute (mname))
error (1, 0, "Absolute module reference invalid: `%s'", mname);
/* Similarly for directories that attempt to step above the root of the
* repository.
*/
if (pathname_levels (mname) > 0)
error (1, 0, "up-level in module reference (`..') invalid: `%s'.",
mname);
/* Don't process absolute directories. Anything else could be a security
* problem. Before this check was put in place:
*
* $ cvs -d:fork:/cvsroot co /foo
* cvs server: warning: cannot make directory CVS in /: Permission denied
* cvs [server aborted]: cannot make directory /foo: Permission denied
* $
*/
if (isabsolute (mname))
error (1, 0, "Absolute module reference invalid: `%s'", mname);
/* Similarly for directories that attempt to step above the root of the
* repository.
*/
if (pathname_levels (mname) > 0)
error (1, 0, "up-level in module reference (`..') invalid: `%s'.",
mname);
/* if this is a directory to ignore, add it to that list */
if (mname[0] == '!' && mname[1] != '\0')
{
+125 -14
View File
@@ -927,7 +927,7 @@ serve_max_dotdot (arg)
int i;
char *p;
if (lim < 0)
if (lim < 0 || lim > 10000)
return;
p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10);
if (p == NULL)
@@ -1647,9 +1647,28 @@ serve_unchanged (arg)
&& strlen (arg) == cp - name
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
if (*timefield != '=')
if (!(timefield = strchr (cp + 1, '/')) || *++timefield == '\0')
{
/* We didn't find the record separator or it is followed by
* the end of the string, so just exit.
*/
if (alloc_pending (80))
sprintf (pending_error_text,
"E Malformed Entry encountered.");
return;
}
/* If the time field is not currently empty, then one of
* serve_modified, serve_is_modified, & serve_unchanged were
* already called for this file. We would like to ignore the
* reinvocation silently or, better yet, exit with an error
* message, but we just avoid the copy-forward and overwrite the
* value from the last invocation instead. See the comment below
* for more.
*/
if (*timefield == '/')
{
/* Copy forward one character. Space was allocated for this
* already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1657,8 +1676,17 @@ serve_unchanged (arg)
*cp = cp[-1];
--cp;
}
*timefield = '=';
}
/* If *TIMEFIELD wasn't "/", we assume that it was because of
* multiple calls to Is-Modified & Unchanged by the client and
* just overwrite the value from the last call. Technically, we
* should probably either ignore calls after the first or send the
* client an error, since the client/server protocol specification
* specifies that only one call to either Is-Modified or Unchanged
* is allowed, but broken versions of WinCVS & TortoiseCVS rely on
* this behavior.
*/
*timefield = '=';
break;
}
}
@@ -1691,9 +1719,28 @@ serve_is_modified (arg)
&& strlen (arg) == cp - name
&& strncmp (arg, name, cp - name) == 0)
{
timefield = strchr (cp + 1, '/') + 1;
if (!(timefield[0] == 'M' && timefield[1] == '/'))
if (!(timefield = strchr (cp + 1, '/')) || *++timefield == '\0')
{
/* We didn't find the record separator or it is followed by
* the end of the string, so just exit.
*/
if (alloc_pending (80))
sprintf (pending_error_text,
"E Malformed Entry encountered.");
return;
}
/* If the time field is not currently empty, then one of
* serve_modified, serve_is_modified, & serve_unchanged were
* already called for this file. We would like to ignore the
* reinvocation silently or, better yet, exit with an error
* message, but we just avoid the copy-forward and overwrite the
* value from the last invocation instead. See the comment below
* for more.
*/
if (*timefield == '/')
{
/* Copy forward one character. Space was allocated for this
* already in serve_entry(). */
cp = timefield + strlen (timefield);
cp[1] = '\0';
while (cp > timefield)
@@ -1701,8 +1748,17 @@ serve_is_modified (arg)
*cp = cp[-1];
--cp;
}
*timefield = 'M';
}
/* If *TIMEFIELD wasn't "/", we assume that it was because of
* multiple calls to Is-Modified & Unchanged by the client and
* just overwrite the value from the last call. Technically, we
* should probably either ignore calls after the first or send the
* client an error, since the client/server protocol specification
* specifies that only one call to either Is-Modified or Unchanged
* is allowed, but broken versions of WinCVS & TortoiseCVS rely on
* this behavior.
*/
*timefield = 'M';
if (kopt != NULL)
{
if (alloc_pending (strlen (name) + 80))
@@ -1757,8 +1813,29 @@ serve_entry (arg)
{
struct an_entry *p;
char *cp;
int i = 0;
if (error_pending()) return;
p = (struct an_entry *) xmalloc (sizeof (struct an_entry));
/* Verify that the entry is well-formed. This can avoid problems later.
* At the moment we only check that the Entry contains five slashes in
* approximately the correct locations since some of the code makes
* assumptions about this.
*/
cp = arg;
if (*cp == 'D') cp++;
while (i++ < 5)
{
if (!cp || *cp != '/')
{
if (alloc_pending (80))
sprintf (pending_error_text,
"E protocol error: Malformed Entry");
return;
}
cp = strchr (cp + 1, '/');
}
p = xmalloc (sizeof (struct an_entry));
if (p == NULL)
{
pending_error = ENOMEM;
@@ -1990,6 +2067,9 @@ serve_notify (arg)
{
char *cp;
if (!data[0])
goto error;
if (strchr (data, '+'))
goto error;
@@ -2122,6 +2202,14 @@ serve_argument (arg)
if (error_pending()) return;
if (argument_count >= 10000)
{
if (alloc_pending (80))
sprintf (pending_error_text,
"E Protocol error: too many arguments");
return;
}
if (argument_vector_size <= argument_count)
{
argument_vector_size *= 2;
@@ -2152,6 +2240,14 @@ serve_argumentx (arg)
if (error_pending()) return;
if (argument_count <= 1)
{
if (alloc_pending (80))
sprintf (pending_error_text,
"E Protocol error: called argumentx without prior call to argument");
return;
}
p = argument_vector[argument_count - 1];
p = xrealloc (p, strlen (p) + 1 + strlen (arg) + 1);
if (p == NULL)
@@ -2508,7 +2604,7 @@ check_command_legal_p (cmd_name)
save some code here... -kff */
/* Chop newline by hand, for strcmp()'s sake. */
if (linebuf[num_red - 1] == '\n')
if (num_red > 0 && linebuf[num_red - 1] == '\n')
linebuf[num_red - 1] = '\0';
if (strcmp (linebuf, CVS_Username) == 0)
@@ -2563,7 +2659,7 @@ check_command_legal_p (cmd_name)
while ((num_red = getline (&linebuf, &linebuf_len, fp)) >= 0)
{
/* Chop newline by hand, for strcmp()'s sake. */
if (linebuf[num_red - 1] == '\n')
if (num_red > 0 && linebuf[num_red - 1] == '\n')
linebuf[num_red - 1] = '\0';
if (strcmp (linebuf, CVS_Username) == 0)
@@ -5237,10 +5333,11 @@ error ENOMEM Virtual memory exhausted.\n");
#if defined (HAVE_KERBEROS) || defined (AUTH_SERVER_SUPPORT) || defined (HAVE_GSSAPI)
static void switch_to_user PROTO((const char *));
static void switch_to_user PROTO((const char *, const char *));
static void
switch_to_user (username)
switch_to_user (cvs_username, username)
const char *cvs_username; /* Only used for error messages. */
const char *username;
{
struct passwd *pw;
@@ -5257,6 +5354,20 @@ error 0 %s: no such user\n", username);
error_exit ();
}
if (pw->pw_uid == 0)
{
#ifdef HAVE_SYSLOG_H
/* FIXME: Can the IP address of the connecting client be retrieved
* and printed here?
*/
syslog (LOG_DAEMON | LOG_ALERT,
"attempt to root from account: %s", cvs_username
);
#endif
printf("error 0: root not allowed\n");
error_exit ();
}
#if HAVE_INITGROUPS
if (initgroups (pw->pw_name, pw->pw_gid) < 0
# ifdef EPERM
@@ -5834,7 +5945,7 @@ pserver_authenticate_connection ()
strcpy (Pserver_Repos, repository);
/* Switch to run as this user. */
switch_to_user (host_user);
switch_to_user (username, host_user);
free (host_user);
free (tmp);
free (repository);
@@ -6027,7 +6138,7 @@ gserver_authenticate_connection ()
error (1, errno, "fwrite failed");
}
switch_to_user (buf);
switch_to_user ("GSSAPI", buf);
printf ("I LOVE YOU\n");
fflush (stdout);
+28 -6
View File
@@ -238,6 +238,30 @@ wrap_unparse_rcs_options (line, first_call_p)
}
#endif /* SERVER_SUPPORT || CLIENT_SUPPORT */
/*
* Remove fmt str specifier other than %% or %s. And allow
* only max_s %s specifiers
*/
wrap_clean_fmt_str(char *fmt, int max_s)
{
while (*fmt) {
if (fmt[0] == '%' && fmt[1])
{
if (fmt[1] == '%')
fmt++;
else
if (fmt[1] == 's' && max_s > 0)
{
max_s--;
fmt++;
} else
*fmt = ' ';
}
fmt++;
}
return;
}
/*
* Open a file and read lines, feeding each line to a line parser. Arrange
* for keeping a temporary list of wrappers at the end, if the "temp"
@@ -558,9 +582,8 @@ wrap_tocvs_process_file(fileName)
args = xmalloc (strlen (e->tocvsFilter)
+ strlen (fileName)
+ strlen (buf));
/* FIXME: sprintf will blow up if the format string contains items other
than %s, or contains too many %s's. We should instead be parsing
e->tocvsFilter ourselves and giving a real error. */
wrap_clean_fmt_str(e->tocvsFilter, 2);
sprintf (args, e->tocvsFilter, fileName, buf);
run_setup (args);
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL|RUN_REALLY );
@@ -592,9 +615,8 @@ wrap_fromcvs_process_file(fileName)
args = xmalloc (strlen (e->fromcvsFilter)
+ strlen (fileName));
/* FIXME: sprintf will blow up if the format string contains items other
than %s, or contains too many %s's. We should instead be parsing
e->fromcvsFilter ourselves and giving a real error. */
wrap_clean_fmt_str(e->fromcvsFilter, 1);
sprintf (args, e->fromcvsFilter, fileName);
run_setup (args);
run_exec(RUN_TTY, RUN_TTY, RUN_TTY, RUN_NORMAL );
+20 -2
View File
@@ -64,6 +64,8 @@ krb5_boolean encode_as_rep_as_tgs_rep; /* bug compatibility */
krb5_boolean check_ticket_addresses;
krb5_boolean allow_null_ticket_addresses;
krb5_boolean allow_anonymous;
int trpolicy;
static const char *trpolicy_str;
static struct getarg_strings addresses_str; /* addresses to listen on */
krb5_addresses explicit_addresses;
@@ -293,9 +295,8 @@ configure(int argc, char **argv)
get_dbinfo();
if(max_request_str){
if(max_request_str)
max_request = parse_bytes(max_request_str, NULL);
}
if(max_request == 0){
p = krb5_config_get_string (context,
@@ -366,6 +367,23 @@ configure(int argc, char **argv)
allow_anonymous =
krb5_config_get_bool(context, NULL, "kdc",
"allow-anonymous", NULL);
trpolicy_str =
krb5_config_get_string_default(context, NULL, "always-check", "kdc",
"transited-policy", NULL);
if(strcasecmp(trpolicy_str, "always-check") == 0)
trpolicy = TRPOLICY_ALWAYS_CHECK;
else if(strcasecmp(trpolicy_str, "allow-per-principal") == 0)
trpolicy = TRPOLICY_ALLOW_PER_PRINCIPAL;
else if(strcasecmp(trpolicy_str, "always-honour-request") == 0)
trpolicy = TRPOLICY_ALWAYS_HONOUR_REQUEST;
else {
kdc_log(0, "unknown transited-policy: %s, reverting to always-check",
trpolicy_str);
trpolicy = TRPOLICY_ALWAYS_CHECK;
}
krb5_config_get_bool_default(context, NULL, TRUE, "kdc",
"enforce-transited-policy", NULL);
#ifdef KRB4
if(v4_realm == NULL){
p = krb5_config_get_string (context, NULL,
+22 -1
View File
@@ -31,7 +31,7 @@
.\"
.\" $Id: kdc.8,v 1.23 2003/04/06 17:48:40 lha Exp $
.\"
.Dd August 22, 2002
.Dd October 22, 2003
.Dt KDC 8
.Os HEIMDAL
.Sh NAME
@@ -185,6 +185,27 @@ Permit tickets with no addresses.
This option is only relevant when check-ticket-addresses is TRUE.
.It Li allow-anonymous = Va boolean
Permit anonymous tickets with no addresses.
.It Li transited-policy = Xo
.Li always-check \*(Ba
.Li allow-per-principal |
.Li always-honour-request
.Xc
This controls how KDC requests with the
.Li disable-transited-check
flag are handled. It can be one of:
.Bl -tag -width "xxx" -offset indent
.It Li always-check
Always check transited encoding, this is the default.
.It Li allow-per-principal
Currently this is identical to
.Li always-check .
In a future release, it will be possible to mark a principal as able
to handle unchecked requests.
.It Li always-honour-request
Always do what the client asked.
In a future release, it will be possible to force a check per
principal.
.El
.It encode_as_rep_as_tgs_rep = Va boolean
Encode AS-Rep as TGS-Rep to be bug-compatible with old DCE code.
The Heimdal clients allow both.
+4
View File
@@ -62,6 +62,10 @@ extern krb5_boolean encode_as_rep_as_tgs_rep;
extern krb5_boolean check_ticket_addresses;
extern krb5_boolean allow_null_ticket_addresses;
extern krb5_boolean allow_anonymous;
enum { TRPOLICY_ALWAYS_CHECK,
TRPOLICY_ALLOW_PER_PRINCIPAL,
TRPOLICY_ALWAYS_HONOUR_REQUEST };
extern int trpolicy;
extern int enable_524;
extern int enable_v4_cross_realm;
+120 -56
View File
@@ -496,8 +496,8 @@ as_rep(KDC_REQ *req,
krb5_enctype cetype, setype;
EncTicketPart et;
EncKDCRepPart ek;
krb5_principal client_princ, server_princ;
char *client_name, *server_name;
krb5_principal client_princ = NULL, server_princ = NULL;
char *client_name = NULL, *server_name = NULL;
krb5_error_code ret = 0;
const char *e_text = NULL;
krb5_crypto crypto;
@@ -506,27 +506,30 @@ as_rep(KDC_REQ *req,
memset(&rep, 0, sizeof(rep));
if(b->sname == NULL){
server_name = "<unknown server>";
ret = KRB5KRB_ERR_GENERIC;
e_text = "No server in request";
} else{
principalname2krb5_principal (&server_princ, *(b->sname), b->realm);
krb5_unparse_name(context, server_princ, &server_name);
}
if (ret) {
kdc_log(0, "AS-REQ malformed server name from %s", from);
goto out;
}
if(b->cname == NULL){
client_name = "<unknown client>";
ret = KRB5KRB_ERR_GENERIC;
e_text = "No client in request";
} else {
principalname2krb5_principal (&client_princ, *(b->cname), b->realm);
krb5_unparse_name(context, client_princ, &client_name);
}
kdc_log(0, "AS-REQ %s from %s for %s",
client_name, from, server_name);
if(ret)
if (ret) {
kdc_log(0, "AS-REQ malformed client name from %s", from);
goto out;
}
kdc_log(0, "AS-REQ %s from %s for %s", client_name, from, server_name);
ret = db_fetch(client_princ, &client);
if(ret){
@@ -842,13 +845,8 @@ as_rep(KDC_REQ *req,
copy_HostAddresses(b->addresses, et.caddr);
}
{
krb5_data empty_string;
krb5_data_zero(&empty_string);
et.transited.tr_type = DOMAIN_X500_COMPRESS;
et.transited.contents = empty_string;
}
et.transited.tr_type = DOMAIN_X500_COMPRESS;
krb5_data_zero(&et.transited.contents);
copy_EncryptionKey(&et.key, &ek.key);
@@ -930,9 +928,11 @@ as_rep(KDC_REQ *req,
ret = 0;
}
out2:
krb5_free_principal(context, client_princ);
if (client_princ)
krb5_free_principal(context, client_princ);
free(client_name);
krb5_free_principal(context, server_princ);
if (server_princ)
krb5_free_principal(context, server_princ);
free(server_name);
if(client)
free_ent(client);
@@ -1055,33 +1055,35 @@ check_tgs_flags(KDC_REQ_BODY *b, EncTicketPart *tgt, EncTicketPart *et)
}
static krb5_error_code
fix_transited_encoding(TransitedEncoding *tr,
fix_transited_encoding(krb5_boolean check_policy,
TransitedEncoding *tr,
EncTicketPart *et,
const char *client_realm,
const char *server_realm,
const char *tgt_realm)
{
krb5_error_code ret = 0;
if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)){
char **realms = NULL, **tmp;
int num_realms = 0;
int i;
if(tr->tr_type && tr->contents.length != 0) {
if(tr->tr_type != DOMAIN_X500_COMPRESS){
kdc_log(0, "Unknown transited type: %u",
tr->tr_type);
return KRB5KDC_ERR_TRTYPE_NOSUPP;
}
ret = krb5_domain_x500_decode(context,
tr->contents,
&realms,
&num_realms,
client_realm,
server_realm);
if(ret){
krb5_warn(context, ret, "Decoding transited encoding");
return ret;
}
}
char **realms, **tmp;
int num_realms;
int i;
if(tr->tr_type != DOMAIN_X500_COMPRESS) {
kdc_log(0, "Unknown transited type: %u", tr->tr_type);
return KRB5KDC_ERR_TRTYPE_NOSUPP;
}
ret = krb5_domain_x500_decode(context,
tr->contents,
&realms,
&num_realms,
client_realm,
server_realm);
if(ret){
krb5_warn(context, ret, "Decoding transited encoding");
return ret;
}
if(strcmp(client_realm, tgt_realm) && strcmp(server_realm, tgt_realm)) {
/* not us, so add the previous realm to transited set */
if (num_realms < 0 || num_realms + 1 > UINT_MAX/sizeof(*realms)) {
ret = ERANGE;
goto free_realms;
@@ -1098,16 +1100,46 @@ fix_transited_encoding(TransitedEncoding *tr,
goto free_realms;
}
num_realms++;
free_TransitedEncoding(tr);
tr->tr_type = DOMAIN_X500_COMPRESS;
ret = krb5_domain_x500_encode(realms, num_realms, &tr->contents);
if(ret)
krb5_warn(context, ret, "Encoding transited encoding");
free_realms:
for(i = 0; i < num_realms; i++)
free(realms[i]);
free(realms);
}
if(num_realms == 0) {
if(strcmp(client_realm, server_realm))
kdc_log(0, "cross-realm %s -> %s", client_realm, server_realm);
} else {
size_t l = 0;
char *rs;
for(i = 0; i < num_realms; i++)
l += strlen(realms[i]) + 2;
rs = malloc(l);
if(rs != NULL) {
*rs = '\0';
for(i = 0; i < num_realms; i++) {
if(i > 0)
strlcat(rs, ", ", l);
strlcat(rs, realms[i], l);
}
kdc_log(0, "cross-realm %s -> %s via [%s]", client_realm, server_realm, rs);
free(rs);
}
}
if(check_policy) {
ret = krb5_check_transited(context, client_realm,
server_realm,
realms, num_realms, NULL);
if(ret) {
krb5_warn(context, ret, "cross-realm %s -> %s",
client_realm, server_realm);
goto free_realms;
}
et->flags.transited_policy_checked = 1;
}
et->transited.tr_type = DOMAIN_X500_COMPRESS;
ret = krb5_domain_x500_encode(realms, num_realms, &et->transited.contents);
if(ret)
krb5_warn(context, ret, "Encoding transited encoding");
free_realms:
for(i = 0; i < num_realms; i++)
free(realms[i]);
free(realms);
return ret;
}
@@ -1175,8 +1207,28 @@ tgs_make_reply(KDC_REQ_BODY *b,
if(ret)
goto out;
copy_TransitedEncoding(&tgt->transited, &et.transited);
ret = fix_transited_encoding(&et.transited,
/* We should check the transited encoding if:
1) the request doesn't ask not to be checked
2) globally enforcing a check
3) principal requires checking
4) we allow non-check per-principal, but principal isn't marked as allowing this
5) we don't globally allow this
*/
#define GLOBAL_FORCE_TRANSITED_CHECK (trpolicy == TRPOLICY_ALWAYS_CHECK)
#define GLOBAL_ALLOW_PER_PRINCIPAL (trpolicy == TRPOLICY_ALLOW_PER_PRINCIPAL)
#define GLOBAL_ALLOW_DISABLE_TRANSITED_CHECK (trpolicy == TRPOLICY_ALWAYS_HONOUR_REQUEST)
/* these will consult the database in future release */
#define PRINCIPAL_FORCE_TRANSITED_CHECK(P) 0
#define PRINCIPAL_ALLOW_DISABLE_TRANSITED_CHECK(P) 0
ret = fix_transited_encoding(!f.disable_transited_check ||
GLOBAL_FORCE_TRANSITED_CHECK ||
PRINCIPAL_FORCE_TRANSITED_CHECK(server) ||
!((GLOBAL_ALLOW_PER_PRINCIPAL &&
PRINCIPAL_ALLOW_DISABLE_TRANSITED_CHECK(server)) ||
GLOBAL_ALLOW_DISABLE_TRANSITED_CHECK),
&tgt->transited, &et,
*krb5_princ_realm(context, client_principal),
*krb5_princ_realm(context, server->principal),
*krb5_princ_realm(context, krbtgt->principal));
@@ -1276,7 +1328,7 @@ tgs_make_reply(KDC_REQ_BODY *b,
DES3? */
ret = encode_reply(&rep, &et, &ek, etype, adtkt ? 0 : server->kvno, ekey,
0, &tgt->key, e_text, reply);
out:
out:
free_TGS_REP(&rep);
free_TransitedEncoding(&et.transited);
if(et.starttime)
@@ -1378,13 +1430,13 @@ get_krbtgt_realm(const PrincipalName *p)
}
static Realm
find_rpath(Realm r)
find_rpath(Realm crealm, Realm srealm)
{
const char *new_realm = krb5_config_get_string(context,
NULL,
"libdefaults",
"capath",
r,
"capaths",
crealm,
srealm,
NULL);
return (Realm)new_realm;
}
@@ -1676,7 +1728,7 @@ tgs_rep2(KDC_REQ_BODY *b,
if ((req_rlm = get_krbtgt_realm(&sp->name)) != NULL) {
if(loop++ < 2) {
new_rlm = find_rpath(req_rlm);
new_rlm = find_rpath(tgt->crealm, req_rlm);
if(new_rlm) {
kdc_log(5, "krbtgt for realm %s not found, trying %s",
req_rlm, new_rlm);
@@ -1725,6 +1777,18 @@ tgs_rep2(KDC_REQ_BODY *b,
}
#endif
if(strcmp(krb5_principal_get_realm(context, sp),
krb5_principal_get_comp_string(context, krbtgt->principal, 1)) != 0) {
char *tpn;
ret = krb5_unparse_name(context, krbtgt->principal, &tpn);
kdc_log(0, "Request with wrong krbtgt: %s", (ret == 0) ? tpn : "<unknown>");
if(ret == 0)
free(tpn);
ret = KRB5KRB_AP_ERR_NOT_US;
goto out;
}
ret = check_flags(client, cpn, server, spn, FALSE);
if(ret)
goto out;
+9
View File
@@ -540,6 +540,15 @@ krb5_change_password (
krb5_data */*result_code_string*/,
krb5_data */*result_string*/);
krb5_error_code
krb5_check_transited (
krb5_context /*context*/,
krb5_const_realm /*client_realm*/,
krb5_const_realm /*server_realm*/,
krb5_realm */*realms*/,
int /*num_realms*/,
int */*bad_realm*/);
krb5_error_code
krb5_check_transited_realms (
krb5_context /*context*/,
+34 -23
View File
@@ -129,6 +129,32 @@ krb5_decode_ap_req(krb5_context context,
return 0;
}
static krb5_error_code
check_transited(krb5_context context, Ticket *ticket, EncTicketPart *enc)
{
char **realms;
int num_realms;
krb5_error_code ret;
if(enc->transited.tr_type != DOMAIN_X500_COMPRESS)
return KRB5KDC_ERR_TRTYPE_NOSUPP;
if(enc->transited.contents.length == 0)
return 0;
ret = krb5_domain_x500_decode(context, enc->transited.contents,
&realms, &num_realms,
enc->crealm,
ticket->realm);
if(ret)
return ret;
ret = krb5_check_transited(context, enc->crealm,
ticket->realm,
realms, num_realms, NULL);
free(realms);
return ret;
}
krb5_error_code
krb5_decrypt_ticket(krb5_context context,
Ticket *ticket,
@@ -161,6 +187,14 @@ krb5_decrypt_ticket(krb5_context context,
krb5_clear_error_string (context);
return KRB5KRB_AP_ERR_TKT_EXPIRED;
}
if(!t.flags.transited_policy_checked) {
ret = check_transited(context, ticket, &t);
if(ret) {
free_EncTicketPart(&t);
return ret;
}
}
}
if(out)
@@ -209,29 +243,6 @@ out:
return ret;
}
#if 0
static krb5_error_code
check_transited(krb5_context context,
krb5_ticket *ticket)
{
char **realms;
int num_realms;
krb5_error_code ret;
if(ticket->ticket.transited.tr_type != DOMAIN_X500_COMPRESS)
return KRB5KDC_ERR_TRTYPE_NOSUPP;
ret = krb5_domain_x500_decode(ticket->ticket.transited.contents,
&realms, &num_realms,
ticket->client->realm,
ticket->server->realm);
if(ret)
return ret;
ret = krb5_check_transited_realms(context, realms, num_realms, NULL);
free(realms);
return ret;
}
#endif
krb5_error_code
krb5_verify_ap_req(krb5_context context,
+49
View File
@@ -308,6 +308,12 @@ krb5_domain_x500_decode(krb5_context context,
struct tr_realm *p, **q;
int ret;
if(tr.length == 0) {
*realms = NULL;
*num_realms = 0;
return 0;
}
/* split string in components */
ret = decode_realms(context, tr.data, tr.length, &r);
if(ret)
@@ -362,6 +368,9 @@ krb5_domain_x500_encode(char **realms, int num_realms, krb5_data *encoding)
char *s = NULL;
int len = 0;
int i;
krb5_data_zero(encoding);
if (num_realms == 0)
return 0;
for(i = 0; i < num_realms; i++){
len += strlen(realms[i]);
if(realms[i][0] == '/')
@@ -369,6 +378,8 @@ krb5_domain_x500_encode(char **realms, int num_realms, krb5_data *encoding)
}
len += num_realms - 1;
s = malloc(len + 1);
if (s == NULL)
return ENOMEM;
*s = '\0';
for(i = 0; i < num_realms; i++){
if(i && i < num_realms - 1)
@@ -382,6 +393,44 @@ krb5_domain_x500_encode(char **realms, int num_realms, krb5_data *encoding)
return 0;
}
krb5_error_code
krb5_check_transited(krb5_context context,
krb5_const_realm client_realm,
krb5_const_realm server_realm,
krb5_realm *realms,
int num_realms,
int *bad_realm)
{
char **tr_realms;
char **p;
int i;
if(num_realms == 0)
return 0;
tr_realms = krb5_config_get_strings(context, NULL,
"capaths",
client_realm,
server_realm,
NULL);
for(i = 0; i < num_realms; i++) {
for(p = tr_realms; p && *p; p++) {
if(strcmp(*p, realms[i]) == 0)
break;
}
if(p == NULL || *p == NULL) {
krb5_config_free_strings(tr_realms);
krb5_set_error_string (context, "no transit through realm %s",
realms[i]);
if(bad_realm)
*bad_realm = i;
return KRB5KRB_AP_ERR_ILL_CR_TKT;
}
}
krb5_config_free_strings(tr_realms);
return 0;
}
krb5_error_code
krb5_check_transited_realms(krb5_context context,
const char *const *realms,
+1 -1
View File
@@ -26,7 +26,7 @@
* major minor fix final patch/beta)
*/
#define OPENSSL_VERSION_NUMBER 0x0090703fL
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7c 30 Sep 2003"
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.7c-p1 30 Sep 2003"
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
+8
View File
@@ -1085,6 +1085,14 @@ start:
goto err;
}
/* Check we have a cipher to change to */
if (s->s3->tmp.new_cipher == NULL)
{
i=SSL_AD_UNEXPECTED_MESSAGE;
SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY);
goto err;
}
rr->length=0;
if (s->msg_callback)
+1
View File
@@ -52,6 +52,7 @@ add path 'ttyP*' unhide
add path 'ttyQ*' unhide
add path 'ttyR*' unhide
add path 'ttyS*' unhide
add path fd unhide
add path 'fd/*' unhide
add path stdin unhide
add path stdout unhide
+8 -7
View File
@@ -11,9 +11,10 @@
; under anonymous FTP as
; file /domain/named.root
; on server FTP.INTERNIC.NET
; -OR- RS.INTERNIC.NET
;
; last update: Nov 5, 2002
; related version of root zone: 2002110501
; last update: Jan 29, 2004
; related version of root zone: 2004012900
;
;
; formerly NS.INTERNIC.NET
@@ -24,7 +25,7 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
; formerly NS1.ISI.EDU
;
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201
;
; formerly C.PSI.NET
;
@@ -61,22 +62,22 @@ H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
;
; operated by VeriSign, Inc.
; operated by VeriSign, Inc.
;
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
;
; housed in LINX, operated by RIPE NCC
; operated by RIPE NCC
;
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
;
; operated by IANA
; operated by ICANN
;
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
;
; housed in Japan, operated by WIDE
; operated by WIDE
;
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
+1 -1
View File
@@ -250,7 +250,7 @@
#define HAVE_SIGVEC 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
+2 -1
View File
@@ -55,12 +55,13 @@
.ds doc-str-Lb-libvgl Video Graphics Library (libvgl, \-lvgl)
.
.\" Default .Os value
.ds doc-default-operating-system FreeBSD\~5.2
.ds doc-default-operating-system FreeBSD\~5.2.1
.
.\" FreeBSD releases not found in doc-common
.ds doc-operating-system-FreeBSD-4.9 4.9
.ds doc-operating-system-FreeBSD-5.1 5.1
.ds doc-operating-system-FreeBSD-5.2 5.2
.ds doc-operating-system-FreeBSD-5.2.1 5.2.1
.
.ec
.
+3 -2
View File
@@ -46,8 +46,9 @@ enum nss_status {
NSS_STATUS_RETURN
};
#define __nss_compat_result(rv) \
((rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN : \
#define __nss_compat_result(rv, err) \
((rv == NSS_STATUS_TRYAGAIN && err == ERANGE) ? NS_RETURN : \
(rv == NSS_STATUS_TRYAGAIN) ? NS_TRYAGAIN : \
(rv == NSS_STATUS_UNAVAIL) ? NS_UNAVAIL : \
(rv == NSS_STATUS_NOTFOUND) ? NS_NOTFOUND : \
(rv == NSS_STATUS_SUCCESS) ? NS_SUCCESS : \
+15 -8
View File
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/param.h>
#include <errno.h>
#include <nss.h>
#include <pthread.h>
#include <pthread_np.h>
@@ -96,9 +97,10 @@ __nss_compat_getgrnam_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(name, grp, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct group **)retval = grp;
return (__nss_compat_result(status));
return (status);
}
@@ -120,9 +122,10 @@ __nss_compat_getgrgid_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(gid, grp, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct group **)retval = grp;
return (__nss_compat_result(status));
return (status);
}
@@ -144,11 +147,12 @@ __nss_compat_getgrent_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(grp, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct group **)retval = grp;
else
else if (status != NS_RETURN)
SET_TERMINATOR(group, &terminator);
return (__nss_compat_result(status));
return (status);
}
@@ -194,9 +198,10 @@ __nss_compat_getpwnam_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(name, pwd, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
return (__nss_compat_result(status));
return (status);
}
@@ -218,9 +223,10 @@ __nss_compat_getpwuid_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(uid, pwd, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
return (__nss_compat_result(status));
return (status);
}
@@ -242,11 +248,12 @@ __nss_compat_getpwent_r(void *retval, void *mdata, va_list ap)
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
status = fn(pwd, buffer, bufsize, errnop);
status = __nss_compat_result(status, *errnop);
if (status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
else
else if (status != NS_RETURN)
SET_TERMINATOR(passwd, &terminator);
return (__nss_compat_result(status));
return (status);
}
+1 -1
View File
@@ -86,7 +86,7 @@ All_FreeBSD(struct disk *d, int force_all)
int type;
#ifdef PC98
type = 0x494;
type = 0xc494;
#else
type = 0xa5;
#endif
+4 -7
View File
@@ -121,6 +121,7 @@ write_pmbr(int fd, const struct disk *disk)
u_long nsects;
int error;
error = 0;
nsects = disk->media_size / disk->sector_size;
buffer = calloc(disk->sector_size, 1);
if (buffer == NULL)
@@ -153,6 +154,7 @@ read_gpt(int fd, const struct disk *disk, struct gpt_hdr *hdr,
size_t nsects, sz;
int error, i;
error = 0;
nsects = disk->gpt_size * sizeof(struct gpt_ent) / disk->sector_size;
nsects++;
sz = nsects * disk->sector_size;
@@ -191,7 +193,6 @@ read_gpt(int fd, const struct disk *disk, struct gpt_hdr *hdr,
uuid_create(&tbl[i].ent_uuid, NULL);
}
error = 0;
goto bail;
}
@@ -213,7 +214,6 @@ read_gpt(int fd, const struct disk *disk, struct gpt_hdr *hdr,
goto bail;
}
memcpy(&hdr[1], buffer, sizeof(struct gpt_hdr));
error = 0;
bail:
free(buffer);
@@ -231,6 +231,8 @@ update_gpt(int fd, const struct disk *disk, struct gpt_hdr *hdr,
size_t bufsz;
int error, idx, sav;
error = 0;
/*
* Save the entries of those chunks that have an index. They are
* the ones that exist on disk already.
@@ -358,7 +360,6 @@ update_gpt(int fd, const struct disk *disk, struct gpt_hdr *hdr,
error = (errno) ? errno : EAGAIN;
goto bail;
}
error = 0;
bail:
free(buffer);
@@ -411,10 +412,6 @@ Write_Disk(const struct disk *disk)
* Update and write the in-memory copy of the GPT.
*/
error = update_gpt(fd, disk, hdr, tbl);
if (error)
goto bail;
return (0);
bail:
close(fd);
+3 -2
View File
@@ -18,11 +18,11 @@
# Set these, release builder!
#
# Fixed version:
#BUILDNAME=5.2-RELEASE
#BUILDNAME=5.2.1-RELEASE
#
# Automatic SNAP versioning:
DATE != date +%Y%m%d
BASE = 5.2
BASE = 5.2.1
BUILDNAME?=${BASE}-${DATE}-SNAP
#
#CHROOTDIR=/junk/release
@@ -739,6 +739,7 @@ release.9:
@awk -f ${.CURDIR}/scripts/driver-copy2.awk 2 \
${.CURDIR}/${TARGET}/drivers.conf \
${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
@strip -g ${RD}/mfsfd/modules/*.ko
.endif
@mkdir -p ${RD}/mfsroot
sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
@@ -49,8 +49,13 @@
<sect1 id="intro">
<title>Introduction</title>
<para>This distribution is a &release.type; of &os; &release.current;, the
latest point along the &release.branch; branch.</para>
<para>This distribution is a &release.type; of &os;
&release.current;. This is a <quote>point release</quote>. It
exists primarily to address some specific issues found
(after-the-fact) in the &os; &release.base; distribution.
Changes made for this point release are described, in the
release notes. Generally speaking, the features of this release
are unchanged compared to &os; &release.base;.</para>
<sect2>
<title>About &os;</title>
@@ -40,29 +40,9 @@
It also provides some notes on upgrading
from previous versions of &os;.</para>
<![ %release.type.snapshot [
<para>The &release.type; distribution to which these release notes
apply represents a point along the &release.branch; development
branch between &release.prev; and the future &release.next;. Some
pre-built, binary &release.type; distributions along this branch
can be found at <ulink url="&release.url;"></ulink>.</para>
]]>
<![ %release.type.release [
<para>This distribution of &os; &release.current; is a
&release.type; distribution. It can be found at <ulink
url="&release.url;"></ulink> or any of its mirrors. More
information on obtaining this (or other) &release.type;
distributions of &os; can be found in the <ulink
url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mirrors.html"><quote>Obtaining
FreeBSD</quote> appendix</ulink> to the <ulink
url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/">FreeBSD
Handbook</ulink>.</para>
]]>
<quote>point release</quote>, intended to address some issues
(primarily bug fixes) discovered in &os; &release.base;.</para>
<para>Users who are new to the &release.branch; series of &os;
&release.type;s should also read the <quote>Early Adopters Guide
@@ -114,6 +94,9 @@
primarily on security advisories, user-visible changes, and major
architectural improvements.</para>
<para>Release note entries that describe changes specific to this
point release are marked with &new.521;.</para>
<sect2 id="security">
<title>Security Advisories</title>
@@ -178,6 +161,29 @@
information, see security advisory
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-03:19.bind.asc">FreeBSD-SA-03:19</ulink>. &merged;</para>
<para>&new.521; A bug in &man.mksnap.ffs.8; has been fixed; it caused the creation of a
filesystem snapshot to reset the flags on the filesystem to
their default values. The possible consequences depended on local
usage, but could include disabling extended access control lists
or enabling the use of setuid executables stored on an untrusted
filesystem. This bug also affected the &man.dump.8;
<option>-L</option> option, which uses &man.mksnap.ffs.8;. Note
that &man.mksnap.ffs.8; is normally only available to the
superuser and members of the <groupname>operator</groupname>
group. For more information, see security advisory <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:01.mksnap_ffs.asc">FreeBSD-SA-04:01</ulink>.</para>
<para>&new.521; A bug with the System V Shared Memory interface
(specifically the &man.shmat.2; system call) has been fixed.
This bug can cause a shared memory segment to reference
unallocated kernel memory. In turn, this can permit a local
attacker to gain unauthorized access to parts of kernel memory,
possibly resulting in disclosure of sensitive information,
bypass of access control mechanisms, or privilege escalation.
More details can be found in security advisory <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:02.shmat.asc">FreeBSD-SA-04:02</ulink>.
&merged;</para>
</sect2>
<sect2 id="kernel">
@@ -201,6 +207,9 @@
update, the cxconfig userland configuration utility has been
replaced by a newer &man.sconfig.8; utility.</para>
<para>&new.521; &man.devfs.5; path rules now work correctly on
directories.</para>
<para arch="i386,pc98">The DRM kernel modules have been updated from
DRI CVS as of 12 November 2003. Among other changes, this
change includes a newly-ported SiS 300/305/540/630/730
@@ -239,7 +248,7 @@
<warning>
<para>This driver should be considered experimental and
and should be used with some caution.</para>
should be used with some caution.</para>
</warning>
<note>
@@ -308,7 +317,9 @@
<sect3 id="boot">
<title>Boot Loader Changes</title>
<para></para>
<para arch="i386">&new.521; <filename>cdboot</filename> now works around a
BIOS problem observed on some systems when booting from USB
CDROM drives.</para>
<!-- Above this line, order boot loader changes by keyword-->
@@ -330,6 +341,10 @@
<para>A bug in the &man.bge.4; driver that prevented it from
working correctly at 10 Mbps has been fixed.</para>
<para arch="sparc64">&new.521; The &man.dc.4; driver now supports sparc64
Davicom cards that store their MAC address in
OpenFirmware.</para>
<para>The &man.em.4; driver now has support for tuning
the interrupt delays using sysctl tunables
without recompiling the driver.</para>
@@ -361,6 +376,9 @@
<para>&man.sk.4; now supports SK-9521 V2.0 and 3COM 3C940 based Gigabit
Ethernet NICs. &merged;</para>
<para>&new.521; Several bugs related to multicast and promiscuous mode
handling in the &man.sk.4; driver have been fixed.</para>
<para>A new &man.utopia.4; driver supports 25MBit/sec,
155MBit/sec and 622MBit/sec ATM physical layer configuration,
status and statistics reporting for the most commonly used
@@ -488,11 +506,23 @@
<para>A number of fixes and updates to the IPv6 and IPSec code
have been imported from the KAME Project.</para>
<para>&new.521; Some bugs in the IPsec implementation from the KAME
Project have been fixed. These bugs were related to freeing
memory objects before all references to them were removed, and
could cause erratic behavior or kernel panics after flushing
the Security Policy Database (SPD).</para>
<para>Support for the IPv6 Advanced Sockets API now conforms to
RFC 3542 (also known as RFC 2292bis), rather than RFC 2292.
Applications using this API have been updated
accordingly.</para>
<para>&new.521; The <literal>PFIL_HOOKS</literal> option is now enabled by
default in the <filename>GENERIC</filename> kernel. The most
notable effect of this change is to make
<application>IPFilter</application> work correctly when loaded
as a kernel module.</para>
<para>Support for the source address selection part of RFC 3484
has been added. The &man.ip6addrctl.8; utility can be used to
configure the address selection policy.</para>
@@ -504,6 +534,23 @@
source or destination. Similar information that used to be
stored in the routing table has been removed.</para>
<para>The TCP implementation in &os; now includes
protection against a certain class of TCP MSS resource
exhaustion attacks, in the form of limits on the size and rate
of TCP segments. The first limit sets the minimum allowed
maximum TCP segment size, and is controlled by the
<varname>net.inet.tcp.minmss</varname> sysctl variable (the
default value is <literal>216</literal> bytes). The second
limit is set by the
<varname>net.inet.tcp.minmssoverload</varname> variable, and
controls the maximum rate of connections whose average segment
size is less than <varname>net.inet.tcp.minmss</varname>.
Connections exceeding this packet rate are reset and dropped.
Because this feature was added late in the &release.base;
release cycle, connection rate limiting is disabled by default,
but can be enabled manually by assigning a non-zero value to
<varname>net.inet.tcp.minmssoverload</varname>.</para>
</sect3>
<sect3 id="disks">
@@ -519,6 +566,11 @@
configuration files, as it is no longer automatically implied
by <literal>device atadisk</literal>.</para>
<para>&new.521; A number of bugs in the &man.ata.4; driver have been
fixed. Most notably, master/slave device detection should
work better, and some problems with timeouts should be
resolved.</para>
<para>&man.ccd.4; can now operate on raw disks and other
&man.geom.4; providers.</para>
@@ -562,6 +614,9 @@
<literal>UDF_ICONV</literal> kernel options,
respectively.</para>
<para>&new.521; A bug in GEOM that could result in I/O hangs in some rare
cases has been fixed.</para>
<para>Some off-by-one errors in the smbfs that prevented it from
working correctly with 15-character NetBIOS names have been fixed.</para>
@@ -600,6 +655,10 @@
More information can be found in the &man.mount.nfs4.8; and
&man.idmapd.8; manual pages.</para>
<para>&new.521; A panic in the NFSv4 client has been fixed; this occurred
when attempting operations against an NFSv3/NFSv2-only
server.</para>
</sect3>
<sect3 id="mm">
@@ -714,6 +773,11 @@
programs that used <filename>libcipher</filename> have been
converted to use <filename>libcrypto</filename> instead.</para>
<para arch="pc98">&new.521; <filename>libdisk</filename> now uses the
correct PC98 disk partition value for &os;. This permits the
&man.sysinstall.8; disk partition editor to correctly create a
single &os; partition covering the entire disk.</para>
<para>The <filename>libkiconv</filename> library has been added to
support working with loadable character set conversion tables in
the kernel.</para>
@@ -765,6 +829,11 @@
<para>The &man.nologin.8; program has been reimplemented in C (it
was formerly a shell script).</para>
<para>&new.521; A bugfix has been applied to NSS support, which fixes
problems when using third-party NSS modules (such as <filename
role="package">net/nss_ldap</filename>) and groups with large
membership lists.</para>
<para>The &man.rc.conf.5; variable <varname>ntpd_flags</varname> for
&man.ntpd.8; now includes <option>-f /var/db/ntpd.drift</option>
by default.</para>
@@ -852,8 +921,15 @@
<para><application>BIND</application> has been updated from 8.3.4
to 8.3.7. &merged;</para>
<para>&new.521; Security improvements from <application>CVS</application>
1.11.10 and 1.11.11 have been backported. Specifically, certain
malformed module requests are now rejected, and when using
<command>cvs pserver</command> mode, attempts to authenticate as
<username>root</username> are rejected and recorded via
&man.syslog.3;.</para>
<para><application>GCC</application> has been updated from 3.2.2 to
a 3.3.3 post-release snapshot from 6 November 2003.
a 3.3.3 pre-release snapshot from 6 November 2003.
<note>
<para>Previous versions of <application>GCC</application>
@@ -928,6 +1004,13 @@
<para>The supported release of <application>KDE</application> has
been updated from 3.1.2 to 3.1.4. &merged;</para>
<para>&new.521; The <filename
role="package">sysutils/kdeadmin3</filename> port and package
have been updated to version 3.1.4_1. This update fixes a bug in the
<application>KUser</application> application that could cause
the <username>root</username> user to be deleted from the
password file</para>
</sect2>
<sect2 id="doc">
@@ -4,6 +4,9 @@
<!-- Text constants which probably don't need to be changed.-->
<!-- Notes new to our first point release (hopefully there'll only be one!) -->
<!ENTITY new.521 "[5.2.1]">
<!-- The marker for MFCs. -->
<!ENTITY merged "[MERGED]">
@@ -28,6 +28,8 @@
<!ENTITY release.4x "4.<replaceable>X</replaceable>">
<!ENTITY release.5x "5.<replaceable>X</replaceable>">
<!ENTITY release.4last "4.9-RELEASE">
<!ENTITY release.5branchpoint "5.3-RELEASE">
]>
@@ -35,7 +37,7 @@
FreeBSD Japanese Documentation Project
$FreeBSD$
Original revision: 1.16
Original revision: 1.17
-->
<article>
@@ -90,10 +92,10 @@
古い &os; リリースを &release.current; にアップグレードするのを
明確に非推奨としています。
特に、今までどおりの動作を期待する慎重なユーザには、しばらくの間は
(4.8-RELEASE のような) &release.4x; リリースで運用することをおすすめします。
(&release.4last; のような) &release.4x; リリースで運用することをおすすめします。
&release.5x; へのアップグレードを考える時期としては、
おそらく 5-STABLE 開発ブランチが作成された後が適当でしょう。
これは 5.2-RELEASE の公開あたりになる見込みです。</para>
これは &release.5branchpoint; の公開あたりになる見込みです。</para>
<para>(&os; &release.5x; はいわゆる<quote>卵鶏問題</quote>を抱えています。
プロジェクトでは皆が可能な限りリリースを
@@ -137,9 +139,9 @@
このブランチは CVS リポジトリで
<literal>RELENG_4</literal> というタグが付けられています。</para>
<para>&os; 5.0 と 5.1 は CURRENT ブランチをベースにしています。
CURRENT ブランチからのリリースは 2 年ぶりです
(前回の &os; 4.0 は 2000 年 3 月でした)。</para>
<para>&os; 5.0 と 5.1, 5.2 は CURRENT ブランチをベースにしています。
最初の 5.0 は CURRENT ブランチからの 2 年ぶりのリリースでした
(前回の HEAD からのリリース &os; 4.0 は 2000 年 3 月でした)。</para>
<para>&os; 5.0 のリリース後、少し経過した時点で
&os; CVS リポジトリに <literal>RELENG_5</literal> というタグが打たれ、
@@ -157,8 +159,8 @@
CVS リポジトリに 5-STABLE ブランチを作成することを予定しています。
おそらくブランチが作成されるまでに、&release.5x;
系列からリリース版がいくつか公開されるでしょう。
5-STABLE ブランチの登場は、5.2-RELEASE
の後あたりになると見込んでいます。</para>
5-STABLE ブランチの登場は、&release.5branchpoint;の前後
あたりになると見込んでいます。</para>
<para>&os; リリースエンジニアリング工程に関する詳細は、
<ulink url="http://www.FreeBSD.org/releng/index.html">リリースエンジニアリングのウェブページ</ulink>
@@ -183,8 +185,11 @@
<itemizedlist>
<listitem>
<para>SMPng: <quote>次世代</quote>に向けた SMP マシン対応です (開発中)。
現在は、カーネルにおけるマルチプロセッサの同時実行に部分的に対応しています。
この作業は現在進行中です。</para>
現在進んでいる作業では、さまざまなカーネルサブシステムにおいて
細粒度 (fine-grained) SMP ロックをおこない、カーネル内で実行される
スレッドの数を増やすことを目標としています。詳しくは
<ulink url="http://www.FreeBSD.org/smp/">FreeBSD SMP
プロジェクト</ulink> のページをご覧下さい。</para>
</listitem>
<listitem>
@@ -192,21 +197,22 @@
(Kernel Scheduled Entities; KSE) は、スケジューラアクティベーション
(Scheduler Activations) の手法と同様の、
1 個のプロセスが複数のカーネルレベルスレッドを
持てるようにするための機構です。この機構を利用して
持てるようにするための機構です。この機構で
&man.pthread.3; API を使用して
マルチスレッドのユーザランドプログラムを実現するために、
(実験的な) <filename>libkse</filename> ライブラリと
<filename>libthr</filename> ライブラリが提供されています。</para>
<filename>libkse</filename> と <filename>libthr</filename>
のスレッドライブラリが提供されています。</para>
</listitem>
<listitem>
<para>新しいアーキテクチャ: &i386;, pc98, alpha アーキテクチャに加え、
新たに &sparc64; と ia64 アーキテクチャに対応しました。</para>
<para>新しいアーキテクチャ: i386, pc98, alpha アーキテクチャに加え、
新たに sparc64, ia64, amd64 アーキテクチャに対応しました。</para>
</listitem>
<listitem>
<para>GCC: コンパイラツールチェインが
GCC 2.95.<replaceable>X</replaceable> ベースのものから、
GCC 3.2.2 に更新されました。</para>
GCC 3.3.<replaceable>X</replaceable> に更新されました。</para>
</listitem>
<listitem>
@@ -217,7 +223,7 @@
<listitem>
<para>GEOM: ディスク I/O 要求を変換する拡張性の高いフレームワークです。
GEOM をベースにしたディスク暗号化機能が実験的に開発されています。</para>
GEOM をベースにした GBDE ディスク暗号化機能が実験的に開発されています。</para>
</listitem>
<listitem>
@@ -239,10 +245,15 @@
<para>Cardbus: Cardbus デバイスに対応しました。</para>
</listitem>
<listitem>
<para>Bluetooth: Bluetooth デバイスに対応しました。</para>
</listitem>
</itemizedlist>
<para>さらに詳しい新機能のリストは、&os; &release.prev; と
&os; &release.current; のリリースノートに書かれています。</para>
<para>さらに詳しい新機能のリストは、各 &os; &release.5x;
リリースのリリースノートに書かれています。</para>
</sect1>
<sect1 id="drawbacks">
@@ -266,8 +277,13 @@
<para>カーネルのデータ構造体や ABI, API が変更されたため、
サードパーティ製のデバイスドライバは、
&os; 5.0 に対応させるための作業が必要です。
また、5-STABLE ブランチが作成される前に若干の
ABI, API の変更が加えられる可能性があります。</para>
また、5-STABLE ブランチが作成される前、特に新しい
マシンアーキテクチャでは、
ABI, API に多少変更が加えられる可能性があります。
(なるべく変更しないようにしていますが)、
ユーザから見える構造体が変更される場合があるかもしれません。
そうした場合にはアプリケーションを
コンパイルし直したり ports/packages をインストールし直す必要があります。</para>
</listitem>
<listitem>
@@ -290,32 +306,34 @@
<listitem>
<para>&os; 4.0 で正しく動作していた多くの ports/packages が、
&os; 5.0 では構築できなくなったり、
&os; &release.5x; では構築できなくなったり、
正しく動作しなくなったりしています。
これは大抵の場合、コンパイラツールチェインの変更と、
ヘッダファイルの整頓が原因です。</para>
これはほとんどがコンパイラツールチェインの変更と、
ヘッダファイルの整頓が原因です。あるいは、カーネルやデバイスにおける
対応の変更によるものもあるでしょう。</para>
</listitem>
<listitem>
<para>&os; &release.5x; の多くの新機能が、
一般向けに広く公開される初めての機会になります。
カーネルは、(SMPng などの) このような新機能によって、
大きく変更されています。</para>
大きく変更されています。これらの変更が安定性と性能に
どう影響するか正確に評価するのは難しいでしょう。</para>
</listitem>
<listitem>
<para>&os; 5.0 の新機能に含まれる問題点を追跡するため、
<para>&os; &release.5x; の新機能に含まれる問題点を追跡するため、
デバッグや診断用のコードがある程度残されています。
これにより &os; 5.0 は、4-STABLE より動作が遅くなっているでしょう。</para>
これにより &os; &release.5x; は、4-STABLE より動作が遅くなっているでしょう。</para>
</listitem>
<listitem>
<para>4-STABLE 開発ブランチへの機能統合は、
-CURRENT で<quote>安定した</quote>後にのみ、行なわれます。
&os; 5.0 は、このような -STABLE ブランチの持つ安定性を持っていません
&os; &release.5x; は、このような -STABLE ブランチの持つ安定性を持っていません
(訳注: &os; 5.0 への新機能追加は、「安定した後に統合」という
-STABLE ブランチの慣習に則っていないという意味です)。
(5-STABLE 開発ブランチは、5.2-RELEASE
(5-STABLE 開発ブランチは、&release.5branchpoint;
の後あたりに作成される予定です)。</para>
</listitem>
@@ -334,20 +352,24 @@
&release.5x; 系列が十分に安定するまでの間、
リリースエンジニアリングチームは、
現在の機能性・安定性を重要視するサイトやユーザに対して
4-STABLE ブランチから公開されるリリース版を利用することを推奨しています。</para>
4-STABLE ブランチから公開されるリリース版を利用することを推奨しています。
当初存在した安定性に関する問題点の多くは解決されたと考えていますが、
性能に関する問題点のいくつかは、また対処中のものがあります。
製品や <quote>ミッションクリティカルな</quote> システムをアップデート
する前にテスト環境でオペレーティングシステムのアップデートを試すのが、
システム管理における最良のやり方であることも注意しておきます。</para>
</sect1>
<sect1 id="plans-stable">
<title>4-STABLE ブランチに対する今後の予定</title>
<para>&os; 5.0 が公開されても、4-STABLE ブランチの開発が終了するわけではありません。
<para>重要: &release.5x; シリーズがリリースされても &release.4x;
リリースのサポートはある期間続けられます。
実際に、&os; 4.8-RELEASE は 5.0-RELEASE の
2 ヵ月後の 2003 年 4 月に公開されました。
このブランチからは、最低でももう 1 回のリリース、
すなわち 4.9-RELEASE が公開されるでしょう
(現在は 2003 年の夏を予定しています)。
4.10-RELEASE が公開される可能性についても同様です。
4-STABLE ブランチからの将来のリリースは、いくつかの要素が絡んできます。
2 ヵ月後の 2003 年 4 月に公開され、続いて 4.9-RELEASE が
2003 年 10 月に公開されました。
4-STABLE ブランチからの将来のリリースが出るとしたら、
それにはいくつかの要素が絡んできます。
最も重要なのは、5-STABLE ブランチの作成と、その安定性です。
CURRENT が 5-STABLE ブランチを作成できるほどに安定していなかった場合、
リリースは 4-STABLE ブランチから作成することになるでしょう。
@@ -360,7 +382,11 @@
将来の 4-STABLE リリースに対するユーザのニーズを考慮するつもりです。
ただしそのニーズは、リリースエンジニアリング作業に必要な労力・資源
(特に開発者の時間、計算機資源、ミラーアーカイブ容量)
に見合ったものである必要があるでしょう。</para>
に見合ったものである必要があるでしょう。
一般に、&os; コミュニティは (ユーザと開発者の双方とも)
&release.5x; ブランチ以降の新機能にひかれて先に進む傾向があるようです。
これは、新機能を &release.4x; に移植 (および保守)
することが難しいためです。</para>
<para>&a.security-officer; は &os; ウェブサイトの
<ulink url="http://www.FreeBSD.org/security/index.html">セキュリティのページ</ulink>
@@ -370,6 +396,21 @@
通常、各ブランチ毎に最も新しい 2 つのリリースです。
セキュリティオフィサチームは、
他のリリース版もこのルールに則ったサポートを行ないます。</para>
<para>現在のところ、リリースエンジニアリングチームは 4-STABLE
開発ブランチの将来について具体的な計画は持っていません。
このブランチからの今後のリリースは (もしあるとしたら)
簡単な <quote>ポイント</quote> リリースになるでしょう。
それらのリリースはおそらく、&release.4last; と比べて機能面で
大きな変更が含まれていないことを示す
4.9.<replaceable>X</replaceable> というバージョン番号になるでしょう。
これらのリリースでは基本的に、セキュリティ問題の修正やバグの修正、
デバイスドライバの更新 (特に新しいハードウェアの対応が、
既に存在するデバイスドライバで簡単に可能な場合) が
重視されます。主要な新機能 (特に &release.5x; で
追加された新しい機構が必要なもの) は、おそらく、
これらのリリースには追加されません。</para>
</sect1>
<sect1 id="upgrade">
@@ -403,13 +444,17 @@
特に、バイナリアップグレードは
&os; &release.4x; に存在して
&os; &release.5x; に存在しないファイルをシステムに数多く残します。
これらの古いファイルは何らかの問題を引き起こす可能性があります。</para>
これらの古いファイルは何らかの問題を引き起こす可能性があります。
例えば、古い C++ ヘッダ、 Ports コレクションへ移動した
プログラム、ダイナミックリンクされた root ファイルシステムの
実行ファイルをサポートするために移動した共有ライブラリが
挙げられます。</para>
<para>&i386; および pc98 プラットフォームの 4-STABLE では、
インストールメディアからの起動の際、
ISA デバイスの設定を起動時に変更できる UserConfig
ユーティリティが利用できるようになっています。
&os; 5.0 では、この機能の一部が &man.device.hints.5; 機構に
&os; &release.5x; では、この機能の一部が &man.device.hints.5; 機構に
置き換えられました(同じパラメータを指定できますが、
対話的なものではなくなっています)。</para>
@@ -463,7 +508,13 @@
で使っていた実行ファイルは &release.5x; でも動作します。
ただし、これには
<filename>compat4x</filename> 配布物がインストールされていることが必要です。
つまり、古い ports を使うことは<emphasis>おそらく</emphasis>可能です。</para>
古い ports をそのまま使うことができる場合もありますが、
後方互換性がない例も数多く判明しています。たとえば
<filename role="package">devel/gnomevfs2</filename>,
<filename role="package">mail/postfix</filename>,
<filename role="package">security/cfs</filename> の各 port は
<literal>statfs</literal>
構造体の変更のため、コンパイルし直す必要があります。</para>
<para>既存の 4-STABLE ベースのシステムに上書きする形でインストールや
アップグレードを行なった場合は、
@@ -1,7 +1,8 @@
<!--
$FreeBSD$
Original revision: 1.2
Original revision: 1.3
-->
<sect1 id="proc">
<title>対応プロセッサおよびマザーボード</title>
@@ -13,14 +14,15 @@
<para>&os;/&arch; は、執筆時点で Athlon64
(<quote>Clawhammer</quote>) と Opteron
(<quote>Sledgehammer</quote>) マシンに対応しています。これまでに試験されている
最大のメモリ構成は 8GB です。現在、SMP には対応していません。</para>
最大のメモリ構成は 8GB です。SMP 対応も完了し、十分に安定しています。</para>
<para>&os;/&arch; が対応するドライバについては、ほぼ &os;/i386 と同じです。
ドライバ (特に古いもの) によっては、64 ビットに対応していないという問題がありますが、
他の 64ビットプラットフォームで正しく動作しているドライバなら、
だいたい動作するでしょう。</para>
<para>&os;/&arch; はまだまだ未完成です。作業の多くは &os; Perforce
リポジトリでおこなわれており、安定してきた後に &os; CVS
リポジトリにマージされます。</para>
<para>&os;/&arch; はまだまだ開発されたばかりのプラットフォームです。
FreeBSD カーネルとベースシステムのほとんどの部分は非常に安定していますが、
特にサードパーティ製のパッケージに対しては、
問題が発生しやすいかも知れません。</para>
</sect1>
File diff suppressed because it is too large. Load diff
@@ -1,7 +1,8 @@
<!--
$FreeBSD$
Original revision: 1.12
Original revision: 1.13
-->
<sect1 id="proc">
<title>対応プロセッサおよびマザーボード</title>
@@ -42,9 +43,9 @@
同じ CPU 内の論理プロセッサ間で共有されている資源に対して、
スケジューリング決定を最適化しません。
このスケジューリング方法では最適な性能を得ることができないため、
デフォルトでは、起動時に論理 CPU を停止させています。
状況によっては、論理 CPU を停止させた方が良いかも知れません。
論理 CPU は <varname>machdep.hlt_logical_cpus</varname>
sysctl 変数で有効にすることができます。また、
sysctl 変数で制御にすることができます。また、
<varname>machdep.hlt_cpus</varname> sysctl 変数を使って、
CPU をアイドルループにすることも可能です。
詳しくは、&man.smp.4; のマニュアルページをご覧ください。</para>
+374 -84
View File
@@ -3,7 +3,7 @@
$FreeBSD$
Original revision: 1.644
Original revision: 1.663.2.13
-->
<articleinfo>
@@ -18,6 +18,7 @@
<year>2001</year>
<year>2002</year>
<year>2003</year>
<year>2004</year>
<holder role="mailto:[email protected]">FreeBSD ドキュメンテーション
プロジェクト</holder>
</copyright>
@@ -46,31 +47,9 @@
これは &os; に最近追加、変更、削除された機能について解説したものであり、
&os; の前のバージョンからのアップグレードについても言及しています。</para>
<![ %release.type.snapshot [
<para>このリリースノートが対応する &release.type; 配布物は、
&release.branch; 開発ブランチの &release.prev; から
将来の &release.next; の間に位置します。
このブランチのあらかじめコンパイルされたバイナリ &release.type;
配布物は <ulink url="&release.url;"></ulink> に公開されています。
</para>
]]>
<![ %release.type.release [
<para>この &os; &release.current; 配布物は &release.type; 配布物です。
この配布物はあらゆるミラーの <ulink url="&release.url;"></ulink>
で見つけることができます。
この (もしくは他の) &os; の &release.type; 配布物を取得する方法
は
<ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/">FreeBSD ハンドブック</ulink>
の
<ulink url="http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mirrors.html">
付録 <quote>FreeBSD を取得する</quote></ulink>
を参照してください。</para>
]]>
<para>この &os; &release.current; 配布物は
<quote>ポイントリリース</quote> であり、&os; &release.base; で発見された
いくつかの問題 (主にバグ) の修正をおこなったものです。</para>
<para>&os; &release.type; の &release.branch;
系列をはじめて利用するユーザは、まず <quote>&os;
@@ -129,6 +108,9 @@
監査で見つかったセキュリティ上好ましくないスタイルで書かれたコードの修正、
ソースコードの整理などです。</para>
<para>&new.521; という印は、このポイントリリースで追加された
リリースノートの項目を表しています。</para>
<sect2 id="security">
<title>セキュリティ勧告</title>
@@ -203,11 +185,53 @@
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-03:18.openssl.asc">FreeBSD-SA-03:18</ulink>
をご覧ください。
&merged;</para>
<para><application>BIND</application>
において、サービス妨害の可能性があったバグが修正されました。
詳細はセキュリティ勧告
<ulink url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-03:19.bind.asc">FreeBSD-SA-03:19</ulink>
をご覧ください。
&merged;</para>
<para>&new.521;
ファイルシステムのスナップショットを作成すると、
対象ファイルシステムのフラグが初期値に戻ってしまうという、
&man.mksnap.ffs.8; のバグが修正されました。
これによる影響の大小はシステムの利用形態によりますが、
拡張アクセス制御リストを無効にしたり、信頼できないファイルシステムに
置かれている setuid 実行ファイルの実行が可能になるおそれがあります。
&man.dump.8; の <option>-L</option> オプションも、
&man.mksnap.ffs.8; を利用するため、このバグによる影響を受けます。
ただし通常、&man.mksnap.ffs.8; を実行可能なのは
スーパユーザと <groupname>operator</groupname> のメンバのみです。
詳細はセキュリティ勧告 <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:01.mksnap_ffs.asc">FreeBSD-SA-04:01</ulink>
をご覧ください。</para>
<para>&new.521;
System V 共有メモリインタフェース
(のうち &man.shmat.2; システムコール) において、
未割当のカーネルメモリを参照する共有メモリセグメントをつくることができる、
というバグが修正されました。
ローカルの攻撃者がこれを悪用すると、カーネルメモリの一部に不正にアクセスすることが
可能になるため、結果としてセキュリティ上重要な情報の漏洩、アクセス制御機構の迂回や
高い権限の不正な獲得などに利用されるおそれがあります。
詳細はセキュリティ勧告 <ulink
url="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-04:02.shmat.asc">FreeBSD-SA-04:02</ulink>
をご覧ください。&merged;</para>
</sect2>
<sect2 id="kernel">
<title>カーネルの変更点</title>
<para arch="i386,ia64,amd64">&man.acpi.4; ドライバの CPU
コンポーネントが、単一プロセッサシステム、SMP システムの両方で
C1 から C3 のアイドル状態に対応しました。これは、プロセッサが
アイドル状態の時に消費電力や発熱を抑制するための機能で、ACPI 2.0
に準拠したものです。また、スロットリング制御機能が ACPI 2.0
に対応するように更新されています。</para>
<para arch="i386">コンソールを初期化する際に、
AT キーボードが接続されていない時でも
&man.atkbd.4; が AT キーボードを登録してしまうバグが修正されました。
@@ -216,10 +240,25 @@
を実行する必要はなくなっています。
&merged;</para>
<para arch="i386">Cronyx-Sigma シリアルインタフェース用の
&man.cx.4; ドライバが大きく修正・改良されました。この更新で
ユーザランドの設定ユーティリティ cxconfig は、&man.sconfig.8;
というユーティリティに置き換えられました。</para>
<para>&new.521; &man.devfs.5; の path ルールがディレクトリに対しても
正しく動作するようになりました。</para>
<para arch="i386,pc98">DRM カーネルモジュールが
DRI CVS リポジトリの 2003 年 9 月 9 日時点のコードに更新されました。
DRI CVS リポジトリの 2003 年 11 月 12 日時点のコードに更新されました。
この変更には、最近移植された SiS 300/305/540/630/730 ドライバの
統合が含まれています。</para>
統合と、SMPng のロック対応が含まれています。</para>
<para>新しく<quote>ダムコンソール</quote>ドライバ &man.dcons.4;
が追加されました。これは、ローカルとリモートコンソールに対応したもので、
&man.dcons.crom.4; ドライバを使うことで FireWire
経由でアクセスすることが可能です。
ユーザからは、&man.dconschat.8; ユーティリティを使うことで
&man.dcons.4; デバイスにアクセスすることができます。</para>
<para>マルチバイト文字集合の変換メソッドに対応する
<literal>LIBICONV</literal> カーネルオプションが追加されました。</para>
@@ -257,6 +296,19 @@
<para>公開鍵暗号機能には対応していません。</para>
</note></para>
<para arch="sparc64">&man.syscons.4; ドライバが
&os;/sparc64 に対応しました。システムコンソールを使ったインストールも
可能になっており、Creator3D グラフィックカードを搭載した
システム (たとえば Ultra 30) では、<application>XFree86</application>
が動作するようになっています。</para>
<para>新しく &man.uart.4; ドライバが追加されました。
これはさまざまな種類の UART (Universal Asynchronous Receiver/Transmitter)
デバイスに対応したもので、&man.sio.4; ドライバに似ていますが、
対応しているデバイスの数がより多くなっています。
このドライバは ia64 や sparc64 といった、
いくつかのアーキテクチャでシリアルポートに対応するために必要です。</para>
<para>カーネルにソフトウェアウォッチドッグ機能が実装されました。
詳しくは &man.watchdog.4; と
&man.watchdogd.8; をご覧ください。</para>
@@ -273,22 +325,39 @@
<sect3 id="proc">
<title>プラットフォーム固有のハードウェアの対応状況</title>
<para arch="i386">単一プロセッサ構成の i386 プラットフォームで、
常に PCI 割り込みが使われるようになりました。
これにより、今まで使用できなかった (特にラップトップの) PCI
カードが使用できるようになっています。</para>
<para arch="i386">割り込み経路の制御と SMP 対応を改良するため、
i386 マシン固有コードに大幅な変更がおこなわれました。
ユーザに影響する大きな変更点は、SMP カーネルが単一プロセッサシステムでも
動作するようになったこと、SMP 機能が <filename>GENERIC</filename>
カーネルで、デフォルトで有効になったことの 2 つです。
また、<literal>options APIC_IO</literal> カーネルオプションは
<literal>device apic</literal> に置き換えられています。</para>
<para arch="pc98">割り込み経路の制御と SMP 対応を改良するため、
i386 マシン固有コードに大幅な変更がおこなわれました。</para>
<para arch="i386">PAE 機能をある特定の量のメモリを搭載しているマシンで有効にした場合に、
カーネルがパニックさせる原因となる整数演算のオーバフローが修正されました。</para>
<para arch="i386,pc98">浮動小数点エミュレーションが削除されました。</para>
<para arch="i386,pc98">一部の Pentium 4 CPU、古い
Pentium Pro と Pentium II CPU における問題への対処が追加されました。
この不具合による症状は、そのほとんどが
メモリ破壊や原因不明のクラッシュとして現れていました。</para>
<para arch="i386">(HyperThreading 機能における) 論理 CPU が、
BIOS 設定に応じて有効化されるようになりました
(従来はデフォルトで無効になっており、
明示的に有効にする必要がありました)。</para>
</sect3>
<sect3 id="boot">
<title>ブートローダの変更</title>
<para></para>
<para arch="i386">&new.521;
BIOS に問題があるシステムでも、USB CDROM ドライブからの起動で
<filename>cdboot</filename> が動作するようになりました。</para>
<!-- Above this line, order bootloader changes by keyword-->
@@ -312,19 +381,30 @@
<para>&man.bge.4; にあったバグが修正され、
10Mbps で正常に動作するようになりました。</para>
<para arch="sparc64">&new.521; &man.dc.4; ドライバが
OpenFirmware に MAC アドレスを格納している
Davicom 製のカードに対応しました。</para>
<para>&man.em.4; ドライバが、ドライバを再コンパイルしなくても、
割込みの遅延量を sysctl 変数を利用して調整できるようになりました。</para>
<para>&man.fatm.4; ドライバが新しく追加されました。これは
Fore/Marconi PCA200 ATM カードに対応した NATM と NgATM
用のドライバです。</para>
<para arch="i386,pc98,sparc64">&man.harp.4; ドライバが新しく追加されました。
これは HARP (Host ATM Research Platform)
用の仮想的な物理インタフェースドライバです。
システムのすべての netgraph ATM インタフェースにアタッチし、
システムのすべての NetGraph ATM インタフェースにアタッチし、
HARP スタックに、
各インタフェースに対応する物理インタフェースを提供します。</para>
<para arch="i386,pc98,sparc64">&man.hatm.4; ドライバが新しく追加されました。
これは、Fore/Marconi HE155, HE622 ATM カードに対応しています。</para>
<para arch="i386">hfa ドライバが、ファームウェアバージョン
4.1.12 に更新され、数個の CBR チャネルに対応しました。</para>
<para arch="i386,pc98,sparc64">&man.patm.4; ドライバが新しく追加されました。
これは、IDT77252 ベースの ATM インタフェースに対応しています。</para>
@@ -337,34 +417,57 @@
Gigabit Ethernet NIC に対応しました。
&merged;</para>
<para>さまざまな種類の
UART (Universal Asynchronous Receiver/Transmitter)
デバイスに対応する &man.uart.4; ドライバが追加されました。
これは &man.sio.4; ドライバと機能が類似していますが、
より幅広いデバイスに対応しており、
ia64 や sparc64 のようなアーキテクチャにおける
シリアルポート対応に必要となるものです。</para>
<para>&new.521; &man.sk.4; ドライバのマルチキャストモードおよび
プロミスキャスモードに関係するバグが修正されました。</para>
<para>新しく &man.utopia.4; ドライバが追加されました。
これは、多くの ATM-PHY チップで使われている
25MBit/sec, 155MBit/sec. 622MBit/sec の
ATM 物理層の設定、状態・統計の取得に対応したものです。</para>
<para>&man.wi.4; ドライバのサスペンド/レジューム対応が
デバイスを down 状態にしている時にも正しく動作するようになりました。
&merged;</para>
<para>&man.wi.4; ドライバが、Lucent 802.11b
インタフェースで正しく動作するようになりました。</para>
<para>802.11 対応レイヤが、
拡張や新機能の追加が可能なように書き直されました。</para>
<para>xe ドライバが CE2, CEM28, CEM33 カードに対応し、
<para>&man.xe.4; ドライバが CE2, CEM28, CEM33 カードに対応し、
マルチキャスト (&man.multicast.4;) データグラムに対応しました。また、
ドライバにあったいくつかのバグも修正されています。</para>
<para>数多くのネットワークドライバの割り込みハンドラが
MPSAFE になりました。MPSAFE とは、ジャイアントロック (Giant lock)
なしに動作可能という意味です。そのように変更されたドライバには、
&man.ath.4;, &man.em.4;, &man.ep.4;, &man.fxp.4;, &man.sn.4;,
&man.wi.4;, &man.sis.4; などがあります。</para>
</sect3>
<sect3 id="net-proto">
<title>ネットワークプロトコル</title>
<para>IPv4 プロトコル実装における <literal>ip_flow</literal> 機能が、
<literal>ip_fastforward</literal> 機能で置き換えられました。
<literal>ip_fastforward</literal> 機能は、
送出インタフェースに向かうパケットをキューや netisr
を使わずに処理することで、単純なパケットの回送を高速化しようというものです。
処理できないパケットがあった場合、通常の <literal>ip_input</literal>
ルーチンに渡されて処理されます。この機能は
sysctl 変数 <varname>net.inet.ip.fastforwarding</varname> を
<literal>1</literal> にすると有効になります。</para>
<para><literal>IP_ONESBCAST</literal> オプションが追加されました。
これを有効にすると、特定のネットワークインタフェースに送られる
すべての &man.ip.4; ブロードキャストを、
強制的にリミテッドブロードキャストアドレスに向けることが可能です。</para>
<para><literal>options IPFILTER</literal> 機能を有効にする際には、
<literal>options PFIL_HOOKS</literal>
の追加が必要になりました。</para>
<para>&man.ipfw.4; limit ルールの処理に含まれていた、
システムパニックを発生させる可能性のあるバグが修正されました。
&merged;</para>
@@ -402,12 +505,8 @@
Protocol Independent Multicast ルーティング (&man.pim.4;) に対応しました。
&merged;</para>
<para>情報漏洩を防ぐため、フラグメンテーション (断片化) されない場合は
IPv4 パケットの <varname>ip_id</varname>
フィールドが設定されなくなりました。</para>
<para>&os; の Bluetooth プロトコルスタックが更新されました。</para>
<itemizedlist>
<listitem>
<para><application>libsdp</application> が
@@ -430,7 +529,7 @@
<listitem>
<para>&man.ng.hci.4; および &man.ng.l2cap.4; カーネルモジュールに含まれていた、
解放されたデータ構造体にアクセスする可能性のあった
netgraph タイムアウト問題が修正されました。</para>
NetGraph タイムアウト問題が修正されました。</para>
</listitem>
<listitem>
@@ -450,12 +549,60 @@
&man.sdpcontrol.8; ユーティリティが追加されました。</para>
</listitem>
</itemizedlist>
<para>IPv6 および IPsec のコードおける数多くの修正と更新が、
KAME プロジェクトから統合されました。</para>
<para>&new.521; KAME プロジェクトから統合された IPsec
の実装に含まれていたバグが修正されました。このバグは、
まだ参照されているメモリオブジェクトを開放してしまうもので、
セキュリティポリシデータベース (SPD; Security Policy Database)
をフラッシュした後に異常な動作をしたり
カーネルパニックが発生するという症状を引き起こします。</para>
<para>IPv6 Advanced Sockets API 対応が RFC 2292 ではなく
RFC 3542 (別名 RFC 2292bis) に準拠しました。
この API を使っているアプリケーションも、それに応じて更新されています。</para>
<para>&new.521; <literal>PFIL_HOOKS</literal> オプションが
<filename>GENERIC</filename> カーネルにおいて
デフォルトで有効になりました。
これにより、<application>IPFilter</application> が
カーネルモジュールとして読み込まれた時にも、正しく動作するように
なりました。</para>
<para>RFC 3484 に含まれているソースアドレス選択 (source address selection)
機能が追加されました。アドレス選択ポリシの設定には、
&man.ip6addrctl.8; ユーティリティが使用できます。</para>
<para>TCP 実装に <literal>tcp_hostcache</literal> 機能が追加されました。
これは過去の TCP セションのパラメータをキャッシュし、
以降に発生する同一の送信元アドレス・送信先アドレスの接続において、
より適切な初期値を与えることを可能にします。
経路表に格納されていた、同じような情報は削除されました。</para>
<para>&os; の TCP 実装に TCP セグメントのサイズと速度を制限するという形で、
ある種の TCP MSS 資源枯渇攻撃に対する対策が追加されました。
ひとつ目は TCP セグメントサイズの最大と最小を制限するもので、
sysctl 変数 <varname>net.inet.tcp.minmss</varname> (デフォルトは
<literal>216</literal>) で制御することができます。
ふたつ目は、セグメントの平均サイズが
<varname>net.inet.tcp.minmss</varname> より小さい接続の
最大通信速度を制限するもので、
<varname>net.inet.tcp.minmssoverload</varname>
変数で制御することができます。
設定されたパケット速度を超える接続は、reset されて切断されます。
この機能は &release.base; リリースサイクルの終りごろに追加されたため、
デフォルトでは、この接続速度の制限は無効になっていますが、
<varname>net.inet.tcp.minmssoverload</varname> に 0 でない
値を設定することで、手動で有効にすることができます。</para>
</sect3>
<sect3 id="disks">
<title>ディスク・記憶装置</title>
<para>&man.amr.4; ドライバがクラッシュダンプ機構に対応しました。</para>
<para>&man.amr.4; ドライバがクラッシュダンプ機構に対応しました。&merged;</para>
<para>&man.ata.4; ドライバが大きく書き直されました。
大きな変更の一つは、&man.ata.4; ドライバの
@@ -466,10 +613,14 @@
現在は、明示的にカーネルコンフィグファイルに
<literal>device ataraid</literal> を追加する必要があります。</para>
<para>&new.521; &man.ata.4; ドライバにあったバグの数々が修正されました。
特に、マスタ/スレーブ接続のデバイス検出が改善され、
タイムアウトによる問題などが解決しています。</para>
<para>&man.ccd.4; が raw ディスクおよび、その他の
&man.geom.4; プロバイダに対して動作するようになりました。</para>
<para>&man.da.4; ドライバが、USB デバイスと Firewire デバイスに
<para>&man.da.4; ドライバが、USB デバイスと FireWire デバイスに
6 バイトコマンドを送出しないようになりました。
現在、この回避策は (不要になったと思われるため) 無効にされています。
従来の動作に戻すには、<literal>options DA_OLD_QUIRKS</literal> を
@@ -500,14 +651,59 @@
<sect3 id="fs">
<title>ファイルシステム</title>
<para>cd9660、msdosfs、ntfs ファイルシステムが
<para>cd9660、msdosfs、ntfs, udf ファイルシステムが
マルチバイト文字変換に対応しました。
それぞれ、カーネルオプション <literal>CD9660_ICONV</literal>、
<literal>MSDOSFS_ICONV</literal>、<literal>NTFS_ICONV</literal> を
カーネルコンフィグファイルに指定してください。</para>
それぞれ、カーネルオプション
<literal>CD9660_ICONV</literal>,
<literal>MSDOSFS_ICONV</literal>,
<literal>NTFS_ICONV</literal>,
<literal>UDF_ICONV</literal>
をカーネルコンフィグファイルに指定してください。</para>
<para>&new.521; まれに I/O が固まった状態に陥るという GEOM の
バグが修正されました。</para>
<para>smbfs が 15 文字の NetBIOS 名で正しく動作するのを阻害していた
いくつかの一つ違い (off-by-one) の誤りが修正されました。</para>
<para>テラバイトオーダのファイルシステムに対応するため、
<literal>statfs</literal>
構造体に含まれるいくつかのメンバ変数の大きさが、
32 ビットから 64 ビットに変更されました。
<itemizedlist>
<listitem>
<para>この変更の前後でソースを使ってアップグレードする場合は、
次のソースアップグレード手順に従って作業し、
カーネルとユーザランドを同期させていなければなりません。</para>
</listitem>
<listitem>
<para>&man.statfs.2; システムコールの後方互換バージョンは、
<literal>COMPAT_FREEBSD4</literal>
カーネルオプションが追加されている場合にのみ利用できます。
このオプションを追加しておくことを強く推奨します。</para>
</listitem>
<listitem>
<para>&man.statfs.2; を使っているプログラムは、
再構築する必要があります。再構築が必要だと判明しているものには、
<filename role="package">devel/gnomevfs2</filename>,
<filename role="package">mail/postfix</filename>,
<filename role="package">security/cfg</filename>
などがあります。</para>
</listitem>
</itemizedlist>
<para>ミシガン大学の Citi NFSv4 クライアント実装が統合され、
NFSv4 に対応しました。
詳細は、&man.mount.nfs4.8; および
&man.idmapd.8; のマニュアルページをご覧ください。</para>
<para>&new.521; NFSv4 クライアントが NFSv3 のみ、あるいは NFSv2 のみに
対応したサーバに NFSv4 操作をおこなおうとした場合にパニックする
バグが修正されました。</para>
</sect3>
<sect3 id="mm">
@@ -520,7 +716,13 @@
<sect2 id="userland">
<title>ユーザランドの変更点</title>
<para>ACPI DSDT デバッガの &man.acpidb.8; が追加されました。</para>
<para arch="i386,pc98">i386 専用の a.out
コンパイラツールチェインが完全に削除されました。</para>
<para>&man.acpiconf.8; に、バッテリの状態を表示する
<option>-i</option> オプションが追加されました。</para>
<para>ACPI DSDT デバッガ &man.acpidb.8; が追加されました。</para>
<para>&man.arp.8; に、ARP エントリに対する操作の影響範囲を
特定のインタフェースに限定する <option>-i</option>
@@ -529,6 +731,11 @@
搭載したルータなどに有用なオプションです。
&merged;</para>
<para arch="i386,pc98">&man.asf.8;
ユーティリティが追加されました。
これは、KLD から &man.gdb.1;
デバッグ環境にシンボルファイルをロードするためのものです。</para>
<para>&man.atmconfig.8; が追加されました。
ATM ドライバと IP over ATM 機能の設定を行います。</para>
@@ -538,7 +745,8 @@
<option>-G</option> オプションを使います。
&merged;</para>
<para>devfs が必須となったため、dev_mkdb ユーティリティは削除されました。</para>
<para><filename>compat4x.i386</filename> ライブラリが、&os;
4.9-RELEASE に対応したものに更新されました。</para>
<para>&man.dhclient.8; が
ネットワークインタフェースの状態をポーリングするようになり、
@@ -546,6 +754,21 @@
ポーリング間隔は
<option>-i</option> オプションで制御することができます。</para>
<para>&man.fsck.8; で作成される <filename>lost+found</filename>
のデフォルトモードが、<literal>01777</literal> から
<literal>0700</literal> に変更されました。
&merged;</para>
<para>&man.fsck.ffs.8; および &man.newfs.8; が、
各ファイルシステムのルートディレクトリに
<groupname>operator</groupname> グループで
<filename>.snap</filename> ディレクトリを作成するようになりました。
&man.fsck.ffs.8;, &man.mksnap.ffs.8;, &man.dump.8; は、
それぞれのファイルシステムスナップショットをこのディレクトリに書き込みます。
この変更は、スナップショットの作成中にファイルシステムのルートディレクトリへの
アクセスをロックしないようにするため、また、<username>root</username>
以外のユーザがスナップショットを作成できるようにするためのものです。</para>
<para>&man.ffsinfo.8; ユーティリティが
UFS2 ファイルシステムを解釈するに更新され、
再びベースシステムに含まれるようになりました。</para>
@@ -554,6 +777,19 @@
これは、ACPI Source Language (ASL) と ACPI Machine language (AML) の
コンパイラ・逆コンパイラです。</para>
<para>&man.ifconfig.8; に新しいオプション <option>staticarp</option>
が追加されました。これは、そのインタフェースから
ARP 要求の送出をしないよう指定するためのものです。</para>
<para>&man.initgroups.3; ライブラリ関数の修正により、
login プロセスがプロセスの権限として、そのユーザが所属する
<emphasis>すべての</emphasis> グループが設定できなかった場合、
ログインが失敗するようになりました。
現在のカーネルにおける制限は、16 グループです。
管理者は、ユーザが 16 グループ以上に所属していないことを
確認することをおすすめします。もし所属グループ数が 16 を超えていると、
ログインすることができなくなります。</para>
<para>&man.ipfw.8; <literal>list</literal> および <literal>show</literal>
コマンドで、ルール番号を範囲で指定することができるようになりました。
&merged;</para>
@@ -561,12 +797,19 @@
<para>&man.ipfw.8; に、実際の動作を行なわずにコマンドの文法だけをチェックする
<option>-n</option> フラグが追加されました。&merged;</para>
<para>&man.kdump.1; に、特定のプロセスに対応するイベントのみを追跡する
<option>-p</option> オプションと、ダンプ開始時点からの相対的な
時刻を表示する <option>-E</option> フラグが追加されました。</para>
<para>&man.last.1; に、出力の行数を制限する
<option>-n</option> フラグが追加されました。</para>
<para><filename>libalias</filename> ライブラリ、&man.natd.8; および
&man.ppp.8; が Cisco Skinny Station プロトコルに対応しました。
このプロトコルは Cisco Call Manager と通信するために
Cisco 製の IP 電話によって利用されています。
ただし現時点では、NAT ゲートウェイの後ろに Call Manager を置く構成には
対応していません。</para>
対応していません。&merged;</para>
<para><filename>libcipher</filename> DES
暗号ライブラリが削除されました。
@@ -576,17 +819,30 @@
すべて <filename>libcrypto</filename>
を使うように変更されています。</para>
<para arch="pc98">&new.521; <filename>libdisk</filename> が
正しい PC98 ディスクパーティションタイプを使用するようになりました。
これにより、&man.sysinstall.8; のディスクパーティションエディタで
ディスク全体を使用する単一の &os; パーティションを正しく作成できる
ようになりました。</para>
<para>カーネルに読み込み可能な文字集合変換テーブルの操作をおこなう
<filename>libkiconv</filename> ライブラリが追加されました。</para>
<para arch="ia64">&os;/ia64 の標準スレッドライブラリが
<filename>libkse</filename> になりました。</para>
<para arch="i386,ia64"><filename>libthr</filename> 1:1
スレッドライブラリがデフォルトで構築されるようになりました。</para>
<para><filename>libwrap</filename> および &man.tcpdchk.8; が、
デフォルトで <application>tcp_wrappers</application>
拡張文法に対応するようになりました。</para>
<para>&man.locale.1; ユーティリティが再実装され、POSIX
標準に準拠しました。新しく追加された <option>-m</option> オプションは
利用可能なすべてのコードセットを表示します。</para>
<para><option>-v</option> フラグを指定して &man.mount.8; ユーティリティを
<para><option>-v</option> フラグを指定して &man.mount.8; ユーティリティを
実行した場合に、通常の情報に加えて各ファイルシステムのファイルシステム ID
が表示されるようになりました。このファイルシステム ID は、
&man.umount.8; ユーティリティでデバイスファイルや
@@ -595,7 +851,7 @@
複数のファイルシステムをマウントしている場合に、
アンマウントするファイルシステムを正確に指定することが可能です。</para>
<para>&man.mount.cd9660.8; と &man.mount.ntfs.8; ユーティリティに
<para>&man.mount.cd9660.8;, &man.mount.ntfs.8;, &man.mount.udf.8; ユーティリティに
<option>-C</option> オプションが追加されました。
これは Unicode ファイル名の変換先になるローカルの文字集合を指定するもので、
マルチバイト文字集合を指定することが可能です。</para>
@@ -618,6 +874,14 @@
<filename>/sbin</filename> から <filename>/usr/sbin</filename>
に移動しました。</para>
<para>(以前はシェルスクリプトだった) &man.nologin.8; プログラムが
C 言語で再実装されました。</para>
<para>&new.521; NSS サポートのバグが修正されました。
<filename role="package">net/nss_ldap</filename> などの
サードパーティ製 NSS モジュールを使い、大量のメンバリストを含む
グループが存在する場合に発生する問題が解決しています。</para>
<para>&man.rc.conf.5; にある、&man.ntpd.8; の起動オプションを設定する変数
<varname>ntpd_flags</varname> がデフォルトで
<option>-f /var/db/ntpd.drift</option> を含むようになりました。</para>
@@ -632,14 +896,20 @@
<para>&man.rarpd.8; にあった、
着脱可能な Ethernet NIC を認識しないというバグが修正されました。</para>
<para>&man.repquota.8; に、ユーザとグループを数値で表示する
<option>-n</option> フラグが追加されました。</para>
<para>&man.rtld.1; がデフォルトで
<quote>libmap</quote> 機能に対応するようになりました。
この変更により、コンパイル時の変数 <varname>WITH_LIBMAP</varname>
は不要となり、廃止されています。
詳細は &man.libmap.conf.5; をご覧ください。</para>
<para>カーネルの全部分が ELF フォーマットに移行し、
a.out フォーマットのツールチェインは使用しないため、
<para>&man.savecore.8; に、コアダンプファイルが存在するかどうかのみを
表示する <option>-C</option> フラグが追加されました。</para>
<para>カーネルの全部分が ELF フォーマットに移行したことにより
a.out フォーマットのツールチェインが使用されなくなったため、
不要になった symorder ユーティリティが削除されました。</para>
<para>&man.sysinstall.8; にインストール中に
@@ -647,11 +917,19 @@
現在、<application>exim</application> と
<application>Postfix</application> を選択することができます。</para>
<para>&man.sysinstall.8; の <quote>セキュリティプロファイル</quote>
対応が廃止されました。同等の機能は、&man.sshd.8; の項目を個々に設定したり、
システムのセキュアレベルを設定することで実現できます。</para>
<para>&man.systat.1; が
IPv6 および ICMPv6 のトラフィックを表示するようになりました。
&merged;</para>
<para><filename>/bin</filename> および
<para>&man.uname.1; に、カーネル識別子を表示する <option>-i</option>
フラグが追加されました。この識別子は、<varname>kern.ident</varname>
という sysctl 変数からも得ることが可能です。</para>
<para arch="i386,alpha,amd64,sparc64,pc98"><filename>/bin</filename> および
<filename>/sbin</filename> にあった多くのユーティリティは、
静的リンクされたクランチバイナリ (crunched binary) として
<filename>/rescue</filename> にも置かれるようになりました。
@@ -661,18 +939,19 @@
<literal>buildworld</literal>/<literal>installworld</literal> の操作で更新されるようになっています。
詳細は &man.rescue.8; をご覧ください。</para>
<para>動的リンクするように構築した実行ファイルを
<filename>/bin</filename> ディレクトリおよび
<filename>/sbin</filename> ディレクトリに
インストールできるようになりました。
<para><filename>/bin</filename> ディレクトリおよび
<filename>/sbin</filename> ディレクトリにあるたくさんの実行ファイルが、
静的リンクではなく動的リンクで構築されるようになりました。
これにより、ベースシステムユーティリティが読み込み可能な
PAM モジュールや NSS モジュールに対応できるようになりました。
また、共有ライブラリを使用することで
ルートファイルシステムに必要とされるディスク容量が削減されました。
この機能は <literal>buildworld</literal> の際に
変数 <varname>WITH_DYNAMICROOT</varname>
を定義して有効にすることができます。</para>
変数 <varname>NO_DYNAMICROOT</varname>
を定義して無効にすることができます。
また、システムの修正や復旧作業用に、静的にリンクされ、
crunch された実行ファイルが、
<filename>/rescue</filename> ディレクトリに置かれています。</para>
</sect2>
<sect2 id="contrib">
@@ -690,10 +969,19 @@
2003 年 7 月 29 日時点のスナップショットに更新されました。</para>
<para><application>BIND</application> がバージョン 8.3.4
から、バージョン 8.3.6 に更新されました。</para>
から、バージョン 8.3.7 に更新されました。&merged;</para>
<para>&new.521; <application>CVS</application> のバージョン
1.11.10 および 1.11.11 から、セキュリティの改善部分が
統合されました。具体的には、
ある形式で書かれた不正なモジュールのリクエストは拒否されるようになったこと、
<command>cvs pserver</command> モードを使用した場合に
<username>root</username> による認証は拒否され
&man.syslog.3; 経由で記録が残るようになったことが含まれます。</para>
<para><application>GCC</application> が、バージョン 3.2.2
から、3.3.1-release に更新されました。
から、2003 年 11 月 6 日における 3.3.3 の
pre release snapshot に更新されました。
<note>
<para><application>GCC</application> の前のバージョンは、
@@ -704,15 +992,6 @@
<literal>p4</literal> の場合の回避策は削除されました。</para>
</note></para>
<para><application>GCC</application> の
スレッドライブラリへのリンクを制御する
<option>-pthread</option> オプションが削除されました。
このオプションは、複数のスレッドライブラリ
(具体的には <filename>libc_r</filename>、<filename>libkse</filename>
および <filename>libthr</filename>) が存在する場合に混乱を引き起こします。
ports では、正しいスレッドライブラリを選択するために
変数 <varname>PTHREAD_LIBS</varname> を使用してください。</para>
<para><application>GNU Readline</application> がバージョン 4.2
から、バージョン 4.3 に更新されました。</para>
@@ -726,7 +1005,7 @@
から、バージョン 3.0.1rc12 に更新されました。</para>
<para><application>lukemftp</application> がバージョン
1.6beta2 から、NetBSD の 2003 年 6 月 30
1.6beta2 から、NetBSD の 2003 年 11 月 11
日時点のスナップショットに更新されました。</para>
<para><application>OpenPAM</application> が
@@ -737,14 +1016,14 @@
&merged;</para>
<para><application>sendmail</application> がバージョン
8.12.10 に更新されました。</para>
8.12.9 から 8.12.10 に更新されました。&merged;</para>
<para><application>texinfo</application> がバージョン 4.5
から、バージョン 4.6 に更新されました。
&merged;</para>
<para>タイムゾーンデータベースが <filename>tzdata2003a</filename> リリースから
<filename>tzdata2003d</filename> リリースに更新されました。</para>
<filename>tzdata2003d</filename> リリースに更新されました。&merged;</para>
</sect2>
@@ -775,12 +1054,23 @@
3.1.2 から 3.1.4 に更新されました。
&merged;</para>
<para>&new.521; <filename role="package">sysutils/kdeadmin3</filename>
port とその package がバージョン 3.1.4_1 に更新されました。
この更新では <application>KUser</application> を使うとシステム
パスワードファイルから <username>root</username> ユーザが
削除されてしまう可能性のあるバグが修正されています。</para>
</sect2>
<sect2 id="doc">
<title>ドキュメンテーション</title>
<para></para>
<para>情報の重複をなくし、内容管理の効率化をはかるため、
ハードウェアノートにある、
特定デバイスの記述をシステムのマニュアルページに移動しました。
このリリースの時点で、この作業はまだ進行中です。</para>
<para>トルコ語 (tr_TR.ISO8859-9) 翻訳プロジェクトが開始しました。</para>
</sect2>
</sect1>
@@ -5,11 +5,14 @@
$FreeBSD$
Original revision: 1.3
Original revision: 1.3.6.1
-->
<!-- Text constants which probably don't need to be changed.-->
<!-- Notes new to our first point release (hopefully there'll only be one!) -->
<!ENTITY new.521 "[5.2.1]">
<!-- The marker for MFCs. -->
<!ENTITY merged "[MFC ºÑ]">
+1 -11
View File
@@ -1,5 +1,5 @@
<!-- $FreeBSD$ -->
<!-- Original revision: 1.7 -->
<!-- Original revision: 1.7.4.1 -->
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY release.dsl PUBLIC "-//FreeBSD//DOCUMENT Release Notes DocBook Language Neutral Stylesheet//EN" CDATA DSSSL>
@@ -36,16 +36,6 @@
(list (list "HREF" "http://www.FreeBSD.org/docs.html"))
(literal "解説文書"))
(literal "をお読みください。")
(make element gi: "p"
attributes: (list (list "align" "center"))
(make element gi: "small"
(literal "FreeBSD ")
(literal (entity-text "release.branch"))
(literal " をお使いの方は、ぜひ ")
(literal "<")
(create-link (list (list "HREF" "mailto:[email protected]"))
(literal "[email protected]"))
(literal "> メーリングリストに参加ください。")))
(make element gi: "p"
attributes: (list (list "align" "center"))
@@ -12,7 +12,7 @@ UNITEXTS= readme errata early-adopter
IMAGEDIR= .imagedir
RHOST= freefall.freebsd.org
RDIR= public_html/relnotes/5.2-RELEASE
RDIR= public_html/relnotes/5.2.1-RELEASE
DOCDIR= ./release/doc
LANG= en_US.ISO8859-1
+5 -2
View File
@@ -6,7 +6,10 @@
<!-- Version of the OS we're describing. This needs to be updated
with each new release. -->
<!ENTITY release.current "5.2-RELEASE">
<!ENTITY release.current "5.2.1-RELEASE">
<!-- The previous minor release, used as a base for this point release. -->
<!ENTITY release.base "5.2-RELEASE">
<!-- The previous version used for comparison in the "What's New"
section. For -CURRENT, we might point back to the last
@@ -42,7 +45,7 @@
<!ENTITY release.manpath.xfree86 "4.3.0">
<!ENTITY release.manpath.netbsd "1.6.1">
<!ENTITY release.manpath.freebsd-ports "Ports">
<!ENTITY release.manpath.freebsd "5.2-RELEASE">
<!ENTITY release.manpath.freebsd "5.2.1-RELEASE">
<!-- Text constants which probably don't need to be changed.-->
+5 -1
View File
@@ -56,6 +56,7 @@ int
main(int argc, char **argv)
{
char *dir, *cp, path[PATH_MAX];
struct statfs stfsbuf;
struct ufs_args args;
struct group *grp;
struct stat stbuf;
@@ -85,6 +86,8 @@ main(int argc, char **argv)
} else {
strlcpy(path, args.fspec, cp - args.fspec + 1);
}
if (statfs(path, &stfsbuf) < 0)
err(1, "%s", path);
if (stat(path, &stbuf) < 0)
err(1, "%s", path);
if (!S_ISDIR(stbuf.st_mode))
@@ -100,7 +103,8 @@ main(int argc, char **argv)
*/
if ((grp = getgrnam("operator")) == NULL)
errx(1, "Cannot retrieve operator gid");
if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT, &args) < 0)
if (mount("ffs", dir, MNT_UPDATE | MNT_SNAPSHOT | stfsbuf.f_flags,
&args) < 0)
err(1, "Cannot create %s", args.fspec);
if ((fd = open(args.fspec, O_RDONLY)) < 0)
err(1, "Cannot open %s", args.fspec);
+7 -4
View File
@@ -317,10 +317,13 @@ Try increasing this number if you get the error
Enables calling the VESA reset BIOS vector on the resume path.
Some graphic chips have problems such as LCD white-out after resume.
Try setting this to 0 if this causes problems for you.
.It Va hw.acpi.os_name
Some systems' ASL may have problems because they look for names
of Microsoft operating systems.
This tunable overrides the default value of "FreeBSD".
.It Va hw.acpi.osname
Some systems' ASL may have problems because they look for names
of Microsoft operating systems.
This tunable overrides the value of the
.Qq Li \e_OS
object from its default of
.Qq Li FreeBSD .
.It Va hw.acpi.pci.link.%d.%d.%d.irq
Override the interrupt to use.
.It Va hw.acpi.verbose
+6 -6
View File
@@ -81,7 +81,7 @@ To support ATAPI floppy drives:
To support ATAPI tape drives:
.Cd device atapist
.Pp
The following tunables are setable from the loader:
The following tunables are settable from the loader:
.Bl -ohang
.It Va hw.ata.ata_dma
set to 1 for DMA access, 0 for PIO (default is DMA).
@@ -110,10 +110,10 @@ Aladdin (ALi5229) compatible chips.
AMD756, AMD766, AMD768, AMD8111.
.It CMD:
CMD646, CMD648, CMD649.
.It Cyrix:
Cyrix 5530.
.It Cypress:
Cypress 82C693.
.It Cyrix:
Cyrix 5530.
.It HighPoint:
HPT302, HPT366, HPT366, HPT368, HPT370, HPT371, HPT372, HPT374.
.It Intel:
@@ -127,9 +127,9 @@ PDC20246, PDC20262, PDC20263, PDC20265, PDC20267, PDC20268, PDC20269, PDC20270,
.It ServerWorks:
ROSB4, CSB5, CSB6.
.It Silicon Image:
SiI0680, SiI3112.
SiI0680, SiI3112, SiI3114.
.It SiS:
SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, SIS963
SIS5513, SIS530, SIS540, SIS550, SIS620, SIS630, SIS630S, SIS633, SIS635, SIS730, SIS733, SIS735, SIS745, SIS961, SIS962, SIS963, SIS964
.It VIA:
VT82C586, VT82C586B, VT82C596, VT82C596B, VT82C686, VT82C686A, VT82C686B, VT8231, VT8233, VT8233A, VT8233C, VT8235, VT8237.
.El
@@ -202,7 +202,7 @@ Static device numbering
kernel option)
reserves a number for each possibly connected disk,
even when not present.
This is usefull in hotswap senarios
This is useful in hotswap senarios
where disks should always show up as the same numbered device,
and not depend on attach order.
.Pp
+6
View File
@@ -170,6 +170,10 @@ FreeBSD 5.1 | NetBSD -current OpenBSD -current |
| \ | | | v
| ----- Mac OS X | |
| 10.3 | |
*---FreeBSD 5.2 | | |
| | | | |
| FreeBSD 5.2.1 | | |
| | | |
FreeBSD 5 -current | | |
| | | |
v v v v
@@ -387,6 +391,8 @@ FreeBSD 5.1 2003-06-09 [FBD]
Mac OS X 10.3 2003-10-24 [APL]
FreeBSD 4.9 2003-10-28 [FBD]
OpenBSD 3.4 2003-11-01 [OBD]
FreeBSD 5.2 2004-01-12 [FBD]
FreeBSD 5.2.1 2004-02-22 [FBD]
Bibliography
------------------------
+1
View File
@@ -68,6 +68,7 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options PFIL_HOOKS # pfil(9) framework
# Debugging for use in -current
#options DDB #Enable the kernel debugger
+3
View File
@@ -1210,6 +1210,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
/* doublefault stack space, runs on ist1 */
common_tss[0].tss_ist1 = (long)&dblfault_stack[sizeof(dblfault_stack)];
/* Set the IO permission bitmap (empty due to tss seg limit) */
common_tss[0].tss_iobase = sizeof(struct amd64tss);
gsel_tss = GSEL(GPROC0_SEL, SEL_KPL);
ltr(gsel_tss);
+1
View File
@@ -335,6 +335,7 @@ init_secondary(void)
/* Init tss */
common_tss[cpu] = common_tss[0];
common_tss[cpu].tss_rsp0 = 0; /* not used until after switch */
common_tss[cpu].tss_iobase = sizeof(struct amd64tss);
gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpu];
ssdtosyssd(&gdt_segs[GPROC0_SEL],
+1
View File
@@ -56,6 +56,7 @@ options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
options PFIL_HOOKS # pfil(9) framework
# Debugging for use in -current
#options DDB #Enable the kernel debugger
-1
View File
@@ -54,7 +54,6 @@ struct amd64tss {
u_int64_t tss_rsp2 __packed; /* kernel stack pointer ring 2 */
u_int32_t tss_rsvd1;
u_int32_t tss_rsvd2;
u_int32_t tss_rsvd3;
u_int64_t tss_ist1 __packed; /* Interrupt stack table 1 */
u_int64_t tss_ist2 __packed; /* Interrupt stack table 2 */
u_int64_t tss_ist3 __packed; /* Interrupt stack table 3 */
+4 -1
View File
@@ -379,6 +379,7 @@ ff.match: add $2,%sp # Discard saved %si
# Trashes: EAX
#
read: push %si # Save
push %cx # Save since some BIOSs trash
mov %eax,edd_lba # LBA to read from
mov %ebx,%eax # Convert address
shr $4,%eax # to segment
@@ -392,7 +393,8 @@ read.retry: call twiddle # Entertain the user
int $0x13 # Call BIOS
pop %dx # Restore
jc read.fail # Worked?
pop %si # Restore
pop %cx # Restore
pop %si
ret # Return
read.fail: cmp $ERROR_TIMEOUT,%ah # Timeout?
je read.retry # Yes, Retry.
@@ -439,6 +441,7 @@ twiddle: push %ax # Save
mov twiddle_chars,%bx # Address table
inc %al # Next
and $3,%al # char
mov %al,twiddle_index # Save index for next call
xlat # Get char
call putc # Output it
mov $8,%al # Backspace
+13 -1
View File
@@ -771,6 +771,7 @@ static int
linprocfs_doproccmdline(PFS_FILL_ARGS)
{
struct ps_strings pstr;
char **ps_argvstr;
int error, i;
/*
@@ -796,10 +797,21 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
sizeof(pstr));
if (error)
return (error);
if (pstr.ps_nargvstr > ARG_MAX)
return (E2BIG);
ps_argvstr = malloc(pstr.ps_nargvstr * sizeof(char *),
M_TEMP, M_WAITOK);
error = copyin((void *)pstr.ps_argvstr, ps_argvstr,
pstr.ps_nargvstr * sizeof(char *));
if (error) {
free(ps_argvstr, M_TEMP);
return (error);
}
for (i = 0; i < pstr.ps_nargvstr; i++) {
sbuf_copyin(sb, pstr.ps_argvstr[i], 0);
sbuf_copyin(sb, ps_argvstr[i], 0);
sbuf_printf(sb, "%c", '\0');
}
free(ps_argvstr, M_TEMP);
}
return (0);
+15 -10
View File
@@ -1328,20 +1328,22 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args)
}
case LINUX_CDROMREADTOCENTRY: {
struct linux_cdrom_tocentry lte, *ltep =
(struct linux_cdrom_tocentry *)args->arg;
struct linux_cdrom_tocentry lte;
struct ioc_read_toc_single_entry irtse;
irtse.address_format = ltep->cdte_format;
irtse.track = ltep->cdte_track;
error = copyin((void *)args->arg, &lte, sizeof(lte));
if (error)
break;
irtse.address_format = lte.cdte_format;
irtse.track = lte.cdte_track;
error = fo_ioctl(fp, CDIOREADTOCENTRY, (caddr_t)&irtse,
td->td_ucred, td);
if (!error) {
lte = *ltep;
lte.cdte_ctrl = irtse.entry.control;
lte.cdte_adr = irtse.entry.addr_type;
bsd_to_linux_msf_lba(irtse.address_format,
&irtse.entry.addr, &lte.cdte_addr);
copyout(&lte, (void *)args->arg, sizeof(lte));
error = copyout(&lte, (void *)args->arg, sizeof(lte));
}
break;
}
@@ -1826,11 +1828,14 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
break;
case LINUX_VT_SETMODE: {
struct vt_mode *mode;
struct vt_mode mode;
if ((error = copyin((void *)args->arg, &mode, sizeof(mode))))
break;
if (!ISSIGVALID(mode.frsig) && ISSIGVALID(mode.acqsig))
mode.frsig = mode.acqsig;
if ((error = copyout(&mode, (void *)args->arg, sizeof(mode))))
break;
args->cmd = VT_SETMODE;
mode = (struct vt_mode *)args->arg;
if (!ISSIGVALID(mode->frsig) && ISSIGVALID(mode->acqsig))
mode->frsig = mode->acqsig;
error = (ioctl(td, (struct ioctl_args *)args));
break;
}
+2 -2
View File
@@ -35,8 +35,8 @@
# $FreeBSD$
TYPE="FreeBSD"
REVISION="5.2"
BRANCH="RELEASE"
REVISION="5.2.1"
BRANCH="RELEASE-p14"
RELEASE="${REVISION}-${BRANCH}"
VERSION="${TYPE} ${RELEASE}"
+3 -1
View File
@@ -1290,8 +1290,10 @@ aac_map_command_sg(void *arg, bus_dma_segment_t *segs, int nseg, int error)
cm->cm_flags |= AAC_CMD_MAPPED;
/* put the FIB on the outbound queue */
if (aac_enqueue_fib(sc, cm->cm_queue, cm) == EBUSY)
if (aac_enqueue_fib(sc, cm->cm_queue, cm) == EBUSY) {
aac_unmap_command(cm);
aac_requeue_ready(cm);
}
return;
}
+1 -1
View File
@@ -58,7 +58,7 @@
*/
#define AAC_FIB_COUNT (PAGE_SIZE/sizeof(struct aac_fib))
#define AAC_PREALLOCATE_FIBS 128
#define AAC_MAX_FIBS 512
#define AAC_MAX_FIBS 504
/*
* The controller reports status events in AIFs. We hang on to a number of
+5 -5
View File
@@ -38,7 +38,8 @@
#undef _COMPONENT
#define _COMPONENT ACPI_TABLES
static char acpi_os_name[128];
static char acpi_osname[128];
TUNABLE_STR("hw.acpi.osname", acpi_osname, sizeof(acpi_osname));
ACPI_STATUS
AcpiOsPredefinedOverride (
@@ -49,10 +50,9 @@ AcpiOsPredefinedOverride (
return(AE_BAD_PARAMETER);
*NewVal = NULL;
if (strncmp(InitVal->Name, "_OS_", 4) == 0 &&
getenv_string("hw.acpi.os_name", acpi_os_name, sizeof(acpi_os_name))) {
printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_os_name);
*NewVal = acpi_os_name;
if (strncmp(InitVal->Name, "_OS_", 4) == 0 && strlen(acpi_osname) > 0) {
printf("ACPI: Overriding _OS definition with \"%s\"\n", acpi_osname);
*NewVal = acpi_osname;
}
return(AE_OK);
+83 -51
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,9 +40,10 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/bio.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
@@ -60,13 +61,13 @@ static d_ioctl_t ata_ioctl;
static struct cdevsw ata_cdevsw = {
.d_ioctl = ata_ioctl,
.d_name = "ata",
.d_maj = 159,
};
/* prototypes */
static void ata_shutdown(void *, int);
static int ata_getparam(struct ata_device *, u_int8_t);
static void ata_identify_devices(struct ata_channel *);
static void ata_fail_requests(struct ata_channel *ch,struct ata_device *device);
static void ata_boot_attach(void);
static void bswap(int8_t *, int);
static void btrim(int8_t *, int);
@@ -77,6 +78,7 @@ static void ata_init(void);
MALLOC_DEFINE(M_ATA, "ATA generic", "ATA driver generic layer");
struct intr_config_hook *ata_delayed_attach = NULL;
devclass_t ata_devclass;
uma_zone_t ata_zone;
int ata_wc = 1;
/* local vars */
@@ -175,7 +177,6 @@ int
ata_detach(device_t dev)
{
struct ata_channel *ch;
struct ata_request *request;
if (!dev || !(ch = device_get_softc(dev)) || !ch->r_irq)
return ENXIO;
@@ -190,16 +191,9 @@ ata_detach(device_t dev)
#endif
/* fail outstanding requests on this channel */
mtx_lock(&ch->queue_mtx);
while ((request = TAILQ_FIRST(&ch->ata_queue))) {
TAILQ_REMOVE(&ch->ata_queue, request, chain);
request->status = ATA_S_ERROR;
mtx_unlock(&ch->queue_mtx);
ata_finish(request);
mtx_lock(&ch->queue_mtx);
}
mtx_unlock(&ch->queue_mtx);
ata_fail_requests(ch, NULL);
/* flush cache and powerdown device */
if (ch->device[MASTER].param) {
if (ch->device[MASTER].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
ata_controlcmd(&ch->device[MASTER], ATA_FLUSHCACHE, 0, 0, 0);
@@ -237,42 +231,51 @@ ata_reinit(struct ata_channel *ch)
return ENXIO;
/* reset the HW */
ata_printf(ch, -1, "resetting devices ..\n");
if (bootverbose)
ata_printf(ch, -1, "reiniting channel ..\n");
ATA_FORCELOCK_CH(ch, ATA_CONTROL);
ch->flags |= ATA_IMMEDIATE_MODE;
ch->running = NULL;
devices = ch->devices;
ch->hw.reset(ch);
ATA_UNLOCK_CH(ch);
if (bootverbose)
ata_printf(ch, -1, "resetting done ..\n");
/* detach what left the channel during reset */
if ((misdev = devices & ~ch->devices)) {
if ((misdev & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) &&
ch->device[MASTER].detach) {
if (request && (request->device == &ch->device[MASTER])) {
request->result = ENXIO;
request->flags |= ATA_R_DONE;
if (request->callback)
(request->callback)(request);
else
wakeup(request);
sema_post(&request->done);
}
ch->device[MASTER].detach(&ch->device[MASTER]);
ata_fail_requests(ch, &ch->device[MASTER]);
free(ch->device[MASTER].param, M_ATA);
ch->device[MASTER].param = NULL;
}
if ((misdev & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE)) &&
ch->device[SLAVE].detach) {
if (request && (request->device == &ch->device[SLAVE])) {
request->result = ENXIO;
request->flags |= ATA_R_DONE;
if (request->callback)
(request->callback)(request);
else
wakeup(request);
sema_post(&request->done);
}
ch->device[SLAVE].detach(&ch->device[SLAVE]);
ata_fail_requests(ch, &ch->device[SLAVE]);
free(ch->device[SLAVE].param, M_ATA);
ch->device[SLAVE].param = NULL;
}
}
/* identify whats present on this channel now */
/* identify what is present on the channel now */
ata_identify_devices(ch);
/* attach new devices that appeared during reset */
@@ -285,17 +288,26 @@ ata_reinit(struct ata_channel *ch)
ch->device[SLAVE].attach(&ch->device[SLAVE]);
}
/* restore transfermode on devices */
if (ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))
/* restore device config and transfermode on devices */
if (ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER)) {
if (ch->device[MASTER].config)
ch->device[MASTER].config(&ch->device[MASTER]);
ch->device[MASTER].setmode(&ch->device[MASTER],ch->device[MASTER].mode);
if (ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))
}
if (ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE)) {
if (ch->device[SLAVE].config)
ch->device[SLAVE].config(&ch->device[SLAVE]);
ch->device[SLAVE].setmode(&ch->device[SLAVE], ch->device[SLAVE].mode);
}
#ifdef DEV_ATAPICAM
atapi_cam_reinit_bus(ch);
#endif
printf("done\n");
if (bootverbose)
ata_printf(ch, -1, "device config done ..\n");
ch->flags &= ~ATA_IMMEDIATE_MODE;
ata_start(ch);
return 0;
}
@@ -543,41 +555,33 @@ ata_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
static int
ata_getparam(struct ata_device *atadev, u_int8_t command)
{
struct ata_params *atacap;
struct ata_request *request;
int error = ENOMEM;
if (atadev->param)
atacap = atadev->param;
else
atacap = malloc(sizeof(struct ata_params), M_ATA, M_NOWAIT);
if (atacap) {
if (!atadev->param)
atadev->param = malloc(sizeof(struct ata_params), M_ATA, M_NOWAIT);
if (atadev->param) {
request = ata_alloc_request();
if (request) {
request->device = atadev;
request->u.ata.command = command;
request->flags = (ATA_R_READ | ATA_R_QUIET);
request->data = (caddr_t)atacap;
request->timeout = 2;
request->retries = 3;
request->bytecount = sizeof(struct ata_params);
request->transfersize = DEV_BSIZE;
while (request->retries) {
int retries = 2;
while (retries-- > 0) {
request->device = atadev;
request->timeout = 5;
request->retries = -1;
request->u.ata.command = command;
request->flags = (ATA_R_READ | ATA_R_IMMEDIATE);
request->data = (caddr_t)atadev->param;
request->bytecount = sizeof(struct ata_params);
request->transfersize = DEV_BSIZE;
ata_queue_request(request);
if (!(error = request->result))
break;
request->flags &= ~ATA_R_QUIET;
request->retries--;
}
ata_free_request(request);
}
if (!isprint(atacap->model[0]) || !isprint(atacap->model[1]))
error = ENXIO;
if (error) {
atadev->param = NULL;
free(atacap, M_ATA);
}
else {
if (!error && (isprint(atadev->param->model[0]) ||
isprint(atadev->param->model[1]))) {
struct ata_params *atacap = atadev->param;
#if BYTE_ORDER == BIG_ENDIAN
int16_t *ptr;
@@ -598,7 +602,6 @@ ata_getparam(struct ata_device *atadev, u_int8_t command)
bswap(atacap->serial, sizeof(atacap->serial));
btrim(atacap->serial, sizeof(atacap->serial));
bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
atadev->param = atacap;
if (bootverbose)
ata_prtdev(atadev,
"pio=0x%02x wdma=0x%02x udma=0x%02x cable=%spin\n",
@@ -606,6 +609,14 @@ ata_getparam(struct ata_device *atadev, u_int8_t command)
ata_umode(atacap),
(atacap->hwres & ATA_CABLE_ID) ? "80":"40");
}
else {
if (!error)
error = ENXIO;
if (atadev->param) {
free(atadev->param, M_ATA);
atadev->param = NULL;
}
}
}
return error;
}
@@ -694,6 +705,24 @@ ata_identify_devices(struct ata_channel *ch)
}
}
static void
ata_fail_requests(struct ata_channel *ch, struct ata_device *device)
{
struct ata_request *request;
mtx_lock(&ch->queue_mtx);
while ((request = TAILQ_FIRST(&ch->ata_queue))) {
if (device == NULL || request->device == device) {
TAILQ_REMOVE(&ch->ata_queue, request, chain);
request->result = ENXIO;
mtx_unlock(&ch->queue_mtx);
ata_finish(request);
mtx_lock(&ch->queue_mtx);
}
}
mtx_unlock(&ch->queue_mtx);
}
static void
ata_boot_attach(void)
{
@@ -964,16 +993,19 @@ ata_init(void)
printf("ata: malloc of delayed attach hook failed\n");
return;
}
ata_delayed_attach->ich_func = (void*)ata_boot_attach;
if (config_intrhook_establish(ata_delayed_attach) != 0) {
printf("ata: config_intrhook_establish failed\n");
free(ata_delayed_attach, M_TEMP);
}
/* Register a handler to flush write caches on shutdown */
/* register handler to flush write caches on shutdown */
if ((EVENTHANDLER_REGISTER(shutdown_post_sync, ata_shutdown,
NULL, SHUTDOWN_PRI_DEFAULT)) == NULL)
printf("ata: shutdown event registration failed!\n");
/* init our UMA zone for ATA requests */
ata_zone = uma_zcreate("ata_request", sizeof(struct ata_request),
NULL, NULL, NULL, NULL, 0, 0);
}
SYSINIT(atadev, SI_SUB_DRIVERS, SI_ORDER_SECOND, ata_init, NULL)
+34 -13
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -135,7 +135,6 @@
#define ATA_BMCMD_START_STOP 0x01
#define ATA_BMCMD_WRITE_READ 0x08
#define ATA_BMCTL_PORT 0x09
#define ATA_BMDEVSPEC_0 0x0a
#define ATA_BMSTAT_PORT 0x0b
#define ATA_BMSTAT_ACTIVE 0x01
@@ -182,30 +181,47 @@ struct ata_request {
u_int32_t donecount; /* bytes transferred */
caddr_t data; /* pointer to data buf */
int flags;
#define ATA_R_DONE 0x0001
#define ATA_R_CONTROL 0x0002
#define ATA_R_READ 0x0004
#define ATA_R_WRITE 0x0008
#define ATA_R_CONTROL 0x0001
#define ATA_R_READ 0x0002
#define ATA_R_WRITE 0x0004
#define ATA_R_DMA 0x0008
#define ATA_R_ATAPI 0x0010
#define ATA_R_QUIET 0x0020
#define ATA_R_DMA 0x0040
#define ATA_R_INTR_SEEN 0x0040
#define ATA_R_TIMEOUT 0x0080
#define ATA_R_ORDERED 0x0100
#define ATA_R_AT_HEAD 0x0200
#define ATA_R_IMMEDIATE 0x0200
#define ATA_R_REQUEUE 0x0400
#define ATA_R_SKIPSTART 0x0800
#define ATA_R_DEBUG 0x1000
void (*callback)(struct ata_request *request);
struct sema done; /* request done sema */
int retries; /* retry count */
int timeout; /* timeout for this cmd */
struct callout_handle timeout_handle; /* handle for untimeout */
int result; /* result error code */
struct task task; /* task management */
struct bio *bio; /* bio for this request */
TAILQ_ENTRY(ata_request) sequence; /* sequence management */
TAILQ_ENTRY(ata_request) chain; /* list management */
};
/* define this for debugging request processing */
#if 0
#define ATA_DEBUG_RQ(request, string) \
{ \
if (request->flags & ATA_R_DEBUG) \
ata_prtdev(request->device, "req=%08x %s " string "\n", \
(u_int)request, ata_cmd2str(request)); \
}
#else
#define ATA_DEBUG_RQ(request, string)
#endif
/* structure describing an ATA/ATAPI device */
struct ata_device {
struct ata_channel *channel;
@@ -218,6 +234,7 @@ struct ata_device {
void *softc; /* ptr to softc for device */
void (*attach)(struct ata_device *atadev);
void (*detach)(struct ata_device *atadev);
void (*config)(struct ata_device *atadev);
void (*start)(struct ata_device *atadev);
int flags;
#define ATA_D_USE_CHS 0x0001
@@ -289,6 +306,7 @@ struct ata_channel {
#define ATA_USE_PC98GEOM 0x04
#define ATA_ATAPI_DMA_RO 0x08
#define ATA_48BIT_ACTIVE 0x10
#define ATA_IMMEDIATE_MODE 0x20
struct ata_device device[2]; /* devices on this channel */
#define MASTER 0x00
@@ -305,11 +323,12 @@ struct ata_channel {
#define ATA_ACTIVE 0x0001
#define ATA_CONTROL 0x0002
void (*reset)(struct ata_channel *);
void (*locking)(struct ata_channel *, int);
#define ATA_LF_LOCK 0x0001
#define ATA_LF_UNLOCK 0x0002
struct mtx queue_mtx;
struct mtx queue_mtx; /* queue lock */
TAILQ_HEAD(, ata_request) ata_queue; /* head of ATA queue */
void *running; /* currently running request */
};
@@ -345,7 +364,6 @@ struct atapi_sense {
/* externs */
extern devclass_t ata_devclass;
extern struct intr_config_hook *ata_delayed_attach;
extern int ata_wc;
/* public prototypes */
@@ -371,8 +389,6 @@ int ata_limit_mode(struct ata_device *atadev, int mode, int maxmode);
/* ata-queue.c: */
int ata_reinit(struct ata_channel *ch);
void ata_start(struct ata_channel *ch);
struct ata_request *ata_alloc_request(void);
void ata_free_request(struct ata_request *request);
int ata_controlcmd(struct ata_device *atadev, u_int8_t command, u_int16_t feature, u_int64_t lba, u_int16_t count);
int ata_atapicmd(struct ata_device *atadev, u_int8_t *ccb, caddr_t data, int count, int flags, int timeout);
void ata_queue_request(struct ata_request *request);
@@ -391,6 +407,11 @@ void atapi_cam_attach_bus(struct ata_channel *ch);
void atapi_cam_detach_bus(struct ata_channel *ch);
void atapi_cam_reinit_bus(struct ata_channel *ch);
/* macros for alloc/free of ata_requests */
extern uma_zone_t ata_zone;
#define ata_alloc_request() uma_zalloc(ata_zone, M_NOWAIT | M_ZERO)
#define ata_free_request(request) uma_zfree(ata_zone, request)
/* macros for locking a channel */
#define ATA_LOCK_CH(ch, value) \
atomic_cmpset_acq_int(&(ch)->state, ATA_IDLE, (value))
+3 -1
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
+4 -2
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2002, 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 2002 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/ata.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/resource.h>
#include <machine/bus.h>
#include <sys/rman.h>
@@ -144,7 +146,7 @@ ata_cbus_attach(device_t dev)
return ENXIO;
}
if ((bus_setup_intr(dev, ctlr->irq, INTR_TYPE_BIO | INTR_ENTROPY,
if ((bus_setup_intr(dev, ctlr->irq, ATA_INTR_FLAGS,
ata_cbus_intr, ctlr, &ctlr->ih))) {
device_printf(dev, "unable to setup interrupt\n");
bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, ctlr->io);
+70 -59
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
#include <sys/ata.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
@@ -99,6 +101,7 @@ static int ata_serverworks_chipinit(device_t);
static void ata_serverworks_setmode(struct ata_device *, int);
static int ata_sii_chipinit(device_t);
static int ata_sii_mio_allocate(device_t, struct ata_channel *);
static void ata_sii_reset(struct ata_channel *);
static void ata_sii_intr(void *);
static void ata_cmd_intr(void *);
static void ata_cmd_old_intr(void *);
@@ -146,7 +149,7 @@ ata_generic_intr(void *data)
for (unit = 0; unit < 2; unit++) {
if (!(ch = ctlr->interrupt[unit].argument))
continue;
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
@@ -247,7 +250,7 @@ ata_acard_intr(void *data)
continue;
if (!(ch = ctlr->interrupt[unit].argument))
continue;
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
@@ -1104,7 +1107,7 @@ ata_promise_ident(device_t dev)
if ((idx->cfg2 & PRTX4) && pci_get_class(GRANDPARENT(dev))==PCIC_BRIDGE &&
!BUS_READ_IVAR(device_get_parent(GRANDPARENT(dev)),
GRANDPARENT(dev), PCI_IVAR_DEVID, &devid) &&
devid == ATA_DEC_21150) {
((devid == ATA_DEC_21150) || (devid == ATA_DEC_21150_1))) {
static long start = 0, end = 0;
if (pci_get_slot(dev) == 1) {
@@ -1193,6 +1196,7 @@ ata_promise_chipinit(device_t dev)
}
break;
}
ctlr->setmode = ata_promise_setmode;
return 0;
}
@@ -1209,8 +1213,8 @@ ata_promise_mio_allocate(device_t dev, struct ata_channel *ch)
}
ch->r_io[ATA_ALTSTAT].res = ctlr->r_io2;
ch->r_io[ATA_ALTSTAT].offset = 0x238 + (ch->unit << 7);
ch->r_io[ATA_BMCTL_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMCTL_PORT].offset = 0x260 + (ch->unit << 7);
ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMCMD_PORT].offset = 0x260 + (ch->unit << 7);
ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMDTP_PORT].offset = 0x244 + (ch->unit << 7);
ch->r_io[ATA_BMDEVSPEC_0].res = ctlr->r_io2;
@@ -1239,7 +1243,7 @@ ata_promise_old_intr(void *data)
if (!(ch = ctlr->interrupt[unit].argument))
continue;
if (ATA_INL(ctlr->r_io1, 0x1c) & (ch->unit ? 0x00004000 : 0x00000400)) {
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
@@ -1266,7 +1270,7 @@ ata_promise_tx2_intr(void *data)
continue;
ATA_IDX_OUTB(ch, ATA_BMDEVSPEC_0, 0x0b);
if (ATA_IDX_INB(ch, ATA_BMDEVSPEC_1) & 0x20) {
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
@@ -1354,7 +1358,7 @@ ata_promise_setmode(struct ata_device *atadev, int mode)
case PRMIO:
if (mode > ATA_UDMA2 &&
(ATA_IDX_INL(atadev->channel, ATA_BMCTL_PORT) & 0x01000000)) {
(ATA_IDX_INL(atadev->channel, ATA_BMCMD_PORT) & 0x01000000)) {
ata_prtdev(atadev,
"DMA limited to UDMA33, non-ATA66 cable or device\n");
mode = ATA_UDMA2;
@@ -1442,8 +1446,8 @@ static int
ata_promise_mio_dmastart(struct ata_channel *ch)
{
ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->mdmatab);
ATA_IDX_OUTL(ch, ATA_BMCTL_PORT,
(ATA_IDX_INL(ch, ATA_BMCTL_PORT) & ~0x000000c0) |
ATA_IDX_OUTL(ch, ATA_BMCMD_PORT,
(ATA_IDX_INL(ch, ATA_BMCMD_PORT) & ~0x000000c0) |
((ch->dma->flags & ATA_DMA_READ) ? 0x00000080 : 0x000000c0));
return 0;
}
@@ -1451,8 +1455,8 @@ ata_promise_mio_dmastart(struct ata_channel *ch)
static int
ata_promise_mio_dmastop(struct ata_channel *ch)
{
ATA_IDX_OUTL(ch, ATA_BMCTL_PORT,
ATA_IDX_INL(ch, ATA_BMCTL_PORT) & ~0x00000080);
ATA_IDX_OUTL(ch, ATA_BMCMD_PORT,
ATA_IDX_INL(ch, ATA_BMCMD_PORT) & ~0x00000080);
return 0;
}
@@ -1582,7 +1586,8 @@ ata_sii_ident(device_t dev)
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
{{ ATA_SII3112, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
{{ ATA_SII3114, 0x00, SIIMEMIO, SII4CH, ATA_SA150, "SiI 3114" },
{ ATA_SII3112, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
{ ATA_SII3112_1, 0x02, SIIMEMIO, 0, ATA_SA150, "SiI 3112" },
{ ATA_SII3112, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" },
{ ATA_SII3112_1, 0x00, SIIMEMIO, SIIBUG, ATA_SA150, "SiI 3112" },
@@ -1622,6 +1627,7 @@ ata_sii_chipinit(device_t dev)
device_printf(dev, "unable to setup interrupt\n");
return ENXIO;
}
rid = 0x24;
if (!(ctlr->r_io2 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
0, ~0, 1, RF_ACTIVE)))
@@ -1636,10 +1642,14 @@ ata_sii_chipinit(device_t dev)
ctlr->chip->text);
}
if (ctlr->chip->cfg2 & SII4CH)
ctlr->channels = 4;
/* enable interrupt as BIOS might not */
pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1);
/* setup chipset defaults as BIOS might not */
#if 0
pci_write_config(dev, 0xa2, 0x328a, 2);
pci_write_config(dev, 0xa4, 0x328a328a, 4);
pci_write_config(dev, 0xa8, 0x22082208, 4);
@@ -1648,12 +1658,10 @@ ata_sii_chipinit(device_t dev)
pci_write_config(dev, 0xe4, 0x328a328a, 4);
pci_write_config(dev, 0xe8, 0x22082208, 4);
pci_write_config(dev, 0xec, 0x40094009, 4);
#endif
ctlr->allocate = ata_sii_mio_allocate;
if (ctlr->chip->max_dma >= ATA_SA150) {
if (ctlr->chip->max_dma >= ATA_SA150)
ctlr->setmode = ata_sata_setmode;
ctlr->locking = ata_serialize;
}
else
ctlr->setmode = ata_sii_setmode;
}
@@ -1683,32 +1691,47 @@ static int
ata_sii_mio_allocate(device_t dev, struct ata_channel *ch)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
int unit01 = (ch->unit & 1), unit10 = (ch->unit & 2);
int i;
for (i = ATA_DATA; i <= ATA_STATUS; i++) {
ch->r_io[i].res = ctlr->r_io2;
ch->r_io[i].offset = 0x80 + i + (ch->unit << 6);
ch->r_io[i].offset = 0x80 + i + (unit01 << 6) + (unit10 << 9);
}
ch->r_io[ATA_ALTSTAT].res = ctlr->r_io2;
ch->r_io[ATA_ALTSTAT].offset = 0x8a + (ch->unit << 6);
ch->r_io[ATA_ALTSTAT].offset = 0x8a + (unit01 << 6) + (unit10 << 9);
ch->r_io[ATA_BMCMD_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (ch->unit << 3);
ch->r_io[ATA_BMCMD_PORT].offset = 0x00 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMSTAT_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (ch->unit << 3);
ch->r_io[ATA_BMSTAT_PORT].offset = 0x02 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMDTP_PORT].res = ctlr->r_io2;
ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (ch->unit << 3);
ch->r_io[ATA_BMDTP_PORT].offset = 0x04 + (unit01 << 3) + (unit10 << 9);
ch->r_io[ATA_BMDEVSPEC_0].res = ctlr->r_io2;
ch->r_io[ATA_BMDEVSPEC_0].offset = 0xa1 + (ch->unit << 6);
ch->r_io[ATA_BMDEVSPEC_0].offset = 0xa1 + (unit01 << 6) + (unit10 << 9);
ch->r_io[ATA_BMDEVSPEC_1].res = ctlr->r_io2;
ch->r_io[ATA_BMDEVSPEC_1].offset = 0x100 + (unit01 << 7) + (unit10 << 9);
ch->r_io[ATA_IDX_ADDR].res = ctlr->r_io2;
if (ctlr->chip->max_dma >= ATA_SA150)
ch->flags |= ATA_NO_SLAVE;
ctlr->dmainit(ch);
if (ctlr->chip->cfg2 & SIIBUG)
ch->dma->boundary = 8 * 1024;
ch->reset = ata_sii_reset;
return 0;
}
static void
ata_sii_reset(struct ata_channel *ch)
{
ATA_IDX_OUTL(ch, ATA_BMDEVSPEC_1, 0x00000001);
DELAY(25000);
ATA_IDX_OUTL(ch, ATA_BMDEVSPEC_1, 0x00000000);
}
static void
ata_sii_intr(void *data)
{
@@ -1721,11 +1744,10 @@ ata_sii_intr(void *data)
if (!(ch = ctlr->interrupt[unit].argument))
continue;
if (ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x08) {
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
ATA_BMSTAT_INTERRUPT)
if (!(bmstat & ATA_BMSTAT_INTERRUPT))
continue;
ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR);
DELAY(1);
@@ -1751,7 +1773,7 @@ ata_cmd_intr(void *data)
(ch->unit ? 0x08 : 0x04))) {
pci_write_config(device_get_parent(ch->dev), 0x71,
reg71 & ~(ch->unit ? 0x04 : 0x08), 1);
if (ch->dma) {
if (ch->dma && (ch->dma->flags & ATA_DMA_ACTIVE)) {
int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=
@@ -1802,14 +1824,16 @@ ata_sii_setmode(struct ata_device *atadev, int mode)
mode = ata_limit_mode(atadev, mode, ctlr->chip->max_dma);
if (ctlr->chip->max_dma < ATA_UDMA2) {
if (ctlr->chip->cfg2 & SIISETCLK) {
if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x79, 1) &
(atadev->channel->unit ? 0x02 : 0x01))) {
ata_prtdev(atadev,
"DMA limited to UDMA33, non-ATA66 cable or device\n");
mode = ATA_UDMA2;
}
}
else
mode = ata_check_80pin(atadev, mode);
}
else if (mode > ATA_UDMA2 && (pci_read_config(parent, 0x79, 1) &
(atadev->channel->unit ? 0x02 : 0x01))) {
ata_prtdev(atadev,"DMA limited to UDMA33, non-ATA66 cable or device\n");
mode = ATA_UDMA2;
}
error = ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode);
@@ -1918,28 +1942,11 @@ ata_sis_ident(device_t dev)
{ ATA_SIS963, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 963" }, /* south */
{ ATA_SIS962, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 962" }, /* south */
{ ATA_SIS755, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 755" }, /* ext south */
{ ATA_SIS752, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 752" }, /* unknown */
{ ATA_SIS751, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 751" }, /* unknown */
{ ATA_SIS750, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 750" }, /* unknown */
{ ATA_SIS748, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 748" }, /* unknown */
{ ATA_SIS746, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 746" }, /* ext south */
{ ATA_SIS745, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 745" }, /* 1chip */
{ ATA_SIS740, 0x00, SIS_SOUTH, 0, ATA_UDMA5, "SiS 740" }, /* ext south */
{ ATA_SIS735, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 735" }, /* 1chip */
{ ATA_SIS733, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 733" }, /* 1chip */
{ ATA_SIS730, 0x00, SIS100OLD, 0, ATA_UDMA5, "SiS 730" }, /* 1chip */
{ ATA_SIS661, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 661" }, /* ext south */
{ ATA_SIS658, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 658" }, /* ext south */
{ ATA_SIS655, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 655" }, /* ext south */
{ ATA_SIS652, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 652" }, /* unknown */
{ ATA_SIS651, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 651" }, /* ext south */
{ ATA_SIS650, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 650" }, /* ext south */
{ ATA_SIS648, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 648" }, /* ext south */
{ ATA_SIS646, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 645DX"},/* ext south */
{ ATA_SIS645, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 645" }, /* ext south */
{ ATA_SIS640, 0x00, SIS_SOUTH, 0, ATA_UDMA4, "SiS 640" }, /* ext south */
{ ATA_SIS635, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 635" }, /* 1chip */
{ ATA_SIS633, 0x00, SIS100NEW, 0, ATA_UDMA5, "SiS 633" }, /* unknown */
{ ATA_SIS630, 0x30, SIS100OLD, 0, ATA_UDMA5, "SiS 630S"}, /* 1chip */
@@ -1951,29 +1958,33 @@ ata_sis_ident(device_t dev)
{ ATA_SIS530, 0x00, SIS66, 0, ATA_UDMA4, "SiS 530" },
{ ATA_SIS5513, 0xc2, SIS33, 0, ATA_UDMA2, "SiS 5513" },
{ ATA_SIS5513, 0x00, SIS33, 0, ATA_WDMA2, "SiS 5513" },
{ ATA_SIS5513, 0x00, SIS33, 1, ATA_WDMA2, "SiS 5513" },
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
if (!(idx = ata_find_chip(dev, ids, -pci_get_slot(dev))))
return ENXIO;
if (idx->cfg1 == SIS_SOUTH) {
if (idx->cfg2) {
pci_write_config(dev, 0x57, pci_read_config(dev, 0x57, 1) & 0x7f, 1);
if (pci_read_config(dev, 0x00, 4) == ATA_SIS5518) {
idx->cfg1 = SIS133NEW;
sprintf(buffer, "SiS 96X %s controller",ata_mode2str(idx->max_dma));
idx->max_dma = ATA_UDMA6;
sprintf(buffer, "SiS 962/963 %s controller",
ata_mode2str(idx->max_dma));
}
else {
struct ata_chip_id id[] =
{{ ATA_SISSOUTH, 0x10, 0, 0, ATA_UDMA6, "SiS 961" },
{ 0, 0, 0, 0, 0, 0 }};
if (ata_find_chip(dev, id, pci_get_slot(dev)))
if (ata_find_chip(dev, id, pci_get_slot(dev))) {
idx->cfg1 = SIS133OLD;
idx->max_dma = ATA_UDMA6;
}
else {
idx->max_dma = ATA_UDMA5;
idx->cfg1 = SIS100NEW;
idx->max_dma = ATA_UDMA5;
}
sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma));
}
@@ -2124,12 +2135,12 @@ ata_via_ident(device_t dev)
{ ATA_VIA8237, 0x00, VIA133, 0x00, ATA_UDMA6, "VIA 8237" },
{ 0, 0, 0, 0, 0, 0 }};
static struct ata_chip_id new_ids[] =
{{ ATA_VIA8237, 0x00, 0x00, 0x00, ATA_SA150, "VIA 8237" },
{{ ATA_VIA8237_1, 0x00, 0x00, 0x00, ATA_SA150, "VIA 8237" },
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
if (pci_get_devid(dev) == ATA_VIA82C571) {
if (!(idx = ata_find_chip(dev, ids, pci_get_slot(dev))))
if (!(idx = ata_find_chip(dev, ids, -99)))
return ENXIO;
}
else {
+40 -30
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,9 @@ __FBSDID("$FreeBSD$");
#include <sys/disk.h>
#include <sys/cons.h>
#include <sys/sysctl.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/uma.h>
#include <machine/md_var.h>
#include <machine/bus.h>
#include <sys/rman.h>
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
/* prototypes */
static void ad_detach(struct ata_device *);
static void ad_config(struct ata_device *);
static void ad_start(struct ata_device *);
static void ad_done(struct ata_request *);
static disk_open_t adopen;
@@ -79,7 +80,9 @@ ad_attach(struct ata_device *atadev)
atadev->attach = NULL;
return;
}
atadev->softc = adp;
adp->device = atadev;
#ifdef ATA_STATIC_ID
adp->lun = (device_get_unit(atadev->channel->dev)<<1)+ATA_DEV(atadev->unit);
#else
@@ -119,28 +122,13 @@ ad_attach(struct ata_device *atadev)
lbasize48 > 268435455)
adp->total_secs = lbasize48;
/* enable read caching */
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_ENAB_RCACHE, 0, 0);
/* enable write caching if enabled */
if (ata_wc)
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_ENAB_WCACHE, 0, 0);
else
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_DIS_WCACHE, 0, 0);
/* use multiple sectors/interrupt if device supports it */
adp->max_iosize = DEV_BSIZE;
if (ad_version(atadev->param->version_major)) {
int secsperint = max(1, min(atadev->param->sectors_intr, 16));
if (!ata_controlcmd(atadev, ATA_SET_MULTI, 0, 0, secsperint))
adp->max_iosize = secsperint * DEV_BSIZE;
}
/* setup the function ptrs */
atadev->detach = ad_detach;
atadev->config = ad_config;
atadev->start = ad_start;
atadev->softc = adp;
/* config device features */
ad_config(atadev);
/* lets create the disk device */
adp->disk.d_open = adopen;
@@ -191,6 +179,30 @@ ad_detach(struct ata_device *atadev)
free(adp, M_AD);
}
static void
ad_config(struct ata_device *atadev)
{
struct ad_softc *adp = atadev->softc;
/* enable read caching */
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_ENAB_RCACHE, 0, 0);
/* enable write caching if enabled */
if (ata_wc)
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_ENAB_WCACHE, 0, 0);
else
ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_DIS_WCACHE, 0, 0);
/* use multiple sectors/interrupt if device supports it */
adp->max_iosize = DEV_BSIZE;
if (ad_version(atadev->param->version_major)) {
int secsperint = max(1, min(atadev->param->sectors_intr, 16));
if (!ata_controlcmd(atadev, ATA_SET_MULTI, 0, 0, secsperint))
adp->max_iosize = secsperint * DEV_BSIZE;
}
}
static int
adopen(struct disk *dp)
{
@@ -241,20 +253,19 @@ ad_start(struct ata_device *atadev)
/* setup request */
request->device = atadev;
request->driver = bp;
request->bio = bp;
request->callback = ad_done;
request->timeout = 10;
request->timeout = 5;
request->retries = 2;
request->data = bp->bio_data;
request->bytecount = bp->bio_bcount;
/* convert LBA contents if this is an old non-LBA device */
if (atadev->flags & ATA_D_USE_CHS) {
struct ata_params *param = atadev->param;
int sector = (bp->bio_pblkno % param->sectors) + 1;
int cylinder = bp->bio_pblkno / (param->sectors * param->heads);
int sector = (bp->bio_pblkno % adp->sectors) + 1;
int cylinder = bp->bio_pblkno / (adp->sectors * adp->heads);
int head = (bp->bio_pblkno %
(param->sectors * param->heads)) / param->sectors;
(adp->sectors * adp->heads)) / adp->sectors;
request->u.ata.lba =
(sector & 0xff) | (cylinder & 0xffff) << 8 | (head & 0xf) << 24;
@@ -295,14 +306,13 @@ ad_start(struct ata_device *atadev)
biofinish(bp, NULL, EIO);
return;
}
request->flags |= ATA_R_SKIPSTART;
ata_queue_request(request);
}
static void
ad_done(struct ata_request *request)
{
struct bio *bp = request->driver;
struct bio *bp = request->bio;
/* finish up transfer */
if ((bp->bio_error = request->result))
+3 -2
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,8 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/endian.h>
#include <sys/malloc.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <sys/bus.h>
#include <machine/bus.h>
#include <sys/rman.h>
+3 -1
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
+39 -46
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,8 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/conf.h>
#include <sys/bus.h>
#include <sys/mutex.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <dev/ata/ata-all.h>
@@ -69,9 +70,17 @@ ata_generic_hw(struct ata_channel *ch)
static int
ata_transaction(struct ata_request *request)
{
/* safety check, device might have been detached FIXME SOS */
if (!request->device->param) {
request->result = ENXIO;
return ATA_OP_FINISHED;
}
/* record the request as running */
request->device->channel->running = request;
ATA_DEBUG_RQ(request, "transaction");
/* disable ATAPI DMA writes if HW doesn't support it */
if ((request->device->channel->flags & ATA_ATAPI_DMA_RO) &&
((request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_WRITE)) ==
@@ -83,7 +92,7 @@ ata_transaction(struct ata_request *request)
/* ATA PIO data transfer and control commands */
default:
{
/* record command direction here as our request might be done later */
/* record command direction here as our request might be gone later */
int write = (request->flags & ATA_R_WRITE);
/* issue command */
@@ -106,6 +115,7 @@ ata_transaction(struct ata_request *request)
ata_pio_write(request, request->transfersize);
}
}
/* return and wait for interrupt */
return ATA_OP_CONTINUES;
@@ -136,6 +146,7 @@ ata_transaction(struct ata_request *request)
request->result = EIO;
break;
}
/* return and wait for interrupt */
return ATA_OP_CONTINUES;
@@ -294,16 +305,23 @@ ata_interrupt(void *data)
return;
}
ATA_DEBUG_RQ(request, "interrupt");
/* ignore interrupt if device is busy */
if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
if (!(request->flags & ATA_R_TIMEOUT) &&
ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) {
DELAY(100);
if (!(ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_DRQ))
return;
}
ATA_DEBUG_RQ(request, "interrupt accepted");
/* clear interrupt and get status */
request->status = ATA_IDX_INB(ch, ATA_STATUS);
request->flags |= ATA_R_INTR_SEEN;
switch (request->flags & (ATA_R_ATAPI | ATA_R_DMA | ATA_R_CONTROL)) {
/* ATA PIO data transfer and control commands */
@@ -341,6 +359,9 @@ ata_interrupt(void *data)
min((request->bytecount - request->donecount),
request->transfersize);
/* clear interrupt seen flag as we need to wait again */
request->flags &= ~ATA_R_INTR_SEEN;
/* if data write command, output the data */
if (request->flags & ATA_R_WRITE) {
@@ -492,12 +513,15 @@ ata_interrupt(void *data)
break;
}
ata_finish(request);
/* if we timed out the unlocking of the ATA channel is done later */
if (!(request->flags & ATA_R_TIMEOUT)) {
ch->running = NULL;
ATA_UNLOCK_CH(ch);
ch->locking(ch, ATA_LF_UNLOCK);
}
/* unlock the ATA channel for new work */
ch->running = NULL;
ATA_UNLOCK_CH(ch);
ch->locking(ch, ATA_LF_UNLOCK);
/* schedule completition for this request */
ata_finish(request);
}
/* must be called with ATA channel locked */
@@ -529,7 +553,7 @@ ata_reset(struct ata_channel *ch)
}
}
/* if nothing showed up no need to get any further */
/* if nothing showed up there is no need to get any further */
/* SOS is that too strong?, we just might loose devices here XXX */
ch->devices = 0;
if (!mask)
@@ -539,7 +563,11 @@ ata_reset(struct ata_channel *ch)
ata_printf(ch, -1, "reset tp1 mask=%02x ostat0=%02x ostat1=%02x\n",
mask, ostat0, ostat1);
/* reset channel */
/* reset host end of channel (if supported) */
if (ch->reset)
ch->reset(ch);
/* reset (both) devices on this channel */
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(10);
ATA_IDX_OUTB(ch, ATA_ALTSTAT, ATA_A_IDS | ATA_A_RESET);
@@ -627,41 +655,6 @@ ata_reset(struct ata_channel *ch)
"reset tp2 mask=%02x stat0=%02x stat1=%02x devices=0x%b\n",
mask, stat0, stat1, ch->devices,
"\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER");
#if 0
if (!mask)
return;
if (mask & 0x01 && ostat0 != 0x00 &&
!(ch->devices & (ATA_ATA_MASTER | ATA_ATAPI_MASTER))) {
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_MASTER);
DELAY(10);
ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
err = ATA_IDX_INB(ch, ATA_ERROR);
lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
if (bootverbose)
ata_printf(ch, ATA_MASTER, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
if (err != 0x58 && lsb == 0xa5)
ch->devices |= ATA_ATA_MASTER;
}
if (mask & 0x02 && ostat1 != 0x00 &&
!(ch->devices & (ATA_ATA_SLAVE | ATA_ATAPI_SLAVE))) {
ATA_IDX_OUTB(ch, ATA_DRIVE, ATA_D_IBM | ATA_SLAVE);
DELAY(10);
ATA_IDX_OUTB(ch, ATA_ERROR, 0x58);
ATA_IDX_OUTB(ch, ATA_CYL_LSB, 0xa5);
err = ATA_IDX_INB(ch, ATA_ERROR);
lsb = ATA_IDX_INB(ch, ATA_CYL_LSB);
if (bootverbose)
ata_printf(ch, ATA_SLAVE, "ATA err=0x%02x lsb=0x%02x\n", err, lsb);
if (err != 0x58 && lsb == 0xa5)
ch->devices |= ATA_ATA_SLAVE;
}
if (bootverbose)
ata_printf(ch, -1, "reset tp3 devices=0x%b\n", ch->devices,
"\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER");
#endif
}
static int
+3 -1
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/bus.h>
#include <sys/malloc.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/stdarg.h>
#include <machine/resource.h>
#include <machine/bus.h>
+6 -3
View File
@@ -88,6 +88,7 @@ struct ata_pci_controller {
#define ATA_CYPRESS_82C693 0xc6931080
#define ATA_DEC_21150 0x00221011
#define ATA_DEC_21150_1 0x00231011
#define ATA_HIGHPOINT_ID 0x1103
#define ATA_HPT366 0x00041103
@@ -158,9 +159,10 @@ struct ata_pci_controller {
#define ATA_CSB6_1 0x02171166
#define ATA_SILICON_IMAGE_ID 0x1095
#define ATA_SII0680 0x06801095
#define ATA_SII3114 0x31141095
#define ATA_SII3112 0x31121095
#define ATA_SII3112_1 0x02401095
#define ATA_SII0680 0x06801095
#define ATA_CMD646 0x06461095
#define ATA_CMD648 0x06481095
#define ATA_CMD649 0x06491095
@@ -220,7 +222,8 @@ struct ata_pci_controller {
#define ATA_VIA8233A 0x31471106
#define ATA_VIA8233C 0x31091106
#define ATA_VIA8235 0x31771106
#define ATA_VIA8237 0x31491106
#define ATA_VIA8237 0x32271106
#define ATA_VIA8237_1 0x31491106
#define ATA_VIA8361 0x31121106
#define ATA_VIA8363 0x03051106
#define ATA_VIA8371 0x03911106
@@ -242,7 +245,6 @@ struct ata_pci_controller {
#define PRNEW 1
#define PRTX 2
#define PRMIO 3
#define PRIDX 4
#define PRTX4 0x01
#define PRSX4K 0x02
#define PRSX6K 0x04
@@ -257,6 +259,7 @@ struct ata_pci_controller {
#define SIIINTR 0x01
#define SIISETCLK 0x02
#define SIIBUG 0x04
#define SII4CH 0x08
#define SIS_SOUTH 1
#define SISSATA 2
+188 -121
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -34,12 +34,12 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/ata.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/bio.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <dev/ata/ata-all.h>
@@ -49,57 +49,57 @@ static void ata_completed(void *, int);
static void ata_timeout(struct ata_request *);
static char *ata_skey2str(u_int8_t);
/* local vars */
static MALLOC_DEFINE(M_ATA_REQ, "ATA request", "ATA request");
static int atadebug = 0;
/*
* ATA request related functions
*/
struct ata_request *
ata_alloc_request(void)
{
struct ata_request *request;
request = malloc(sizeof(struct ata_request), M_ATA_REQ, M_NOWAIT | M_ZERO);
if (!request)
printf("FAILURE - malloc ATA request failed\n");
return request;
}
void
ata_free_request(struct ata_request *request)
{
free(request, M_ATA_REQ);
}
void
ata_queue_request(struct ata_request *request)
{
/* mark request as virgin (it might be a reused one) */
/* mark request as virgin */
request->result = request->status = request->error = 0;
request->flags &= ~ATA_R_DONE;
if (!request->callback && !(request->flags & ATA_R_REQUEUE))
sema_init(&request->done, 0, "ATA request done");
/* put request on the locked queue at the specified location */
mtx_lock(&request->device->channel->queue_mtx);
if (request->flags & ATA_R_AT_HEAD)
TAILQ_INSERT_HEAD(&request->device->channel->ata_queue, request, chain);
else
TAILQ_INSERT_TAIL(&request->device->channel->ata_queue, request, chain);
mtx_unlock(&request->device->channel->queue_mtx);
/* in IMMEDIATE_MODE we dont queue but call HW directly */
/* used only during reinit for getparm and config */
if ((request->device->channel->flags & ATA_IMMEDIATE_MODE) &&
(request->flags & (ATA_R_CONTROL | ATA_R_IMMEDIATE))) {
/* arm timeout */
if (!request->timeout_handle.callout && !dumping) {
request->timeout_handle =
timeout((timeout_t*)ata_timeout, request, request->timeout*hz);
}
/* kick HW into action */
if (request->device->channel->hw.transaction(request)==ATA_OP_FINISHED){
if (!request->callback)
sema_destroy(&request->done);
return;
}
}
else {
/* put request on the locked queue at the specified location */
mtx_lock(&request->device->channel->queue_mtx);
if (request->flags & ATA_R_IMMEDIATE)
TAILQ_INSERT_HEAD(&request->device->channel->ata_queue,
request, chain);
else
TAILQ_INSERT_TAIL(&request->device->channel->ata_queue,
request, chain);
mtx_unlock(&request->device->channel->queue_mtx);
ATA_DEBUG_RQ(request, "queued");
/* should we skip start ? */
if (!(request->flags & ATA_R_SKIPSTART))
ata_start(request->device->channel);
}
/* if this was a requeue op callback/sleep already setup */
/* if this is a requeued request callback/sleep has been setup */
if (request->flags & ATA_R_REQUEUE)
return;
/* if this is not a callback and we havn't seen DONE yet -> sleep */
/* if this is not a callback wait until request is completed */
if (!request->callback) {
while (!(request->flags & ATA_R_DONE))
tsleep(request, PRIBIO, "atareq", hz/10);
ATA_DEBUG_RQ(request, "wait for completition");
sema_wait(&request->done);
sema_destroy(&request->done);
}
}
@@ -118,6 +118,7 @@ ata_controlcmd(struct ata_device *atadev, u_int8_t command, u_int16_t feature,
request->u.ata.feature = feature;
request->flags = ATA_R_CONTROL;
request->timeout = 5;
request->retries = -1;
ata_queue_request(request);
error = request->result;
ata_free_request(request);
@@ -132,11 +133,11 @@ ata_atapicmd(struct ata_device *atadev, u_int8_t *ccb, caddr_t data,
struct ata_request *request = ata_alloc_request();
int packet_size, error = ENOMEM;
if ((atadev->param->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12)
packet_size = 12;
else
packet_size = 16;
if (request) {
if ((atadev->param->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12)
packet_size = 12;
else
packet_size = 16;
request->device = atadev;
bcopy(ccb, request->u.atapi.ccb, packet_size);
request->data = data;
@@ -156,16 +157,19 @@ ata_start(struct ata_channel *ch)
{
struct ata_request *request;
/* if in immediate mode, just skip start requests (stall queue) */
if (ch->flags & ATA_IMMEDIATE_MODE)
return;
/* lock the ATA HW for this request */
mtx_lock(&ch->queue_mtx);
ch->locking(ch, ATA_LF_LOCK);
if (!ATA_LOCK_CH(ch, ATA_ACTIVE)) {
mtx_unlock(&ch->queue_mtx);
return;
}
if (atadebug && mtx_owned(&Giant)) printf("ata_start holds GIANT!!!\n");
/* if we dont have any work, ask the subdriver(s) */
mtx_lock(&ch->queue_mtx);
if (TAILQ_EMPTY(&ch->ata_queue)) {
mtx_unlock(&ch->queue_mtx);
if (ch->device[MASTER].start)
@@ -178,63 +182,125 @@ if (atadebug && mtx_owned(&Giant)) printf("ata_start holds GIANT!!!\n");
TAILQ_REMOVE(&ch->ata_queue, request, chain);
mtx_unlock(&ch->queue_mtx);
ATA_DEBUG_RQ(request, "starting");
/* arm timeout */
if (!request->timeout_handle.callout && !dumping) {
request->timeout_handle =
timeout((timeout_t*)ata_timeout, request, request->timeout*hz);
}
/* kick HW into action */
/* kick HW into action and wait for interrupt if it flies*/
if (ch->hw.transaction(request) == ATA_OP_CONTINUES)
return;
/* untimeout request */
untimeout((timeout_t *)ata_timeout, request, request->timeout_handle);
ata_finish(request);
}
else
mtx_unlock(&ch->queue_mtx);
/* unlock ATA channel HW */
ATA_UNLOCK_CH(ch);
ch->locking(ch, ATA_LF_UNLOCK);
/* if we have a request here it failed and should be completed */
if (request)
ata_finish(request);
else
mtx_unlock(&ch->queue_mtx);
}
void
ata_finish(struct ata_request *request)
{
ATA_DEBUG_RQ(request, "taskqueue completition");
/* request is done schedule it for completition */
TASK_INIT(&request->task, 0, ata_completed, request);
taskqueue_enqueue(taskqueue_swi, &request->task);
if (request->device->channel->flags & ATA_IMMEDIATE_MODE) {
ata_completed(request, 0);
}
else {
if (request->bio)
bio_taskqueue(request->bio, (bio_task_t *)ata_completed, request);
else {
TASK_INIT(&request->task, 0, ata_completed, request);
taskqueue_enqueue(taskqueue_swi, &request->task);
}
}
}
/* current command finished, clean up and return result */
static void
ata_completed(void *context, int pending)
ata_completed(void *context, int dummy)
{
struct ata_request *request = (struct ata_request *)context;
struct ata_channel *channel = request->device->channel;
/* untimeout request now we have control back */
untimeout((timeout_t *)ata_timeout, request, request->timeout_handle);
ATA_DEBUG_RQ(request, "completed called");
/* do the all the magic for completition evt retry etc etc */
if ((request->status & (ATA_S_CORR | ATA_S_ERROR)) == ATA_S_CORR)
ata_prtdev(request->device, "WARNING - %s soft error (ECC corrected)\n",
ata_cmd2str(request));
if (request->flags & ATA_R_TIMEOUT) {
/* if this is a UDMA CRC error, retry request */
if (request->flags & ATA_R_DMA && request->error & ATA_E_ICRC) {
if (request->retries--) {
/* if negative retry count just give up and unlock channel HW */
if (request->retries < 0) {
if (!(request->flags & ATA_R_QUIET))
ata_prtdev(request->device,
"FAILURE - %s no interrupt\n",
ata_cmd2str(request));
request->result = EIO;
ATA_UNLOCK_CH(channel);
channel->locking(channel, ATA_LF_UNLOCK);
}
else {
/* reset controller and devices */
ata_reinit(channel);
/* if retries still permit, reinject this request */
if (request->retries-- > 0) {
request->flags &= ~ATA_R_TIMEOUT;
request->flags |= (ATA_R_IMMEDIATE | ATA_R_REQUEUE);
ata_queue_request(request);
return;
}
/* otherwise just finish with error */
else {
if (!(request->flags & ATA_R_QUIET))
ata_prtdev(request->device,
"FAILURE - %s timed out\n",
ata_cmd2str(request));
request->result = EIO;
}
}
}
else {
/* untimeout request now we have control back */
untimeout((timeout_t *)ata_timeout, request, request->timeout_handle);
/* do the all the magic for completition evt retry etc etc */
if ((request->status & (ATA_S_CORR | ATA_S_ERROR)) == ATA_S_CORR) {
ata_prtdev(request->device,
"WARNING - %s UDMA ICRC error (retrying request)\n",
"WARNING - %s soft error (ECC corrected)",
ata_cmd2str(request));
request->flags &= ~ATA_R_SKIPSTART;
ata_queue_request(request);
return;
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
}
/* if this is a UDMA CRC error, retry request */
if (request->flags & ATA_R_DMA && request->error & ATA_E_ICRC) {
if (request->retries-- > 0) {
ata_prtdev(request->device,
"WARNING - %s UDMA ICRC error (retrying request)",
ata_cmd2str(request));
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
request->flags |= (ATA_R_IMMEDIATE | ATA_R_REQUEUE);
ata_queue_request(request);
return;
}
}
}
switch (request->flags & ATA_R_ATAPI) {
/* ATA errors */
default:
if (request->status & ATA_S_ERROR) {
@@ -250,8 +316,7 @@ ata_completed(void *context, int pending)
if ((request->flags & ATA_R_DMA) &&
(request->dmastat & ATA_BMSTAT_ERROR))
printf(" dma=0x%02x", request->dmastat);
if (!(request->flags & ATA_R_ATAPI) &&
!(request->flags & ATA_R_CONTROL))
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
}
@@ -306,74 +371,67 @@ ata_completed(void *context, int pending)
break;
}
request->flags |= ATA_R_DONE;
ATA_DEBUG_RQ(request, "completed callback/wakeup");
if (request->callback)
(request->callback)(request);
else
wakeup(request);
sema_post(&request->done);
ata_start(channel);
}
static void
ata_timeout(struct ata_request *request)
{
struct ata_channel *ch = request->device->channel;
int quiet = request->flags & ATA_R_QUIET;
ATA_DEBUG_RQ(request, "timeout");
/* clear timeout etc */
request->timeout_handle.callout = NULL;
/* call hw.interrupt to try finish up the command */
ch->hw.interrupt(request->device->channel);
if (ch->running != request) {
if (!quiet)
ata_prtdev(request->device,
"WARNING - %s recovered from missing interrupt\n",
if (request->flags & ATA_R_INTR_SEEN) {
if (request->retries-- > 0) {
ata_prtdev(request->device,
"WARNING - %s interrupt was seen but timeout fired",
ata_cmd2str(request));
return;
}
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
/* if this was a DMA request stop the engine to be on the safe side */
if (request->flags & ATA_R_DMA) {
request->dmastat =
request->device->channel->dma->stop(request->device->channel);
/* re-arm timeout */
if (!request->timeout_handle.callout && !dumping) {
request->timeout_handle =
timeout((timeout_t*)ata_timeout, request,
request->timeout * hz);
}
}
else {
ata_prtdev(request->device,
"WARNING - %s interrupt was seen but taskqueue stalled",
ata_cmd2str(request));
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
ata_completed(request, 0);
}
return;
}
/* report that we timed out */
if (request->retries > 0 && !(request->flags & ATA_R_QUIET))
if (!(request->flags & ATA_R_QUIET) && request->retries > 0) {
ata_prtdev(request->device,
"TIMEOUT - %s retrying (%d retr%s left)\n",
"TIMEOUT - %s retrying (%d retr%s left)",
ata_cmd2str(request), request->retries,
request->retries == 1 ? "y" : "ies");
/* try to adjust HW's attitude towards work */
ata_reinit(request->device->channel);
/* if device disappeared nothing more to do here */
if (!request->device->softc) {
if (!(request->flags & ATA_R_QUIET))
ata_prtdev(request->device,
"FAILURE - %s device lockup/removed\n",
ata_cmd2str(request));
return;
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
printf(" LBA=%llu", (unsigned long long)request->u.ata.lba);
printf("\n");
}
/* if retries still permit, reinject this request */
if (request->retries-- > 0) {
request->flags |= (ATA_R_AT_HEAD | ATA_R_REQUEUE);
request->flags &= ~ATA_R_SKIPSTART;
ata_queue_request(request);
}
/* otherwise just schedule finish with error */
else {
if (!(request->flags & ATA_R_QUIET))
ata_prtdev(request->device,
"FAILURE - %s timed out\n",
ata_cmd2str(request));
request->status = ATA_S_ERROR;
TASK_INIT(&request->task, 0, ata_completed, request);
taskqueue_enqueue(taskqueue_swi, &request->task);
}
/* now simulate the missing interrupt */
request->flags |= ATA_R_TIMEOUT;
request->device->channel->hw.interrupt(request->device->channel);
return;
}
char *
@@ -464,7 +522,16 @@ ata_cmd2str(struct ata_request *request)
case 0xe7: return ("FLUSHCACHE");
case 0xea: return ("FLUSHCACHE48");
case 0xec: return ("ATA_IDENTIFY");
case 0xef: return ("SETFEATURES");
case 0xef:
switch (request->u.ata.feature) {
case 0x03: return ("SETFEATURES SET TRANSFER MODE");
case 0x02: return ("SETFEATURES ENABLE WCACHE");
case 0x82: return ("SETFEATURES DISABLE WCACHE");
case 0xaa: return ("SETFEATURES ENABLE RCACHE");
case 0x55: return ("SETFEATURES DISABLE RCACHE");
}
sprintf(buffer, "SETFEATURES 0x%02x", request->u.ata.feature);
return buffer;
}
}
sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command);
+10 -4
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 2000 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 2000 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$");
#include <sys/cons.h>
#include <sys/unistd.h>
#include <sys/kthread.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <sys/rman.h>
#include <geom/geom_disk.h>
@@ -711,7 +713,7 @@ arstrategy(struct bio *bp)
return;
}
buf1 = malloc(sizeof(struct ar_buf), M_AR, M_NOWAIT | M_ZERO);
buf1 = malloc(sizeof(struct ar_buf), M_AR, M_NOWAIT | M_ZERO); /* XXX */
buf1->bp.bio_pblkno = lba;
if ((buf1->drive = drv) > 0)
buf1->bp.bio_pblkno += rdp->offset;
@@ -819,7 +821,7 @@ arstrategy(struct bio *bp)
((rdp->flags & AR_F_REBUILDING) &&
(rdp->disks[buf1->drive].flags & AR_DF_SPARE) &&
buf1->bp.bio_pblkno < rdp->lock_start)) {
buf2 = malloc(sizeof(struct ar_buf), M_AR, M_NOWAIT);
buf2 = malloc(sizeof(struct ar_buf), M_AR, M_NOWAIT); /* XXX */
bcopy(buf1, buf2, sizeof(struct ar_buf));
buf1->mirror = buf2;
buf2->mirror = buf1;
@@ -1020,7 +1022,7 @@ ar_rebuild(void *arg)
rdp->lock_end = rdp->lock_start + AR_REBUILD_SIZE;
rdp->flags |= AR_F_REBUILDING;
splx(s);
buffer = malloc(AR_REBUILD_SIZE * DEV_BSIZE, M_AR, M_NOWAIT | M_ZERO);
buffer = malloc(AR_REBUILD_SIZE * DEV_BSIZE, M_AR, M_NOWAIT | M_ZERO); /* XXX */
/* now go copy entire disk(s) */
while (rdp->lock_end < (rdp->total_sectors / rdp->width)) {
@@ -1306,9 +1308,11 @@ ar_highpoint_write_conf(struct ar_softc *rdp)
sizeof(struct highpoint_raid_conf),
(caddr_t)config, AR_WRITE)) {
printf("ar%d: Highpoint write conf failed\n", rdp->lun);
free(config, M_AR);
return -1;
}
}
free(config, M_AR);
}
return 0;
}
@@ -1601,9 +1605,11 @@ ar_promise_write_conf(struct ar_softc *rdp)
(caddr_t)config, AR_WRITE)) {
printf("ar%d: %s write conf failed\n",
rdp->lun, local ? "FreeBSD" : "Promise");
free(config, M_AR);
return -1;
}
}
free(config, M_AR);
}
return 0;
}
+5 -1
View File
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
#include <sys/taskqueue.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/sema.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <cam/cam.h>
@@ -681,8 +683,10 @@ cam_rescan(struct cam_sim *sim)
union ccb *ccb = malloc(sizeof(union ccb), M_ATACAM, M_WAITOK | M_ZERO);
if (xpt_create_path(&path, xpt_periph, cam_sim_path(sim),
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP)
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
free(ccb, M_ATACAM);
return;
}
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("Rescanning ATAPI bus.\n"));
xpt_setup_ccb(&ccb->ccb_h, path, 5/*priority (low)*/);
+8 -8
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -45,8 +45,9 @@ __FBSDID("$FreeBSD$");
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/ctype.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <sys/mutex.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <geom/geom.h>
#include <dev/ata/ata-all.h>
@@ -451,7 +452,6 @@ acd_describe(struct acd_softc *cdp)
(cdp->device->unit == ATA_MASTER) ? "master" : "slave",
ata_mode2str(cdp->device->mode) );
}
}
static __inline void
@@ -1139,7 +1139,7 @@ acd_start(struct ata_device *atadev)
ccb[8] = count;
if (!(request = ata_alloc_request())) {
g_io_deliver(bp, EIO);
g_io_deliver(bp, ENOMEM);
return;
}
request->device = atadev;
@@ -1153,7 +1153,7 @@ acd_start(struct ata_device *atadev)
request->timeout = (ccb[0] == ATAPI_WRITE_BIG) ? 60 : 30;
request->retries = 2;
request->callback = acd_done;
request->flags = ATA_R_SKIPSTART | ATA_R_ATAPI;
request->flags = ATA_R_ATAPI;
if (request->device->mode >= ATA_DMA)
request->flags |= ATA_R_DMA;
switch (bp->bio_cmd) {
@@ -1335,9 +1335,9 @@ acd_select_slot(struct acd_softc *cdp)
cdp->changer_info->current_slot, 0, 0, 0, 0, 0, 0, 0 };
/* unload the current media from player */
if (!(request = ata_alloc_request())) {
if (!(request = ata_alloc_request()))
return;
}
request->device = cdp->device;
request->driver = cdp;
bcopy(ccb, request->u.atapi.ccb,
@@ -1345,7 +1345,7 @@ acd_select_slot(struct acd_softc *cdp)
ATA_PROTO_ATAPI_12 ? 16 : 12);
request->timeout = 30;
request->callback = acd_unload_done;
request->flags |= (ATA_R_ATAPI | ATA_R_AT_HEAD);
request->flags |= (ATA_R_ATAPI | ATA_R_IMMEDIATE);
ata_queue_request(request);
}
+6 -4
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/cdio.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <geom/geom_disk.h>
#include <dev/ata/ata-all.h>
@@ -343,7 +345,7 @@ afd_start(struct ata_device *atadev)
ccb[8] = count;
if (!(request = ata_alloc_request())) {
biofinish(bp, NULL, EIO);
biofinish(bp, NULL, ENOMEM);
return;
}
request->device = atadev;
@@ -359,10 +361,10 @@ afd_start(struct ata_device *atadev)
request->callback = afd_done;
switch (bp->bio_cmd) {
case BIO_READ:
request->flags |= (ATA_R_SKIPSTART | ATA_R_ATAPI | ATA_R_READ);
request->flags |= (ATA_R_ATAPI | ATA_R_READ);
break;
case BIO_WRITE:
request->flags |= (ATA_R_SKIPSTART | ATA_R_ATAPI | ATA_R_WRITE);
request->flags |= (ATA_R_ATAPI | ATA_R_WRITE);
break;
default:
ata_prtdev(atadev, "unknown BIO operation\n");
+6 -4
View File
@@ -1,5 +1,5 @@
/*-
* Copyright (c) 1998 - 2003 Søren Schmidt <sos@FreeBSD.org>
* Copyright (c) 1998 - 2004 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/mtio.h>
#include <sys/devicestat.h>
#include <sys/sema.h>
#include <sys/taskqueue.h>
#include <vm/uma.h>
#include <machine/bus.h>
#include <dev/ata/ata-all.h>
#include <dev/ata/atapi-tape.h>
@@ -509,7 +511,7 @@ ast_start(struct ata_device *atadev)
ccb[4] = blkcount;
if (!(request = ata_alloc_request())) {
biofinish(bp, NULL, EIO);
biofinish(bp, NULL, ENOMEM);
return;
}
request->device = atadev;
@@ -525,10 +527,10 @@ ast_start(struct ata_device *atadev)
request->callback = ast_done;
switch (bp->bio_cmd) {
case BIO_READ:
request->flags |= (ATA_R_SKIPSTART | ATA_R_ATAPI | ATA_R_READ);
request->flags |= (ATA_R_ATAPI | ATA_R_READ);
break;
case BIO_WRITE:
request->flags |= (ATA_R_SKIPSTART | ATA_R_ATAPI | ATA_R_WRITE);
request->flags |= (ATA_R_ATAPI | ATA_R_WRITE);
break;
default:
ata_prtdev(atadev, "unknown BIO operation\n");
+17
View File
@@ -917,6 +917,9 @@ static int r128_cce_dispatch_write_span( drm_device_t *dev,
DRM_DEBUG( "\n" );
count = depth->n;
if ( count > 4096 || count <= 0 ) {
return DRM_ERR(EMSGSIZE);
}
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
}
@@ -1010,9 +1013,16 @@ static int r128_cce_dispatch_write_pixels( drm_device_t *dev,
DRM_DEBUG( "\n" );
count = depth->n;
if ( count > 4096 || count <= 0 ) {
return DRM_ERR(EMSGSIZE);
}
xbuf_size = count * sizeof(*x);
ybuf_size = count * sizeof(*y);
if ( xbuf_size <= 0 || ybuf_size <= 0 ) {
return DRM_ERR(EMSGSIZE);
}
x = DRM_MALLOC( xbuf_size );
if ( x == NULL ) {
return DRM_ERR(ENOMEM);
@@ -1127,6 +1137,10 @@ static int r128_cce_dispatch_read_span( drm_device_t *dev,
DRM_DEBUG( "\n" );
count = depth->n;
if ( count > 4096 || count <= 0 ) {
return DRM_ERR(EMSGSIZE);
}
if ( DRM_COPY_FROM_USER( &x, depth->x, sizeof(x) ) ) {
return DRM_ERR(EFAULT);
}
@@ -1175,6 +1189,9 @@ static int r128_cce_dispatch_read_pixels( drm_device_t *dev,
xbuf_size = count * sizeof(*x);
ybuf_size = count * sizeof(*y);
if ( xbuf_size <= 0 || ybuf_size <= 0 ) {
return DRM_ERR(EMSGSIZE);
}
x = DRM_MALLOC( xbuf_size );
if ( x == NULL ) {
return DRM_ERR(ENOMEM);
+3 -1
View File
@@ -77,7 +77,9 @@ feed_vchan_s16(struct pcm_feeder *f, struct pcm_channel *c, u_int8_t *b, u_int32
int16_t *tmp, *dst;
unsigned int cnt;
KASSERT(sndbuf_getsize(src) >= count, ("bad bufsize"));
if (sndbuf_getsize(src) < count)
panic("feed_vchan_s16(%s): tmp buffer size %d < count %d, flags = 0x%x",
c->name, sndbuf_getsize(src), count, c->flags);
count &= ~1;
bzero(b, count);
+4 -2
View File
@@ -855,14 +855,16 @@ scioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td)
scrshot_t *ptr = (scrshot_t *)data;
void *outp = ptr->buf;
if (ptr->x < 0 || ptr->y < 0 || ptr->xsize < 0 || ptr->ysize < 0)
return EINVAL;
s = spltty();
if (ISGRAPHSC(scp)) {
splx(s);
return EOPNOTSUPP;
}
hist_rsz = (scp->history != NULL) ? scp->history->vtb_rows : 0;
if ((ptr->x + ptr->xsize) > scp->xsize ||
(ptr->y + ptr->ysize) > (scp->ysize + hist_rsz)) {
if (((u_int)ptr->x + ptr->xsize) > scp->xsize ||
((u_int)ptr->y + ptr->ysize) > (scp->ysize + hist_rsz)) {
splx(s);
return EINVAL;
}
+2 -1
View File
@@ -633,7 +633,8 @@ devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_dirent *de)
dev = devfs_rule_getdev(de);
if (dev != NULL)
pname = dev->si_name;
else if (de->de_dirent->d_type == DT_LNK)
else if (de->de_dirent->d_type == DT_LNK ||
de->de_dirent->d_type == DT_DIR)
pname = de->de_dirent->d_name;
else
return (0);
+13 -1
View File
@@ -178,6 +178,7 @@ int
procfs_doproccmdline(PFS_FILL_ARGS)
{
struct ps_strings pstr;
char **ps_argvstr;
int error, i;
/*
@@ -204,10 +205,21 @@ procfs_doproccmdline(PFS_FILL_ARGS)
sizeof(pstr));
if (error)
return (error);
if (pstr.ps_nargvstr > ARG_MAX)
return (E2BIG);
ps_argvstr = malloc(pstr.ps_nargvstr * sizeof(char *),
M_TEMP, M_WAITOK);
error = copyin((void *)pstr.ps_argvstr, ps_argvstr,
pstr.ps_nargvstr * sizeof(char *));
if (error) {
free(ps_argvstr, M_TEMP);
return (error);
}
for (i = 0; i < pstr.ps_nargvstr; i++) {
sbuf_copyin(sb, pstr.ps_argvstr[i], 0);
sbuf_copyin(sb, ps_argvstr[i], 0);
sbuf_printf(sb, "%c", '\0');
}
free(ps_argvstr, M_TEMP);
}
return (0);
+5
View File
@@ -525,6 +525,11 @@ pfs_read(struct vop_read_args *va)
PRELE(proc);
PFS_RETURN (EINVAL);
}
if (buflen > MAXPHYS) {
if (proc != NULL)
PRELE(proc);
PFS_RETURN (EIO);
}
sb = sbuf_new(sb, NULL, buflen, 0);
if (sb == NULL) {
if (proc != NULL)
+2
View File
@@ -242,6 +242,8 @@ g_cancel_event(void *ref)
} else {
g_free(ep);
}
if (--g_pending_events == 0)
wakeup(&g_pending_events);
break;
}
}
+27
View File
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
static struct g_bioq g_bio_run_down;
static struct g_bioq g_bio_run_up;
static struct g_bioq g_bio_run_task;
static u_int pace;
static uma_zone_t biozone;
@@ -151,6 +152,7 @@ g_io_init()
g_bioq_init(&g_bio_run_down);
g_bioq_init(&g_bio_run_up);
g_bioq_init(&g_bio_run_task);
biozone = uma_zcreate("g_bio", sizeof (struct bio),
NULL, NULL,
NULL, NULL,
@@ -358,6 +360,23 @@ g_io_schedule_down(struct thread *tp __unused)
}
}
void
bio_taskqueue(struct bio *bp, bio_task_t *func, void *arg)
{
bp->bio_task = func;
bp->bio_task_arg = arg;
/*
* The taskqueue is actually just a second queue off the "up"
* queue, so we use the same lock.
*/
g_bioq_lock(&g_bio_run_up);
TAILQ_INSERT_TAIL(&g_bio_run_task.bio_queue, bp, bio_queue);
g_bio_run_task.bio_queue_length++;
wakeup(&g_wait_up);
g_bioq_unlock(&g_bio_run_up);
}
void
g_io_schedule_up(struct thread *tp __unused)
{
@@ -368,6 +387,14 @@ g_io_schedule_up(struct thread *tp __unused)
mtx_init(&mymutex, "g_xup", NULL, MTX_DEF);
for(;;) {
g_bioq_lock(&g_bio_run_up);
bp = g_bioq_first(&g_bio_run_task);
if (bp != NULL) {
g_bioq_unlock(&g_bio_run_up);
mtx_lock(&mymutex);
bp->bio_task(bp->bio_task_arg);
mtx_unlock(&mymutex);
continue;
}
bp = g_bioq_first(&g_bio_run_up);
if (bp != NULL) {
g_bioq_unlock(&g_bio_run_up);
+1
View File
@@ -57,6 +57,7 @@ options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
options PFIL_HOOKS # pfil(9) framework
# Debugging for use in -current
#options DDB #Enable the kernel debugger
+1
View File
@@ -50,6 +50,7 @@ options SYSVSHM # SYSV-style shared memory
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Hash-based directory lookup scheme
options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions
options PFIL_HOOKS # pfil(9) framework
# Various "busses"
device acpi # ACPI support (mandatory)
+12 -12
View File
@@ -179,8 +179,19 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
struct prison *pr;
int error;
p = td->td_proc;
/*
* XXX: Note that there is a slight race here if two threads
* in the same privileged process attempt to attach to two
* different jails at the same time. It is important for
* user processes not to do this, or they might end up with
* a process root from one prison, but attached to the jail
* of another.
*/
error = suser(td);
if (error)
return (error);
p = td->td_proc;
mtx_lock(&allprison_mtx);
pr = prison_find(uap->jid);
if (pr == NULL) {
@@ -191,9 +202,6 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
mtx_unlock(&pr->pr_mtx);
mtx_unlock(&allprison_mtx);
error = suser_cred(td->td_ucred, PRISON_ROOT);
if (error)
goto e_dropref;
mtx_lock(&Giant);
vn_lock(pr->pr_root, LK_EXCLUSIVE | LK_RETRY, td);
if ((error = change_dir(pr->pr_root, td)) != 0)
@@ -208,13 +216,6 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
newcred = crget();
PROC_LOCK(p);
/* Implicitly fail if already in jail. */
error = suser_cred(p->p_ucred, 0);
if (error) {
PROC_UNLOCK(p);
crfree(newcred);
goto e_dropref;
}
oldcred = p->p_ucred;
setsugid(p);
crcopy(newcred, oldcred);
@@ -226,7 +227,6 @@ jail_attach(struct thread *td, struct jail_attach_args *uap)
e_unlock:
VOP_UNLOCK(pr->pr_root, 0, td);
mtx_unlock(&Giant);
e_dropref:
mtx_lock(&pr->pr_mtx);
pr->pr_ref--;
mtx_unlock(&pr->pr_mtx);
+1
View File
@@ -378,6 +378,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
rv = vm_map_find(&p->p_vmspace->vm_map, shm_handle->shm_object,
0, &attach_va, size, (flags & MAP_FIXED)?0:1, prot, prot, 0);
if (rv != KERN_SUCCESS) {
vm_object_deallocate(shm_handle->shm_object);
error = ENOMEM;
goto done2;
}
+14
View File
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/linker.h>
#include <sys/mac.h>
@@ -678,6 +679,10 @@ vfs_domount(
if (strlen(fstype) >= MFSNAMELEN || strlen(fspath) >= MNAMELEN)
return (ENAMETOOLONG);
/* mount(2) is not permitted inside the jail. */
if (jailed(td->td_ucred))
return (EPERM);
if (usermount == 0) {
error = suser(td);
if (error)
@@ -1014,6 +1019,15 @@ unmount(td, uap)
char *pathbuf;
int error, id0, id1;
/* unmount(2) is not permitted inside the jail. */
if (jailed(td->td_ucred))
return (EPERM);
if (usermount == 0) {
if ((error = suser(td)) != 0)
return (error);
}
pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK);
error = copyinstr(uap->path, pathbuf, MNAMELEN, NULL);
if (error) {
+2 -2
View File
@@ -669,11 +669,11 @@ in_pcbdisconnect(inp)
inp->inp_faddr.s_addr = INADDR_ANY;
inp->inp_fport = 0;
in_pcbrehash(inp);
if (inp->inp_socket->so_state & SS_NOFDREF)
in_pcbdetach(inp);
#ifdef IPSEC
ipsec_pcbdisconn(inp->inp_sp);
#endif
if (inp->inp_socket->so_state & SS_NOFDREF)
in_pcbdetach(inp);
}
void
+1
View File
@@ -213,6 +213,7 @@ struct ip6_frag {
#define IPV6_MMTU 1280 /* minimal MTU and reassembly. 1024 + 256 */
#define IPV6_MAXPACKET 65535 /* ip6 max packet size without Jumbo payload*/
#define IPV6_MAXOPTHDR 2048 /* max option header size, 256 64-bit words */
#ifdef _KERNEL
/*
+61 -9
View File
@@ -57,6 +57,8 @@
#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */
#include <vm/uma.h>
#include <net/if.h>
#include <net/route.h>
@@ -97,8 +99,6 @@
#include <machine/in_cksum.h>
MALLOC_DEFINE(M_TSEGQ, "tseg_qent", "TCP segment queue entry");
static const int tcprexmtthresh = 3;
tcp_cc tcp_ccgen;
@@ -134,6 +134,24 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3390, CTLFLAG_RW,
&tcp_do_rfc3390, 0,
"Enable RFC 3390 (Increasing TCP's Initial Congestion Window)");
SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
"TCP Segment Reassembly Queue");
static int tcp_reass_maxseg = 0;
SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN,
&tcp_reass_maxseg, 0,
"Global maximum number of TCP Segments in Reassembly Queue");
int tcp_reass_qsize = 0;
SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD,
&tcp_reass_qsize, 0,
"Global number of TCP Segments currently in Reassembly Queue");
static int tcp_reass_overflows = 0;
SYSCTL_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD,
&tcp_reass_overflows, 0,
"Global number of TCP Segment Reassembly Queue Overflows");
struct inpcbhead tcb;
#define tcb6 tcb /* for KAME src sync over BSD*'s */
struct inpcbinfo tcbinfo;
@@ -174,6 +192,19 @@ do { \
(tp->t_flags & TF_RXWIN0SENT) == 0) && \
(tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
/* Initialize TCP reassembly queue */
uma_zone_t tcp_reass_zone;
void
tcp_reass_init()
{
tcp_reass_maxseg = nmbclusters / 16;
TUNABLE_INT_FETCH("net.inet.tcp.reass.maxsegments",
&tcp_reass_maxseg);
tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
uma_zone_set_max(tcp_reass_zone, tcp_reass_maxseg);
}
static int
tcp_reass(tp, th, tlenp, m)
register struct tcpcb *tp;
@@ -184,7 +215,7 @@ tcp_reass(tp, th, tlenp, m)
struct tseg_qent *q;
struct tseg_qent *p = NULL;
struct tseg_qent *nq;
struct tseg_qent *te;
struct tseg_qent *te = NULL;
struct socket *so = tp->t_inpcb->inp_socket;
int flags;
@@ -195,14 +226,32 @@ tcp_reass(tp, th, tlenp, m)
if (th == 0)
goto present;
/* Allocate a new queue entry. If we can't, just drop the pkt. XXX */
MALLOC(te, struct tseg_qent *, sizeof (struct tseg_qent), M_TSEGQ,
M_NOWAIT);
/*
* Limit the number of segments in the reassembly queue to prevent
* holding on to too many segments (and thus running out of mbufs).
* Make sure to let the missing segment through which caused this
* queue. Always keep one global queue entry spare to be able to
* process the missing segment.
*/
if (th->th_seq != tp->rcv_nxt &&
tcp_reass_qsize + 1 >= tcp_reass_maxseg) {
tcp_reass_overflows++;
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
return (0);
}
/*
* Allocate a new queue entry. If we can't, or hit the zone limit
* just drop the pkt.
*/
te = uma_zalloc(tcp_reass_zone, M_NOWAIT);
if (te == NULL) {
tcpstat.tcps_rcvmemdrop++;
m_freem(m);
return (0);
}
tcp_reass_qsize++;
/*
* Find a segment which begins after this one does.
@@ -227,7 +276,8 @@ tcp_reass(tp, th, tlenp, m)
tcpstat.tcps_rcvduppack++;
tcpstat.tcps_rcvdupbyte += *tlenp;
m_freem(m);
FREE(te, M_TSEGQ);
uma_zfree(tcp_reass_zone, te);
tcp_reass_qsize--;
/*
* Try to present any queued data
* at the left window edge to the user.
@@ -262,7 +312,8 @@ tcp_reass(tp, th, tlenp, m)
nq = LIST_NEXT(q, tqe_q);
LIST_REMOVE(q, tqe_q);
m_freem(q->tqe_m);
FREE(q, M_TSEGQ);
uma_zfree(tcp_reass_zone, q);
tcp_reass_qsize--;
q = nq;
}
@@ -296,7 +347,8 @@ present:
m_freem(q->tqe_m);
else
sbappendstream(&so->so_rcv, q->tqe_m);
FREE(q, M_TSEGQ);
uma_zfree(tcp_reass_zone, q);
tcp_reass_qsize--;
q = nq;
} while (q && q->tqe_th->th_seq == tp->rcv_nxt);
ND6_HINT(tp);
+7 -2
View File
@@ -286,6 +286,7 @@ tcp_init()
tcp_timer_init();
syncache_init();
tcp_hc_init();
tcp_reass_init();
}
/*
@@ -708,7 +709,8 @@ tcp_discardcb(tp)
while ((q = LIST_FIRST(&tp->t_segq)) != NULL) {
LIST_REMOVE(q, tqe_q);
m_freem(q->tqe_m);
FREE(q, M_TSEGQ);
uma_zfree(tcp_reass_zone, q);
tcp_reass_qsize--;
}
inp->inp_ppcb = NULL;
tp->t_inpcb = NULL;
@@ -769,7 +771,8 @@ tcp_drain()
!= NULL) {
LIST_REMOVE(te, tqe_q);
m_freem(te->tqe_m);
FREE(te, M_TSEGQ);
uma_zfree(tcp_reass_zone, te);
tcp_reass_qsize--;
}
}
INP_UNLOCK(inpb);
@@ -1653,6 +1656,8 @@ tcp_twclose(struct tcptw *tw, int reuse)
#endif
in_pcbdetach(inp);
tcpstat.tcps_closed++;
crfree(tw->tw_cred);
tw->tw_cred = NULL;
if (reuse)
return (tw);
uma_zfree(tcptw_zone, tw);
+3 -3
View File
@@ -54,9 +54,8 @@ struct tseg_qent {
struct mbuf *tqe_m; /* mbuf contains packet */
};
LIST_HEAD(tsegqe_head, tseg_qent);
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_TSEGQ);
#endif
extern int tcp_reass_qsize;
extern struct uma_zone *tcp_reass_zone;
struct tcptemp {
u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */
@@ -514,6 +513,7 @@ struct tcpcb *
int tcp_output(struct tcpcb *);
struct inpcb *
tcp_quench(struct inpcb *, int);
void tcp_reass_init(void);
void tcp_respond(struct tcpcb *, void *,
struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int);
int tcp_twrespond(struct tcptw *, struct socket *, struct mbuf *, int);
+7
View File
@@ -405,6 +405,10 @@ in6_pcbconnect(inp, nam, td)
#endif
in_pcbrehash(inp);
#ifdef IPSEC
if (inp->inp_socket->so_type == SOCK_STREAM)
ipsec_pcbconn(inp->inp_sp);
#endif
return (0);
}
@@ -417,6 +421,9 @@ in6_pcbdisconnect(inp)
/* clear flowinfo - draft-itojun-ipv6-flowlabel-api-00 */
inp->in6p_flowinfo &= ~IPV6_FLOWLABEL_MASK;
in_pcbrehash(inp);
#ifdef IPSEC
ipsec_pcbdisconn(inp->inp_sp);
#endif
if (inp->inp_socket->so_state & SS_NOFDREF)
in6_pcbdetach(inp);
}
+37 -1
View File
@@ -1762,12 +1762,48 @@ do { \
break;
}
optbuf = sopt->sopt_val;
switch (optname) {
case IPV6_HOPOPTS:
case IPV6_DSTOPTS:
case IPV6_RTHDRDSTOPTS:
case IPV6_NEXTHOP:
if (!privileged)
error = EPERM;
break;
}
if (error)
break;
switch (optname) {
case IPV6_PKTINFO:
optlen = sizeof(struct in6_pktinfo);
break;
case IPV6_NEXTHOP:
optlen = SOCK_MAXADDRLEN;
break;
default:
optlen = IPV6_MAXOPTHDR;
break;
}
if (sopt->sopt_valsize > optlen) {
error = EINVAL;
break;
}
optlen = sopt->sopt_valsize;
optbuf = malloc(optlen, M_TEMP, M_WAITOK);
error = sooptcopyin(sopt, optbuf, optlen,
optlen);
if (error) {
free(optbuf, M_TEMP);
break;
}
optp = &in6p->in6p_outputopts;
error = ip6_pcbopt(optname,
optbuf, optlen,
optp, privileged, uproto);
free(optbuf, M_TEMP);
break;
}
#undef OPTSET
+4 -1
View File
@@ -1311,8 +1311,11 @@ ipsec_deepcopy_policy(src)
struct ipsecrequest *r;
struct secpolicy *dst;
if (src == NULL)
return NULL;
dst = key_newsp(0);
if (src == NULL || dst == NULL)
if (dst == NULL)
return NULL;
/*
+13 -6
View File
@@ -1957,7 +1957,6 @@ key_spdadd(so, m, mhp)
newsp->lifetime = lft ? lft->sadb_lifetime_addtime : 0;
newsp->validtime = lft ? lft->sadb_lifetime_usetime : 0;
newsp->refcnt = 1; /* do not reclaim until I say I do */
newsp->state = IPSEC_SPSTATE_ALIVE;
LIST_INSERT_TAIL(&sptree[newsp->dir], newsp, secpolicy, chain);
@@ -2094,6 +2093,7 @@ key_spddelete(so, m, mhp)
ipseclog((LOG_DEBUG,
"key_spddelete2: attempt to remove persistent SP:%u.\n",
sp->id));
key_freesp(sp); /* ref gained by key_getsp */
return key_senderror(so, m, EPERM);
}
@@ -2171,11 +2171,12 @@ key_spddelete2(so, m, mhp)
ipseclog((LOG_DEBUG,
"key_spddelete2: attempt to remove persistent SP:%u.\n",
id));
key_freesp(sp); /* ref gained by key_getspbyid */
return key_senderror(so, m, EPERM);
}
key_sp_dead(sp);
key_freesp(sp); /* ref gained by key_getsp */
key_freesp(sp); /* ref gained by key_getspbyid */
key_sp_unlink(sp);
sp = NULL;
@@ -2276,6 +2277,7 @@ key_spdget(so, m, mhp)
}
n = key_setdumpsp(sp, SADB_X_SPDGET, 0, mhp->msg->sadb_msg_pid);
key_freesp(sp); /* ref gained by key_getspbyid */
if (n != NULL) {
m_freem(m);
return key_sendup_mbuf(so, n, KEY_SENDUP_ONE);
@@ -2773,10 +2775,11 @@ key_delsah(sah)
/* sanity check */
KEY_CHKSASTATE(state, sav->state, "key_delsah");
key_freesav(sav);
/* remove back pointer */
sav->sah = NULL;
key_freesav(sav);
sav = NULL;
}
}
@@ -4320,6 +4323,9 @@ key_timehandler(arg)
}
}
}
/* invalidate all cached SPD pointers on pcb */
ipsec_invalpcbcacheall();
}
/* SAD */
@@ -7581,9 +7587,10 @@ key_sp_unlink(sp)
{
/* remove from SP index */
if (__LIST_CHAINED(sp))
if (__LIST_CHAINED(sp)) {
LIST_REMOVE(sp, chain);
key_freesp(sp);
key_freesp(sp);
}
}
/* XXX too much? */
+1
View File
@@ -58,6 +58,7 @@ options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options PFIL_HOOKS # pfil(9) framework
# Debugging for use in -current
#options DDB #Enable the kernel debugger
+18
View File
@@ -131,6 +131,11 @@ __FBSDID("$FreeBSD$");
#include <pci/if_dcreg.h>
#ifdef __sparc64__
#include <dev/ofw/openfirm.h>
#include <machine/ofw_machdep.h>
#endif
MODULE_DEPEND(dc, pci, 1, 1, 1);
MODULE_DEPEND(dc, ether, 1, 1, 1);
MODULE_DEPEND(dc, miibus, 1, 1, 1);
@@ -2106,6 +2111,19 @@ dc_attach(device_t dev)
dc_read_eeprom(sc, (caddr_t)&eaddr, 0, 3, 1);
break;
case DC_TYPE_DM9102:
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
#ifdef __sparc64__
/*
* If this is an onboard dc(4) the station address read from
* the EEPROM is all zero and we have to get it from the fcode.
*/
for (i = 0; i < ETHER_ADDR_LEN; i++)
if (eaddr[i] != 0x00)
break;
if (i >= ETHER_ADDR_LEN && OF_getetheraddr2(dev, eaddr) == -1)
OF_getetheraddr(dev, eaddr);
#endif
break;
case DC_TYPE_21143:
case DC_TYPE_ASIX:
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
+105 -54
View File
@@ -224,9 +224,11 @@ static int sk_marv_miibus_writereg (struct sk_if_softc *, int, int,
int);
static void sk_marv_miibus_statchg (struct sk_if_softc *);
static u_int32_t sk_mchash (caddr_t);
static uint32_t sk_xmchash (const uint8_t *);
static uint32_t sk_gmchash (const uint8_t *);
static void sk_setfilt (struct sk_if_softc *, caddr_t, int);
static void sk_setmulti (struct sk_if_softc *);
static void sk_setpromisc (struct sk_if_softc *);
#ifdef SK_USEIOSPACE
#define SK_RES SYS_RES_IOPORT
@@ -709,26 +711,65 @@ sk_marv_miibus_statchg(sc_if)
return;
}
#define SK_POLY 0xEDB88320
#define SK_BITS 6
#define XMAC_POLY 0xEDB88320
#define GMAC_POLY 0x04C11DB7L
#define HASH_BITS 6
static u_int32_t
sk_mchash(addr)
caddr_t addr;
sk_xmchash(addr)
const uint8_t *addr;
{
u_int32_t crc;
int idx, bit;
u_int8_t data;
uint32_t crc;
int idx, bit;
uint8_t data;
/* Compute CRC for the address value. */
crc = 0xFFFFFFFF; /* initial value */
for (idx = 0; idx < 6; idx++) {
for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1)
crc = (crc >> 1) ^ (((crc ^ data) & 1) ? SK_POLY : 0);
crc = (crc >> 1) ^ (((crc ^ data) & 1) ? XMAC_POLY : 0);
}
return (~crc & ((1 << SK_BITS) - 1));
return (~crc & ((1 << HASH_BITS) - 1));
}
static u_int32_t
sk_gmchash(addr)
const uint8_t *addr;
{
u_int32_t crc;
uint idx, bit;
uint8_t tmpData, data;
/* Compute CRC for the address value. */
crc = 0xFFFFFFFF; /* initial value */
for (idx = 0; idx < 6; idx++) {
data = *addr++;
/* Change bit order in byte. */
tmpData = data;
for (bit = 0; bit < 8; bit++) {
if (tmpData & 1) {
data |= 1 << (7 - bit);
} else {
data &= ~(1 << (7 - bit));
}
tmpData >>= 1;
}
crc ^= (data << 24);
for (bit = 0; bit < 8; bit++) {
if (crc & 0x80000000) {
crc = (crc << 1) ^ GMAC_POLY;
} else {
crc <<= 1;
}
}
}
return (crc & ((1 << HASH_BITS) - 1));
}
static void
@@ -755,7 +796,7 @@ sk_setmulti(sc_if)
struct sk_softc *sc = sc_if->sk_softc;
struct ifnet *ifp = &sc_if->arpcom.ac_if;
u_int32_t hashes[2] = { 0, 0 };
int h, i;
int h = 0, i;
struct ifmultiaddr *ifma;
u_int8_t dummy[] = { 0, 0, 0, 0, 0 ,0 };
@@ -798,8 +839,16 @@ sk_setmulti(sc_if)
continue;
}
h = sk_mchash(
LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
switch(sc->sk_type) {
case SK_GENESIS:
h = sk_xmchash(
LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
break;
case SK_YUKON:
h = sk_gmchash(
LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
break;
}
if (h < 32)
hashes[0] |= (1 << h);
else
@@ -825,6 +874,35 @@ sk_setmulti(sc_if)
return;
}
static void
sk_setpromisc(sc_if)
struct sk_if_softc *sc_if;
{
struct sk_softc *sc = sc_if->sk_softc;
struct ifnet *ifp = &sc_if->arpcom.ac_if;
switch(sc->sk_type) {
case SK_GENESIS:
if (ifp->if_flags & IFF_PROMISC) {
SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
} else {
SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
}
break;
case SK_YUKON:
if (ifp->if_flags & IFF_PROMISC) {
SK_YU_CLRBIT_2(sc_if, YUKON_RCR,
YU_RCR_UFLEN | YU_RCR_MUFLEN);
} else {
SK_YU_SETBIT_2(sc_if, YUKON_RCR,
YU_RCR_UFLEN | YU_RCR_MUFLEN);
}
break;
}
return;
}
static int
sk_init_rx_ring(sc_if)
struct sk_if_softc *sc_if;
@@ -1107,7 +1185,6 @@ sk_ioctl(ifp, command, data)
caddr_t data;
{
struct sk_if_softc *sc_if = ifp->if_softc;
struct sk_softc *sc = sc_if->sk_softc;
struct ifreq *ifr = (struct ifreq *) data;
int error = 0;
struct mii_data *mii;
@@ -1125,34 +1202,12 @@ sk_ioctl(ifp, command, data)
break;
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&
ifp->if_flags & IFF_PROMISC &&
!(sc_if->sk_if_flags & IFF_PROMISC)) {
switch(sc->sk_type) {
case SK_GENESIS:
SK_XM_SETBIT_4(sc_if, XM_MODE,
XM_MODE_RX_PROMISC);
break;
case SK_YUKON:
SK_YU_CLRBIT_2(sc_if, YUKON_RCR,
YU_RCR_UFLEN | YU_RCR_MUFLEN);
break;
if (ifp->if_flags & IFF_RUNNING) {
if ((ifp->if_flags ^ sc_if->sk_if_flags)
& IFF_PROMISC) {
sk_setpromisc(sc_if);
sk_setmulti(sc_if);
}
sk_setmulti(sc_if);
} else if (ifp->if_flags & IFF_RUNNING &&
!(ifp->if_flags & IFF_PROMISC) &&
sc_if->sk_if_flags & IFF_PROMISC) {
switch(sc->sk_type) {
case SK_GENESIS:
SK_XM_CLRBIT_4(sc_if, XM_MODE,
XM_MODE_RX_PROMISC);
break;
case SK_YUKON:
SK_YU_SETBIT_2(sc_if, YUKON_RCR,
YU_RCR_UFLEN | YU_RCR_MUFLEN);
break;
}
sk_setmulti(sc_if);
} else
sk_init(sc_if);
} else {
@@ -2258,12 +2313,6 @@ sk_init_xmac(sc_if)
*(u_int16_t *)(&sc_if->arpcom.ac_enaddr[4]));
SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_USE_STATION);
if (ifp->if_flags & IFF_PROMISC) {
SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
} else {
SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_PROMISC);
}
if (ifp->if_flags & IFF_BROADCAST) {
SK_XM_CLRBIT_4(sc_if, XM_MODE, XM_MODE_RX_NOBROAD);
} else {
@@ -2305,6 +2354,9 @@ sk_init_xmac(sc_if)
*/
SK_XM_WRITE_2(sc_if, XM_TX_REQTHRESH, SK_XM_TX_FIFOTHRESH);
/* Set promiscuous mode */
sk_setpromisc(sc_if);
/* Set multicast filter */
sk_setmulti(sc_if);
@@ -2400,8 +2452,7 @@ static void sk_init_yukon(sc_if)
SK_YU_WRITE_2(sc_if, YUKON_PAR, reg);
/* receive control reg */
SK_YU_WRITE_2(sc_if, YUKON_RCR, YU_RCR_UFLEN | YU_RCR_MUFLEN |
YU_RCR_CRCR);
SK_YU_WRITE_2(sc_if, YUKON_RCR, YU_RCR_CRCR);
/* transmit parameter register */
SK_YU_WRITE_2(sc_if, YUKON_TPR, YU_TPR_JAM_LEN(0x3) |
@@ -2425,11 +2476,11 @@ static void sk_init_yukon(sc_if)
SK_YU_WRITE_2(sc_if, YUKON_SAL2 + i * 4, reg);
}
/* clear all Multicast filter hash registers */
SK_YU_WRITE_2(sc_if, YUKON_MCAH1, 0);
SK_YU_WRITE_2(sc_if, YUKON_MCAH2, 0);
SK_YU_WRITE_2(sc_if, YUKON_MCAH3, 0);
SK_YU_WRITE_2(sc_if, YUKON_MCAH4, 0);
/* Set promiscuous mode */
sk_setpromisc(sc_if);
/* Set multicast filter */
sk_setmulti(sc_if);
/* enable interrupt mask for counter overflows */
SK_YU_WRITE_2(sc_if, YUKON_TIMR, 0);
+1
View File
@@ -55,6 +55,7 @@ options SYSVSHM #SYSV-style shared memory
options SYSVMSG #SYSV-style message queues
options SYSVSEM #SYSV-style semaphores
#options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
options PFIL_HOOKS # pfil(9) framework
# Debugging for use in -current
options DDB #Enable the kernel debugger
+52 -46
View File
@@ -1039,7 +1039,7 @@ rpcclnt_reply(myrep, td)
if (*tl != rpc_reply) {
rpcstats.rpcinvalid++;
m_freem(mrep);
rpcmout:
rpcmout:
if (myrep->r_flags & R_GETONEREP)
RPC_RETURN(0);
continue;
@@ -1212,7 +1212,8 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
if (rpc->rc_soflags & PR_CONNREQUIRED)
error = rpcclnt_sndlock(&rpc->rc_flag, task);
if (!error) {
error = rpcclnt_send(rpc->rc_so, rpc->rc_name, m_copym(m, 0, M_COPYALL, M_TRYWAIT),
error = rpcclnt_send(rpc->rc_so, rpc->rc_name,
m_copym(m, 0, M_COPYALL, M_TRYWAIT),
task);
if (rpc->rc_soflags & PR_CONNREQUIRED)
rpcclnt_sndunlock(&rpc->rc_flag);
@@ -1292,63 +1293,68 @@ rpcclnt_request(rpc, mrest, procnum, td, cred, reply)
case RPC_MISMATCH:
rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl++);
reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl);
reply->stat.mismatch_info.high = fxdr_unsigned(u_int32_t, *tl);
error = EOPNOTSUPP;
break;
case RPC_AUTHERR:
rpcm_dissect(tl, u_int32_t *, RPCX_UNSIGNED);
reply->stat.autherr = fxdr_unsigned(u_int32_t, *tl);
error = EACCES;
break;
default:
error = EBADRPC;
goto rpcmout;
break;
}
RPC_RETURN(0);
} else if (reply->stat.type == RPC_MSGACCEPTED) {
rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
reply->verf_md = md;
reply->verf_dpos = dpos;
reply->verf_type = fxdr_unsigned(u_int32_t, *tl++);
reply->verf_size = fxdr_unsigned(u_int32_t, *tl);
if (reply->verf_size != 0)
rpcm_adv(rpcm_rndup(reply->verf_size));
rpcm_dissect(tl, u_int32_t *, RPCX_UNSIGNED);
reply->stat.status = fxdr_unsigned(u_int32_t, *tl);
if (reply->stat.status == RPC_SUCCESS) {
if ((uint32_t)(dpos - mtod(md, caddr_t)) >= md->m_len) {
RPCDEBUG("where is the next mbuf?");
RPCDEBUG("%d -> %d", (int)(dpos - mtod(md, caddr_t)), md->m_len);
if (md->m_next == NULL) {
error = EBADRPC;
goto rpcmout;
} else {
reply->result_md = md->m_next;
reply->result_dpos = mtod(reply->result_md, caddr_t);
}
} else {
reply->result_md = md;
reply->result_dpos = dpos;
}
} else if (reply->stat.status == RPC_PROGMISMATCH) {
rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl++);
reply->stat.mismatch_info.high = fxdr_unsigned(u_int32_t, *tl);
} else if (reply->stat.status > 5) {
error = EBADRPC;
goto rpcmout;
}
RPC_RETURN(0);
} else {
goto rpcmout;
} else if (reply->stat.type != RPC_MSGACCEPTED) {
error = EBADRPC;
goto rpcmout;
}
rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
reply->verf_md = md;
reply->verf_dpos = dpos;
reply->verf_type = fxdr_unsigned(u_int32_t, *tl++);
reply->verf_size = fxdr_unsigned(u_int32_t, *tl);
if (reply->verf_size != 0)
rpcm_adv(rpcm_rndup(reply->verf_size));
rpcm_dissect(tl, u_int32_t *, RPCX_UNSIGNED);
reply->stat.status = fxdr_unsigned(u_int32_t, *tl);
if (reply->stat.status == RPC_SUCCESS) {
if ((uint32_t)(dpos - mtod(md, caddr_t)) >= md->m_len) {
RPCDEBUG("where is the next mbuf?");
RPCDEBUG("%d -> %d",
(int)(dpos - mtod(md, caddr_t)), md->m_len);
if (md->m_next == NULL) {
error = EBADRPC;
goto rpcmout;
} else {
reply->result_md = md->m_next;
reply->result_dpos = mtod(reply->result_md,
caddr_t);
}
} else {
reply->result_md = md;
reply->result_dpos = dpos;
}
} else if (reply->stat.status == RPC_PROGMISMATCH) {
rpcm_dissect(tl, u_int32_t *, 2 * RPCX_UNSIGNED);
reply->stat.mismatch_info.low = fxdr_unsigned(u_int32_t, *tl++);
reply->stat.mismatch_info.high = fxdr_unsigned(u_int32_t, *tl);
error = EOPNOTSUPP;
goto rpcmout;
} else {
error = EPROTONOSUPPORT;
goto rpcmout;
}
error = 0;
rpcmout:
RPCDEBUG("request returning error %d", error);
RPC_RETURN(error);
}
Loaded 100 of 111 files, more files were not shown because too many files have changed in this diff. Show more