The following issues were found
drivers/scsi/bfa/bfad_debugfs.c
1 issues
Line: 445
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 bfad_s *bfad = port->bfad;
const struct bfad_debugfs_entry *file;
char name[64];
int i;
if (!bfa_debugfs_enable)
return;
Reported by FlawFinder.
drivers/ntb/test/ntb_perf.c
1 issues
Line: 1319
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
size_t size, loff_t *offp)
{
struct perf_ctx *perf = filep->private_data;
char buf[8];
ssize_t pos;
pos = scnprintf(buf, sizeof(buf), "%hhu\n", perf->tcnt);
return simple_read_from_buffer(ubuf, size, offp, buf, pos);
Reported by FlawFinder.
drivers/ntb/test/ntb_msi_test.c
1 issues
Line: 273
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
static void ntb_msit_create_dbgfs(struct ntb_msit_ctx *nm)
{
struct pci_dev *pdev = nm->ntb->pdev;
char buf[32];
int i;
struct dentry *peer_dir;
nm->dbgfs_dir = debugfs_create_dir(pci_name(pdev),
ntb_msit_dbgfs_topdir);
Reported by FlawFinder.
drivers/scsi/bfa/bfad_im.h
1 issues
Line: 121
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 bfad_im_s {
struct bfad_s *bfad;
struct workqueue_struct *drv_workq;
char drv_workq_name[KOBJ_NAME_LEN];
struct work_struct aen_im_notify_work;
};
#define bfad_get_aen_entry(_drv, _entry) do { \
unsigned long _flags; \
Reported by FlawFinder.
drivers/nfc/s3fwrn5/nci.c
1 issues
Line: 102
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
for (i = 0; i < fw->size; i += S3FWRN5_RFREG_SECTION_SIZE) {
len = (fw->size - i < S3FWRN5_RFREG_SECTION_SIZE) ?
(fw->size - i) : S3FWRN5_RFREG_SECTION_SIZE;
memcpy(set_rfreg.data, fw->data+i, len);
ret = nci_prop_cmd(info->ndev, NCI_PROP_SET_RFREG,
len+1, (__u8 *)&set_rfreg);
if (ret < 0) {
dev_err(&info->ndev->nfc_dev->dev,
"rfreg update error (code=%d)\n", ret);
Reported by FlawFinder.
drivers/net/wireless/intersil/hostap/hostap.h
1 issues
Line: 69
Column: 35
CWE codes:
327
Suggestion:
Use a different algorithm, such as SHA-256, with a larger, non-repeating salt
int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac);
void ap_control_kickall(struct ap_data *ap);
void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,
struct lib80211_crypt_data ***crypt);
int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
struct iw_quality qual[], int buf_size,
int aplist);
int prism2_ap_translate_scan(struct net_device *dev,
struct iw_request_info *info, char *buffer);
Reported by FlawFinder.
drivers/nfc/s3fwrn5/i2c.c
1 issues
Line: 85
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 sk_buff *skb;
size_t hdr_size;
size_t data_len;
char hdr[4];
int ret;
hdr_size = (phy->common.mode == S3FWRN5_MODE_NCI) ?
NCI_CTRL_HDR_SIZE : S3FWRN5_FW_HDR_SIZE;
ret = i2c_master_recv(phy->i2c_dev, hdr, hdr_size);
Reported by FlawFinder.
drivers/nfc/nxp-nci/nxp-nci.h
1 issues
Line: 37
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 nxp_nci_fw_info {
char name[NFC_FIRMWARE_NAME_MAXSIZE + 1];
const struct firmware *fw;
size_t size;
size_t written;
Reported by FlawFinder.
drivers/nfc/nxp-nci/firmware.c
1 issues
Line: 214
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
goto fw_download_exit;
}
strcpy(fw_info->name, firmware_name);
r = request_firmware(&fw_info->fw, firmware_name,
ndev->nfc_dev->dev.parent);
if (r < 0)
goto fw_download_exit;
Reported by FlawFinder.
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
1 issues
Line: 790
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
return;
/* remember that this AP is broken */
memcpy(mvm->uapsd_noagg_bssids[mvm->uapsd_noagg_bssid_write_idx].addr,
vif->bss_conf.bssid, ETH_ALEN);
mvm->uapsd_noagg_bssid_write_idx++;
if (mvm->uapsd_noagg_bssid_write_idx >= IWL_MVM_UAPSD_NOAGG_LIST_LEN)
mvm->uapsd_noagg_bssid_write_idx = 0;
Reported by FlawFinder.