The following issues were found
samples/bpf/sock_flags_kern.c
1 issues
Line: 8
#include <uapi/linux/in6.h>
#include <bpf/bpf_helpers.h>
SEC("cgroup/sock1")
int bpf_prog1(struct bpf_sock *sk)
{
char fmt[] = "socket: family %d type %d protocol %d\n";
char fmt2[] = "socket: uid %u gid %u\n";
__u64 gid_uid = bpf_get_current_uid_gid();
Reported by Cppcheck.
net/tipc/msg.h
1 issues
Line: 1170
Column: 2
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
static inline void msg_set_node_id(struct tipc_msg *hdr, u8 *id)
{
memcpy(msg_data(hdr), id, 16);
}
static inline u8 *msg_node_id(struct tipc_msg *hdr)
{
return (u8 *)msg_data(hdr);
Reported by FlawFinder.
sound/soc/sh/rcar/dvc.c
1 issues
Line: 327
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 device *dev = rsnd_priv_to_dev(priv);
struct rsnd_dvc *dvc;
struct clk *clk;
char name[RSND_DVC_NAME_SIZE];
int i, nr, ret;
/* This driver doesn't support Gen1 at this point */
if (rsnd_is_gen1(priv))
return 0;
Reported by FlawFinder.
sound/soc/sh/rcar/gen.c
1 issues
Line: 30
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
/* RSND_REG_MAX base */
struct regmap_field *regs[REG_MAX];
const char *reg_name[REG_MAX];
};
#define rsnd_priv_to_gen(p) ((struct rsnd_gen *)(p)->gen)
#define rsnd_reg_name(gen, id) ((gen)->reg_name[id])
Reported by FlawFinder.
sound/pci/hda/hda_beep.h
1 issues
Line: 21
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 hda_beep {
struct input_dev *dev;
struct hda_codec *codec;
char phys[32];
int tone;
hda_nid_t nid;
unsigned int registered:1;
unsigned int enabled:1;
unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */
Reported by FlawFinder.
sound/pci/hda/hda_bind.c
1 issues
Line: 209
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 request_codec_module(struct hda_codec *codec)
{
#ifdef MODULE
char modalias[32];
const char *mod = NULL;
switch (codec->probe_id) {
case HDA_CODEC_ID_GENERIC_HDMI:
#if IS_MODULE(CONFIG_SND_HDA_CODEC_HDMI)
Reported by FlawFinder.
sound/isa/msnd/msnd_midi.c
1 issues
Line: 162
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
rmidi->private_data = mpu;
rmidi->private_free = snd_msndmidi_free;
spin_lock_init(&mpu->input_lock);
strcpy(rmidi->name, "MSND MIDI");
snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT,
&snd_msndmidi_input);
rmidi->info_flags |= SNDRV_RAWMIDI_INFO_INPUT;
return 0;
}
Reported by FlawFinder.
sound/isa/msnd/msnd.c
1 issues
Line: 682
Column: 2
CWE codes:
120
Suggestion:
Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_msnd_capture_ops);
pcm->private_data = chip;
strcpy(pcm->name, "Hurricane");
return 0;
}
EXPORT_SYMBOL(snd_msnd_pcm);
Reported by FlawFinder.
sound/usb/hiface/chip.c
1 issues
Line: 26
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
MODULE_LICENSE("GPL v2");
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for card */
static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
#define DRIVER_NAME "snd-usb-hiface"
#define CARD_NAME "hiFace"
Reported by FlawFinder.
sound/isa/gus/gus_volume.c
1 issues
Line: 65
Column: 24
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
unsigned short end,
unsigned int us)
{
static const unsigned char vol_rates[19] =
{
23, 24, 26, 28, 29, 31, 32, 34,
36, 37, 39, 40, 42, 44, 45, 47,
49, 50, 52
};
Reported by FlawFinder.