summaryrefslogtreecommitdiffstats
path: root/sys/netsmb/smb_conn.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove a reference to LK_DRAIN now that lockmgr(9) is gone from thisdavide2013-06-281-1/+0
| | | | | | piece of code. Reported by: attilio
* Overhaul locking in netsmb, getting rid of the obsolete lockmgr() primitive.davide2013-05-041-85/+134
| | | | | | This solves a long standing LOR between smb_conn and smb_vc. Tested by: martymac, pho (previous version)
* Fix panic due to page faults while in kernel mode, under conditions ofdavide2012-10-311-3/+0
| | | | | | | | | VM pressure. The reason is that in some codepaths pointers to stack variables were passed from one thread to another. In collaboration with: pho Reported by: pho's stress2 suite Sponsored by: iXsystems inc.
* Add unicode support to msdosfs and smbfs; original pathes from imura,kevlo2011-11-181-4/+28
| | | | | | bug fixes by Kuan-Chung Chiu <buganini at gmail dot com>. Tested by me in production for several days at work.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Switch to our preferred 2-clause BSD license.joel2010-04-071-6/+0
| | | | Approved by: bp
* Catch up internal locking routines in netsmb with lockmgr changes --rwatson2008-11-021-51/+48
| | | | explicit thread arguments are no longer required in many places.
* smb_vc_put() requires that the passed vcp be locked, so lock it beforerwatson2008-11-021-1/+3
| | | | | | | | | | | | dropping the connection when the requested service isn't available, or we may try to release a lock that isn't locked. This prevents an assertion failure when trying to mount a non-present share using smbfs with INVARIANTS; a lock order reversal warning that immediately follows is not yet fixed. Reported by: attilio MFC after: 3 days
* Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it isattilio2008-02-251-1/+1
| | | | | | | | | always curthread. As KPI gets broken by this patch, manpages and __FreeBSD_version will be updated by further commits. Tested by: Andrea Barberio <insomniac at slackware dot it>
* Currently, smb_co_init() uses the same lock name for the mutex interlockattilio2008-02-241-8/+9
| | | | | | and the lockmgr. Use different names in order to avoid WITNESS conflicts. Reported by: Bryan Venteicher <bryanv at daemoninthecloset dot org>
* Cleanup lockmgr interface and exported KPI:attilio2008-01-241-9/+7
| | | | | | | | | | | | | | | | | | | | - Remove the "thread" argument from the lockmgr() function as it is always curthread now - Axe lockcount() function as it is no longer used - Axe LOCKMGR_ASSERT() as it is bogus really and no currently used. Hopefully this will be soonly replaced by something suitable for it. - Remove the prototype for dumplockinfo() as the function is no longer present Addictionally: - Introduce a KASSERT() in lockstatus() in order to let it accept only curthread or NULL as they should only be passed - Do a little bit of style(9) cleanup on lockmgr.h KPI results heavilly broken by this change, so manpages and FreeBSD_version will be modified accordingly by further commits. Tested by: matteo
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-0/+1
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Always lock the lockmgr lock when creating an smb connection object ratherjhb2006-07-171-1/+2
| | | | | | | than only locking it if INVARIANTS is enabled. All the callers expect smb_co_init() to return with the lock held. Tested by: "Jiawei Ye" <leafy7382 at gmail>
* Normalize a significant number of kernel malloc type names:rwatson2005-10-311-1/+1
| | | | | | | | | | | | | | | | | | | - Prefer '_' to ' ', as it results in more easily parsed results in memory monitoring tools such as vmstat. - Remove punctuation that is incompatible with using memory type names as file names, such as '/' characters. - Disambiguate some collisions by adding subsystem prefixes to some memory types. - Generally prefer lower case to upper case. - If the same type is defined in multiple architecture directories, attempt to use the same name in additional cases. Not all instances were caught in this change, so more work is required to finish this conversion. Similar changes are required for UMA zone names.
* lockmgr(...,LK_DRAIN,...) requires a balancing LK_RELEASE: recentpeadar2005-05-131-3/+2
| | | | | | | | | | | INVARIANTS dependent checks in userret() pinpointed a missing invocation here. Remove an unused variable while here. Reviewed By: bp@ Reported By: yongari@ MFC After: 3 days
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Avoid casts as lvalues.kan2004-07-281-4/+12
|
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherrwatson2004-03-011-2/+2
| | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam
* Split the mlock() kernel code into two parts, mlock(), which unpackstruckman2004-02-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the syscall arguments and does the suser() permission check, and kern_mlock(), which does the resource limit checking and calls vm_map_wire(). Split munlock() in a similar way. Enable the RLIMIT_MEMLOCK checking code in kern_mlock(). Replace calls to vslock() and vsunlock() in the sysctl code with calls to kern_mlock() and kern_munlock() so that the sysctl code will obey the wired memory limits. Nuke the vslock() and vsunlock() implementations, which are no longer used. Add a member to struct sysctl_req to track the amount of memory that is wired to handle the request. Modify sysctl_wire_old_buffer() to return an error if its call to kern_mlock() fails. Only wire the minimum of the length specified in the sysctl request and the length specified in its argument list. It is recommended that sysctl handlers that use sysctl_wire_old_buffer() should specify reasonable estimates for the amount of data they want to return so that only the minimum amount of memory is wired no matter what length has been specified by the request. Modify the callers of sysctl_wire_old_buffer() to look for the error return. Modify sysctl_old_user to obey the wired buffer length and clean up its implementation. Reviewed by: bms
* Add support for SMB request signing, which prevents "man in the middle"tjr2004-01-021-0/+5
| | | | | | | | | | | attacks and is required to connect to Windows 2003 servers in their default configuration. This adds an extra field to the SMB header containing the truncated 64-bit MD5 digest of a key (a function of the user's password and the server's authentication challenge), an implicit sequence number, and the message data itself. As signing each message imposes a significant performance penalty, we only enable it if the server will not let us connect without it; this should eventually become an option to mount_smbfs.
* Rewrite the code that uses the try/catch paradigm implemented bymarcel2003-08-231-68/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | goto and abstracted by the itry, ithrow and icatch macros (among others). The problem with this code is that it doesn't compile on ia64. The compiler is sufficiently confused that it inserts a call to __ia64_save_stack_nonlock(). This is a magic function that saves enough of the stack to allow for non-local gotos, such as would be the case for nested functions. Since it's not a compiler defined function, it needs a runtime implementation. This we have not in a standalone compilation as is the kernel. There's no indication that the compiler is not confused on other platforms. It's likely that saving the stack in those cases is trivial enough that the compiler doesn't need to off-load the complexity to a runtime function. The code is believed to be correctly translated, but has not been tested. The overall structure remained the same, except that it's made explicit. The macros that implement the try/catch construct have been removed to avoid reintroduction of their use. It's not a good idea. In general the rewritten code is slightly more optimal in that it doesn't need as much stack space and generally is smaller in size. Found by: LINT
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Wire the sysctl output buffer before grabbing any locks to preventtruckman2002-07-281-0/+1
| | | | | | | SYSCTL_OUT() from blocking while locks are held. This should only be done when it would be inconvenient to make a temporary copy of the data and defer calling SYSCTL_OUT() until after the locks are released.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-1/+1
| | | | reference.
* Pull netsmb requester from the pre-KSE world. This update mostly basedbp2001-12-021-65/+65
| | | | on the patches submitted by Max Khon <fjoe@iclub.nsu.ru>
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-06-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind
* Import kernel part of SMB/CIFS requester.bp2001-04-101-0/+874
Add smbfs(CIFS) filesystem. Userland part will be in the ports tree for a while. Obtained from: smbfs-1.3.7-dev package.
OpenPOWER on IntegriCloud