func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
do_getattr (app_t app, ctrl_t ctrl, const char *name)
{
static struct {
const char *name;
int special;
} table[] = {
{ "$AUTHKEYID", 1 },
{ "NKS-VERSION", 2 },
{ "CHV-STATUS", 3 },
{ NULL, 0 }
};
gpg_error_t err = 0;
int idx;
char buffer[100];
err = switch_application (app, 0... | 0 | [
"CWE-20"
] | gnupg | 2183683bd633818dd031b090b5530951de76f392 | 204,697,681,724,518,530,000,000,000,000,000,000,000 | 74 | Use inline functions to convert buffer data to scalars.
* common/host2net.h (buf16_to_ulong, buf16_to_uint): New.
(buf16_to_ushort, buf16_to_u16): New.
(buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New.
--
Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to
avoid all sign extension on ... |
bool grab_super_passive(struct super_block *sb)
{
spin_lock(&sb_lock);
if (hlist_unhashed(&sb->s_instances)) {
spin_unlock(&sb_lock);
return false;
}
sb->s_count++;
spin_unlock(&sb_lock);
if (down_read_trylock(&sb->s_umount)) {
if (sb->s_root && (sb->s_flags & MS_BORN))
return true;
up_read(&sb->s_um... | 0 | [
"CWE-17"
] | linux | eee5cc2702929fd41cce28058dc6d6717f723f87 | 205,416,321,065,424,100,000,000,000,000,000,000,000 | 20 | get rid of s_files and files_lock
The only thing we need it for is alt-sysrq-r (emergency remount r/o)
and these days we can do just as well without going through the
list of files.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> |
window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode,
struct cmd_find_state *fs, struct args *args)
{
struct screen *s;
struct timeval tv = { .tv_sec = 10 };
if (wp->mode != NULL)
return (1);
wp->mode = mode;
wp->modelast = time(NULL);
evtimer_set(&wp->modetimer, window_pane_mode_t... | 0 | [] | src | b32e1d34e10a0da806823f57f02a4ae6e93d756e | 66,520,211,906,784,260,000,000,000,000,000,000,000 | 22 | evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547. |
static inline int security_ptrace_traceme(struct task_struct *parent)
{
return cap_ptrace_traceme(parent);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 21,551,921,753,470,866,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
chk_atstar (name, quoted, quoted_dollar_atp, contains_dollar_at)
char *name;
int quoted;
int *quoted_dollar_atp, *contains_dollar_at;
{
char *temp1;
if (name == 0)
{
if (quoted_dollar_atp)
*quoted_dollar_atp = 0;
if (contains_dollar_at)
*contains_dollar_at = 0;
return 0;
... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 91,652,295,792,118,650,000,000,000,000,000,000,000 | 57 | bash-4.4-rc2 release |
PJ_DEF(void) pj_scan_get_quotes(pj_scanner *scanner,
const char *begin_quote, const char *end_quote,
int qsize, pj_str_t *out)
{
register char *s = scanner->curptr;
int qpair = -1;
int i;
pj_assert(qsize > 0);
/* Check and eat the beg... | 0 | [
"CWE-125"
] | pjproject | 077b465c33f0aec05a49cd2ca456f9a1b112e896 | 72,433,105,749,631,030,000,000,000,000,000,000,000 | 70 | Merge pull request from GHSA-7fw8-54cv-r7pm |
template<typename T>
inline CImg<_cimg_Tfloat> sin(const CImg<T>& instance) {
return instance.get_sin(); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 283,370,218,724,678,540,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static u16 get_segment_selector(struct x86_emulate_ctxt *ctxt, unsigned seg)
{
u16 selector;
struct desc_struct desc;
ctxt->ops->get_segment(ctxt, &selector, &desc, NULL, seg);
return selector;
} | 0 | [] | kvm | e28ba7bb020f07193bc000453c8775e9d2c0dda7 | 316,319,810,131,112,250,000,000,000,000,000,000,000 | 8 | KVM: x86: fix missing checks in syscall emulation
On hosts without this patch, 32bit guests will crash (and 64bit guests
may behave in a wrong way) for example by simply executing following
nasm-demo-application:
[bits 32]
global _start
SECTION .text
_start: syscall
(I tested it with winxp and linux ... |
static void tipc_sk_conn_proto_rcv(struct tipc_sock *tsk, struct sk_buff *skb,
struct sk_buff_head *inputq,
struct sk_buff_head *xmitq)
{
struct tipc_msg *hdr = buf_msg(skb);
u32 onode = tsk_own_node(tsk);
struct sock *sk = &tsk->sk;
int mtyp = msg_type(hdr);
bool was_cong;
/* Ignore if connection ... | 0 | [
"CWE-200",
"CWE-909"
] | linux | d6d86830705f173fca6087a3e67ceaf68db80523 | 66,525,276,076,924,950,000,000,000,000,000,000,000 | 54 | net ticp:fix a kernel-infoleak in __tipc_sendmsg()
struct tipc_socket_addr.ref has a 4-byte hole,and __tipc_getname() currently
copying it to user space,causing kernel-infoleak.
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline]
BUG: KMSAN: kernel-infoleak in instrument_c... |
set_rw_fname(char_u *fname, char_u *sfname)
{
#ifdef FEAT_AUTOCMD
buf_T *buf = curbuf;
/* It's like the unnamed buffer is deleted.... */
if (curbuf->b_p_bl)
apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
# ifdef FEAT_EVAL
if... | 0 | [
"CWE-200",
"CWE-668"
] | vim | 5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8 | 219,177,622,883,581,840,000,000,000,000,000,000,000 | 45 | patch 8.0.1263: others can read the swap file if a user is careless
Problem: Others can read the swap file if a user is careless with his
primary group.
Solution: If the group permission allows for reading but the world
permissions doesn't, make sure the group is right. |
int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)
{
struct qrtr_node *node = ep->node;
const struct qrtr_hdr_v1 *v1;
const struct qrtr_hdr_v2 *v2;
struct qrtr_sock *ipc;
struct sk_buff *skb;
struct qrtr_cb *cb;
unsigned int size;
unsigned int ver;
size_t hdrlen;
if (len == 0 || l... | 0 | [
"CWE-909"
] | linux | 50535249f624d0072cd885bcdce4e4b6fb770160 | 330,791,481,195,573,100,000,000,000,000,000,000,000 | 103 | net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
struct sockaddr_qrtr has a 2-byte hole, and qrtr_recvmsg() currently
does not clear it before copying kernel data to user space.
It might be too late to name the hole since sockaddr_qrtr structure is uapi.
BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 ... |
static inline void vpid_sync_vcpu_all(struct vcpu_vmx *vmx)
{
if (vmx->vpid == 0)
return;
__invvpid(VMX_VPID_EXTENT_SINGLE_CONTEXT, vmx->vpid, 0);
} | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 92,640,437,720,846,790,000,000,000,000,000,000,000 | 7 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
int seccomp_lock_personality(unsigned long personality) {
uint32_t arch;
int r;
if (personality >= PERSONALITY_INVALID)
return -EINVAL;
SECCOMP_FOREACH_LOCAL_ARCH(arch) {
_cleanup_(seccomp_releasep) scmp_filter_ctx seccomp = NULL;
r = se... | 0 | [] | systemd | b835eeb4ec1dd122b6feff2b70881265c529fcdd | 170,461,966,377,388,030,000,000,000,000,000,000,000 | 34 | shared/seccomp: disallow pkey_mprotect the same as mprotect for W^X mappings (#7295)
MemoryDenyWriteExecution policy could be be bypassed by using pkey_mprotect
instead of mprotect to create an executable writable mapping.
The impact is mitigated by the fact that the man page says "Note that this
feature is fully... |
static enum enum_field_types mysql_to_perl_type(enum enum_field_types type)
{
static enum enum_field_types enum_type;
switch (type) {
case MYSQL_TYPE_DOUBLE:
case MYSQL_TYPE_FLOAT:
enum_type= MYSQL_TYPE_DOUBLE;
break;
case MYSQL_TYPE_SHORT:
case MYSQL_TYPE_TINY:
case MYSQL_TYPE_LONG:
case MYSQ... | 0 | [
"CWE-125"
] | DBD-mysql | 793b72b1a0baa5070adacaac0e12fd995a6fbabe | 104,169,698,160,746,400,000,000,000,000,000,000,000 | 63 | Added Pali's fix for CVE-2016-1249 |
static void ca8210_reset_send(struct spi_device *spi, unsigned int ms)
{
struct ca8210_platform_data *pdata = spi->dev.platform_data;
struct ca8210_priv *priv = spi_get_drvdata(spi);
long status;
gpio_set_value(pdata->gpio_reset, 0);
reinit_completion(&priv->ca8210_is_awake);
msleep(ms);
gpio_set_value(pdata->g... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 6402939ec86eaf226c8b8ae00ed983936b164908 | 196,853,650,152,864,130,000,000,000,000,000,000,000 | 26 | ieee802154: ca8210: prevent memory leak
In ca8210_probe the allocated pdata needs to be assigned to
spi_device->dev.platform_data before calling ca8210_get_platform_data.
Othrwise when ca8210_get_platform_data fails pdata cannot be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Link: https://lor... |
double ompl::geometric::VFRRT::biasedSampling(const Eigen::VectorXd &vrand, const Eigen::VectorXd &vfield,
double lambdaScale)
{
double sigma = .25 * (vrand - vfield).squaredNorm();
updateGain();
double scaledLambda = lambda_ * lambdaScale / meanNorm_;
doubl... | 0 | [
"CWE-703"
] | ompl | abb4fadcb4e4fe4c9cf41e5e7706143a66948eb7 | 164,751,459,046,850,060,000,000,000,000,000,000,000 | 10 | fix memory leak in VFRRT. closes #839 |
ext4_next_entry(struct ext4_dir_entry_2 *p)
{
return (struct ext4_dir_entry_2 *)((char *)p +
ext4_rec_len_from_disk(p->rec_len));
} | 0 | [
"CWE-20"
] | linux-2.6 | e6b8bc09ba2075cd91fbffefcd2778b1a00bd76f | 126,479,709,045,219,550,000,000,000,000,000,000,000 | 5 | ext4: Add sanity check to make_indexed_dir
Make sure the rec_len field in the '..' entry is sane, lest we overrun
the directory block and cause a kernel oops on a purposefully
corrupted filesystem.
Thanks to Sami Liedes for reporting this bug.
http://bugzilla.kernel.org/show_bug.cgi?id=12430
Signed-off-by: "Theodor... |
bool schemeIsHttp(const Http::RequestHeaderMap& downstream_headers,
const Network::Connection& connection) {
if (downstream_headers.getForwardedProtoValue() == Http::Headers::get().SchemeValues.Http) {
return true;
}
if (!connection.ssl()) {
return true;
}
return false;
} | 0 | [
"CWE-703"
] | envoy | 18871dbfb168d3512a10c78dd267ff7c03f564c6 | 30,189,605,336,699,496,000,000,000,000,000,000,000 | 10 | [1.18] CVE-2022-21655
Crash with direct_response
Signed-off-by: Otto van der Schaaf <ovanders@redhat.com> |
long __sys_recvmsg(int fd, struct user_msghdr __user *msg, unsigned int flags,
bool forbid_cmsg_compat)
{
int fput_needed, err;
struct msghdr msg_sys;
struct socket *sock;
if (forbid_cmsg_compat && (flags & MSG_CMSG_COMPAT))
return -EINVAL;
sock = sockfd_lookup_light(fd, &err, &fput_needed);
if (!sock)
... | 0 | [
"CWE-362"
] | linux | 6d8c50dcb029872b298eea68cc6209c866fd3e14 | 105,684,765,302,893,250,000,000,000,000,000,000,000 | 20 | socket: close race condition between sock_close() and sockfs_setattr()
fchownat() doesn't even hold refcnt of fd until it figures out
fd is really needed (otherwise is ignored) and releases it after
it resolves the path. This means sock_close() could race with
sockfs_setattr(), which leads to a NULL pointer dereferenc... |
int RAND_pseudo_bytes(unsigned char *buf, int num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth->pseudorand != NULL)
return meth->pseudorand(buf, num);
return -1;
} | 0 | [
"CWE-330"
] | openssl | 1b0fe00e2704b5e20334a16d3c9099d1ba2ef1be | 126,848,542,440,678,070,000,000,000,000,000,000,000 | 8 | drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.
The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork... |
static struct query_handler *qh_find_handler(const char *name)
{
return (struct query_handler *)dkhash_get(qh_table, name, NULL);
} | 0 | [
"CWE-476"
] | nagioscore | b1a92a3b52d292ccb601e77a0b29cb1e67ac9d76 | 49,347,855,355,664,620,000,000,000,000,000,000,000 | 4 | merge accidental master PR (#553) into maint and fix changelog
merge conflict |
delete_printer(cupsd_client_t *con, /* I - Client connection */
ipp_attribute_t *uri) /* I - URI of printer or class */
{
http_status_t status; /* Policy status */
cups_ptype_t dtype; /* Destination type (printer/class) */
cupsd_printer_t *printer; /* Printer/class */
char filename[1024]; ... | 0 | [
"CWE-20"
] | cups | 49fa4983f25b64ec29d548ffa3b9782426007df3 | 141,980,016,029,728,870,000,000,000,000,000,000,000 | 110 | DBUS notifications could crash the scheduler (Issue #5143)
- scheduler/ipp.c: Make sure requesting-user-name string is valid UTF-8. |
_outTidScan(StringInfo str, const TidScan *node)
{
WRITE_NODE_TYPE("TIDSCAN");
_outScanInfo(str, (const Scan *) node);
WRITE_NODE_FIELD(tidquals);
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 70,722,984,361,189,040,000,000,000,000,000,000,000 | 8 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
static void kill_urbs(struct wdm_device *desc)
{
/* the order here is essential */
usb_kill_urb(desc->command);
usb_kill_urb(desc->validity);
usb_kill_urb(desc->response);
} | 0 | [
"CWE-119",
"CWE-269"
] | linux | c0f5ecee4e741667b2493c742b60b6218d40b3aa | 1,759,880,408,948,301,000,000,000,000,000,000,000 | 7 | USB: cdc-wdm: fix buffer overflow
The buffer for responses must not overflow.
If this would happen, set a flag, drop the data and return
an error after user space has read all remaining data.
Signed-off-by: Oliver Neukum <oliver@neukum.org>
CC: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundati... |
int ssl3_get_certificate_request(SSL *s)
{
int ok,ret=0;
unsigned long n,nc,l;
unsigned int llen, ctype_num,i;
X509_NAME *xn=NULL;
const unsigned char *p,*q;
unsigned char *d;
STACK_OF(X509_NAME) *ca_sk=NULL;
n=s->method->ssl_get_message(s,
SSL3_ST_CR_CERT_REQ_A,
SSL3_ST_CR_CERT_REQ_B,
-1,
s->max_cert... | 0 | [] | openssl | 4817504d069b4c5082161b02a22116ad75f822b1 | 237,088,044,040,738,800,000,000,000,000,000,000,000 | 169 | PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve
Support for TLS/DTLS heartbeats. |
void auth_request_ref(struct auth_request *request)
{
request->refcount++;
} | 0 | [
"CWE-284"
] | core | 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 | 168,194,330,301,515,050,000,000,000,000,000,000,000 | 4 | auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter fro... |
have_sampled_guard_with_id(guard_selection_t *gs, const uint8_t *rsa_id)
{
return get_sampled_guard_with_id(gs, rsa_id) != NULL;
} | 0 | [
"CWE-200"
] | tor | 665baf5ed5c6186d973c46cdea165c0548027350 | 313,972,859,544,307,120,000,000,000,000,000,000,000 | 4 | Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit node when
deciding if the guard was usable, and we didn't catch that during
code review.
This patch makes the guard_restriction_t code ... |
line_decode(const char *str, LINE *line)
{
char *tail;
while (isspace((unsigned char) *str))
str++;
if (*str++ != '{')
return false;
line->A = strtod(str, &tail);
if (tail <= str)
return false;
str = tail;
while (isspace((unsigned char) *str))
str++;
if (*str++ != DELIM)
return false;
line->B = s... | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 327,839,435,694,864,270,000,000,000,000,000,000,000 | 39 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
void exit_shm(struct task_struct *task)
{
struct ipc_namespace *ns = task->nsproxy->ipc_ns;
struct shmid_kernel *shp, *n;
if (list_empty(&task->sysvshm.shm_clist))
return;
/*
* If kernel.shm_rmid_forced is not set then only keep track of
* which shmids are orphaned, so that a later set of the sysctl
* can... | 0 | [] | linux | 95e91b831f87ac8e1f8ed50c14d709089b4e01b8 | 156,149,024,845,912,350,000,000,000,000,000,000,000 | 45 | ipc/shm: Fix shmat mmap nil-page protection
The issue is described here, with a nice testcase:
https://bugzilla.kernel.org/show_bug.cgi?id=192931
The problem is that shmat() calls do_mmap_pgoff() with MAP_FIXED, and
the address rounded down to 0. For the regular mmap case, the
protection mentioned above is that... |
mesh_state_create(struct module_env* env, struct query_info* qinfo,
struct respip_client_info* cinfo, uint16_t qflags, int prime,
int valrec)
{
struct regional* region = alloc_reg_obtain(env->alloc);
struct mesh_state* mstate;
int i;
if(!region)
return NULL;
mstate = (struct mesh_state*)regional_alloc(region, ... | 0 | [
"CWE-613",
"CWE-703"
] | unbound | f6753a0f1018133df552347a199e0362fc1dac68 | 61,568,330,985,222,320,000,000,000,000,000,000,000 | 78 | - Fix the novel ghost domain issues CVE-2022-30698 and CVE-2022-30699. |
e1000e_rss_calc_hash(E1000ECore *core,
struct NetRxPkt *pkt,
E1000E_RSSInfo *info)
{
NetRxPktRssType type;
assert(e1000e_rss_enabled(core));
switch (info->type) {
case E1000_MRQ_RSS_TYPE_IPV4:
type = NetPktRssIpV4;
break;
case E1000_MRQ_RSS... | 0 | [
"CWE-835"
] | qemu | 4154c7e03fa55b4cf52509a83d50d6c09d743b77 | 109,172,893,801,651,680,000,000,000,000,000,000,000 | 31 | net: e1000e: fix an infinite loop issue
This issue is like the issue in e1000 network card addressed in
this commit:
e1000: eliminate infinite loops on out-of-bounds transfer start.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.... |
static void console_clear_xy(QemuConsole *s, int x, int y)
{
int y1 = (s->y_base + y) % s->total_height;
TextCell *c = &s->cells[y1 * s->width + x];
c->ch = ' ';
c->t_attrib = s->t_attrib_default;
update_xy(s, x, y);
} | 0 | [
"CWE-416"
] | qemu | a4afa548fc6dd9842ed86639b4d37d4d1c4ad480 | 267,037,416,320,502,700,000,000,000,000,000,000,000 | 8 | char: move front end handlers in CharBackend
Since the hanlders are associated with a CharBackend, rather than the
CharDriverState, it is more appropriate to store in CharBackend. This
avoids the handler copy dance in qemu_chr_fe_set_handlers() then
mux_chr_update_read_handler(), by storing the CharBackend pointer
dir... |
static bool test_state(unsigned int *tasks, enum psi_states state)
{
switch (state) {
case PSI_IO_SOME:
return unlikely(tasks[NR_IOWAIT]);
case PSI_IO_FULL:
return unlikely(tasks[NR_IOWAIT] && !tasks[NR_RUNNING]);
case PSI_MEM_SOME:
return unlikely(tasks[NR_MEMSTALL]);
case PSI_MEM_FULL:
return unlikely(ta... | 0 | [
"CWE-416"
] | linux | a06247c6804f1a7c86a2e5398a4c1f1db1471848 | 156,615,496,414,180,890,000,000,000,000,000,000,000 | 23 | psi: Fix uaf issue when psi trigger is destroyed while being polled
With write operation on psi files replacing old trigger with a new one,
the lifetime of its waitqueue is totally arbitrary. Overwriting an
existing trigger causes its waitqueue to be freed and pending poll()
will stumble on trigger->event_wait which w... |
WriteCharData(mat_t *mat, void *data, int N,enum matio_types data_type)
{
int nBytes = 0, i;
size_t byteswritten = 0;
mat_int8_t pad1 = 0;
switch ( data_type ) {
case MAT_T_UINT16:
{
nBytes = N*2;
fwrite(&data_type,4,1,(FILE*)mat->fp);
fwrite(&nBytes,... | 0 | [
"CWE-190",
"CWE-401"
] | matio | 5fa49ef9fc4368fe3d19b5fdaa36d8fa5e7f4606 | 202,995,055,001,167,200,000,000,000,000,000,000,000 | 75 | Fix integer addition overflow
As reported by https://github.com/tbeu/matio/issues/121 |
read4B(UINT32 *dest, UINT8 *buf) {
*dest = (UINT32)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]);
} | 0 | [
"CWE-125"
] | Pillow | 4853e522bddbec66022c0915b9a56255d0188bf9 | 214,752,686,534,223,700,000,000,000,000,000,000,000 | 3 | Fix OOB read in SgiRleDecode.c
* From Pillow 4.3.0->8.1.0
* CVE-2021-25293 |
ClientRequestContext::hostHeaderVerify()
{
// Require a Host: header.
const char *host = http->request->header.getStr(Http::HdrType::HOST);
if (!host) {
// TODO: dump out the HTTP/1.1 error about missing host header.
// otherwise this is fine, can't forge a header value when its not even se... | 0 | [
"CWE-116"
] | squid | 7024fb734a59409889e53df2257b3fc817809fb4 | 277,183,834,071,039,600,000,000,000,000,000,000,000 | 92 | Handle more Range requests (#790)
Also removed some effectively unused code. |
static int bond_change_mtu(struct net_device *bond_dev, int new_mtu)
{
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *rollback_slave;
struct list_head *iter;
int res = 0;
netdev_dbg(bond_dev, "bond=%p, new_mtu=%d\n", bond, new_mtu);
bond_for_each_slave(bond, slave, iter) {
slave_dbg(bond_... | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 33,953,588,769,465,020,000,000,000,000,000,000,000 | 50 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
static int fts3SegReaderDoclistCmpRev(Fts3SegReader *pLhs, Fts3SegReader *pRhs){
int rc = (pLhs->pOffsetList==0)-(pRhs->pOffsetList==0);
if( rc==0 ){
if( pLhs->iDocid==pRhs->iDocid ){
rc = pRhs->iIdx - pLhs->iIdx;
}else{
rc = (pLhs->iDocid < pRhs->iDocid) ? 1 : -1;
}
}
assert( pLhs->aNod... | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 24,839,154,390,908,285,000,000,000,000,000,000,000 | 12 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
CtPtr ProtocolV1::wait_message() {
if (state != OPENED) { // must have changed due to a replace
return nullptr;
}
ldout(cct, 20) << __func__ << dendl;
return READ(sizeof(char), handle_message);
} | 0 | [
"CWE-294"
] | ceph | 6c14c2fb5650426285428dfe6ca1597e5ea1d07d | 165,479,674,379,694,130,000,000,000,000,000,000,000 | 9 | mon/MonClient: bring back CEPHX_V2 authorizer challenges
Commit c58c5754dfd2 ("msg/async/ProtocolV1: use AuthServer and
AuthClient") introduced a backwards compatibility issue into msgr1.
To fix it, commit 321548010578 ("mon/MonClient: skip CEPHX_V2
challenge if client doesn't support it") set out to skip authorizer
c... |
static int lookup_go(AvahiSRBLookup *l) {
int n = 0;
assert(l);
if (l->record_browser->dead)
return 0;
lookup_ref(l);
/* Browse the cache for the root request */
n = lookup_scan_cache(l);
/* Start the lookup */
if (!l->record_browser->dead && l->ref > 1) {
if ((l->fl... | 0 | [] | avahi | 9d31939e55280a733d930b15ac9e4dda4497680c | 237,571,625,992,637,440,000,000,000,000,000,000,000 | 26 | Fix NULL pointer crashes from #175
avahi-daemon is crashing when running "ping .local".
The crash is due to failing assertion from NULL pointer.
Add missing NULL pointer checks to fix it.
Introduced in #175 - merge commit 8f75a045709a780c8cf92a6a21e9d35b593bdecd |
static void ib_uverbs_add_one(struct ib_device *device)
{
int devnum;
dev_t base;
struct ib_uverbs_device *uverbs_dev;
int ret;
if (!device->alloc_ucontext)
return;
uverbs_dev = kzalloc(sizeof *uverbs_dev, GFP_KERNEL);
if (!uverbs_dev)
return;
ret = init_srcu_struct(&uverbs_dev->disassociate_srcu);
if (... | 0 | [
"CWE-284",
"CWE-264"
] | linux | e6bd18f57aad1a2d1ef40e646d03ed0f2515c9e3 | 124,921,710,940,209,860,000,000,000,000,000,000,000 | 91 | IB/security: Restrict use of the write() interface
The drivers/infiniband stack uses write() as a replacement for
bi-directional ioctl(). This is not safe. There are ways to
trigger write calls that result in the return structure that
is normally written to user space being shunted off to user
specified kernel memory... |
static inline void seeknext(struct SISTREAM *s) {
fseek(s->f, s->fnext[s->level], SEEK_SET);
/* s->sleft = s->smax = fread(s->buff,1,BUFSIZ,s->f); */
s->sleft = s->smax = 0;
} | 0 | [
"CWE-189"
] | clamav-devel | c6870a6c857dd722dffaf6d37ae52ec259d12492 | 181,015,456,476,740,460,000,000,000,000,000,000,000 | 5 | bb #6808 |
static int init_status_attrs(void)
{
int id;
status_attrs = kcalloc(vhci_num_controllers, sizeof(struct status_attr),
GFP_KERNEL);
if (status_attrs == NULL)
return -ENOMEM;
for (id = 0; id < vhci_num_controllers; id++)
set_status_attr(id);
return 0;
} | 0 | [
"CWE-200"
] | linux | 2f2d0088eb93db5c649d2a5e34a3800a8a935fc5 | 82,712,147,716,126,675,000,000,000,000,000,000,000 | 14 | usbip: prevent vhci_hcd driver from leaking a socket pointer address
When a client has a USB device attached over IP, the vhci_hcd driver is
locally leaking a socket pointer address via the
/sys/devices/platform/vhci_hcd/status file (world-readable) and in debug
output when "usbip --debug port" is run.
Fix it to not... |
static int gen_wants_ndx(int desired_ndx, int flist_num)
{
static int next_ndx = -1;
static int done_cnt = 0;
static BOOL got_eof = False;
if (got_eof)
return 0;
/* TODO: integrate gen-reading I/O into perform_io() so this is not needed? */
io_flush(FULL_FLUSH);
while (next_ndx < desired_ndx) {
if (inc_re... | 0 | [
"CWE-862"
] | rsync | 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 | 261,232,245,504,450,400,000,000,000,000,000,000,000 | 34 | Check fname in recv_files sooner. |
static inline int ebt_entry_to_user(struct ebt_entry *e, const char *base,
char __user *ubase)
{
int ret;
char __user *hlp;
const struct ebt_entry_target *t;
if (e->bitmask == 0) {
/* special case !EBT_ENTRY_OR_ENTRIES */
if (copy_to_user(ubase + ((char *)e - base), e,
sizeof(struct ebt_entries)))... | 0 | [
"CWE-787"
] | linux | b71812168571fa55e44cdd0254471331b9c4c4c6 | 252,103,542,961,930,600,000,000,000,000,000,000,000 | 34 | netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets
We need to make sure the offsets are not out of range of the
total size.
Also check that they are in ascending order.
The WARN_ON triggered by syzkaller (it sets panic_on_warn) is
changed to also bail out, no point in continuing parsing.
Briefly tested... |
static int parse_unalias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
{
ALIAS *tmp, *last = NULL;
do
{
mutt_extract_token (buf, s, 0);
if (mutt_strcmp ("*", buf->data) == 0)
{
if (CurrentMenu == MENU_ALIAS)
{
for (tmp = Aliases; tmp ; tmp = tmp->next)
tmp->del = 1;
set... | 0 | [
"CWE-668"
] | mutt | 6d0624411a979e2e1d76af4dd97d03f47679ea4a | 67,368,901,891,881,530,000,000,000,000,000,000,000 | 46 | use a 64-bit random value in temporary filenames.
closes #3158 |
vrend_resource_alloc_buffer(struct vrend_resource *gr, uint32_t flags)
{
const uint32_t bind = gr->base.bind;
const uint32_t size = gr->base.width0;
if (bind == VIRGL_BIND_CUSTOM) {
/* use iovec directly when attached */
gr->storage_bits |= VREND_STORAGE_HOST_SYSTEM_MEMORY;
gr->ptr = malloc(... | 1 | [
"CWE-909"
] | virglrenderer | b05bb61f454eeb8a85164c8a31510aeb9d79129c | 136,103,138,308,419,370,000,000,000,000,000,000,000 | 57 | vrend: clear memory when allocating a host-backed memory resource
Closes: #249
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com> |
static boolean FillInputBuffer(j_decompress_ptr cinfo)
{
SourceManager
*source;
source=(SourceManager *) cinfo->src;
source->manager.bytes_in_buffer=(size_t) ReadBlob(source->image,
MaxBufferExtent,source->buffer);
if (source->manager.bytes_in_buffer == 0)
{
if (source->start_of_blob != FALSE... | 0 | [
"CWE-200",
"CWE-703"
] | ImageMagick | f6463ca9588579633bbaed9460899d892aa3c64a | 77,118,146,173,692,350,000,000,000,000,000,000,000 | 21 | Zero pixel buffer |
int wc_ecc_import_point_der(byte* in, word32 inLen, const int curve_idx,
ecc_point* point)
{
int err = 0;
int compressed = 0;
int keysize;
byte pointType;
if (in == NULL || point == NULL || (curve_idx < 0) ||
(wc_ecc_is_valid_idx(curve_idx) == 0))
return ... | 0 | [
"CWE-326",
"CWE-203"
] | wolfssl | 1de07da61f0c8e9926dcbd68119f73230dae283f | 98,709,707,444,085,820,000,000,000,000,000,000,000 | 150 | Constant time EC map to affine for private operations
For fast math, use a constant time modular inverse when mapping to
affine when operation involves a private key - key gen, calc shared
secret, sign. |
}
inline float abs(const float a) {
return (float)std::fabs((double)a); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 292,911,172,868,678,520,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
dir_check(VALUE dir)
{
struct dir_data *dirp = dir_get(dir);
if (!dirp->dir) dir_closed();
return dirp;
} | 0 | [
"CWE-22"
] | ruby | bd5661a3cbb38a8c3a3ea10cd76c88bbef7871b8 | 169,710,821,111,130,530,000,000,000,000,000,000,000 | 6 | dir.c: check NUL bytes
* dir.c (GlobPathValue): should be used in rb_push_glob only.
other methods should use FilePathValue.
https://hackerone.com/reports/302338
* dir.c (rb_push_glob): expand GlobPathValue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
void* priv) {
v8::Isolate* isolate = context->GetIsolate();
gin_helper::Dictionary dict(isolate, exports);
dict.Set("WebContents", WebContents::GetConstructor... | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 163,023,022,182,085,380,000,000,000,000,000,000,000 | 11 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
static void sdma_err_progress_check(struct timer_list *t)
{
unsigned index;
struct sdma_engine *sde = from_timer(sde, t, err_progress_check_timer);
dd_dev_err(sde->dd, "SDE progress check event\n");
for (index = 0; index < sde->dd->num_sdma; index++) {
struct sdma_engine *curr_sde = &sde->dd->per_sdma[index];
... | 0 | [
"CWE-400",
"CWE-401"
] | linux | 34b3be18a04ecdc610aae4c48e5d1b799d8689f6 | 284,840,180,910,264,660,000,000,000,000,000,000,000 | 38 | RDMA/hfi1: Prevent memory leak in sdma_init
In sdma_init if rhashtable_init fails the allocated memory for
tmp_sdma_rht should be released.
Fixes: 5a52a7acf7e2 ("IB/hfi1: NULL pointer dereference when freeing rhashtable")
Link: https://lore.kernel.org/r/20190925144543.10141-1-navid.emamdoost@gmail.com
Signed-off-by: ... |
void DecimalQuantity::_setToDecNum(const DecNum& decnum, UErrorCode& status) {
if (U_FAILURE(status)) { return; }
if (decnum.isNegative()) {
flags |= NEGATIVE_FLAG;
}
if (!decnum.isZero()) {
readDecNumberToBcd(decnum);
compact();
}
} | 0 | [
"CWE-190"
] | icu | 53d8c8f3d181d87a6aa925b449b51c4a2c922a51 | 174,034,914,281,757,130,000,000,000,000,000,000,000 | 10 | ICU-20246 Fixing another integer overflow in number parsing. |
static void __exit nf_defrag_fini(void)
{
nf_unregister_hooks(ipv6_defrag_ops, ARRAY_SIZE(ipv6_defrag_ops));
nf_ct_frag6_cleanup();
} | 0 | [
"CWE-787"
] | linux | 9b57da0630c9fd36ed7a20fc0f98dc82cc0777fa | 23,582,631,276,260,760,000,000,000,000,000,000,000 | 5 | netfilter: ipv6: nf_defrag: drop mangled skb on ream error
Dmitry Vyukov reported GPF in network stack that Andrey traced down to
negative nh offset in nf_ct_frag6_queue().
Problem is that all network headers before fragment header are pulled.
Normal ipv6 reassembly will drop the skb when errors occur further down
th... |
GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_kind(size_t lb, int k)
{
return GC_malloc_kind_global(lb, k);
} | 0 | [
"CWE-119"
] | bdwgc | 7292c02fac2066d39dd1bcc37d1a7054fd1e32ee | 128,398,183,593,143,350,000,000,000,000,000,000,000 | 4 | Fix malloc routines to prevent size value wrap-around
See issue #135 on Github.
* allchblk.c (GC_allochblk, GC_allochblk_nth): Use
OBJ_SZ_TO_BLOCKS_CHECKED instead of OBJ_SZ_TO_BLOCKS.
* malloc.c (GC_alloc_large): Likewise.
* alloc.c (GC_expand_hp_inner): Type of "bytes" local variable changed
from word to size_t; ca... |
static void setup_frame (int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs *regs)
{
struct sigframe *frame;
int err = 0;
int usig;
unsigned char *ret;
frame = get_sigframe(ka, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto give_sigsegv;
usig = current_threa... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 269,897,201,210,911,000,000,000,000,000,000,000,000 | 66 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static void netdev_queue_get_ownership(struct kobject *kobj,
kuid_t *uid, kgid_t *gid)
{
const struct net *net = netdev_queue_namespace(kobj);
net_ns_get_ownership(net, uid, gid); | 0 | [
"CWE-401"
] | linux | 895a5e96dbd6386c8e78e5b78e067dcc67b7f0ab | 333,144,681,865,551,100,000,000,000,000,000,000,000 | 7 | net-sysfs: Fix mem leak in netdev_register_kobject
syzkaller report this:
BUG: memory leak
unreferenced object 0xffff88837a71a500 (size 256):
comm "syz-executor.2", pid 9770, jiffies 4297825125 (age 17.843s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ... |
void *Type_Text_Description_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, cmsUInt32Number* nItems, cmsUInt32Number SizeOfTag)
{
char* Text = NULL;
cmsMLU* mlu = NULL;
cmsUInt32Number AsciiCount;
cmsUInt32Number i, UnicodeCode, UnicodeCount;
cmsUInt16Number ScriptCodeCode, Dummy;
... | 0 | [] | Little-CMS | 41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 | 233,836,162,812,089,500,000,000,000,000,000,000,000 | 79 | Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage
and pass it to cmsPipelineInsertStage without checking whether the
allocation succeeded. cmsPipelineInsertStage would then assert (or crash)
if it had not.
The fix here is to change cmsPipelineI... |
enum_func_status
php_mysqlnd_rowp_read_text_protocol_zval(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields,
unsigned int field_count, const MYSQLND_FIELD * fields_metadata,
zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC)
{
enum_func_status ret;
DBG_ENTER("php_mysqlnd_rowp_read_text... | 0 | [
"CWE-119",
"CWE-787"
] | php-src | 28f80baf3c53e267c9ce46a2a0fadbb981585132 | 207,528,902,787,957,030,000,000,000,000,000,000,000 | 9 | Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields |
lib_split_tklist(self, list_str)
VALUE self;
VALUE list_str;
{
return lib_split_tklist_core(Qnil, list_str);
} | 0 | [] | tk | ebd0fc80d62eeb7b8556522256f8d035e013eb65 | 109,703,411,019,383,150,000,000,000,000,000,000,000 | 6 | tcltklib.c: check argument
* ext/tk/tcltklib.c (ip_cancel_eval_core): check argument type and
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
g_NPN_DestroyStream(NPP instance, NPStream *stream, NPError reason)
{
if (!thread_check()) {
npw_printf("WARNING: NPN_DestroyStream not called from the main thread\n");
return NPERR_INVALID_INSTANCE_ERROR;
}
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
PluginInstance *plugin = PLUGIN_INSTAN... | 0 | [
"CWE-264"
] | nspluginwrapper | 7e4ab8e1189846041f955e6c83f72bc1624e7a98 | 300,238,821,576,346,260,000,000,000,000,000,000,000 | 37 | Support all the new variables added |
int nci_get_conn_info_by_dest_type_params(struct nci_dev *ndev, u8 dest_type,
const struct dest_spec_params *params)
{
const struct nci_conn_info *conn_info;
list_for_each_entry(conn_info, &ndev->conn_info_list, list) {
if (conn_info->dest_type == dest_type) {
if (!params)
return conn_info->conn_id;
... | 0 | [] | linux | 48b71a9e66c2eab60564b1b1c85f4928ed04e406 | 250,741,867,212,731,070,000,000,000,000,000,000,000 | 18 | NFC: add NCI_UNREG flag to eliminate the race
There are two sites that calls queue_work() after the
destroy_workqueue() and lead to possible UAF.
The first site is nci_send_cmd(), which can happen after the
nci_close_device as below
nfcmrvl_nci_unregister_dev | nfc_genl_dev_up
nci_close_device |
f... |
bool jslMatch(int expected_tk) {
if (lex->tk != expected_tk) {
jslMatchError(expected_tk);
return false;
}
jslGetNextToken();
return true;
} | 0 | [
"CWE-787"
] | Espruino | bed844f109b6c222816740555068de2e101e8018 | 187,041,101,438,946,950,000,000,000,000,000,000,000 | 8 | remove strncpy usage as it's effectively useless, replace with an assertion since fn is only used internally (fix #1426) |
static inline __u16 mtu2blksize(struct net_device *dev)
{
u32 blksize = dev->mtu;
if (blksize > 0xffff)
blksize = 0xffff;
if (dev->type == ARPHRD_ETHER ||
dev->type == ARPHRD_PPP ||
dev->type == ARPHRD_IPGRE ||
dev->type == ARPHRD_LOOPBACK)
blksize -= 2;
return (__u16)blksize;
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 272,512,423,309,364,400,000,000,000,000,000,000,000 | 14 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
ipmi_fru_set_field_string(struct ipmi_intf * intf, uint8_t fruId, uint8_t
f_type, uint8_t f_index, char *f_string)
{
struct ipmi_rs *rsp;
struct ipmi_rq req;
struct fru_info fru;
struct fru_header header;
uint8_t msg_data[4];
uint8_t checksum;
int i = 0;
int rc = 1;
uint8_t *fru_data = NULL;
uint8_t *fru_are... | 0 | [
"CWE-120",
"CWE-787"
] | ipmitool | e824c23316ae50beb7f7488f2055ac65e8b341f2 | 307,977,146,004,981,470,000,000,000,000,000,000,000 | 191 | fru: Fix buffer overflow vulnerabilities
Partial fix for CVE-2020-5208, see
https://github.com/ipmitool/ipmitool/security/advisories/GHSA-g659-9qxw-p7cp
The `read_fru_area_section` function only performs size validation of
requested read size, and falsely assumes that the IPMI message will not
respond with more than ... |
static bool __sev_recycle_asids(int min_asid, int max_asid)
{
if (sev_flush_asids(min_asid, max_asid))
return false;
/* The flush process will flush all reclaimable SEV and SEV-ES ASIDs */
bitmap_xor(sev_asid_bitmap, sev_asid_bitmap, sev_reclaim_asid_bitmap,
nr_asids);
bitmap_zero(sev_reclaim_asid_bitmap, n... | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 41,752,099,171,610,830,000,000,000,000,000,000,000 | 12 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
static int vcpu_interrupt_line(struct kvm_vcpu *vcpu, int number, bool level)
{
int bit_index;
bool set;
unsigned long *ptr;
if (number == KVM_ARM_IRQ_CPU_IRQ)
bit_index = __ffs(HCR_VI);
else /* KVM_ARM_IRQ_CPU_FIQ */
bit_index = __ffs(HCR_VF);
ptr = (unsigned long *)&vcpu->arch.irq_lines;
if (level)
set... | 0 | [
"CWE-399",
"CWE-284"
] | linux | e8180dcaa8470ceca21109f143876fdcd9fe050a | 324,324,739,369,205,180,000,000,000,000,000,000,000 | 32 | ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl
Some ARM KVM VCPU ioctls require the vCPU to be properly initialized
with the KVM_ARM_VCPU_INIT ioctl before being used with further
requests. KVM_RUN checks whether this initialization has been
done, but other ioctls do not.
Namely KVM_GET_REG_LIST will ... |
_mono_reflection_parse_type (char *name, char **endptr, gboolean is_recursed,
MonoTypeNameParse *info)
{
char *start, *p, *w, *temp, *last_point, *startn;
int in_modifiers = 0;
int isbyref = 0, rank, arity = 0, i;
start = p = w = name;
//FIXME could we just zero the whole struct? memset (&info, 0, sizeof... | 0 | [
"CWE-20"
] | mono | 4905ef1130feb26c3150b28b97e4a96752e0d399 | 204,488,695,529,344,800,000,000,000,000,000,000,000 | 205 | Handle invalid instantiation of generic methods.
* verify.c: Add new function to internal verifier API to check
method instantiations.
* reflection.c (mono_reflection_bind_generic_method_parameters):
Check the instantiation before returning it.
Fixes #655847 |
static int avrcp_controller_server_probe(struct btd_profile *p,
struct btd_adapter *adapter)
{
sdp_record_t *record;
struct avrcp_server *server;
DBG("path %s", adapter_get_path(adapter));
server = find_server(servers, adapter);
if (server != NULL)
goto done;
server = avrcp_server_register(adapter);
i... | 0 | [
"CWE-200"
] | bluez | e2b0f0d8d63e1223bb714a9efb37e2257818268b | 62,507,112,311,077,330,000,000,000,000,000,000,000 | 34 | avrcp: Fix not checking if params_len match number of received bytes
This makes sure the number of bytes in the params_len matches the
remaining bytes received so the code don't end up accessing invalid
memory. |
hb_set_set (hb_set_t *set,
const hb_set_t *other)
{
/* Immutible-safe. */
set->set (*other);
} | 0 | [
"CWE-787"
] | harfbuzz | d3e09bf4654fe5478b6dbf2b26ebab6271317d81 | 126,072,168,876,742,400,000,000,000,000,000,000,000 | 6 | [set] Make all operators null-safe again
Changed my mind.
Also for hb_map_clear().
Part of https://github.com/harfbuzz/harfbuzz/pull/3162 |
f_term_getline(typval_T *argvars, typval_T *rettv)
{
buf_T *buf = term_get_buf(argvars, "term_getline()");
term_T *term;
int row;
rettv->v_type = VAR_STRING;
if (buf == NULL)
return;
term = buf->b_term;
row = get_row_number(&argvars[1], term);
if (term->tl_vterm == NULL)
... | 0 | [
"CWE-476"
] | vim | cd929f7ba8cc5b6d6dcf35c8b34124e969fed6b8 | 118,862,921,540,879,690,000,000,000,000,000,000,000 | 42 | patch 8.1.0633: crash when out of memory while opening a terminal window
Problem: Crash when out of memory while opening a terminal window.
Solution: Handle out-of-memory more gracefully. |
xsltElementComp(xsltStylesheetPtr style, xmlNodePtr inst) {
#ifdef XSLT_REFACTORED
xsltStyleItemElementPtr comp;
#else
xsltStylePreCompPtr comp;
#endif
/*
* <xsl:element
* name = { qname }
* namespace = { uri-reference }
* use-attribute-sets = qnames>
* <!-- Content: template --... | 0 | [] | libxslt | 7ca19df892ca22d9314e95d59ce2abdeff46b617 | 92,643,779,543,878,220,000,000,000,000,000,000,000 | 111 | Fix for type confusion in preprocessing attributes
CVE-2015-7995 http://www.openwall.com/lists/oss-security/2015/10/27/10
We need to check that the parent node is an element before dereferencing
its namespace |
static uint8_t* jmp_if(
int condition,
uint8_t* ip)
{
uint8_t* result;
if (condition)
{
result = *(uint8_t**)(ip + 1);
// ip will be incremented at the end of the execution loop,
// decrement it here to compensate.
result--;
}
else
{
result = ip + sizeof(uint64_t);
}
ret... | 0 | [
"CWE-416"
] | yara | 053e67e3ec81cc9268ce30eaf0d6663d8639ed1e | 182,178,627,578,825,350,000,000,000,000,000,000,000 | 22 | Fix issue #658 |
bool HeifContext::is_image(heif_item_id ID) const
{
for (const auto& img : m_all_images) {
if (img.first == ID)
return true;
}
return false;
} | 0 | [
"CWE-125"
] | libheif | f7399b62d7fbc596f1b2871578c1d2053bedf1dd | 146,220,896,116,397,980,000,000,000,000,000,000,000 | 9 | Handle case where referenced "iref" box doesn't exist (fixes #138). |
void MainWindow::onMultitrackCreated()
{
m_player->enableTab(Player::ProjectTabIndex, true);
} | 0 | [
"CWE-89",
"CWE-327",
"CWE-295"
] | shotcut | f008adc039642307f6ee3378d378cdb842e52c1d | 162,196,214,156,345,800,000,000,000,000,000,000,000 | 4 | fix upgrade check is not using TLS correctly |
static void mark_btf_ld_reg(struct bpf_verifier_env *env,
struct bpf_reg_state *regs, u32 regno,
enum bpf_reg_type reg_type,
struct btf *btf, u32 btf_id)
{
if (reg_type == SCALAR_VALUE) {
mark_reg_unknown(env, regs, regno);
return;
}
mark_reg_known_zero(env, regs, regno);
regs[regno].type =... | 0 | [] | linux | 9b00f1b78809309163dda2d044d9e94a3c0248a3 | 50,913,907,864,190,410,000,000,000,000,000,000,000 | 14 | bpf: Fix truncation handling for mod32 dst reg wrt zero
Recently noticed that when mod32 with a known src reg of 0 is performed,
then the dst register is 32-bit truncated in verifier:
0: R1=ctx(id=0,off=0,imm=0) R10=fp0
0: (b7) r0 = 0
1: R0_w=inv0 R1=ctx(id=0,off=0,imm=0) R10=fp0
1: (b7) r1 = -1
2: R0_w=inv... |
InputAndShape AddAggregatedInputs(const NodeDef& root_node,
const string& node_name,
const InputAndShape& left,
const InputAndShape& right) {
// copy attributes from a root node
DataType dtype = root_no... | 0 | [
"CWE-476"
] | tensorflow | e6340f0665d53716ef3197ada88936c2a5f7a2d3 | 262,424,125,536,555,000,000,000,000,000,000,000,000 | 23 | Handle a special grappler case resulting in crash.
It might happen that a malformed input could be used to trick Grappler into trying to optimize a node with no inputs. This, in turn, would produce a null pointer dereference and a segfault.
PiperOrigin-RevId: 369242852
Change-Id: I2e5cbe7aec243d34a6d60220ac8ac9b16f13... |
static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp)
{
struct vhost_vring_state s;
if (vq->private_data)
return -EBUSY;
if (copy_from_user(&s, argp, sizeof(s)))
return -EFAULT;
if (s.num != VHOST_VRING_LITTLE_ENDIAN &&
s.num != VHOST_VRING_BIG_ENDIAN)
return -EINVAL;
vq->... | 0 | [
"CWE-399"
] | linux | 7932c0bd7740f4cd2aa168d3ce0199e7af7d72d5 | 293,194,438,209,674,420,000,000,000,000,000,000,000 | 18 | vhost: actually track log eventfd file
While reviewing vhost log code, I found out that log_file is never
set. Note: I haven't tested the change (QEMU doesn't use LOG_FD yet).
Cc: stable@vger.kernel.org
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> |
sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
{
int ret_sz = 0, i, k, rem_sz, num, mx_sc_elems;
int sg_tablesize = sfp->parentdp->sg_tablesize;
int blk_size = buff_size, order;
gfp_t gfp_mask = GFP_ATOMIC | __GFP_COMP | __GFP_NOWARN;
struct sg_device *sdp = sfp->parentdp;
if (blk_size < 0... | 0 | [] | linux | a45b599ad808c3c982fdcdc12b0b8611c2f92824 | 4,813,811,668,135,894,300,000,000,000,000,000,000 | 83 | scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()
This shall help avoid copying uninitialized memory to the userspace when
calling ioctl(fd, SG_IO) with an empty command.
Reported-by: syzbot+7d26fc1eea198488deab@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Potapenko <glider@go... |
static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
int len)
{
struct sock *sk = sock->sk;
struct atalk_sock *at = at_sk(sk);
struct sockaddr_at *usat = (struct sockaddr_at *)msg->msg_name;
int flags = msg->msg_flags;
int loopback = 0;
struct sockaddr_at local_satalk, gsat;
... | 1 | [] | history | 7ab442d7e0a76402c12553ee256f756097cae2d2 | 153,761,947,041,868,060,000,000,000,000,000,000,000 | 159 | [DDP]: Convert to new protocol interface.
Convert ddp to the new protocol interface which means it has to
handle fragmented skb's. The only big change is in the checksum
routine which has to do more work (like skb_checksum).
Minor speedup is folding the carry to avoid a branch.
Tested against a 2.4 system and by ru... |
static struct dyn_lease *oldest_expired_lease(void)
{
struct dyn_lease *oldest_lease = NULL;
leasetime_t oldest_time = time(NULL);
unsigned i;
/* Unexpired leases have g_leases[i].expires >= current time
* and therefore can't ever match */
for (i = 0; i < server_config.max_leases; i++) {
if (g_leases[i].expir... | 0 | [
"CWE-125"
] | busybox | 6d3b4bb24da9a07c263f3c1acf8df85382ff562c | 183,207,698,866,459,000,000,000,000,000,000,000,000 | 18 | udhcpc: check that 4-byte options are indeed 4-byte, closes 11506
function old new delta
udhcp_get_option32 - 27 +27
udhcp_get_option 231 248 +17
----------------------------------... |
void add_ref_exclusion(struct string_list **ref_excludes_p, const char *exclude)
{
if (!*ref_excludes_p) {
*ref_excludes_p = xcalloc(1, sizeof(**ref_excludes_p));
(*ref_excludes_p)->strdup_strings = 1;
}
string_list_append(*ref_excludes_p, exclude);
} | 0 | [] | git | a937b37e766479c8e780b17cce9c4b252fd97e40 | 277,545,834,603,915,650,000,000,000,000,000,000,000 | 8 | revision: quit pruning diff more quickly when possible
When the revision traversal machinery is given a pathspec,
we must compute the parent-diff for each commit to determine
which ones are TREESAME. We set the QUICK diff flag to avoid
looking at more entries than we need; we really just care
whether there are any cha... |
inline void remove_arguments() { arg_count=0; } | 0 | [
"CWE-617"
] | server | 2e7891080667c59ac80f788eef4d59d447595772 | 308,239,744,408,824,600,000,000,000,000,000,000,000 | 1 | MDEV-25635 Assertion failure when pushing from HAVING into WHERE of view
This bug could manifest itself after pushing a where condition over a
mergeable derived table / view / CTE DT into a grouping view / derived
table / CTE V whose item list contained set functions with constant
arguments such as MIN(2), SUM(1) etc.... |
static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_rp_write_link_policy *rp = (void *) skb->data;
struct hci_conn *conn;
void *sent;
BT_DBG("%s status 0x%2.2x", hdev->name, rp->status);
if (rp->status)
return;
sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LINK_POLICY);... | 0 | [
"CWE-290"
] | linux | 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 | 44,877,685,182,343,120,000,000,000,000,000,000,000 | 23 | Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection
state is BT_CONFIG so callers don't have to check the state.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
bool Zone::excess_allocation() {
return segment_bytes_allocated_ > zone_excess_limit_;
} | 0 | [
"CWE-119"
] | node | fcb9145e291e8cb82164bc1fe3db1c1dae219b55 | 144,988,659,426,666,320,000,000,000,000,000,000,000 | 3 | deps: backport 3a9bfec from v8 upstream
Some of the logic from `zone.cc` is found in `zone-inl.h` in this
release stream.
Original commit message:
Fix overflow issue in Zone::New
When requesting a large allocation near the end of the address space,
the computation could overflow and erroneously *not* grow the... |
I2SCodec *tsc210x_codec(uWireSlave *chip)
{
TSC210xState *s = (TSC210xState *) chip->opaque;
return &s->codec;
} | 0 | [
"CWE-119"
] | qemu | 5193be3be35f29a35bc465036cd64ad60d43385f | 231,464,403,171,801,230,000,000,000,000,000,000,000 | 6 | tsc210x: fix buffer overrun on invalid state load
CVE-2013-4539
s->precision, nextprecision, function and nextfunction
come from wire and are used
as idx into resolution[] in TSC_CUT_RESOLUTION.
Validate after load to avoid buffer overrun.
Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst... |
ContentEncoding::ContentEncoding()
: enc_algo_(5),
enc_key_id_(NULL),
encoding_order_(0),
encoding_scope_(1),
encoding_type_(1),
enc_key_id_length_(0) {} | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 65,849,456,647,476,680,000,000,000,000,000,000,000 | 7 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
struct xt_table_info *newinfo,
unsigned int *size,
const unsigned char *base,
const unsigned char *limit,
const unsigned int *hook_entries,
const unsigned int *underflows,
const char *name)
{
struct xt_entry_match *... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91 | 71,684,473,859,983,030,000,000,000,000,000,000,000 | 86 | netfilter: x_tables: make sure e->next_offset covers remaining blob size
Otherwise this function may read data beyond the ruleset blob.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
int device_links_read_lock_held(void)
{
return srcu_read_lock_held(&device_links_srcu);
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 218,203,284,723,316,130,000,000,000,000,000,000,000 | 4 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
cockpit_web_response_gerror (CockpitWebResponse *self,
GHashTable *headers,
GError *error)
{
int code;
g_return_if_fail (COCKPIT_IS_WEB_RESPONSE (self));
if (g_error_matches (error,
COCKPIT_ERROR, COCKPIT_ERROR_AUTHENTICATION_FAILE... | 0 | [
"CWE-1021"
] | cockpit | 8d9bc10d8128aae03dfde62fd00075fe492ead10 | 140,511,043,459,062,890,000,000,000,000,000,000,000 | 25 | common: Restrict frame embedding to same origin
Declare `X-Frame-Options: sameorigin` [1] so that cockpit frames can
only be embedded into pages coming from the same origin. This is similar
to setting CORP in commit 2b38b8de92f9a (which applies to `<script>`,
`<img>`, etc.).
The main use case for embedding is to run ... |
void perf_event_exec(void)
{
int ctxn;
rcu_read_lock();
for_each_task_context_nr(ctxn)
perf_event_enable_on_exec(ctxn);
rcu_read_unlock();
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 12ca6ad2e3a896256f086497a7c7406a547ee373 | 309,067,339,606,780,260,000,000,000,000,000,000,000 | 9 | perf: Fix race in swevent hash
There's a race on CPU unplug where we free the swevent hash array
while it can still have events on. This will result in a
use-after-free which is BAD.
Simply do not free the hash array on unplug. This leaves the thing
around and no use-after-free takes place.
When the last swevent die... |
static unsigned int task_scan_start(struct task_struct *p)
{
unsigned long smin = task_scan_min(p);
unsigned long period = smin;
struct numa_group *ng;
/* Scale the maximum scan period with the amount of shared memory. */
rcu_read_lock();
ng = rcu_dereference(p->numa_group);
if (ng) {
unsigned long shared = g... | 0 | [
"CWE-400",
"CWE-703"
] | linux | de53fd7aedb100f03e5d2231cfce0e4993282425 | 217,053,736,894,147,500,000,000,000,000,000,000,000 | 21 | sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices
It has been observed, that highly-threaded, non-cpu-bound applications
running under cpu.cfs_quota_us constraints can hit a high percentage of
periods throttled while simultaneously not consuming the allocated
amount of quota... |
p11_rpc_message_write_space_string (p11_rpc_message *msg,
CK_UTF8CHAR *data,
CK_ULONG length)
{
assert (msg != NULL);
assert (msg->output != NULL);
assert (data != NULL);
assert (length != 0);
assert (!msg->signature || p11_rpc_message_verify... | 0 | [
"CWE-787"
] | p11-kit | 2617f3ef888e103324a28811886b99ed0a56346d | 273,917,658,127,588,760,000,000,000,000,000,000,000 | 14 | Check attribute length against buffer size
If an attribute's length does not match the length of the byte array
inside it, one length was used for allocation, and the other was used
for memcpy. This additional check will instead return an error on
malformed messages. |
int CLASS parse_jpeg(int offset)
{
int len, save, hlen, mark;
fseek(ifp, offset, SEEK_SET);
if (fgetc(ifp) != 0xff || fgetc(ifp) != 0xd8)
return 0;
while (fgetc(ifp) == 0xff && (mark = fgetc(ifp)) != 0xda)
{
order = 0x4d4d;
len = get2() - 2;
save = ftell(ifp);
if (mark == 0xc0 || mark == ... | 0 | [
"CWE-190"
] | LibRaw | 4554e24ce24beaef5d0ef48372801cfd91039076 | 232,606,353,563,084,600,000,000,000,000,000,000,000 | 38 | parse_qt: possible integer overflow |
void Item_trigger_field::cleanup()
{
want_privilege= original_privilege;
/*
Since special nature of Item_trigger_field we should not do most of
things from Item_field::cleanup() or Item_ident::cleanup() here.
*/
Item::cleanup();
} | 0 | [] | server | b000e169562697aa072600695d4f0c0412f94f4f | 255,408,361,759,108,880,000,000,000,000,000,000,000 | 9 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST, COL), NAME_CONST('NAME', NULL))
based on:
commit f7316aa0c9a
Author: Ajo Robert <ajo.robert@oracle.com>
Date: Thu Aug 24 17:03:21 2017 +0530
Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME'... |
absl::optional<CelValue> operator[](CelValue key) const override {
if (value_ == nullptr || !key.IsString()) {
return {};
}
auto str = std::string(key.StringOrDie().value());
if (!Http::validHeaderString(str)) {
// Reject key if it is an invalid header string
return {};
}
aut... | 1 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 334,454,082,009,665,080,000,000,000,000,000,000,000 | 12 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static void jas_cmshapmat_destroy(jas_cmpxform_t *pxform)
{
jas_cmshapmat_t *shapmat = &pxform->data.shapmat;
int i;
for (i = 0; i < 3; ++i)
jas_cmshapmatlut_cleanup(&shapmat->luts[i]);
} | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 267,106,241,105,135,280,000,000,000,000,000,000,000 | 7 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
int ssl3_setup_buffers(SSL *s)
{
if (!ssl3_setup_read_buffer(s))
return 0;
if (!ssl3_setup_write_buffer(s))
return 0;
return 1;
} | 0 | [
"CWE-125"
] | openssl | bb1a4866034255749ac578adb06a76335fc117b1 | 1,574,747,657,170,829,000,000,000,000,000,000,000 | 8 | Make message buffer slightly larger than message.
Grow TLS/DTLS 16 bytes more than strictly necessary as a precaution against
OOB reads. In most cases this will have no effect because the message buffer
will be large enough already.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 006a788c84e54... |
static int rsi_usb_init_rx(struct rsi_hw *adapter)
{
struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
struct rx_usb_ctrl_block *rx_cb;
u8 idx, num_rx_cb;
num_rx_cb = (adapter->priv->coex_mode > 1 ? 2 : 1);
for (idx = 0; idx < num_rx_cb; idx++) {
rx_cb = &dev->rx_cb[idx];
rx_cb->rx_urb... | 0 | [
"CWE-415"
] | wireless-drivers | 8b51dc7291473093c821195c4b6af85fadedbc2f | 290,779,168,871,083,000,000,000,000,000,000,000,000 | 36 | rsi: fix a double free bug in rsi_91x_deinit()
`dev` (struct rsi_91x_usbdev *) field of adapter
(struct rsi_91x_usbdev *) is allocated and initialized in
`rsi_init_usb_interface`. If any error is detected in information
read from the device side, `rsi_init_usb_interface` will be
freed. However, in the higher level e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.