The following issues were found
samples/trace_events/trace-events-sample.h
1 issues
Line: 247
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
TP_fast_assign(
strlcpy(__entry->foo, foo, 10);
__entry->bar = bar;
memcpy(__get_dynamic_array(list), lst,
__length_of(lst) * sizeof(int));
__assign_str(str, string);
__assign_bitmask(cpus, cpumask_bits(mask), num_possible_cpus());
),
Reported by FlawFinder.
samples/bpf/test_probe_write_user_user.c
1 issues
Line: 20
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 bpf_program *prog;
struct bpf_object *obj;
socklen_t sockaddr_len;
char filename[256];
char *ip;
serv_addr_in = (struct sockaddr_in *)&serv_addr;
mapped_addr_in = (struct sockaddr_in *)&mapped_addr;
tmp_addr_in = (struct sockaddr_in *)&tmp_addr;
Reported by FlawFinder.
security/integrity/ima/ima_kexec.c
1 issues
Line: 62
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
khdr.count = cpu_to_le64(khdr.count);
khdr.buffer_size = cpu_to_le64(khdr.buffer_size);
}
memcpy(file.buf, &khdr, sizeof(khdr));
print_hex_dump(KERN_DEBUG, "ima dump: ", DUMP_PREFIX_NONE,
16, 1, file.buf,
file.count < 100 ? file.count : 100, true);
Reported by FlawFinder.
sound/synth/emux/soundfont.c
1 issues
Line: 285
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
sf->zones = NULL;
sf->samples = NULL;
if (name)
memcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN);
return sf;
}
/* check if the given name matches to the existing list */
Reported by FlawFinder.
sound/soc/sof/pcm.c
1 issues
Line: 232
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
spcm->prepared[substream->stream] = true;
/* save pcm hw_params */
memcpy(&spcm->params[substream->stream], params, sizeof(*params));
return ret;
}
static int sof_pcm_hw_free(struct snd_soc_component *component,
Reported by FlawFinder.
sound/soc/codecs/max98371.c
1 issues
Line: 39
4, 5, TLV_DB_SCALE_ITEM(852, 104, 0),
6, 7, TLV_DB_SCALE_ITEM(1072, 131, 0),
8, 9, TLV_DB_SCALE_ITEM(1350, 165, 0),
10, 11, TLV_DB_SCALE_ITEM(1699, 101, 0),
);
static const DECLARE_TLV_DB_RANGE(max98371_dht_max_gain,
0, 1, TLV_DB_SCALE_ITEM(537, 66, 0),
2, 3, TLV_DB_SCALE_ITEM(677, 82, 0),
Reported by Cppcheck.
sound/soc/codecs/max98373.c
1 issues
Line: 88
static DECLARE_TLV_DB_SCALE(max98373_digital_tlv, -6350, 50, 1);
static const DECLARE_TLV_DB_RANGE(max98373_spk_tlv,
0, 8, TLV_DB_SCALE_ITEM(0, 50, 0),
9, 10, TLV_DB_SCALE_ITEM(500, 100, 0),
);
static const DECLARE_TLV_DB_RANGE(max98373_spkgain_max_tlv,
0, 9, TLV_DB_SCALE_ITEM(800, 100, 0),
);
static const DECLARE_TLV_DB_RANGE(max98373_dht_step_size_tlv,
Reported by Cppcheck.
security/safesetid/securityfs.c
1 issues
Line: 275
Column: 18
CWE codes:
126
if (pol) {
kbuf = pol->policy_str;
res = simple_read_from_buffer(buf, len, ppos,
kbuf, strlen(kbuf));
}
mutex_unlock(policy_update_lock);
return res;
}
Reported by FlawFinder.
sound/soc/codecs/max9867.c
1 issues
Line: 150
3, 17, TLV_DB_SCALE_ITEM(-7800, 400, 0),
18, 25, TLV_DB_SCALE_ITEM(-2000, 200, 0),
26, 34, TLV_DB_SCALE_ITEM( -500, 100, 0),
35, 40, TLV_DB_SCALE_ITEM( 350, 50, 0),
);
static DECLARE_TLV_DB_SCALE(max9867_mic_tlv, 0, 100, 0);
static DECLARE_TLV_DB_SCALE(max9867_line_tlv, -600, 200, 0);
static DECLARE_TLV_DB_SCALE(max9867_adc_tlv, -1200, 100, 0);
static DECLARE_TLV_DB_SCALE(max9867_dac_tlv, -1500, 100, 0);
Reported by Cppcheck.
sound/soc/codecs/max98926.c
1 issues
Line: 208
static DECLARE_TLV_DB_SCALE(max98926_spk_tlv, -600, 100, 0);
static DECLARE_TLV_DB_RANGE(max98926_current_tlv,
0, 11, TLV_DB_SCALE_ITEM(20, 20, 0),
12, 15, TLV_DB_SCALE_ITEM(320, 40, 0),
);
static SOC_ENUM_SINGLE_DECL(max98926_dac_hpf_cutoff,
MAX98926_FILTERS, MAX98926_DAC_HPF_SHIFT,
max98926_hpf_cutoff_txt);
Reported by Cppcheck.