-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'nfs-for-5.11-3' of git://git.linux-nfs.org/projects/trondm…
…y/linux-nfs Pull NFS client fixes from Trond Myklebust: - SUNRPC: Handle 0 length opaque XDR object data properly - Fix a layout segment leak in pnfs_layout_process() - pNFS/NFSv4: Update the layout barrier when we schedule a layoutreturn - pNFS/NFSv4: Improve rejection of out-of-order layouts - pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process() * tag 'nfs-for-5.11-3' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: SUNRPC: Handle 0 length opaque XDR object data properly SUNRPC: Move simple_get_bytes and simple_get_netobj into private header pNFS/NFSv4: Improve rejection of out-of-order layouts pNFS/NFSv4: Update the layout barrier when we schedule a layoutreturn pNFS/NFSv4: Try to return invalid layout in pnfs_layout_process() pNFS/NFSv4: Fix a layout segment leak in pnfs_layout_process()
- Loading branch information
Showing
5 changed files
with
93 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
/* | ||
* linux/net/sunrpc/auth_gss/auth_gss_internal.h | ||
* | ||
* Internal definitions for RPCSEC_GSS client authentication | ||
* | ||
* Copyright (c) 2000 The Regents of the University of Michigan. | ||
* All rights reserved. | ||
* | ||
*/ | ||
#include <linux/err.h> | ||
#include <linux/string.h> | ||
#include <linux/sunrpc/xdr.h> | ||
|
||
static inline const void * | ||
simple_get_bytes(const void *p, const void *end, void *res, size_t len) | ||
{ | ||
const void *q = (const void *)((const char *)p + len); | ||
if (unlikely(q > end || q < p)) | ||
return ERR_PTR(-EFAULT); | ||
memcpy(res, p, len); | ||
return q; | ||
} | ||
|
||
static inline const void * | ||
simple_get_netobj(const void *p, const void *end, struct xdr_netobj *dest) | ||
{ | ||
const void *q; | ||
unsigned int len; | ||
|
||
p = simple_get_bytes(p, end, &len, sizeof(len)); | ||
if (IS_ERR(p)) | ||
return p; | ||
q = (const void *)((const char *)p + len); | ||
if (unlikely(q > end || q < p)) | ||
return ERR_PTR(-EFAULT); | ||
if (len) { | ||
dest->data = kmemdup(p, len, GFP_NOFS); | ||
if (unlikely(dest->data == NULL)) | ||
return ERR_PTR(-ENOMEM); | ||
} else | ||
dest->data = NULL; | ||
dest->len = len; | ||
return q; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters