History log of /openbsd/sys/nfs/nfs_serv.c (Results 1 – 25 of 131)
Revision Date Author Comments
# af61481e 05-Nov-2024 jsg <jsg@openbsd.org>

remove VATTR_NULL() define, directly call vattr_null()

There used to be a predefined null vattr for !DIAGNOSTIC
but that was removed in vnode.h rev 1.84 in 2007.

ok semarie@ miod@


# 8d80561b 18-Sep-2024 jsg <jsg@openbsd.org>

remove unneeded semicolons after switch statements


# df0421f7 11-Sep-2024 claudio <claudio@openbsd.org>

After calling m_freem() on nmi_mrep (or nmi_mreq) set the pointer to NULL.

Only do this if struct nfsm_info doesn't have local scope.
In some cases the caller would perfrom another m_freem and doubl

After calling m_freem() on nmi_mrep (or nmi_mreq) set the pointer to NULL.

Only do this if struct nfsm_info doesn't have local scope.
In some cases the caller would perfrom another m_freem and double free
the mbuf and Bad Things(TM) would happen.

Reported by Claes M Nyberg on bugs@; with & ok miod@

show more ...


# 8e9d9dd5 10-Sep-2024 miod <miod@openbsd.org>

nfsm_srvnamesiz() may set up an NFSERR_NAMETOL error, which nfsm_reply() would
consider as not tragic enough to abort the operation, in order to batch error
replies.

This would end up invoking nfs_n

nfsm_srvnamesiz() may set up an NFSERR_NAMETOL error, which nfsm_reply() would
consider as not tragic enough to abort the operation, in order to batch error
replies.

This would end up invoking nfs_namei() using an uninitialized variable as
length, and Bad Things(TM) would happen.

Reported by Claes M Nyberg on bugs@; tweaks & ok claudio@

show more ...


# 98d98fd9 17-Aug-2024 jsg <jsg@openbsd.org>

avoid uninitialised var use in nfs_serv.c error paths

some functions have a nfsmout label with code that assumes NDINIT has
been called

nfsrv_rename has two NDINIT calls, the nfsmout code assumes b

avoid uninitialised var use in nfs_serv.c error paths

some functions have a nfsmout label with code that assumes NDINIT has
been called

nfsrv_rename has two NDINIT calls, the nfsmout code assumes both are
setup but is only jumped to when none/one is setup

found with llvm scan-build
checked by deraadt@ beck@, ok miod@

show more ...


# 564dba15 01-May-2024 jsg <jsg@openbsd.org>

remove unneeded includes
ok miod@ mpi@


# 45db009a 30-Apr-2024 miod <miod@openbsd.org>

Constify NFS data whenever possible. Also make a few more const data static.

ok jsg@ semarie@


# a43f2b81 30-Apr-2024 miod <miod@openbsd.org>

Convert all the NFS macros (in nfsm_subs.h) into inline functions with the
appropriate extra arguments.

This (hopefully) completes the unmessyfication work started by thib@ a long,
long time ago (in

Convert all the NFS macros (in nfsm_subs.h) into inline functions with the
appropriate extra arguments.

This (hopefully) completes the unmessyfication work started by thib@ a long,
long time ago (in a galaxy far away).

The conversion logic has been:
- nfsm_dissect has been turned into an rvalue expression, leaving the
cast operation up to its caller.
- macros which had three different exit paths (return, goto nfsmout or
fallthrough) have been split so that no macros have more than two exit paths.
- then they have been modified to return a value, which lets the caller
figure out what exit path is needed.
- local variables abused by the macros are now local variables of the new
inline functions.

This single commit is the sum of 25 intermediate diffs, which have all been
carefully reviewed by (at least) jsg@ and semarie@.

Tested with v2 and v3 servers and clients.

ok jsg@ semarie@

show more ...


# 6cb92a3c 25-Mar-2024 guenther <guenther@openbsd.org>

Move the "no (hard) linking directories" and "no cross-mount links"
checks from all the filesystems that support hardlinks at all into
the VFS layer. Simplify, EPERM description in link(2).

ok miod

Move the "no (hard) linking directories" and "no cross-mount links"
checks from all the filesystems that support hardlinks at all into
the VFS layer. Simplify, EPERM description in link(2).

ok miod@ mpi@

show more ...


# 5b133f3f 08-Mar-2023 guenther <guenther@openbsd.org>

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@


# 7e664d26 27-May-2022 mpi <mpi@openbsd.org>

Call uvm_vnp_uncache() before VOP_RENAME().

ok kettenis@


# b66b9ef8 11-Mar-2021 jsg <jsg@openbsd.org>

spelling


# fa5a0c50 19-Jan-2019 cheloha <cheloha@openbsd.org>

Move boottime into the timehands.

To protect the timehands we first need to protect the basis for all UTC
time in the kernel: the boottime.

Because the boottime can be changed at any time it needs

Move boottime into the timehands.

To protect the timehands we first need to protect the basis for all UTC
time in the kernel: the boottime.

Because the boottime can be changed at any time it needs to be versioned
along with the other members of the timehands to enable safe lockless reads
when using it for anything. So the global boottime timespec goes away and
the static boottimebin becomes a member of the timehands. Instead of reading
the global boottime you use one of two interfaces: binboottime(9) or
microboottime(9). nanoboottime(9) can trivially be added later, though there
are no consumers for it at the moment.

This introduces one small change in behavior. We used to advance the
reported boottime just before launching kernel threads from main().
This makes it look to userland like we "booted" moments before those
threads were launched. Because there is no longer a boottime global we
can no longer trivially do this from main(), so the boottime we report
to userspace via e.g. kern.boottime will now reflect whatever the time
was when we bootstrapped the timehands via inittodr(9). This is usually
no more than a minute before the kernel threads are launched from main().
The prior behavior can be restored by adding a new interface to the
timecounter layer in a future commit.

Based on FreeBSD r303387.

Discussed with mpi@ and visa@.

ok visa@

show more ...


# f1b73c6d 18-Jan-2019 bluhm <bluhm@openbsd.org>

Check for negative length integers in NFS server. A malicious
client could crash the server.
OK tedu@


# b5b7f62e 09-Nov-2018 claudio <claudio@openbsd.org>

M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers for
m_leadingspace() and m_trailingspace(). Convert all callers to call
directly the functions and remove the defines.
OK krw@, mpi@


# b1caf6da 13-Jun-2018 visa <visa@openbsd.org>

Make the VFS layer responsible for preventing the deletion
of mounted on directories.

OK guenther@, mpi@


# 4dd4d774 07-Jun-2018 visa <visa@openbsd.org>

Make callers of VOP_CREATE(9) and VOP_MKNOD(9) responsible for
unlocking the directory vnode.

OK mpi@, helg@


# 6e880534 02-May-2018 visa <visa@openbsd.org>

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 36bb23f1 28-Apr-2018 visa <visa@openbsd.org>

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


# 98edb555 30-Dec-2017 guenther <guenther@openbsd.org>

Delete unnecessary <sys/file.h> includes

ok millert@ krw@


# fe1f2e8d 22-Feb-2017 mpi <mpi@openbsd.org>

Keep local definitions local.

"good work" deraadt@, ok visa@


# f24984d5 21-Sep-2016 jsg <jsg@openbsd.org>

Fix nfsrv_symlink() indentation. No binary change.
ok mpi@ deraadt@


# a16a9cd8 04-Jul-2016 natano <natano@openbsd.org>

Add missing vput() in error path to prevent a vnode getting stuck with a
stale reference and lock, while it shouldn't hold either.

"makes sense to me" beck@


# 9b247b22 29-Apr-2016 beck <beck@openbsd.org>

Fix some gibbering horrors due to uninitialized struct nameidata's

1) turn NDINITAT into a function and make the macros point to it
with the later goal of getting rid of them.

2) Sweep the kernel f

Fix some gibbering horrors due to uninitialized struct nameidata's

1) turn NDINITAT into a function and make the macros point to it
with the later goal of getting rid of them.

2) Sweep the kernel for places where people make a struct nameidata manually
on the stack and fill in what they hope are the required fields and count
on prayer and clean living to always get them right. Instead use NDINIT
everywhere. NFS was especially bad for this and there have likely
been things lurking there for a while.

3) Add a couple of strategic KASSERT's to catch future offenders.

ok krw@ sthen@ deraadt@

show more ...


# 937fcae7 19-Mar-2016 natano <natano@openbsd.org>

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


123456