The following issues were found
fs/orangefs/orangefs-utils.c
1 issues
Line: 336
Column: 28
CWE codes:
126
break;
case S_IFLNK:
if (flags & ORANGEFS_GETATTR_NEW) {
inode->i_size = (loff_t)strlen(new_op->
downcall.resp.getattr.link_target);
ret = strscpy(orangefs_inode->link_target,
new_op->downcall.resp.getattr.link_target,
ORANGEFS_NAME_MAX);
if (ret == -E2BIG) {
Reported by FlawFinder.
fs/nfs/fscache.h
1 issues
Line: 51
Column: 3
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
/* uniquifier - can be used if nfs_server.flags includes
* NFS_MOUNT_UNSHARED */
u8 uniq_len;
char uniquifier[0];
} key;
};
/*
* Definition of the auxiliary data attached to NFS inode storage objects
Reported by FlawFinder.
fs/nfs/fscache.c
1 issues
Line: 143
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
key->key.rpc_auth.au_flavor = nfss->client->cl_auth->au_flavor;
key->key.uniq_len = ulen;
memcpy(key->key.uniquifier, uniq, ulen);
spin_lock(&nfs_fscache_keys_lock);
p = &nfs_fscache_keys.rb_node;
parent = NULL;
while (*p) {
Reported by FlawFinder.
fs/nfs/flexfilelayout/flexfilelayoutdev.c
1 issues
Line: 273
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
dserr->status = status;
dserr->opnum = opnum;
nfs4_stateid_copy(&dserr->stateid, &mirror->stateid);
memcpy(&dserr->deviceid, &mirror->mirror_ds->id_node.deviceid,
NFS4_DEVICEID4_SIZE);
spin_lock(&flo->generic_hdr.plh_inode->i_lock);
ff_layout_add_ds_error_locked(flo, dserr);
spin_unlock(&flo->generic_hdr.plh_inode->i_lock);
Reported by FlawFinder.
fs/nfs/filelayout/filelayout.c
1 issues
Line: 730
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
p = xdr_inline_decode(&stream, fl->fh_array[i]->size);
if (unlikely(!p))
goto out_err;
memcpy(fl->fh_array[i]->data, p, fl->fh_array[i]->size);
dprintk("DEBUG: %s: fh len %d\n", __func__,
fl->fh_array[i]->size);
}
__free_page(scratch);
Reported by FlawFinder.
include/linux/namei.h
1 issues
Line: 83
Column: 4
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
static inline void nd_terminate_link(void *name, size_t len, size_t maxlen)
{
((char *) name)[min(len, maxlen)] = '\0';
}
/**
* retry_estale - determine whether the caller should retry an operation
* @error: the error that would currently be returned
Reported by FlawFinder.
fs/nfs/cache_lib.c
1 issues
Line: 24
Column: 8
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
#define NFS_CACHE_UPCALL_PATHLEN 256
#define NFS_CACHE_UPCALL_TIMEOUT 15
static char nfs_cache_getent_prog[NFS_CACHE_UPCALL_PATHLEN] =
"/sbin/nfs_cache_getent";
static unsigned long nfs_cache_getent_timeout = NFS_CACHE_UPCALL_TIMEOUT;
module_param_string(cache_getent, nfs_cache_getent_prog,
sizeof(nfs_cache_getent_prog), 0600);
Reported by FlawFinder.
fs/nfs/blocklayout/blocklayout.c
1 issues
Line: 623
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
if (!be)
return -ENOMEM;
memcpy(&id, p, NFS4_DEVICEID4_SIZE);
p += XDR_QUADLEN(NFS4_DEVICEID4_SIZE);
be->be_device = bl_find_get_deviceid(NFS_SERVER(lo->plh_inode), &id,
lo->plh_lc_cred, gfp_mask);
if (IS_ERR(be->be_device)) {
Reported by FlawFinder.
fs/netfs/read_helper.c
1 issues
Line: 183
Column: 13
CWE codes:
120
20
subreq->start + subreq->transferred,
subreq->len - subreq->transferred);
cres->ops->read(cres, subreq->start, &iter, seek_data,
netfs_cache_read_terminated, subreq);
}
/*
* Fill a subrequest region with zeroes.
Reported by FlawFinder.
fs/minix/namei.c
1 issues
Line: 78
Column: 10
CWE codes:
126
struct dentry *dentry, const char *symname)
{
int err = -ENAMETOOLONG;
int i = strlen(symname)+1;
struct inode * inode;
if (i > dir->i_sb->s_blocksize)
goto out;
Reported by FlawFinder.