The following issues were found
fs/verity/enable.c
1 issues
Line: 190
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
blocks = (blocks + params->hashes_per_block - 1) >>
params->log_arity;
}
memcpy(root_hash, pending_hashes, params->digest_size);
err = 0;
out:
kfree(pending_hashes);
fsverity_free_hash_request(params->hash_alg, req);
return err;
Reported by FlawFinder.
fs/verity/hash_algs.c
1 issues
Line: 190
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
err = -ENOMEM;
goto err_free;
}
memcpy(padded_salt, salt, salt_size);
sg_init_one(&sg, padded_salt, padded_salt_size);
ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_SLEEP |
CRYPTO_TFM_REQ_MAY_BACKLOG,
crypto_req_done, &wait);
Reported by FlawFinder.
fs/verity/open.c
1 issues
Line: 172
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
goto out;
}
memcpy(vi->root_hash, desc->root_hash, vi->tree_params.digest_size);
err = compute_file_digest(vi->tree_params.hash_alg, desc,
vi->file_digest);
if (err) {
fsverity_err(inode, "Error %d computing file digest", err);
Reported by FlawFinder.
drivers/video/fbdev/via/via-gpio.c
1 issues
Line: 77
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
struct gpio_chip gpio_chip;
struct viafb_dev *vdev;
struct viafb_gpio *active_gpios[VIAFB_NUM_GPIOS];
const char *gpio_names[VIAFB_NUM_GPIOS];
};
/*
* GPIO access functions
*/
Reported by FlawFinder.
fs/verity/verify.c
1 issues
Line: 48
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
{
void *virt = kmap_atomic(hpage);
memcpy(out, virt + hoffset, hsize);
kunmap_atomic(virt);
}
static inline int cmp_hashes(const struct fsverity_info *vi,
const u8 *want_hash, const u8 *real_hash,
Reported by FlawFinder.
fs/exfat/nls.c
1 issues
Line: 545
Column: 11
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
int buflen)
{
int i, j, len, out_len = 0;
unsigned char buf[MAX_CHARSET_SIZE];
const unsigned short *uniname = p_uniname->name;
struct nls_table *nls = EXFAT_SB(sb)->nls_io;
i = 0;
while (i < MAX_NAME_LENGTH && out_len < (buflen - 1)) {
Reported by FlawFinder.
fs/exfat/fatent.c
1 issues
Line: 26
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
c_bh = sb_getblk(sb, sec2);
if (!c_bh)
return -ENOMEM;
memcpy(c_bh->b_data, bh->b_data, sb->s_blocksize);
set_buffer_uptodate(c_bh);
mark_buffer_dirty(c_bh);
if (sb->s_flags & SB_SYNCHRONOUS)
err = sync_dirty_buffer(c_bh);
brelse(c_bh);
Reported by FlawFinder.
include/linux/pe.h
1 issues
Line: 298
Column: 2
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
};
struct section_header {
char name[8]; /* name or "/12\0" string tbl offset */
uint32_t virtual_size; /* size of loaded section in ram */
uint32_t virtual_address; /* relative virtual address */
uint32_t raw_data_size; /* size of the section */
uint32_t data_addr; /* file pointer to first page of sec */
uint32_t relocs; /* file pointer to relocation entries */
Reported by FlawFinder.
fs/exfat/dir.c
1 issues
Line: 286
Column: 30
CWE codes:
126
* of buffer given from user is larger than one page size.
*/
mutex_unlock(&EXFAT_SB(sb)->s_lock);
if (!dir_emit(ctx, nb->lfn, strlen(nb->lfn), inum,
(de.attr & ATTR_SUBDIR) ? DT_DIR : DT_REG))
goto out_unlocked;
mutex_lock(&EXFAT_SB(sb)->s_lock);
ctx->pos = cpos;
goto get_new;
Reported by FlawFinder.
fs/erofs/internal.h
1 issues
Line: 263
Column: 13
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
#ifdef CONFIG_EROFS_FS_ZIP
struct {
unsigned short z_advise;
unsigned char z_algorithmtype[2];
unsigned char z_logical_clusterbits;
};
#endif /* CONFIG_EROFS_FS_ZIP */
};
/* the corresponding vfs inode */
Reported by FlawFinder.