The following issues were found
kernel/locking/spinlock.c
1 issues
Line: 127
Column: 16
CWE codes:
120
20
* __[spin|read|write]_lock_bh()
*/
BUILD_LOCK_OPS(spin, raw_spinlock);
BUILD_LOCK_OPS(read, rwlock);
BUILD_LOCK_OPS(write, rwlock);
#endif
#ifndef CONFIG_INLINE_SPIN_TRYLOCK
Reported by FlawFinder.
include/uapi/linux/vbox_vmmdev_types.h
1 issues
Line: 180
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
/** HGCM host service location. */
struct vmmdev_hgcm_service_location_localhost {
/** Service name */
char service_name[128];
};
VMMDEV_ASSERT_SIZE(vmmdev_hgcm_service_location_localhost, 128);
/** HGCM service location. */
struct vmmdev_hgcm_service_location {
Reported by FlawFinder.
net/netfilter/nfnetlink_log.c
1 issues
Line: 702
Column: 10
CWE codes:
126
return;
if (prefix)
plen = strlen(prefix) + 1;
/* FIXME: do we want to make the size calculation conditional based on
* what is actually present? way more branches and checks, but more
* memory efficient... */
size = nlmsg_total_size(sizeof(struct nfgenmsg))
Reported by FlawFinder.
include/uapi/linux/un.h
1 issues
Line: 11
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 sockaddr_un {
__kernel_sa_family_t sun_family; /* AF_UNIX */
char sun_path[UNIX_PATH_MAX]; /* pathname */
};
#define SIOCUNIXFILE (SIOCPROTOPRIVATE + 0) /* open a socket file with O_PATH */
#endif /* _LINUX_UN_H */
Reported by FlawFinder.
kernel/pid_namespace.c
1 issues
Line: 42
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
/* Level 0 is init_pid_ns.pid_cachep */
struct kmem_cache **pkc = &pid_cache[level - 1];
struct kmem_cache *kc;
char name[4 + 10 + 1];
unsigned int len;
kc = READ_ONCE(*pkc);
if (kc)
return kc;
Reported by FlawFinder.
kernel/power/energy_model.c
1 issues
Line: 36
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 em_debug_create_ps(struct em_perf_state *ps, struct dentry *pd)
{
struct dentry *d;
char name[24];
snprintf(name, sizeof(name), "ps:%lu", ps->frequency);
/* Create per-ps directory */
d = debugfs_create_dir(name, pd);
Reported by FlawFinder.
include/uapi/linux/uleds.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
#define LED_MAX_NAME_SIZE 64
struct uleds_user_dev {
char name[LED_MAX_NAME_SIZE];
int max_brightness;
};
#endif /* _UAPI__ULEDS_H_ */
Reported by FlawFinder.
include/uapi/linux/tc_ematch/tc_em_text.h
1 issues
Line: 11
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
#define TC_EM_TEXT_ALGOSIZ 16
struct tcf_em_text {
char algo[TC_EM_TEXT_ALGOSIZ];
__u16 from_offset;
__u16 to_offset;
__u16 pattern_len;
__u8 from_layer:4;
__u8 to_layer:4;
Reported by FlawFinder.
kernel/power/wakelock.c
1 issues
Line: 263
Column: 8
CWE codes:
126
if (!capable(CAP_BLOCK_SUSPEND))
return -EPERM;
len = strlen(buf);
if (!len)
return -EINVAL;
if (buf[len-1] == '\n')
len--;
Reported by FlawFinder.
kernel/printk/console_cmdline.h
1 issues
Line: 7
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 console_cmdline
{
char name[16]; /* Name of the driver */
int index; /* Minor dev. to use */
bool user_specified; /* Specified by command line vs. platform */
char *options; /* Options for the driver */
#ifdef CONFIG_A11Y_BRAILLE_CONSOLE
char *brl_options; /* Options for braille driver */
Reported by FlawFinder.