aboutsummaryrefslogtreecommitdiff
path: root/sys/rpc
Commit message (Collapse)AuthorAgeFilesLines
* nfs-over-tls: handle res.gid.gid_val correctly for memory allocationRick Macklem2021-01-121-0/+2
| | | | | | | | | | | | | | When the server side nfs-over-tls does an upcall to rpc.tlsservd(8) for the handshake and the rpc.tlsservd "-u" command line option has been specified, a list of gids may be returned. The list will be returned in malloc'd memory pointed to by res.gid.gid_val. To ensure the malloc occurs, res.gid.gid_val must be NULL before the call. Then, the malloc'd memory needs to be free'd. mem_free() just calls free(9), so a NULL pointer argument is fine and a length argument == 0 is ok, since the "len" argument is not used. This bug would have only affected nfs-over-tls and only when rpc.tlsservd(8) is running with the "-u" command line option.
* Add a new "tlscertname" NFS mount option.Rick Macklem2020-12-236-7/+37
| | | | | | | | | | | | | When using NFS-over-TLS, an NFS client can optionally provide an X.509 certificate to the server during the TLS handshake. For some situations, such as different NFS servers or different certificates being mapped to different user credentials on the NFS server, there may be a need for different mounts to provide different certificates. This new mount option called "tlscertname" may be used to specify a non-default certificate be provided. This alernate certificate will be stored in /etc/rpc.tlsclntd in a file with a name based on what is provided by this mount option.
* Fix a potential memory leak in the NFS over TLS handling code.Rick Macklem2020-09-051-0/+2
| | | | | | | | | | | | | | For the TLS case where there is a "user@domain" name specified in the X.509 v3 certificate presented by the client in the otherName component of subjectAltName, a gid list is allocated via mem_alloc(). This needs to be free'd. Otherwise xp_gidp == NULL and free() handles that. (The size argument to mem_free() is not used by FreeBSD, so it can be 0.) This leak would not have occurred for any other case than NFS over TLS with the "user@domain" in the client's certificate. Notes: svn path=/head/; revision=365355
* Remove a duplicate declarationMitchell Horne2020-09-031-2/+0
| | | | | | | | | | This is already declared in sys/file.h, which is included directly. Compiling with GCC9 emits an error. Discussed with: rmacklem Notes: svn path=/head/; revision=365316
* Add TLS support to the kernel RPC.Rick Macklem2020-08-2214-21/+1618
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An internet draft titled "Towards Remote Procedure Call Encryption By Default" describes how TLS is to be used for Sun RPC, with NFS as an intended use case. This patch adds client and server support for this to the kernel RPC, using KERN_TLS and upcalls to daemons for the handshake, peer reset and other non-application data record cases. The upcalls to the daemons use three fields to uniquely identify the TCP connection. They are the time.tv_sec, time.tv_usec of the connection establshment, plus a 64bit sequence number. The time fields avoid problems with re-use of the sequence number after a daemon restart. For the server side, once a Null RPC with AUTH_TLS is received, kernel reception on the socket is blocked and an upcall to the rpctlssd(8) daemon is done to perform the TLS handshake. Upon completion, the completion status of the handshake is stored in xp_tls as flag bits and the reply to the Null RPC is sent. For the client, if CLSET_TLS has been set, a new TCP connection will send the Null RPC with AUTH_TLS to initiate the handshake. The client kernel RPC code will then block kernel I/O on the socket and do an upcall to the rpctlscd(8) daemon to perform the handshake. If the upcall is successful, ct_rcvstate will be maintained to indicate if/when an upcall is being done. If non-application data records are received, the code does an upcall to the appropriate daemon, which will do a SSL_read() of 0 length to handle the record(s). When the socket is being shut down, upcalls are done to the daemons, so that they can perform SSL_shutdown() calls to perform the "peer reset". The rpctlssd(8) and rpctlscd(8) daemons require a patched version of the openssl library and, as such, will not be committed to head at this time. Although the changes done by this patch are fairly numerous, there should be no semantics change to the kernel RPC at this time. A future commit to the NFS code will optionally enable use of TLS for NFS. Notes: svn path=/head/; revision=364475
* Add an argument to newnfs_connect() that indicates use TLS for the connection.Rick Macklem2020-08-111-0/+2
| | | | | | | | | | | | | | | | | | For NFSv4.0, the server creates a server->client TCP connection for callbacks. If the client mount on the server is using TLS, enable TLS for this callback TCP connection. TLS connections from clients will not be supported until the kernel RPC changes are committed. Since this changes the internal ABI between the NFS kernel modules that will require a version bump, delete newnfs_trimtrailing(), which is no longer used. Since LCL_TLSCB is not yet set, these changes should not have any semantic affect at this time. Notes: svn path=/head/; revision=364092
* Fix up a comment added by r362455.Rick Macklem2020-06-211-1/+1
| | | | Notes: svn path=/head/; revision=362457
* Modify the way the client side krpc does soreceive() for TCP.Rick Macklem2020-06-212-95/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, clnt_vc_soupcall() first does a soreceive() for 4 bytes (the Sun RPC over TCP record mark) and then soreceive(s) for the RPC message. This first soreceive() almost always results in an mbuf allocation, since having the 4byte record mark in a separate mbuf in the socket rcv queue is unlikely. This is somewhat inefficient and rather odd. It also will not work for the ktls rx, since the latter returns a TLS record for each soreceive(). This patch replaces the above with code similar to what the server side of the krpc does for TCP, where it does a soreceive() for as much data as possible and then parses RPC messages out of the received data. A new field of the TCP socket structure called ct_raw is the list of received mbufs that the RPC message(s) are parsed from. I think this results in cleaner code and is needed for support of nfs-over-tls. It also fixes the code for the case where a server sends an RPC message in multiple RPC message fragments. Although this is allowed by RFC5531, no extant NFS server does this. However, it is probably good to fix this in case some future NFS server does do this. Notes: svn path=/head/; revision=362455
* Add the .h file that describes the operations for the rpctls_syscall.Rick Macklem2020-05-311-0/+82
| | | | | | | | This .h file will be used by the nfs-over-tls daemons to do the system call that was added by r361599. Notes: svn path=/head/; revision=361658
* Split XDR into separate kernel module. Make krpc depend on xdr.Gleb Smirnoff2020-04-171-0/+1
| | | | | | | | Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D24408 Notes: svn path=/head/; revision=360036
* Move M_RPC malloc type into XDR. Both RPC and XDR libraries useGleb Smirnoff2020-04-171-2/+0
| | | | | | | | | | | this type, but since RPC depends on XDR (not vice versa) we need it defined in XDR to make the module loadable without RPC. Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D24408 Notes: svn path=/head/; revision=360035
* Change the xid for client side krpc over UDP to a global value.Rick Macklem2020-04-051-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the xid used for the client side krpc requests over UDP was initialized for each "connection". A "connection" for UDP is rather sketchy and for the kernel NLM a new one is created every 2minutes. A problem with client side interoperability with a Netapp server for the NLM was reported and it is believed to be caused by reuse of the same xid. Although this was never completely diagnosed by the reporter, I could see how the same xid might get reused, since it is initialized to a value based on the TOD clock every two minutes. I suspect initializing the value for every "connection" was inherited from userland library code, where having a global xid was not practical. However, implementing a global "xid" for the kernel rpc is straightforward and will ensure that an xid value is not reused for a long time. This patch does that and is hoped it will fix the Netapp interoperability problem. PR: 245022 Reported by: danny@cs.huji.ac.il MFC after: 2 weeks Notes: svn path=/head/; revision=359643
* Remove obsolete old-freebsd version compat shim.Warner Losh2020-03-011-4/+0
| | | | Notes: svn path=/head/; revision=358509
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-262-5/+7
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Change r355157 to make svc_rpc_gss_lifetime_max a static.Rick Macklem2019-11-281-1/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=355161
* Add a cap on credential lifetime for Kerberized NFS.Rick Macklem2019-11-281-1/+13
| | | | | | | | | | | | | | | | | | | | | The kernel RPCSEC_GSS code sets the credential (called a client) lifetime to the lifetime of the Kerberos ticket, which is typically several hours. As such, when a user's credentials change such as being added to a new group, it can take several hours for this change to be recognized by the NFS server. This patch adds a sysctl called kern.rpc.gss.lifetime_max which can be set by a sysadmin to put a cap on the time to expire for the credentials, so that a sysadmin can reduce the timeout. It also fixes a bug, where time_uptime is added twice when GSS_C_INDEFINITE is returned for a lifetime. This has no effect in practice, sine Kerberos never does this. Tested by: pen@lysator.liu.se PR: 242132 Submitted by: pen@lysator.liu.se MFC after: 2 weeks Notes: svn path=/head/; revision=355157
* Avoid relying on header pollution from sys/refcount.h.Mark Johnston2019-07-291-0/+1
| | | | | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350421
* Fix malloc stats for the RPCSEC_GSS server code when DEBUG is enabled.Rick Macklem2019-04-041-1/+1
| | | | | | | | | | | | | | | | The code enabled when "DEBUG" is defined uses mem_alloc(), which is a malloc(.., M_RPC, M_WAITOK | M_ZERO), but then calls gss_release_buffer() which does a free(.., M_GSSAPI) to free the memory. This patch fixes the problem by replacing mem_alloc() with a malloc(.., M_GSSAPI, M_WAITOK | M_ZERO). This bug affects almost no one, since the sources are not normally built with "DEBUG" defined. Submitted by: peter@ifm.liu.se MFC after: 2 weeks Notes: svn path=/head/; revision=345866
* Add a comment to the r345818 patch to explain why cl_refs is initialized to 2.Rick Macklem2019-04-031-0/+5
| | | | | | | | PR: 235582 MFC after: 2 weeks Notes: svn path=/head/; revision=345828
* Fix a race in the RPCSEC_GSS server code that caused crashes.Rick Macklem2019-04-021-8/+7
| | | | | | | | | | | | | | | | | | | | | | | When a new client structure was allocated, it was added to the list so that it was visible to other threads before the expiry time was initialized, with only a single reference count. The caller would increment the reference count, but it was possible for another thread to decrement the reference count to zero and free the structure before the caller incremented the reference count. This could occur because the expiry time was still set to zero when the new client structure was inserted in the list and the list was unlocked. This patch fixes the race by initializing the reference count to two and initializing all fields, including the expiry time, before inserting it in the list. Tested by: peter@ifm.liu.se PR: 235582 MFC after: 2 weeks Notes: svn path=/head/; revision=345818
* Bump the default kern.rpc.gss.client_max from 128 to 1024.Edward Tomasz Napierala2019-02-191-1/+1
| | | | | | | | | | | | | The old value resulted in bad performance, with high kernel and gssd(8) load, with more than ~64 clients; it also triggered crashes, which are to be fixed by a different patch. PR: 235582 Discussed with: rmacklem@ MFC after: 2 weeks Notes: svn path=/head/; revision=344276
* Add kern.rpc.gss.client_hash tunable, to make it possible to bumpEdward Tomasz Napierala2019-02-191-6/+12
| | | | | | | | | | | | it easily. This can lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson <pa at chalmers dot se> Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Notes: svn path=/head/; revision=344273
* Add kern.rpc.gss.client_max, to make it possible to bump it easily.Edward Tomasz Napierala2018-12-151-2/+15
| | | | | | | | | | | | | This can drastically lower the load on gssd(8) on large NFS servers. Submitted by: Per Andersson <pa at chalmers dot se> Reviewed by: rmacklem@ MFC after: 2 weeks Sponsored by: Chalmers University of Technology Differential Revision: https://reviews.freebsd.org/D18393 Notes: svn path=/head/; revision=342114
* Set SO_SNDTIMEO in the client side krpc when CLSET_TIMEOUT is done.Rick Macklem2018-07-201-1/+17
| | | | | | | | | | | | | | | | | During testing of the pNFS client, it was observed that an RPC could get stuck in sosend() for a very long time if the network connection to a DS had failed. This is fixed by setting SO_SNDTIMEO on the TCP socket. This is only done when CLSET_TIMEOUT is done and this is not done by any use of the krpc currently in the source tree, so there should be no effect on extant uses. A future patch will use CLSET_TIMEOUT for TCP connections to DSs. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16293 Notes: svn path=/head/; revision=336542
* Fix the server side krpc so that the kernel nfsd threads terminate.Rick Macklem2018-07-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Occationally the kernel nfsd threads would not terminate when a SIGKILL was posted for the kernel process (called nfsd (slave)). When this occurred, the thread associated with the process (called "ismaster") had returned from svc_run_internal() and was sleeping waiting for the other threads to terminate. The other threads (created by kthread_start()) were still in svc_run_internal() handling NFS RPCs. The only way this could occur is for the "ismaster" thread to return from svc_run_internal() without having called svc_exit(). There was only one place in the code where this could happen and this patch stops that from happening. Since the problem is intermittent, I cannot be sure if this has fixed the problem, but I have not seen an occurrence of the problem with this patch applied. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16087 Notes: svn path=/head/; revision=335866
* Do pass removing some write-only variables from the kernel.Alexander Kabaev2017-12-251-6/+2
| | | | | | | | | | | | This reduces noise when kernel is compiled by newer GCC versions, such as one used by external toolchain ports. Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial) Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c) Differential Revision: https://reviews.freebsd.org/D10385 Notes: svn path=/head/; revision=327173
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-277-0/+14
| | | | | | | | | | | | | | | | | 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
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2035-0/+71
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Listening sockets improvements.Gleb Smirnoff2017-06-081-41/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Separate fields of struct socket that belong to listening from fields that belong to normal dataflow, and unionize them. This shrinks the structure a bit. - Take out selinfo's from the socket buffers into the socket. The first reason is to support braindamaged scenario when a socket is added to kevent(2) and then listen(2) is cast on it. The second reason is that there is future plan to make socket buffers pluggable, so that for a dataflow socket a socket buffer can be changed, and in this case we also want to keep same selinfos through the lifetime of a socket. - Remove struct struct so_accf. Since now listening stuff no longer affects struct socket size, just move its fields into listening part of the union. - Provide sol_upcall field and enforce that so_upcall_set() may be called only on a dataflow socket, which has buffers, and for listening sockets provide solisten_upcall_set(). o Remove ACCEPT_LOCK() global. - Add a mutex to socket, to be used instead of socket buffer lock to lock fields of struct socket that don't belong to a socket buffer. - Allow to acquire two socket locks, but the first one must belong to a listening socket. - Make soref()/sorele() to use atomic(9). This allows in some situations to do soref() without owning socket lock. There is place for improvement here, it is possible to make sorele() also to lock optionally. - Most protocols aren't touched by this change, except UNIX local sockets. See below for more information. o Reduce copy-and-paste in kernel modules that accept connections from listening sockets: provide function solisten_dequeue(), and use it in the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4), infiniband, rpc. o UNIX local sockets. - Removal of ACCEPT_LOCK() global uncovered several races in the UNIX local sockets. Most races exist around spawning a new socket, when we are connecting to a local listening socket. To cover them, we need to hold locks on both PCBs when spawning a third one. This means holding them across sonewconn(). This creates a LOR between pcb locks and unp_list_lock. - To fix the new LOR, abandon the global unp_list_lock in favor of global unp_link_lock. Indeed, separating these two locks didn't provide us any extra parralelism in the UNIX sockets. - Now call into uipc_attach() may happen with unp_link_lock hold if, we are accepting, or without unp_link_lock in case if we are just creating a socket. - Another problem in UNIX sockets is that uipc_close() basicly did nothing for a listening socket. The vnode remained opened for connections. This is fixed by removing vnode in uipc_close(). Maybe the right way would be to do it for all sockets (not only listening), simply move the vnode teardown from uipc_detach() to uipc_close()? Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D9770 Notes: svn path=/head/; revision=319722
* * limit size of buffers to RPC_MAXDATASIZEXin LI2017-06-013-7/+21
| | | | | | | | | | | | | | | | | | | * don't leak memory * be more picky about bad parameters From: https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt https://github.com/guidovranken/rpcbomb/blob/master/rpcbind_patch.txt via NetBSD. Reviewed by: emaste, cem (earlier version) Differential Revision: https://reviews.freebsd.org/D10922 MFC after: 3 days Notes: svn path=/head/; revision=319369
* Remove register keyword from sys/ and ANSIfy prototypesEd Maste2017-05-171-1/+1
| | | | | | | | | | | | | | | A long long time ago the register keyword told the compiler to store the corresponding variable in a CPU register, but it is not relevant for any compiler used in the FreeBSD world today. ANSIfy related prototypes while here. Reviewed by: cem, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10193 Notes: svn path=/head/; revision=318389
* Fix the client side krpc from doing TCP reconnects for ERESTART from sosend().Rick Macklem2017-05-071-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sosend() replies ERESTART in the client side krpc, it indicates that the RPC message hasn't yet been sent and that the send queue is full or locked while a signal is posted for the process. Without this patch, this would result in a RPC_CANTSEND reply from clnt_vc_call(), which would cause clnt_reconnect_call() to create a new TCP transport connection. For most NFS servers, this wasn't a serious problem, although it did imply retries of outstanding RPCs, which could possibly have missed the DRC. For an NFSv4.1 mount to AmazonEFS, this caused a serious problem, since AmazonEFS often didn't retain the NFSv4.1 session and would reply with NFS4ERR_BAD_SESSION. This implies to the client a crash/reboot which requires open/lock state recovery. Three options were considered to fix this: - Return the ERESTART all the way up to the system call boundary and then have the system call redone. This is fraught with risk, due to convoluted code paths, asynchronous I/O RPCs etc. cperciva@ worked on this, but it is still a work in prgress and may not be feasible. - Set SB_NOINTR for the socket buffer. This fixes the problem, but makes the sosend() completely non interruptible, which kib@ considered inappropriate. It also would break forced dismount when a thread was blocked in sosend(). - Modify the retry loop in clnt_vc_call(), so that it loops for this case for up to 15sec. Testing showed that the sosend() usually succeeded by the 2nd retry. The extreme case observed was 111 loop iterations, or about 100msec of delay. This third alternative is what is implemented in this patch, since the change is: - localized - straightforward - forced dismount is not broken by it. This patch has been tested by cperciva@ extensively against AmazonEFS. Reported by: cperciva Tested by: cperciva MFC after: 2 weeks Notes: svn path=/head/; revision=317906
* Fix a crash during unmount of an NFSv4.1 mount.Rick Macklem2017-04-102-6/+1
| | | | | | | | | | | | | | | | | | Larry Rosenman reported a crash on freebsd-current@ which was caused by a premature release of the krpc backchannel socket structure. I believe this was caused by a race between the SVC_RELEASE() in clnt_vc.c and the xprt_unregister() in the higher layer (clnt_rc.c), which tried to lock the mutex in the xprt structure and crashed. This patch fixes this by removing the xprt_unregister() in the clnt_vc layer and allowing this to always be done by the clnt_rc (higher reconnect layer). Reported by: ler@lerctr.org Tested by: ler@letctr.org MFC after: 2 weeks Notes: svn path=/head/; revision=316694
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* add svcpool_close to handle killed nfsd threadsAndriy Gapon2017-02-142-2/+46
| | | | | | | | | | | | | | | | | | This patch adds a new function to the server krpc called svcpool_close(). It is similar to svcpool_destroy(), but does not free the data structures, so that the pool can be used again. This function is then used instead of svcpool_destroy(), svcpool_create() when the nfsd threads are killed. PR: 204340 Reported by: Panzura Approved by: rmacklem Obtained from: rmacklem MFC after: 1 week Notes: svn path=/head/; revision=313735
* Hide the boottime and bootimebin globals, provide the getboottime(9)Konstantin Belousov2016-07-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | and getboottimebin(9) KPI. Change consumers of boottime to use the KPI. The variables were renamed to avoid shadowing issues with local variables of the same name. Issue is that boottime* should be adjusted from tc_windup(), which requires them to be members of the timehands structure. As a preparation, this commit only introduces the interface. Some uses of boottime were found doubtful, e.g. NLM uses boottime to identify the system boot instance. Arguably the identity should not change on the leap second adjustment, but the commit is about the timekeeping code and the consumers were kept bug-to-bug compatible. Tested by: pho (as part of the bigger patch) Reviewed by: jhb (same) Discussed with: bde Sponsored by: The FreeBSD Foundation MFC after: 1 month X-Differential revision: https://reviews.freebsd.org/D7302 Notes: svn path=/head/; revision=303382
* Don't test for xpt not being NULL before calling svc_xprt_free(..)Enji Cooper2016-07-111-3/+2
| | | | | | | | | | | | | svc_xprt_alloc(..) will always return initialized memory as it uses mem_alloc(..) under the covers, which uses malloc(.., M_WAITOK, ..). MFC after: 1 week Reported by: Coverity CID: 1007341 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=302553
* Convert `svc_xprt_alloc(..)` and `svc_xprt_free(..)`'s prototypes toEnji Cooper2016-07-111-3/+2
| | | | | | | | | | ANSI C style prototypes MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=302552
* Deobfuscate cleanup path in clnt_vc_create(..)Enji Cooper2016-07-111-6/+4
| | | | | | | | | | | | | | Similar to r300836, r301800, and r302550, cl and ct will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. MFC after: 1 week Reported by: Coverity CID: 1007342 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=302551
* Deobfuscate cleanup path in clnt_dg_create(..)Enji Cooper2016-07-111-5/+3
| | | | | | | | | | | | | | | | | | Similar to r300836 and r301800, cl and cu will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and cu was not, cu would not be free'd, and also removes a duplicate test for cl not being NULL. MFC after: 1 week Reported by: Coverity CID: 1007033, 1007344 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=302550
* Deobfuscate cleanup path in clnt_bck_create(..)Enji Cooper2016-06-101-8/+3
| | | | | | | | | | | | | | | | | | | | Similar to r300836, cl and ct will always be non-NULL as they're allocated using the mem_alloc routines, which always use `malloc(..., M_WAITOK)`. Deobfuscating the cleanup path fixes a leak where if cl was NULL and ct was not, ct would not be free'd, and also removes a duplicate test for cl not being NULL. Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6801 MFC after: 1 week Reported by: Coverity CID: 1229999 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=301800
* Fix the rpcb_getaddr() definition to match its declaration.Kevin Lo2016-06-091-1/+1
| | | | | | | Submitted by: Sebastian Huber <sebastian dot huber at embedded-brains dot de> Notes: svn path=/head/; revision=301734
* Quell false positives in svc_vc_create and svc_vc_create_conn with cd and xprtEnji Cooper2016-05-271-13/+11
| | | | | | | | | | | | | | | | | | | | | Both cd and xprt will be non-NULL after their respective malloc(9) wrappers are called (mem_alloc and svc_xprt_alloc, which calls mem_alloc) as mem_alloc always gets called with M_WAITOK|M_ZERO today. Thus, testing for them being non-NULL is incorrect -- it misleads Coverity and it misleads the reader. Remove some unnecessary NULL initializations as a follow up to help solidify the fact that these pointers will be initialized properly in sys/rpc/.. with the interfaces the way they are currently. Differential Revision: https://reviews.freebsd.org/D6572 MFC after: 2 weeks Reported by: Coverity CID: 1007338, 1007339, 1007340 Reviewed by: markj, truckman Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300836
* Remove unnecessary memset(.., 0, ..)'sEnji Cooper2016-05-241-2/+0
| | | | | | | | | | | | The mem_alloc macro calls calloc (userspace) / malloc(.., M_WAITOK|M_ZERO) under the covers, so zeroing out memory is already handled by the underlying calls MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=300625
* sys/rpc: minor spelling fixes.Pedro F. Giffuni2016-05-066-11/+11
| | | | | | | No functional change. Notes: svn path=/head/; revision=299150
* sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-04-301-2/+2
| | | | | | | No functional change. Notes: svn path=/head/; revision=298848
* kgssapi(4): Fix string overrun in Kerberos principal constructionConrad Meyer2016-04-201-1/+1
| | | | | | | | | | | | 'buf.value' was previously treated as a nul-terminated string, but only allocated with strlen() space. Rectify this. Reported by: Coverity CID: 1007639 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298336
* RPC: for pointers replace 0 with NULL.Pedro F. Giffuni2016-04-141-1/+1
| | | | | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle. Notes: svn path=/head/; revision=297975
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Remove some NULL checks for M_WAITOK allocations.Edward Tomasz Napierala2016-03-291-8/+0
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=297391