aboutsummaryrefslogtreecommitdiff
path: root/sys/netsmb/smb_iod.c
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in current: (cherry picked from commit 685dc743dc3b)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* smb_iod_main: eliminate write only variable errorWarner Losh2022-10-021-2/+0
| | | | | | Sponsored by: Netflix (cherry picked from commit 65ee334d112e1d19425bb59628500d0ba91ab48c)
* net: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-6/+1
| | | | Notes: svn path=/head/; revision=365071
* Make timespecadd(3) and friends publicAlan Somers2018-07-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725 Notes: svn path=/head/; revision=336914
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326272
* The problem report was for a crash that happened when smbfs wasRick Macklem2015-11-181-0/+3
| | | | | | | | | | | | | | | | | | | | trying to do a mount. Given the backtrace, it appears that the crash occurred when smb_vc_create() failed and then called smb_vc_put() with vcp->vc_iod == NULL. smb_vc_put() subsequently called smb_vc_disconnect() with vcp->vc_iod == NULL, causing the crash. This patch adds a check for vcp->vc_iod != NULL in smb_vc_disconnect() to avoid the crash. It also fixes the case in smb_vc_create() where kproc_create() fails so that it destroys the mutexes and sets vcp->vc_iod == NULL before free()'ing the iod structure. The person who reported the PR tested the patch, but was not able to reproduce the crash with or without the patch. PR: 201912 Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=291035
* When the smbfs iod thread (smb_iod_thread()) is shutting down, smb_iod_destroy()Rick Macklem2015-11-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | would call smb_iod_request(). This call could return as soon as the wakeup(evp) in smb_iod_main() call is done and then could destroy the mutexes. This caused a race with the rest of smb_iod_main()s use of these mutexes. A crash reported on freebsd-stable@ by Christian Kratzer was diagnosed as a use of one of these mutexes after it was destroyed. This patch moves destruction of the mutexes from smb_iod_destroy() to the end of smb_iod_thread(), so that they aren't destroyed before the thread is done with them. Christian comfirmed that the patch stopped the crashes from happening. Reported by: ck-lists@cksoft.de (Christian Kratzer) Tested by: ck-lists@cksoft.de (Christian Kratzer) Diagnosed by: jhb Reviewed by: jhb MFC after: 2 weeks Notes: svn path=/head/; revision=290959
* Remove redundant unlock.Andrey V. Elsukov2014-04-171-2/+0
| | | | | | | | | | | | This code was removed from the opensolaris and darwin's netsmb implementations, in DfBSD it also has been disabled. PR: 36566, 87859, 139407, 161579, 175557, 178412, 186652 MFC after: 2 weeks Sponsored by: Yandex LLC Notes: svn path=/head/; revision=264600
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-051-1/+1
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* Switch to our preferred 2-clause BSD license.Joel Dahl2010-04-071-6/+0
| | | | | | | Approved by: bp Notes: svn path=/head/; revision=206361
* Really, smb_iod_main() is not totally MPSAFE, so just acquire and dropAttilio Rao2008-03-271-0/+3
| | | | | | | | | | Giant around it in order to assume MPSAFETY. Reported by: jhb, rwatson Pointy hat to: attilio Notes: svn path=/head/; revision=177654
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.Ruslan Ermilov2008-03-251-2/+2
| | | | | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation. Notes: svn path=/head/; revision=177599
* Remove a spourious Giant acquisition.Attilio Rao2008-02-251-3/+0
| | | | | | | | | | | | The code seems pretty MPSAFE and Giant is held over kproc_exit() which at lowel calls exit1(). exit1() requires Giant to be unowned so this opens a window for races. Reported by: Bryan Venteicher <bryanv at daemoninthecloset dot org> Tested by: Bryan Venteicher <bryanv at daemoninthecloset dot org> Notes: svn path=/head/; revision=176566
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-2/+2
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Fix misalignment bugs caused by invalid type casts of pointersMarcel Moolenaar2006-08-221-2/+2
| | | | | | | | | | | returned by md_reserve(). Space reserved by mb_reserve() is byte aligned and need to be used in conjunction with le16enc() and le32enc(). Tested on: ia64 Notes: svn path=/head/; revision=161523
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139823
* Add support for SMB request signing, which prevents "man in the middle"Tim J. Robbins2004-01-021-0/+2
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=124087
* Rewrite the code that uses the try/catch paradigm implemented byMarcel Moolenaar2003-08-231-23/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=119376
* Avoid dereferencing the thread pointer in smb_iod_addrq() if it's NULL.Tim J. Robbins2003-06-141-1/+2
| | | | | | | | Fixes mdconfig -t vnode on smbfs: mdsetcred()'s "horrible kludge" calls into smbfs VOP_READ with a NULL uio_td. Notes: svn path=/head/; revision=116339
* Use __FBSDID().David E. O'Brien2003-06-111-2/+3
| | | | Notes: svn path=/head/; revision=116189
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withJeff Roberson2003-03-311-1/+1
| | | | | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK. Notes: svn path=/head/; revision=112888
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-3/+3
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-3/+3
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Remove the hto(be|le)[slq] and (be|le)toh[slq] macros defined inRobert Drehmel2002-12-161-2/+2
| | | | | | | | | | | | | | _KERNEL scope from "src/sys/sys/mchain.h". Replace each occurrence of the above in _KERNEL scope with the appropriate macro from the set of hto(be|le)(16|32|64) and (be|le)toh(16|32|64) from "src/sys/sys/endian.h". Tested by: tjr Requested by: comment marked with XXX Notes: svn path=/head/; revision=107940
* Some kernel threads try to do significant work, and the default KSTACK_PAGESScott Long2002-10-021-1/+1
| | | | | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb Notes: svn path=/head/; revision=104354
* Fix trivial warning:Peter Wemm2002-05-241-0/+1
| | | | | | | smb_iod.c:560: deprecated use of label at end of compound statement Notes: svn path=/head/; revision=97209
* Move the new byte order function prototypes from <sys/param.h> toMike Barcroft2002-04-261-0/+1
| | | | | | | <sys/endian.h>. This puts us in line with NetBSD and OpenBSD. Notes: svn path=/head/; revision=95533
* - Replace M_WAIT with M_TRYWAIT since the M_WAIT flag is deprecated.Andrew R. Reiter2001-12-091-1/+1
| | | | | | | Spotted by: bde Notes: svn path=/head/; revision=87565
* Pull netsmb requester from the pre-KSE world. This update mostly basedBoris Popov2001-12-021-22/+20
| | | | | | | on the patches submitted by Max Khon <fjoe@iclub.nsu.ru> Notes: svn path=/head/; revision=87192
* Use local wrappers instead of direct calls to mtx_destroy().Boris Popov2001-08-211-3/+3
| | | | | | | | Obtained from: Mac OS X MFC after: 1 week Notes: svn path=/head/; revision=82045
* Import kernel part of SMB/CIFS requester.Boris Popov2001-04-101-0/+709
Add smbfs(CIFS) filesystem. Userland part will be in the ports tree for a while. Obtained from: smbfs-1.3.7-dev package. Notes: svn path=/head/; revision=75374