Home | History | Annotate | Download | only in nfs
History log of /src/sys/nfs/nfs_srvsubs.c
RevisionDateAuthorComments
 1.17  23-Mar-2023  riastradh nfs: Avoid integer overflow in nfs_namei bounds check.

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.16  27-Apr-2022  hannken branches: 1.16.4;
As VOP_GETATTR() needs a shared lock at least move the preopattr lookup
inside nfs_namei() where we may lock the start directory without violating
the lock order.
 1.15  17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.14  05-Nov-2012  dholland branches: 1.14.30; 1.14.38; 1.14.42; 1.14.44;
Rename the new ni_startdir (the slot used to hold the starting point
for openat() and friends) to ni_atdir to avoid confusion with a
previously existing (and, alas, still documented) ni_startdir field
that meant something else entirely.
 1.13  13-Oct-2012  dholland Replace hack implementation of NDAT() for "nameiat" with a proper one.
(This change requires a kernel bump.)
 1.12  27-Sep-2011  christos branches: 1.12.2; 1.12.12;
use NFS_MAXPATHLEN instead of MAXPATHLEN
 1.11  08-Aug-2011  dholland nfs_namei() should not return a non-null path buffer except on success,
even though the callers are apparently prepared to cope.

Fixes last tidyup part of PR 44625.
 1.10  11-Apr-2011  dholland Clean up. Move some more code across from nfsd's private entry points.
 1.9  19-Mar-2011  dholland Fix memory leak introduced with the struct pathbuf changes. Hi, me.
Closes PR 44625.
 1.8  30-Nov-2010  dholland branches: 1.8.2;
Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
 1.7  19-Nov-2010  dholland Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
 1.6  24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.5  27-Sep-2009  dholland branches: 1.5.2; 1.5.4;
Move a big wodge of symlink-following code from nfsd to inside
lookup_for_nfsd(). This code is, or at least should be, the same as
the regular symlink-following code plus an extra flag nfsd needs.

The two lots of code can/will be merged in the future.
 1.4  27-Sep-2009  dholland Rename lookup() to lookup_for_nfsd(), to make it clear just whose
private backdoor entry point this is.

Also, clone the lookup_for_nfsd() entry point as
lookup_for_nfsd_index(), for use by a different call site in nfsd that
does different unclean things with nameidata.
 1.3  04-May-2009  yamt branches: 1.3.2;
when freeing cn_pnbuf, make it NULL if DIAGNOSTIC.
 1.2  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.1  19-Nov-2008  ad branches: 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.1.10.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.8.3  28-Apr-2009  skrll Sync with HEAD.
 1.1.8.2  19-Jan-2009  skrll Sync with HEAD.
 1.1.8.1  19-Nov-2008  skrll file nfs_srvsubs.c was added on branch nick-hppapmap on 2009-01-19 13:20:20 +0000
 1.1.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.1.6.1  19-Nov-2008  mjf file nfs_srvsubs.c was added on branch mjf-devfs2 on 2009-01-17 13:29:34 +0000
 1.1.4.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.4.1  19-Nov-2008  haad file nfs_srvsubs.c was added on branch haad-dm on 2008-12-13 01:15:28 +0000
 1.3.2.4  11-Aug-2010  yamt sync with head.
 1.3.2.3  11-Mar-2010  yamt sync with head
 1.3.2.2  04-May-2009  yamt sync with head.
 1.3.2.1  04-May-2009  yamt file nfs_srvsubs.c was added on branch yamt-nfs-mp on 2009-05-04 08:14:22 +0000
 1.5.4.3  21-Apr-2011  rmind sync with head
 1.5.4.2  05-Mar-2011  rmind sync with head
 1.5.4.1  03-Jul-2010  rmind sync with head
 1.5.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.8.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.12.12.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.12.2.2  16-Jan-2013  yamt sync with (a bit old) head
 1.12.2.1  30-Oct-2012  yamt sync with head
 1.14.44.1  17-Jan-2020  ad Sync with head.
 1.14.42.1  30-Mar-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1617):

sys/nfs/nfs_serv.c: revision 1.184
sys/nfs/nfs_srvsubs.c: revision 1.17
sys/nfs/nfsm_subs.h: revision 1.56
sys/nfs/nfsm_subs.h: revision 1.57

nfs: Use unsigned fhlen so we don't trip over negative values.

nfs: Avoid integer overflow in nfs_namei bounds check.

nfs: Use unsigned name lengths so we don't trip over negative ones.
- nfsm_strsiz is only used with uint32_t in callers, but let's not
leave it as a rake to step on.
- nfsm_srvnamesiz is abused with signed s. The internal conversion
to unsigned serves to reject both negative and too-large values in
such callers.
XXX Should make all callers use unsigned, rather than flipping back
and forth between signed and unsigned for name lengths.

nfs: Avoid free of uninitialized on bad name size in create, mknod.
XXX These error branches are a nightmare and need to be more
systematically cleaned up. Even if they are correct now, they are
impossible to audit and extremely fragile in case anyone ever needs
to make other changes to them.
 1.14.38.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.14.30.1  30-Mar-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1810):

sys/nfs/nfs_serv.c: revision 1.184
sys/nfs/nfs_srvsubs.c: revision 1.17
sys/nfs/nfsm_subs.h: revision 1.56
sys/nfs/nfsm_subs.h: revision 1.57

nfs: Use unsigned fhlen so we don't trip over negative values.

nfs: Avoid integer overflow in nfs_namei bounds check.

nfs: Use unsigned name lengths so we don't trip over negative ones.
- nfsm_strsiz is only used with uint32_t in callers, but let's not
leave it as a rake to step on.
- nfsm_srvnamesiz is abused with signed s. The internal conversion
to unsigned serves to reject both negative and too-large values in
such callers.
XXX Should make all callers use unsigned, rather than flipping back
and forth between signed and unsigned for name lengths.

nfs: Avoid free of uninitialized on bad name size in create, mknod.
XXX These error branches are a nightmare and need to be more
systematically cleaned up. Even if they are correct now, they are
impossible to audit and extremely fragile in case anyone ever needs
to make other changes to them.
 1.16.4.1  30-Mar-2023  martin Pull up following revision(s) (requested by riastradh in ticket #134):

sys/nfs/nfs_serv.c: revision 1.184
sys/nfs/nfs_srvsubs.c: revision 1.17
sys/nfs/nfsm_subs.h: revision 1.56
sys/nfs/nfsm_subs.h: revision 1.57

nfs: Use unsigned fhlen so we don't trip over negative values.

nfs: Avoid integer overflow in nfs_namei bounds check.

nfs: Use unsigned name lengths so we don't trip over negative ones.
- nfsm_strsiz is only used with uint32_t in callers, but let's not
leave it as a rake to step on.
- nfsm_srvnamesiz is abused with signed s. The internal conversion
to unsigned serves to reject both negative and too-large values in
such callers.
XXX Should make all callers use unsigned, rather than flipping back
and forth between signed and unsigned for name lengths.

nfs: Avoid free of uninitialized on bad name size in create, mknod.
XXX These error branches are a nightmare and need to be more
systematically cleaned up. Even if they are correct now, they are
impossible to audit and extremely fragile in case anyone ever needs
to make other changes to them.

RSS XML Feed