| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
penalize the 'good' drivers: Allocate a shadow cdevsw and populate
it with wrapper functions which grab Giant
|
| |
|
|
|
|
|
|
| |
from kern_conf.c to devfs.
For now just two prototypes, more to come.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
some of the options test, specifically the joliet and rockridge tests.
Since the root mount callchain doesn't go through cd9660_cmount, the
default mount options aren't set. Rather than having the main codepath
assume the options are there, test for the absence of the inverted
optioin
e.g. instead of vfs_flagopt(.. "joliet" ..), test for
!vfs_flagopt(.. "nojoliet" ..)
This works for root mount, non-root mount and future nmount cases.
- in cd9660_cmount, remove inadvertent setting of "gens" when "extatt"
was set.
Reported by: grehan, Dario Freni <saturnero at freesbie org>
Tested by: Dario Freni
Not objected to by: phk
MFC after: 3 days
|
| |
|
|
|
|
| |
made static.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
event handler, dev_clone, which accepts a credential argument.
Implementors of the event can ignore it if they're not interested,
and most do. This avoids having multiple event handler types and
fall-back/precedence logic in devfs.
This changes the kernel API for /dev cloning, and may affect third
party packages containg cloning kernel modules.
Requested by: phk
MFC after: 3 days
|
|
|
|
|
|
| |
processes can cause a panic when operating on rulesets.
Approved by: phk
|
|
|
|
|
|
|
| |
Submitted by: csjp
Reviewed by: phk
Security: FreeBSD-SA-05:17.devfs
Approved by: cperciva
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a character cannot be converted to DOS code page,
unix2doschr() returned `0'. As a result, unix2dosfn()
was forced to return `0', so we saw a file which was
composed of these characters as `Invalid argument'.
To correct this, if a character can be converted to
Unicode, unix2doschr() now returns `1' which is a magic
number to make unix2dosfn() know that the character
must be converted to `_'.
[2] unix2dosfn()
The above-mentioned solution only works if a file
has both of Unicode name and DOS code page name.
Unicode name would not be recorded if file name
can be settled within 11 bytes (DOS short name)
and if no conversion from Unix charset to DOS code
page has occurred. Thus, FreeBSD can create a file
which has only short name, but there is no guarantee
that the short name contains allways valid characters
because we leave it to people by using mount_msdosfs(8)
to select which conversion is used between DOS code
page and unix charset.
To avoid this, Unicode file name should be recorded
unless a character is an ascii character. This is
the way Windows XP do.
PR: 77074 [1]
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
process that caused the clone event to take place for the device driver
creating the device. This allows cloned device drivers to adapt the
device node based on security aspects of the process, such as the uid,
gid, and MAC label.
- Add a cred reference to struct cdev, so that when a device node is
instantiated as a vnode, the cloning credential can be exposed to
MAC.
- Add make_dev_cred(), a version of make_dev() that additionally
accepts the credential to stick in the struct cdev. Implement it and
make_dev() in terms of a back-end make_dev_credv().
- Add a new event handler, dev_clone_cred, which can be registered to
receive the credential instead of dev_clone, if desired.
- Modify the MAC entry point mac_create_devfs_device() to accept an
optional credential pointer (may be NULL), so that MAC policies can
inspect and act on the label or other elements of the credential
when initializing the skeleton device protections.
- Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(),
so that the pty clone credential is exposed to the MAC Framework.
While currently primarily focussed on MAC policies, this change is also
a prerequisite for changes to allow ptys to be instantiated with the UID
of the process looking up the pty. This requires further changes to the
pty driver -- in particular, to immediately recycle pty nodes on last
close so that the credential-related state can be recreated on next
lookup.
Submitted by: Andrew Reisse <andrew.reisse@sparta.com>
Obtained from: TrustedBSD Project
Sponsored by: SPAWAR, SPARTA
MFC after: 1 week
MFC note: Merge to 6.x, but not 5.x for ABI reasons
|
|
|
|
| |
Approved by: re (scottl)
|
|
|
|
|
|
|
| |
prior to calling vgone() to prevent any races.
Sponsored by: Isilon Systems, Inc.
Approved by: re (vfs blanket)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is good enough to be able to run a RELENG_4 gdb binary against
a RELENG_4 application, along with various other tools (eg: 4.x gcore).
We use this at work.
ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace,
procfs and core dumps.
procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client
and target application.
procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their
sscanf fails. They expect an unsigned long.
imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps.
sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note
that 64 bit consumers can still debug 32 bit targets.
IA64 has got stubs for ia32_reg.c.
Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't
implemented in the 32/64 wrapper yet. We also make a tiny patch to
gdb pacify it over conflicting formats of ld-elf.so.1.
Approved by: re
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ioctl numbers in backwards compatability mode. eg: an IOC_IN ioctl with
a size of zero. Traditionally this was what you did before IOC_VOID
existed, and we had some established users of this in the tree, namely
procfs. Certain 3rd party drivers with binary userland components also
have this too.
This is necessary to have 4.x and 5.x binaries use these ioctl's. We
found this at work when trying to run 4.x binaries.
Approved by: re
|
|
|
|
|
| |
Reviewed by: scottl
MFC after: 2 weeks
|
|
|
|
|
|
|
|
| |
it as static in the same file. This is not legal C,
and GCC 4.0 will issue an error.
Reviewed by: phk
Approved by: das (mentor)
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
| |
Noticed by: Coverity Prevent analysis tool.
|
|
|
|
|
| |
PR: kern/43613
Submitted by: Matt Emmerton, matt at gsicomp dot on dot ca
|
|
|
|
|
| |
front of the pointer value. Therefore, remove the "0x"
from the format string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To check a directory's in-use bitmap bit by bit, we use
a pointer to an 8 bit wide unsigned value.
The index used to dereference this pointer is calculated
by shifting the bit index right 3 bits. Then we do a
logical AND with the bit# represented by the lower 3
bits of the bit index.
This is an idiomatic way of iterating through a bit map
with simple bitwise operations.
This commit fixes the bug that we only checked bits
3:0 of each 8 bit chunk, because we only used bits 1:0
of the bit index for the bit# in the current 8 bit value.
This resulted in files not being returned by getdirentries(2).
Change the type of the bit map pointer from `char *' to
`u_int8_t *'.
|
|
|
|
| |
Pointed out by: hrs via IRC
|
|
|
|
| |
PR:78110
|
|
|
|
|
|
|
| |
perfect solution as the lower vm object can change at unpredictable times
if our lower vp happens to be on another unionfs, etc.
Submitted by: Oleg Sharoiko <os@rsu.ru>
|
|
|
|
|
| |
We still have to DROP_GIANT and PICKUP_GIANT when NEEDGIANT is not set
because vfs is still sometime entered with Giant held.
|
| |
|
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
Agreed in principle by: phk
|
|
|
|
| |
closer to passing DEBUG_VFS_LOCKS.
|
|
|
|
| |
- Remove an erroneous VOP lock assert.
|
|
|
|
|
|
|
| |
the vnode interlock are allowed mark it by passing MTX_DUPOK to this
lock operation only.
Sponsored by: Isilon Systems, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the name cache is case-sensitive and msdosfs isn't,
creating a file 'foo' won't invalidate a negative entry for 'FOO'.
There are similar problems related to 8.3 filenames.
A better solution is to override VOP_LOOKUP with a method that
canonicalizes the name, then calls vfs_cache_lookup(). Unfortunately,
it's not quite that simple because vfs_cache_lookup() will call
msdosfs_lookup() on a cache miss, and msdosfs_lookup() needs a way to
get at the original component name.
|
|
|
|
|
|
|
|
|
|
|
| |
than WIN_CHARS bytes, we shift the suffix (previous substrings) upwards
by the amount this substring exceeds its WIN_CHARS slot. Profiling shows
this change is indistinguishable from the previous code at 95% confidence.
This bug would result in attempts to access or create files or directories
with multi-byte characters returning an error but no data loss.
Reported and tested by: avatar
MFC after: 3 days
|
|
|
|
| |
Obtained from: OpenBSD
|
|
|
|
|
|
| |
locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details.
Sponsored by: Isilon Systems, Inc.
|
|
|
|
|
| |
the node is actually already locked, and VOP_INACTIVE is not desirable
in this case.
|
|
|
|
| |
us will decide whether or not to grab a real shared lock.
|
|
|
|
|
|
| |
panic when trying to access a file on mounted smbfs.
Submitted by: takawata at jp freebsd org
|
|
|
|
|
|
|
|
| |
the directory entry.
This solves the corruption problem I belive.
Regression test script by: silby
|
|
|
|
| |
unlocked in the ISDOTDOT case now, not for all !ISLASTCN lookups.
|
|
|
|
|
| |
closes the race where the cdev was reclaimed before it ever made it
back to devfs lookup.
|
|
|
|
|
|
| |
Add unlocked version of dev_ref()
Clean up various stuff in sys/conf.h
|
| |
|
|
|
|
| |
Sponsored by: Isilon Systems, Inc.
|
|
|
|
|
| |
prevents any callers from doing a modifying op without
LOCKPARENT or WANTPARENT.
|
|
|
|
|
| |
prevents any callers from doing a DELETE or RENAME without locking
the parent.
|
|
|
|
|
|
| |
Remove redundant code.
Sponsored by: Isilon Systems, Inc.
|
|
|
|
| |
Spotted by: pjd
|