cve_id
stringlengths 13
16
| cwe_ids
stringclasses 400
values | cvss_vector
stringclasses 256
values | cvss_is_v3
float64 0
1
⌀ | repo_name
stringlengths 3
45
| commit_msg
stringlengths 3
19.3k
⌀ | commit_hash
stringlengths 7
40
| git_url
stringlengths 56
159
| file_path
stringlengths 4
100
| func_name
stringlengths 1
127
⌀ | func_before
stringlengths 10
83k
⌀ | abstract_func_before
stringlengths 10
68.1k
⌀ | func_graph_path_before
stringlengths 38
127
⌀ | func
stringlengths 8
83.3k
| abstract_func
stringlengths 8
68.4k
| func_graph_path
stringlengths 35
126
⌀ | diff_func
stringlengths 77
14.5k
⌀ | diff_line_info
stringlengths 42
5.91k
⌀ | is_vul
bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CVE-2018-9336
|
['CWE-415']
|
AV:L/AC:L/Au:N/C:P/I:P/A:P
| 0
|
OpenVPN/openvpn
|
Fix potential double-free() in Interactive Service (CVE-2018-9336)
Malformed input data on the service pipe towards the OpenVPN interactive
service (normally used by the OpenVPN GUI to request openvpn instances
from the service) can result in a double free() in the error handling code.
This usually only leads to a process crash (DoS by an unprivileged local
account) but since it could possibly lead to memory corruption if
happening while multiple other threads are active at the same time,
CVE-2018-9336 has been assigned to acknowledge this risk.
Fix by ensuring that sud->directory is set to NULL in GetStartUpData()
for all error cases (thus not being free()ed in FreeStartupData()).
Rewrite control flow to use explicit error label for error exit.
Discovered and reported by Jacob Baines <jbaines@tenable.com>.
CVE: 2018-9336
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Selva Nair <selva.nair@gmail.com>
Message-Id: <20180414072617.25075-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/search?l=mid&q=20180414072617.25075-1-gert@greenie.muc.de
Signed-off-by: Gert Doering <gert@greenie.muc.de>
|
1394192b210cb3c6624a7419bcf3ff966742e79b
|
https://github.com/OpenVPN/openvpn/commit/1394192b210cb3c6624a7419bcf3ff966742e79b
|
src/openvpnserv/interactive.c
|
RegisterDNS
| null | null | null |
static DWORD WINAPI
RegisterDNS(LPVOID unused)
{
DWORD err;
DWORD i;
WCHAR sys_path[MAX_PATH];
DWORD timeout = RDNS_TIMEOUT * 1000; /* in milliseconds */
/* default path of ipconfig command */
WCHAR ipcfg[MAX_PATH] = L"C:\\Windows\\system32\\ipconfig.exe";
struct
{
WCHAR *argv0;
WCHAR *cmdline;
DWORD timeout;
} cmds [] = {
{ ipcfg, L"ipconfig /flushdns", timeout },
{ ipcfg, L"ipconfig /registerdns", timeout },
};
int ncmds = sizeof(cmds) / sizeof(cmds[0]);
HANDLE wait_handles[2] = {rdns_semaphore, exit_event};
if (GetSystemDirectory(sys_path, MAX_PATH))
{
swprintf(ipcfg, MAX_PATH, L"%s\\%s", sys_path, L"ipconfig.exe");
ipcfg[MAX_PATH-1] = L'\0';
}
if (WaitForMultipleObjects(2, wait_handles, FALSE, timeout) == WAIT_OBJECT_0)
{
/* Semaphore locked */
for (i = 0; i < ncmds; ++i)
{
ExecCommand(cmds[i].argv0, cmds[i].cmdline, cmds[i].timeout);
}
err = 0;
if (!ReleaseSemaphore(rdns_semaphore, 1, NULL) )
{
err = MsgToEventLog(M_SYSERR, TEXT("RegisterDNS: Failed to release regsiter-dns semaphore:"));
}
}
else
{
MsgToEventLog(M_ERR, TEXT("RegisterDNS: Failed to lock register-dns semaphore"));
err = ERROR_SEM_TIMEOUT; /* Windows error code 0x79 */
}
return err;
}
|
static DWORD VAR_0
RegisterDNS(LPVOID VAR_1)
{
DWORD VAR_2;
DWORD VAR_3;
WCHAR VAR_4[VAR_5];
DWORD VAR_6 = VAR_7 * 1000; /* COMMENT_0 */
/* COMMENT_1 */
WCHAR VAR_8[VAR_5] = L"C:\\Windows\\system32\\ipconfig.exe";
struct
{
WCHAR *argv0;
WCHAR *cmdline;
DWORD timeout;
} VAR_9 [] = {
{ VAR_8, L"ipconfig /flushdns", VAR_6 },
{ VAR_8, L"ipconfig /registerdns", VAR_6 },
};
int VAR_10 = sizeof(cmds) / sizeof(cmds[0]);
HANDLE VAR_11[2] = {VAR_12, VAR_13};
if (GetSystemDirectory(VAR_4, VAR_5))
{
swprintf(VAR_8, VAR_5, L"%s\\%s", VAR_4, L"ipconfig.exe");
VAR_8[VAR_5-1] = L'\0';
}
if (WaitForMultipleObjects(2, VAR_11, FALSE, VAR_6) == VAR_14)
{
/* COMMENT_2 */
for (VAR_3 = 0; VAR_3 < VAR_10; ++VAR_3)
{
ExecCommand(cmds[VAR_3].argv0, cmds[VAR_3].cmdline, cmds[VAR_3].timeout);
}
VAR_2 = 0;
if (!ReleaseSemaphore(VAR_12, 1, NULL) )
{
VAR_2 = MsgToEventLog(VAR_15, TEXT("RegisterDNS: Failed to release regsiter-dns semaphore:"));
}
}
else
{
MsgToEventLog(VAR_16, TEXT("RegisterDNS: Failed to lock register-dns semaphore"));
VAR_2 = VAR_17; /* COMMENT_3 */
}
return VAR_2;
}
| null | null | null | false
|
CVE-2021-31916
|
['CWE-787']
|
AV:L/AC:L/Au:N/C:P/I:P/A:C
| 0
|
torvalds/linux
|
dm ioctl: fix out of bounds array access when no devices
If there are not any dm devices, we need to zero the "dev" argument in
the first structure dm_name_list. However, this can cause out of
bounds write, because the "needed" variable is zero and len may be
less than eight.
Fix this bug by reporting DM_BUFFER_FULL_FLAG if the result buffer is
too small to hold the "nl->dev" value.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
|
4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a
|
https://github.com/torvalds/linux/commit/4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a
|
drivers/md/dm-ioctl.c
|
invalid_str
| null | null | null |
static int invalid_str(char *str, void *end)
{
while ((void *) str < end)
if (!*str++)
return 0;
return -EINVAL;
}
|
static int invalid_str(char *VAR_0, void *VAR_1)
{
while ((void *) VAR_0 < VAR_1)
if (!*VAR_0++)
return 0;
return -VAR_2;
}
|
torvalds/linux/4edbe1d7bcffcd6269f3b5eb63f710393ff2ec7a/dm-ioctl.c/non_vul/19.json
| null | null | false
|
CVE-2018-11693
|
['CWE-125']
|
AV:N/AC:M/Au:N/C:P/I:N/A:P
| 0
|
sass/libsass
|
Fix handling of unclosed interpolant in url
Fixes #2661
|
af0e12cdf09d43dbd1fc11e3f64b244277cc1a1e
|
https://github.com/sass/libsass/commit/af0e12cdf09d43dbd1fc11e3f64b244277cc1a1e
|
src/parser.cpp
|
Parser::parse_almost_any_value
| null | null | null |
String_Schema_Obj Parser::parse_almost_any_value()
{
String_Schema_Obj schema = SASS_MEMORY_NEW(String_Schema, pstate);
if (*position == 0) return 0;
lex < spaces >(false);
Expression_Obj token = lex_almost_any_value_token();
if (!token) return 0;
schema->append(token);
if (*position == 0) {
schema->rtrim();
return schema.detach();
}
while ((token = lex_almost_any_value_token())) {
schema->append(token);
}
lex < css_whitespace >();
schema->rtrim();
return schema.detach();
}
|
String_Schema_Obj Parser::parse_almost_any_value()
{
String_Schema_Obj VAR_0 = SASS_MEMORY_NEW(VAR_1, VAR_2);
if (*VAR_3 == 0) return 0;
VAR_4 < spaces >(false);
Expression_Obj VAR_5 = lex_almost_any_value_token();
if (!VAR_5) return 0;
VAR_0->append(VAR_5);
if (*VAR_3 == 0) {
VAR_0->rtrim();
return VAR_0.detach();
}
while ((VAR_5 = lex_almost_any_value_token())) {
VAR_0->append(VAR_5);
}
VAR_4 < css_whitespace >();
VAR_0->rtrim();
return VAR_0.detach();
}
|
sass/libsass/af0e12cdf09d43dbd1fc11e3f64b244277cc1a1e/parser.cpp/non_vul/11.json
| null | null | false
|
CVE-2021-46914
|
['CWE-Other']
|
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
| 1
|
torvalds/linux
|
commit debb9df311582c83fe369baa35fa4b92e8a9c58a upstream.
pci_disable_device() called in __ixgbe_shutdown() decreases
dev->enable_cnt by 1. pci_enable_device_mem() which increases
dev->enable_cnt by 1, was removed from ixgbe_resume() in commit
6f82b2558735 ("ixgbe: use generic power management"). This caused
unbalanced increase/decrease. So add pci_enable_device_mem() back.
Fix the following call trace.
ixgbe 0000:17:00.1: disabling already-disabled device
Call Trace:
__ixgbe_shutdown+0x10a/0x1e0 [ixgbe]
ixgbe_suspend+0x32/0x70 [ixgbe]
pci_pm_suspend+0x87/0x160
? pci_pm_freeze+0xd0/0xd0
dpm_run_callback+0x42/0x170
__device_suspend+0x114/0x460
async_suspend+0x1f/0xa0
async_run_entry_fn+0x3c/0xf0
process_one_work+0x1dd/0x410
worker_thread+0x34/0x3f0
? cancel_delayed_work+0x90/0x90
kthread+0x14c/0x170
? kthread_park+0x90/0x90
ret_from_fork+0x1f/0x30
Fixes: 6f82b2558735 ("ixgbe: use generic power management")
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
be07581aacae7cd0a073afae8e8862032f794309
|
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=be07581aacae7cd0a073afae8e8862032f794309
|
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
|
ixgbe_irq_disable
| null | null | null |
static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
{
switch (adapter->hw.mac.type) {
case ixgbe_mac_82598EB:
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0);
break;
case ixgbe_mac_82599EB:
case ixgbe_mac_X540:
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
case ixgbe_mac_x550em_a:
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0);
IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0);
break;
default:
break;
}
IXGBE_WRITE_FLUSH(&adapter->hw);
if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
int vector;
for (vector = 0; vector < adapter->num_q_vectors; vector++)
synchronize_irq(adapter->msix_entries[vector].vector);
synchronize_irq(adapter->msix_entries[vector++].vector);
} else {
synchronize_irq(adapter->pdev->irq);
}
}
|
static inline void ixgbe_irq_disable(struct ixgbe_adapter *VAR_0)
{
switch (VAR_0->hw.mac.type) {
case VAR_1:
IXGBE_WRITE_REG(&VAR_0->hw, VAR_2, ~0);
break;
case VAR_3:
case VAR_4:
case VAR_5:
case VAR_6:
case VAR_7:
IXGBE_WRITE_REG(&VAR_0->hw, VAR_2, 0xFFFF0000);
IXGBE_WRITE_REG(&VAR_0->hw, IXGBE_EIMC_EX(0), ~0);
IXGBE_WRITE_REG(&VAR_0->hw, IXGBE_EIMC_EX(1), ~0);
break;
default:
break;
}
IXGBE_WRITE_FLUSH(&VAR_0->hw);
if (VAR_0->flags & VAR_8) {
int VAR_9;
for (VAR_9 = 0; VAR_9 < VAR_0->num_q_vectors; VAR_9++)
synchronize_irq(VAR_0->msix_entries[VAR_9].vector);
synchronize_irq(VAR_0->msix_entries[VAR_9++].vector);
} else {
synchronize_irq(VAR_0->pdev->irq);
}
}
|
torvalds/linux/be07581aacae7cd0a073afae8e8862032f794309/ixgbe_main.c/non_vul/22.json
| null | null | false
|
CVE-2018-14017
|
['CWE-125']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
radareorg/radare2
|
Fix #10498 - Fix crash in fuzzed java files (#10511)
|
e9ce0d64faf19fa4e9c260250fbdf25e3c11e152
|
https://github.com/radareorg/radare2/commit/e9ce0d64faf19fa4e9c260250fbdf25e3c11e152
|
shlr/java/class.c
|
r_bin_java_get_item_name_from_cp_item_list
| null | null | null |
R_API char *r_bin_java_get_item_name_from_cp_item_list(RList *cp_list, RBinJavaCPTypeObj *obj, int depth) {
/*
Given a constant poool object Class, FieldRef, MethodRef, or InterfaceMethodRef
return the actual descriptor string.
@param cp_list: RList of RBinJavaCPTypeObj *
@param obj object to look up the name for
@rvalue ut8* (user frees) or NULL
*/
if (obj == NULL || cp_list == NULL || depth < 0) {
return NULL;
}
switch (obj->tag) {
case R_BIN_JAVA_CP_NAMEANDTYPE:
return r_bin_java_get_utf8_from_cp_item_list (
cp_list, obj->info.cp_name_and_type.name_idx);
case R_BIN_JAVA_CP_CLASS:
return r_bin_java_get_utf8_from_cp_item_list (
cp_list, obj->info.cp_class.name_idx);
// XXX - Probably not good form, but they are the same memory structure
case R_BIN_JAVA_CP_FIELDREF:
case R_BIN_JAVA_CP_INTERFACEMETHOD_REF:
case R_BIN_JAVA_CP_METHODREF:
obj = r_bin_java_get_item_from_cp_item_list (
cp_list, obj->info.cp_method.name_and_type_idx);
return r_bin_java_get_item_name_from_cp_item_list (
cp_list, obj, depth - 1);
default:
return NULL;
case 0:
IFDBG eprintf("Invalid 0 tag in the constant pool\n");
return NULL;
}
return NULL;
}
|
R_API char *r_bin_java_get_item_name_from_cp_item_list(RList *VAR_0, RBinJavaCPTypeObj *VAR_1, int VAR_2) {
/* COMMENT_0 */
if (VAR_1 == NULL || VAR_0 == NULL || VAR_2 < 0) {
return NULL;
}
switch (VAR_1->tag) {
case VAR_3:
return r_bin_java_get_utf8_from_cp_item_list (
VAR_0, VAR_1->info.cp_name_and_type.name_idx);
case VAR_4:
return r_bin_java_get_utf8_from_cp_item_list (
VAR_0, VAR_1->info.cp_class.name_idx);
/* COMMENT_7 */
case VAR_5:
case VAR_6:
case VAR_7:
VAR_1 = r_bin_java_get_item_from_cp_item_list (
VAR_0, VAR_1->info.cp_method.name_and_type_idx);
return r_bin_java_get_item_name_from_cp_item_list (
VAR_0, VAR_1, VAR_2 - 1);
default:
return NULL;
case 0:
IFDBG VAR_8("Invalid 0 tag in the constant pool\n");
return NULL;
}
return NULL;
}
| null | null | null | false
|
CVE-2017-11569
|
['CWE-125']
|
AV:N/AC:M/Au:N/C:P/I:P/A:P
| 0
|
fontforge
|
parsettf.c: Fix out of bounds read condition on buffer
Closes #3093
|
7bfec47910293bf149b8debe44c6f3f788506092
|
https://github.com/fontforge/fontforge/commit/7bfec47910293bf149b8debe44c6f3f788506092
|
fontforge/parsettf.c
|
FindLangEntry
| null | null | null |
static char *FindLangEntry(struct ttfinfo *info, int id ) {
/* Look for an entry with string id */
/* we prefer english, if we can't find english look for something in ascii */
struct ttflangname *cur;
char *ret;
for ( cur=info->names; cur!=NULL && cur->lang!=0x409; cur=cur->next );
if ( cur!=NULL && cur->names[id]==NULL ) cur = NULL;
if ( cur==NULL )
for ( cur=info->names; cur!=NULL && (cur->lang&0xf)!=0x09; cur=cur->next );
if ( cur!=NULL && cur->names[id]==NULL ) cur = NULL;
if ( cur==NULL )
for ( cur=info->names; cur!=NULL && !is_ascii(cur->names[id]); cur=cur->next );
if ( cur==NULL )
for ( cur=info->names; cur!=NULL && cur->names[id]==NULL; cur=cur->next );
if ( cur==NULL )
return( NULL );
ret = copy(cur->names[id]);
return( ret );
}
|
static char *FindLangEntry(struct ttfinfo *VAR_0, int VAR_1 ) {
/* COMMENT_0 */
/* COMMENT_1 */
struct ttflangname *VAR_2;
char *VAR_3;
for ( VAR_2=VAR_0->names; VAR_2!=NULL && VAR_2->lang!=0x409; VAR_2=VAR_2->next );
if ( VAR_2!=NULL && VAR_2->names[VAR_1]==NULL ) VAR_2 = NULL;
if ( VAR_2==NULL )
for ( VAR_2=VAR_0->names; VAR_2!=NULL && (VAR_2->lang&0xf)!=0x09; VAR_2=VAR_2->next );
if ( VAR_2!=NULL && VAR_2->names[VAR_1]==NULL ) VAR_2 = NULL;
if ( VAR_2==NULL )
for ( VAR_2=VAR_0->names; VAR_2!=NULL && !is_ascii(VAR_2->names[VAR_1]); VAR_2=VAR_2->next );
if ( VAR_2==NULL )
for ( VAR_2=VAR_0->names; VAR_2!=NULL && VAR_2->names[VAR_1]==NULL; VAR_2=VAR_2->next );
if ( VAR_2==NULL )
return( NULL );
VAR_3 = copy(VAR_2->names[VAR_1]);
return( VAR_3 );
}
|
fontforge/7bfec47910293bf149b8debe44c6f3f788506092/parsettf.c/non_vul/72.json
| null | null | false
|
CVE-2017-20006
|
['CWE-787']
|
AV:N/AC:M/Au:N/C:P/I:P/A:P
| 0
|
aawc/unrar
|
5.6.1.4: Use in-memory archive instead of file IO
|
0ff832d31470471803b175cfff4e40c1b08ee779
|
https://github.com/aawc/unrar/commit/0ff832d31470471803b175cfff4e40c1b08ee779
|
archive.cpp
|
Archive::Tell
|
int64 Archive::Tell()
{
int64 QPos;
if (QOpen.Tell(&QPos))
return QPos;
return File::Tell();
}
|
int64 Archive::Tell()
{
int64 VAR_0;
if (VAR_1.Tell(&VAR_0))
return VAR_0;
return File::Tell();
}
|
aawc/unrar/0ff832d31470471803b175cfff4e40c1b08ee779/archive.cpp/vul/before/2.json
|
int64 Archive::Tell()
{
#ifdef USE_QOPEN
int64 QPos;
if (QOpen.Tell(&QPos))
return QPos;
#endif
#ifdef USE_ARCMEM
int64 APos;
if (ArcMem.Tell(&APos))
return APos;
#endif
return File::Tell();
}
|
int64 Archive::Tell()
{
#ifdef VAR_0
int64 VAR_1;
if (VAR_2.Tell(&VAR_1))
return VAR_1;
#endif
#ifdef VAR_3
int64 VAR_4;
if (VAR_5.Tell(&VAR_4))
return VAR_4;
#endif
return File::Tell();
}
|
aawc/unrar/0ff832d31470471803b175cfff4e40c1b08ee779/archive.cpp/vul/after/2.json
|
--- func_before
+++ func_after
@@ -1,7 +1,14 @@
int64 Archive::Tell()
{
+#ifdef USE_QOPEN
int64 QPos;
if (QOpen.Tell(&QPos))
return QPos;
+#endif
+#ifdef USE_ARCMEM
+ int64 APos;
+ if (ArcMem.Tell(&APos))
+ return APos;
+#endif
return File::Tell();
}
|
{'deleted_lines': [], 'added_lines': ['#ifdef USE_QOPEN', '#endif', '#ifdef USE_ARCMEM', ' int64 APos;', ' if (ArcMem.Tell(&APos))', ' return APos;', '#endif']}
| true
|
CVE-2021-41035
|
['CWE-440', 'CWE-250']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
eclipse-openj9/openj9
|
Throw IAE when an InterfaceHandle thunk finds a non-public method
The interface dispatch implemented by InterfaceHandle is supposed to
throw IllegalAccessError (IAE) when the dispatched callee is not public,
just like the dispatch performed by invokeinterface.
|
c6e0d9296ff9a3084965d83e207403de373c0bad
|
https://github.com/eclipse-openj9/openj9/commit/c6e0d9296ff9a3084965d83e207403de373c0bad
|
runtime/compiler/env/VMJ9.cpp
|
TR_J9VMBase::getOSRFrameHeaderSizeInBytes
| null | null | null |
UDATA TR_J9VMBase::getOSRFrameHeaderSizeInBytes() {return sizeof(J9OSRFrame);}
|
UDATA TR_J9VMBase::getOSRFrameHeaderSizeInBytes() {return sizeof(VAR_0);}
|
eclipse-openj9/openj9/c6e0d9296ff9a3084965d83e207403de373c0bad/VMJ9.cpp/non_vul/497.json
| null | null | false
|
CVE-2019-20052
|
['CWE-401']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
tbeu/matio
|
Fix memory leak
As reported by https://github.com/tbeu/matio/issues/131
|
a47b7cd3aca70e9a0bddf8146eb4ab0cbd19c2c3
|
https://github.com/tbeu/matio/commit/a47b7cd3aca70e9a0bddf8146eb4ab0cbd19c2c3
|
src/mat.c
|
SafeMul
| null | null | null |
int SafeMul(size_t* res, size_t a, size_t b)
{
if ( !psnip_safe_size_mul(res, a, b) ) {
*res = 0;
return 1;
}
return 0;
}
|
int SafeMul(size_t* VAR_0, size_t VAR_1, size_t VAR_2)
{
if ( !psnip_safe_size_mul(VAR_0, VAR_1, VAR_2) ) {
*VAR_0 = 0;
return 1;
}
return 0;
}
|
tbeu/matio/a47b7cd3aca70e9a0bddf8146eb4ab0cbd19c2c3/mat.c/non_vul/10.json
| null | null | false
|
CVE-2014-8559
|
['CWE-400']
|
AV:L/AC:L/Au:N/C:N/I:N/A:C
| 0
|
torvalds/linux
|
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
|
946e51f2bf37f1656916eb75bd0742ba33983c28
|
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?h=946e51f2bf37f1656916eb75bd0742ba33983c28
|
kernel/trace/trace_events.c
|
create_new_subsystem
| null | null | null |
static struct event_subsystem *
create_new_subsystem(const char *name)
{
struct event_subsystem *system;
/* need to create new entry */
system = kmalloc(sizeof(*system), GFP_KERNEL);
if (!system)
return NULL;
system->ref_count = 1;
/* Only allocate if dynamic (kprobes and modules) */
if (!core_kernel_data((unsigned long)name)) {
system->ref_count |= SYSTEM_FL_FREE_NAME;
system->name = kstrdup(name, GFP_KERNEL);
if (!system->name)
goto out_free;
} else
system->name = name;
system->filter = NULL;
system->filter = kzalloc(sizeof(struct event_filter), GFP_KERNEL);
if (!system->filter)
goto out_free;
list_add(&system->list, &event_subsystems);
return system;
out_free:
if (system->ref_count & SYSTEM_FL_FREE_NAME)
kfree(system->name);
kfree(system);
return NULL;
}
|
static struct event_subsystem *
create_new_subsystem(const char *VAR_0)
{
struct event_subsystem *VAR_1;
/* COMMENT_0 */
VAR_1 = kmalloc(sizeof(*VAR_1), VAR_2);
if (!VAR_1)
return NULL;
VAR_1->ref_count = 1;
/* COMMENT_1 */
if (!core_kernel_data((unsigned long)VAR_0)) {
VAR_1->ref_count |= VAR_3;
VAR_1->name = kstrdup(VAR_0, VAR_2);
if (!VAR_1->name)
goto out_free;
} else
VAR_1->name = VAR_0;
VAR_1->filter = NULL;
VAR_1->filter = kzalloc(sizeof(struct event_filter), VAR_2);
if (!VAR_1->filter)
goto out_free;
list_add(&VAR_1->list, &VAR_4);
return VAR_1;
out_free:
if (VAR_1->ref_count & VAR_3)
kfree(VAR_1->name);
kfree(VAR_1);
return NULL;
}
|
torvalds/linux/946e51f2bf37f1656916eb75bd0742ba33983c28/trace_events.c/non_vul/29.json
| null | null | false
|
CVE-2022-0695
|
['CWE-400']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
radareorg/radare2
|
Fix DoS in PE/QNX/DYLDCACHE/PSX parsers ##crash
* Reported by lazymio
* Reproducer: AAA4AAAAAB4=
|
634b886e84a5c568d243e744becc6b3223e089cf
|
https://github.com/radareorg/radare2/commit/634b886e84a5c568d243e744becc6b3223e089cf
|
libr/util/buf.c
|
r_buf_new_slice
| null | null | null |
R_API RBuffer *r_buf_new_slice(RBuffer *b, ut64 offset, ut64 size) {
struct buf_ref_user u = { 0 };
u.parent = b;
u.offset = offset;
u.size = size;
return new_buffer (R_BUFFER_REF, &u);
}
|
R_API RBuffer *r_buf_new_slice(RBuffer *VAR_0, ut64 VAR_1, ut64 VAR_2) {
struct buf_ref_user VAR_3 = { 0 };
VAR_3.parent = VAR_0;
VAR_3.offset = VAR_1;
VAR_3.size = VAR_2;
return new_buffer (VAR_4, &VAR_3);
}
| null | null | null | false
|
CVE-2019-3459
|
['CWE-125']
|
AV:A/AC:L/Au:N/C:P/I:N/A:N
| 0
|
torvalds/linux
|
The function l2cap_get_conf_opt will return L2CAP_CONF_OPT_SIZE + opt->len
as length value. The opt->len however is in control over the remote user
and can be used by an attacker to gain access beyond the bounds of the
actual packet.
To prevent any potential leak of heap memory, it is enough to check that
the resulting len calculation after calling l2cap_get_conf_opt is not
below zero. A well formed packet will always return >= 0 here and will
end with the length value being zero after the last option has been
parsed. In case of malformed packets messing with the opt->len field the
length value will become negative. If that is the case, then just abort
and ignore the option.
In case an attacker uses a too short opt->len value, then garbage will
be parsed, but that is protected by the unknown option handling and also
the option parameter size checks.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
|
7c9cbd0b5e38a1672fcd137894ace3b042dfbf69
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=7c9cbd0b5e38a1672fcd137894ace3b042dfbf69
|
net/bluetooth/l2cap_core.c
|
l2cap_chan_put
| null | null | null |
void l2cap_chan_put(struct l2cap_chan *c)
{
BT_DBG("chan %p orig refcnt %d", c, kref_read(&c->kref));
kref_put(&c->kref, l2cap_chan_destroy);
}
|
void l2cap_chan_put(struct l2cap_chan *VAR_0)
{
BT_DBG("chan %p orig refcnt %d", VAR_0, kref_read(&VAR_0->kref));
kref_put(&VAR_0->kref, VAR_1);
}
|
torvalds/linux/7c9cbd0b5e38a1672fcd137894ace3b042dfbf69/l2cap_core.c/non_vul/7.json
| null | null | false
|
CVE-2020-27671
|
['CWE-Other']
|
AV:L/AC:M/Au:N/C:C/I:C/A:C
| 0
|
xen-project/xen
|
IOMMU: hold page ref until after deferred TLB flush
When moving around a page via XENMAPSPACE_gmfn_range, deferring the TLB
flush for the "from" GFN range requires that the page remains allocated
to the guest until the TLB flush has actually occurred. Otherwise a
parallel hypercall to remove the page would only flush the TLB for the
GFN it has been moved to, but not the one is was mapped at originally.
This is part of XSA-346.
Fixes: cf95b2a9fd5a ("iommu: Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb... ")
Reported-by: Julien Grall <jgrall@amazon.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
|
5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
|
https://github.com/xen-project/xen/commit/5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5
|
xen/arch/arm/mm.c
|
xen_pt_update_entry
| null | null | null |
static int xen_pt_update_entry(mfn_t root, unsigned long virt,
mfn_t mfn, unsigned int flags)
{
int rc;
unsigned int level;
/* We only support 4KB mapping (i.e level 3) for now */
unsigned int target = 3;
lpae_t *table;
/*
* The intermediate page tables are read-only when the MFN is not valid
* and we are not populating page table.
* This means we either modify permissions or remove an entry.
*/
bool read_only = mfn_eq(mfn, INVALID_MFN) && !(flags & _PAGE_POPULATE);
lpae_t pte, *entry;
/* convenience aliases */
DECLARE_OFFSETS(offsets, (paddr_t)virt);
/* _PAGE_POPULATE and _PAGE_PRESENT should never be set together. */
ASSERT((flags & (_PAGE_POPULATE|_PAGE_PRESENT)) != (_PAGE_POPULATE|_PAGE_PRESENT));
table = xen_map_table(root);
for ( level = HYP_PT_ROOT_LEVEL; level < target; level++ )
{
rc = xen_pt_next_level(read_only, level, &table, offsets[level]);
if ( rc == XEN_TABLE_MAP_FAILED )
{
/*
* We are here because xen_pt_next_level has failed to map
* the intermediate page table (e.g the table does not exist
* and the pt is read-only). It is a valid case when
* removing a mapping as it may not exist in the page table.
* In this case, just ignore it.
*/
if ( flags & (_PAGE_PRESENT|_PAGE_POPULATE) )
{
mm_printk("%s: Unable to map level %u\n", __func__, level);
rc = -ENOENT;
goto out;
}
else
{
rc = 0;
goto out;
}
}
else if ( rc != XEN_TABLE_NORMAL_PAGE )
break;
}
if ( level != target )
{
mm_printk("%s: Shattering superpage is not supported\n", __func__);
rc = -EOPNOTSUPP;
goto out;
}
entry = table + offsets[level];
rc = -EINVAL;
if ( !xen_pt_check_entry(*entry, mfn, flags) )
goto out;
/* If we are only populating page-table, then we are done. */
rc = 0;
if ( flags & _PAGE_POPULATE )
goto out;
/* We are removing the page */
if ( !(flags & _PAGE_PRESENT) )
memset(&pte, 0x00, sizeof(pte));
else
{
/* We are inserting a mapping => Create new pte. */
if ( !mfn_eq(mfn, INVALID_MFN) )
{
pte = mfn_to_xen_entry(mfn, PAGE_AI_MASK(flags));
/* Third level entries set pte.pt.table = 1 */
pte.pt.table = 1;
}
else /* We are updating the permission => Copy the current pte. */
pte = *entry;
/* Set permission */
pte.pt.ro = PAGE_RO_MASK(flags);
pte.pt.xn = PAGE_XN_MASK(flags);
}
write_pte(entry, pte);
rc = 0;
out:
xen_unmap_table(table);
return rc;
}
|
static int xen_pt_update_entry(mfn_t VAR_0, unsigned long VAR_1,
mfn_t VAR_2, unsigned int VAR_3)
{
int VAR_4;
unsigned int VAR_5;
/* COMMENT_0 */
unsigned int VAR_6 = 3;
lpae_t *VAR_7;
/* COMMENT_1 */
bool VAR_8 = mfn_eq(VAR_2, VAR_9) && !(VAR_3 & VAR_10);
lpae_t VAR_11, *VAR_12;
/* COMMENT_6 */
DECLARE_OFFSETS(VAR_13, (paddr_t)VAR_1);
/* COMMENT_7 */
ASSERT((VAR_3 & (VAR_10|VAR_14)) != (VAR_10|VAR_14));
VAR_7 = xen_map_table(VAR_0);
for ( VAR_5 = VAR_15; VAR_5 < VAR_6; VAR_5++ )
{
VAR_4 = xen_pt_next_level(VAR_8, VAR_5, &VAR_7, VAR_13[VAR_5]);
if ( VAR_4 == VAR_16 )
{
/* COMMENT_8 */
if ( VAR_3 & (VAR_14|VAR_10) )
{
mm_printk("%s: Unable to map level %u\n", VAR_17, VAR_5);
VAR_4 = -VAR_18;
goto out;
}
else
{
VAR_4 = 0;
goto out;
}
}
else if ( VAR_4 != VAR_19 )
break;
}
if ( VAR_5 != VAR_6 )
{
mm_printk("%s: Shattering superpage is not supported\n", VAR_17);
VAR_4 = -VAR_20;
goto out;
}
VAR_12 = VAR_7 + VAR_13[VAR_5];
VAR_4 = -VAR_21;
if ( !xen_pt_check_entry(*VAR_12, VAR_2, VAR_3) )
goto out;
/* COMMENT_15 */
VAR_4 = 0;
if ( VAR_3 & VAR_10 )
goto out;
/* COMMENT_16 */
if ( !(VAR_3 & VAR_14) )
memset(&VAR_11, 0x00, sizeof(VAR_11));
else
{
/* COMMENT_17 */
if ( !mfn_eq(VAR_2, VAR_9) )
{
VAR_11 = mfn_to_xen_entry(VAR_2, PAGE_AI_MASK(VAR_3));
/* COMMENT_18 */
VAR_11.pt.table = 1;
}
else /* COMMENT_19 */
VAR_11 = *VAR_12;
/* COMMENT_20 */
VAR_11.pt.ro = PAGE_RO_MASK(VAR_3);
VAR_11.pt.xn = PAGE_XN_MASK(VAR_3);
}
write_pte(VAR_12, VAR_11);
VAR_4 = 0;
out:
xen_unmap_table(VAR_7);
return VAR_4;
}
|
xen-project/xen/5777a3742d88ff1c0ebc626ceb4fd47f9b3dc6d5/mm.c/non_vul/1.json
| null | null | false
|
CVE-2017-0861
|
['CWE-416']
|
AV:L/AC:L/Au:N/C:P/I:P/A:P
| 0
|
torvalds/linux
|
Drivers can implement 'struct snd_pcm_ops.ioctl' to handle some requests
from ALSA PCM core. These requests are internal purpose in kernel land.
Usually common set of operations are used for it.
SNDRV_PCM_IOCTL1_INFO is one of the requests. According to code comment,
it has been obsoleted in the old days.
We can see old releases in ftp.alsa-project.org. The command was firstly
introduced in v0.5.0 release as SND_PCM_IOCTL1_INFO, to allow drivers to
fill data of 'struct snd_pcm_channel_info' type. In v0.9.0 release,
this was obsoleted by the other commands for ioctl(2) such as
SNDRV_PCM_IOCTL_CHANNEL_INFO.
This commit removes the long-abandoned command, bye.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
e11f0f90a626f93899687b1cc909ee37dd6c5809
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=e11f0f90a626f93899687b1cc909ee37dd6c5809
|
sound/core/pcm_lib.c
|
snd_pcm_hw_rule_ranges
| null | null | null |
static int snd_pcm_hw_rule_ranges(struct snd_pcm_hw_params *params,
struct snd_pcm_hw_rule *rule)
{
struct snd_pcm_hw_constraint_ranges *r = rule->private;
return snd_interval_ranges(hw_param_interval(params, rule->var),
r->count, r->ranges, r->mask);
}
|
static int snd_pcm_hw_rule_ranges(struct snd_pcm_hw_params *VAR_0,
struct snd_pcm_hw_rule *VAR_1)
{
struct snd_pcm_hw_constraint_ranges *VAR_2 = VAR_1->private;
return snd_interval_ranges(hw_param_interval(VAR_0, VAR_1->var),
VAR_2->count, VAR_2->ranges, VAR_2->mask);
}
|
torvalds/linux/e11f0f90a626f93899687b1cc909ee37dd6c5809/pcm_lib.c/non_vul/48.json
| null | null | false
|
CVE-2017-7395
|
['CWE-190']
|
AV:N/AC:L/Au:S/C:N/I:N/A:P
| 0
|
TigerVNC/tigervnc
|
Fix crash from integer overflow in SMsgReader::readClientCutText
The length sent by client is U32, but is converted into int. If it was bigger than 0x7fffffff the resulting int is negative, it passes the check against maxCutText and later throws std::bad_alloc from CharArray which takes down the whole server.
All the Streaming API deals with lengths in ints, so we can't tell it to skip that big amount of data. And it is not realistic to expect more than 2GB of clipboard data anyway. So lets just throw rdr::Exception that will disconnect this client and keep the server alive.
|
bf3bdac082978ca32895a4b6a123016094905689
|
https://github.com/TigerVNC/tigervnc/commit/bf3bdac082978ca32895a4b6a123016094905689
|
common/rfb/SMsgReader.cxx
|
SMsgReader::readFence
| null | null | null |
void SMsgReader::readFence()
{
rdr::U32 flags;
rdr::U8 len;
char data[64];
is->skip(3);
flags = is->readU32();
len = is->readU8();
if (len > sizeof(data)) {
fprintf(stderr, "Ignoring fence with too large payload\n");
is->skip(len);
return;
}
is->readBytes(data, len);
handler->fence(flags, len, data);
}
|
void SMsgReader::readFence()
{
rdr::U32 VAR_0;
rdr::U8 VAR_1;
char VAR_2[64];
VAR_3->skip(3);
VAR_0 = VAR_3->readU32();
VAR_1 = VAR_3->readU8();
if (VAR_1 > sizeof(VAR_2)) {
fprintf(VAR_4, "Ignoring fence with too large payload\n");
VAR_3->skip(VAR_1);
return;
}
VAR_3->readBytes(VAR_2, VAR_1);
VAR_5->fence(VAR_0, VAR_1, VAR_2);
}
|
TigerVNC/tigervnc/bf3bdac082978ca32895a4b6a123016094905689/SMsgReader.cxx/non_vul/6.json
| null | null | false
|
CVE-2023-5377
|
['CWE-125']
|
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
| 1
|
gpac
|
fixed #2606
|
8e9d6b38c036a97020c462ad48e1132e0ddc57ce
|
https://github.com/gpac/gpac/commit/8e9d6b38c036a97020c462ad48e1132e0ddc57ce
|
src/isomedia/box_code_base.c
|
rtp_hnti_box_del
| null | null | null |
void rtp_hnti_box_del(GF_Box *s)
{
GF_RTPBox *ptr = (GF_RTPBox *)s;
if (ptr->sdpText) gf_free(ptr->sdpText);
gf_free(ptr);
}
|
void rtp_hnti_box_del(GF_Box *VAR_0)
{
GF_RTPBox *VAR_1 = (GF_RTPBox *)VAR_0;
if (VAR_1->sdpText) gf_free(VAR_1->sdpText);
gf_free(VAR_1);
}
|
gpac/8e9d6b38c036a97020c462ad48e1132e0ddc57ce/box_code_base.c/non_vul/600.json
| null | null | false
|
CVE-2021-34141
|
['CWE-697']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
numpy
|
DEP: Remove deprecated numeric style dtype strings (#19539)
Finishes the deprecation, and effectively closes gh-18993
* Insecure String Comparison
* Finished Deprecations
* Breaks numpy types
* Removed elements in dep_tps
* Delete Typecode Comment
* Deleted for loop
* Fixed 80 characters or more issue
* Expired Release Note
* Updated Release Note
* Update numpy/core/numerictypes.py
* Update numpy/core/tests/test_deprecations.py
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
eeef9d4646103c3b1afd3085f1393f2b3f9575b2
|
https://github.com/numpy/numpy/commit/eeef9d4646103c3b1afd3085f1393f2b3f9575b2
|
numpy/core/src/multiarray/descriptor.c
|
arraydescr_protocol_typestr_get
| null | null | null |
NPY_NO_EXPORT PyObject *
arraydescr_protocol_typestr_get(PyArray_Descr *self, void *NPY_UNUSED(ignored))
{
char basic_ = self->kind;
char endian = self->byteorder;
int size = self->elsize;
PyObject *ret;
if (endian == '=') {
endian = '<';
if (!PyArray_IsNativeByteOrder(endian)) {
endian = '>';
}
}
if (self->type_num == NPY_UNICODE) {
size >>= 2;
}
if (self->type_num == NPY_OBJECT) {
ret = PyUnicode_FromFormat("%c%c", endian, basic_);
}
else {
ret = PyUnicode_FromFormat("%c%c%d", endian, basic_, size);
}
if (ret == NULL) {
return NULL;
}
if (PyDataType_ISDATETIME(self)) {
PyArray_DatetimeMetaData *meta;
meta = get_datetime_metadata_from_dtype(self);
if (meta == NULL) {
Py_DECREF(ret);
return NULL;
}
PyObject *umeta = metastr_to_unicode(meta, 0);
if (umeta == NULL) {
Py_DECREF(ret);
return NULL;
}
Py_SETREF(ret, PyUnicode_Concat(ret, umeta));
Py_DECREF(umeta);
}
return ret;
}
|
NPY_NO_EXPORT VAR_0 *
arraydescr_protocol_typestr_get(PyArray_Descr *VAR_1, void *NPY_UNUSED(ignored))
{
char VAR_2 = VAR_1->kind;
char VAR_3 = VAR_1->byteorder;
int VAR_4 = VAR_1->elsize;
PyObject *VAR_5;
if (VAR_3 == '=') {
VAR_3 = '<';
if (!PyArray_IsNativeByteOrder(VAR_3)) {
VAR_3 = '>';
}
}
if (VAR_1->type_num == VAR_6) {
VAR_4 >>= 2;
}
if (VAR_1->type_num == VAR_7) {
VAR_5 = PyUnicode_FromFormat("%c%c", VAR_3, VAR_2);
}
else {
VAR_5 = PyUnicode_FromFormat("%c%c%d", VAR_3, VAR_2, VAR_4);
}
if (VAR_5 == NULL) {
return NULL;
}
if (PyDataType_ISDATETIME(VAR_1)) {
PyArray_DatetimeMetaData *VAR_8;
VAR_8 = get_datetime_metadata_from_dtype(VAR_1);
if (VAR_8 == NULL) {
Py_DECREF(VAR_5);
return NULL;
}
PyObject *VAR_9 = metastr_to_unicode(VAR_8, 0);
if (VAR_9 == NULL) {
Py_DECREF(VAR_5);
return NULL;
}
Py_SETREF(VAR_5, PyUnicode_Concat(VAR_5, VAR_9));
Py_DECREF(VAR_9);
}
return VAR_5;
}
| null | null | null | false
|
CVE-2017-6903
|
['CWE-Other']
|
AV:N/AC:M/Au:N/C:C/I:C/A:C
| 0
|
iortcw
|
All: Merge some file writing extension checks
|
11a83410153756ae350a82ed41b08d128ff7f998
|
https://github.com/iortcw/iortcw/commit/11a83410153756ae350a82ed41b08d128ff7f998
|
MP/code/qcommon/common.c
|
Z_LogZoneHeap
| null | null | null |
void Z_LogZoneHeap( memzone_t *zone, char *name ) {
#ifdef ZONE_DEBUG
char dump[32], *ptr;
int i, j;
#endif
memblock_t *block;
char buf[4096];
int size, allocSize, numBlocks;
if ( !logfile || !FS_Initialized() ) {
return;
}
size = numBlocks = 0;
#ifdef ZONE_DEBUG
allocSize = 0;
#endif
Com_sprintf( buf, sizeof( buf ), "\r\n================\r\n%s log\r\n================\r\n", name );
FS_Write( buf, strlen( buf ), logfile );
for ( block = zone->blocklist.next ; block->next != &zone->blocklist; block = block->next ) {
if ( block->tag ) {
#ifdef ZONE_DEBUG
ptr = ( (char *) block ) + sizeof( memblock_t );
j = 0;
for ( i = 0; i < 20 && i < block->d.allocSize; i++ ) {
if ( ptr[i] >= 32 && ptr[i] < 127 ) {
dump[j++] = ptr[i];
} else {
dump[j++] = '_';
}
}
dump[j] = '\0';
Com_sprintf( buf, sizeof( buf ), "size = %8d: %s, line: %d (%s) [%s]\r\n", block->d.allocSize, block->d.file, block->d.line, block->d.label, dump );
FS_Write( buf, strlen( buf ), logfile );
allocSize += block->d.allocSize;
#endif
size += block->size;
numBlocks++;
}
}
#ifdef ZONE_DEBUG
// subtract debug memory
size -= numBlocks * sizeof( zonedebug_t );
#else
allocSize = numBlocks * sizeof( memblock_t ); // + 32 bit alignment
#endif
Com_sprintf( buf, sizeof( buf ), "%d %s memory in %d blocks\r\n", size, name, numBlocks );
FS_Write( buf, strlen( buf ), logfile );
Com_sprintf( buf, sizeof( buf ), "%d %s memory overhead\r\n", size - allocSize, name );
FS_Write( buf, strlen( buf ), logfile );
}
|
void Z_LogZoneHeap( memzone_t *VAR_0, char *VAR_1 ) {
#ifdef VAR_2
char VAR_3[32], *VAR_4;
int VAR_5, VAR_6;
#endif
memblock_t *VAR_7;
char VAR_8[4096];
int VAR_9, VAR_10, VAR_11;
if ( !VAR_12 || !FS_Initialized() ) {
return;
}
VAR_9 = VAR_11 = 0;
#ifdef VAR_2
VAR_10 = 0;
#endif
Com_sprintf( VAR_8, sizeof( VAR_8 ), "\r\n================\r\n%s log\r\n================\r\n", VAR_1 );
FS_Write( VAR_8, strlen( VAR_8 ), VAR_12 );
for ( VAR_7 = VAR_0->blocklist.next ; VAR_7->next != &VAR_0->blocklist; VAR_7 = VAR_7->next ) {
if ( VAR_7->tag ) {
#ifdef VAR_2
VAR_4 = ( (char *) VAR_7 ) + sizeof( memblock_t );
VAR_6 = 0;
for ( VAR_5 = 0; VAR_5 < 20 && VAR_5 < VAR_7->d.allocSize; VAR_5++ ) {
if ( VAR_4[VAR_5] >= 32 && VAR_4[VAR_5] < 127 ) {
VAR_3[VAR_6++] = VAR_4[VAR_5];
} else {
VAR_3[VAR_6++] = '_';
}
}
VAR_3[VAR_6] = '\0';
Com_sprintf( VAR_8, sizeof( VAR_8 ), "size = %8d: %s, line: %d (%s) [%s]\r\n", VAR_7->d.allocSize, VAR_7->d.file, VAR_7->d.line, VAR_7->d.label, VAR_3 );
FS_Write( VAR_8, strlen( VAR_8 ), VAR_12 );
VAR_10 += VAR_7->d.allocSize;
#endif
VAR_9 += VAR_7->size;
VAR_11++;
}
}
#ifdef VAR_2
/* COMMENT_0 */
VAR_9 -= VAR_11 * sizeof( VAR_13 );
#else
VAR_10 = VAR_11 * sizeof( memblock_t ); /* COMMENT_1 */
#endif
Com_sprintf( VAR_8, sizeof( VAR_8 ), "%d %s memory in %d blocks\r\n", VAR_9, VAR_1, VAR_11 );
FS_Write( VAR_8, strlen( VAR_8 ), VAR_12 );
Com_sprintf( VAR_8, sizeof( VAR_8 ), "%d %s memory overhead\r\n", VAR_9 - VAR_10, VAR_1 );
FS_Write( VAR_8, strlen( VAR_8 ), VAR_12 );
}
|
iortcw/11a83410153756ae350a82ed41b08d128ff7f998/common.c/non_vul/43.json
| null | null | false
|
CVE-2021-21261
|
['CWE-74']
|
AV:L/AC:L/Au:N/C:C/I:C/A:C
| 0
|
flatpak
|
portal: Do not use caller-supplied variables in environment
If the caller specifies a variable that can be used to inject arbitrary
code into processes, we must not allow it to enter the environment
block used to run `flatpak run`, which runs unsandboxed.
This change requires the previous commit "context: Add --env-fd option",
which adds infrastructure used here.
To be secure, this change also requires the previous commit
"run: Convert all environment variables into bwrap arguments", which
protects a non-setuid bwrap(1) from the same attack.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: https://github.com/flatpak/flatpak/security/advisories/GHSA-4ppf-fxf6-vxg2
|
cc1401043c075268ecc652eac557ef8076b5eaba
|
https://github.com/flatpak/flatpak/commit/cc1401043c075268ecc652eac557ef8076b5eaba
|
portal/flatpak-portal.c
|
update_monitor_get_data
| null | null | null |
static UpdateMonitorData *
update_monitor_get_data (PortalFlatpakUpdateMonitor *monitor)
{
return (UpdateMonitorData *)g_object_get_data (G_OBJECT (monitor), "update-monitor-data");
}
|
static UpdateMonitorData *
update_monitor_get_data (PortalFlatpakUpdateMonitor *VAR_0)
{
return (UpdateMonitorData *)g_object_get_data (G_OBJECT (VAR_0), "update-monitor-data");
}
|
flatpak/cc1401043c075268ecc652eac557ef8076b5eaba/flatpak-portal.c/non_vul/46.json
| null | null | false
|
CVE-2023-25193
|
['CWE-770']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| 1
|
harfbuzz
|
[layout] Limit how far we skip when looking back
See comments.
|
85be877925ddbf34f74a1229f3ca1716bb6170dc
|
https://github.com/harfbuzz/harfbuzz/commit/85be877925ddbf34f74a1229f3ca1716bb6170dc
|
src/hb-ot-layout-gsubgpos.hh
|
pop_cur_done_glyphs
| null | null | null |
bool pop_cur_done_glyphs ()
{
if (!active_glyphs_stack)
return false;
active_glyphs_stack.pop ();
return true;
}
|
bool pop_cur_done_glyphs ()
{
if (!VAR_0)
return false;
VAR_0.pop ();
return true;
}
|
harfbuzz/85be877925ddbf34f74a1229f3ca1716bb6170dc/hb-ot-layout-gsubgpos.hh/non_vul/20.json
| null | null | false
|
CVE-2013-2905
|
['CWE-264']
|
AV:N/AC:L/Au:N/C:P/I:N/A:N
| 0
|
chromium
|
Posix: fix named SHM mappings permissions.
Make sure that named mappings in /dev/shm/ aren't created with
broad permissions.
BUG=254159
R=mark@chromium.org, markus@chromium.org
Review URL: https://codereview.chromium.org/17779002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209814 0039d316-1c4b-4281-b951-d872f2087c98
|
afb848acb43ba316097ab4fddfa38dbd80bc6a71
|
https://github.com/chromium/chromium/commit/afb848acb43ba316097ab4fddfa38dbd80bc6a71
|
base/memory/shared_memory_posix.cc
|
SharedMemory::SharedMemory
| null | null | null |
SharedMemory::SharedMemory(SharedMemoryHandle handle, bool read_only,
ProcessHandle process)
: mapped_file_(handle.fd),
inode_(0),
mapped_size_(0),
memory_(NULL),
read_only_(read_only),
requested_size_(0) {
// We don't handle this case yet (note the ignored parameter); let's die if
// someone comes calling.
NOTREACHED();
}
|
SharedMemory::SharedMemory(SharedMemoryHandle VAR_0, bool VAR_1,
ProcessHandle VAR_2)
: mapped_file_(VAR_0.fd),
inode_(0),
mapped_size_(0),
memory_(NULL),
read_only_(VAR_1),
requested_size_(0) {
/* COMMENT_0 */
/* COMMENT_1 */
NOTREACHED();
}
|
chromium/afb848acb43ba316097ab4fddfa38dbd80bc6a71/shared_memory_posix.cc/non_vul/0.json
| null | null | false
|
CVE-2016-9815
|
['CWE-284']
|
AV:L/AC:L/Au:N/C:N/I:N/A:C
| 0
|
xen-project/xen
|
arm: crash the guest when it traps on external abort
If we spot a data or prefetch abort bearing the ESR_EL2.EA bit set, we
know that this is an external abort, and that should crash the guest.
This is part of XSA-201.
Signed-off-by: Wei Chen <Wei.Chen@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Julien Grall <Julien.Grall@arm.com>
|
f8c6a9334b251d2e78b0873a71b4d369908fb123
|
https://github.com/xen-project/xen/commit/f8c6a9334b251d2e78b0873a71b4d369908fb123
|
xen/arch/arm/traps.c
|
mode_string
| null | null | null |
static const char *mode_string(uint32_t cpsr)
{
uint32_t mode;
static const char *mode_strings[] = {
[PSR_MODE_USR] = "32-bit Guest USR",
[PSR_MODE_FIQ] = "32-bit Guest FIQ",
[PSR_MODE_IRQ] = "32-bit Guest IRQ",
[PSR_MODE_SVC] = "32-bit Guest SVC",
[PSR_MODE_MON] = "32-bit Monitor",
[PSR_MODE_ABT] = "32-bit Guest ABT",
[PSR_MODE_HYP] = "Hypervisor",
[PSR_MODE_UND] = "32-bit Guest UND",
[PSR_MODE_SYS] = "32-bit Guest SYS",
#ifdef CONFIG_ARM_64
[PSR_MODE_EL3h] = "64-bit EL3h (Monitor, handler)",
[PSR_MODE_EL3t] = "64-bit EL3t (Monitor, thread)",
[PSR_MODE_EL2h] = "64-bit EL2h (Hypervisor, handler)",
[PSR_MODE_EL2t] = "64-bit EL2t (Hypervisor, thread)",
[PSR_MODE_EL1h] = "64-bit EL1h (Guest Kernel, handler)",
[PSR_MODE_EL1t] = "64-bit EL1t (Guest Kernel, thread)",
[PSR_MODE_EL0t] = "64-bit EL0t (Guest User)",
#endif
};
mode = cpsr & PSR_MODE_MASK;
if ( mode > ARRAY_SIZE(mode_strings) )
return "Unknown";
return mode_strings[mode] ? : "Unknown";
}
|
static const char *mode_string(uint32_t VAR_0)
{
uint32_t VAR_1;
static const char *VAR_2[] = {
[VAR_3] = "32-bit Guest USR",
[VAR_4] = "32-bit Guest FIQ",
[VAR_5] = "32-bit Guest IRQ",
[VAR_6] = "32-bit Guest SVC",
[VAR_7] = "32-bit Monitor",
[VAR_8] = "32-bit Guest ABT",
[VAR_9] = "Hypervisor",
[VAR_10] = "32-bit Guest UND",
[VAR_11] = "32-bit Guest SYS",
#ifdef VAR_12
[VAR_13] = "64-bit EL3h (Monitor, handler)",
[VAR_14] = "64-bit EL3t (Monitor, thread)",
[VAR_15] = "64-bit EL2h (Hypervisor, handler)",
[VAR_16] = "64-bit EL2t (Hypervisor, thread)",
[VAR_17] = "64-bit EL1h (Guest Kernel, handler)",
[VAR_18] = "64-bit EL1t (Guest Kernel, thread)",
[VAR_19] = "64-bit EL0t (Guest User)",
#endif
};
VAR_1 = VAR_0 & VAR_20;
if ( VAR_1 > ARRAY_SIZE(VAR_2) )
return "Unknown";
return VAR_2[VAR_1] ?VAR_21 : "Unknown";
}
|
xen-project/xen/f8c6a9334b251d2e78b0873a71b4d369908fb123/traps.c/non_vul/8.json
| null | null | false
|
CVE-2017-6355
|
['CWE-190']
|
AV:L/AC:L/Au:N/C:N/I:N/A:P
| 0
|
virglrenderer
|
As the 'pkt_length' and 'offlen' can be malicious from guest,
the vrend_create_shader function has an integer overflow, this
will make the next 'memcpy' oob access. This patch avoid this.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
93761787b29f37fa627dea9082cdfc1a1ec608d6
|
https://cgit.freedesktop.org/virglrenderer/commit/?id=93761787b29f37fa627dea9082cdfc1a1ec608d6
|
src/vrend_renderer.c
|
vrend_object_bind_blend
| null | null | null |
void vrend_object_bind_blend(struct vrend_context *ctx,
uint32_t handle)
{
struct pipe_blend_state *state;
if (handle == 0) {
memset(&ctx->sub->blend_state, 0, sizeof(ctx->sub->blend_state));
vrend_blend_enable(ctx, false);
return;
}
state = vrend_object_lookup(ctx->sub->object_hash, handle, VIRGL_OBJECT_BLEND);
if (!state) {
report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_HANDLE, handle);
return;
}
ctx->sub->blend_state = *state;
vrend_hw_emit_blend(ctx, &ctx->sub->blend_state);
}
|
void vrend_object_bind_blend(struct vrend_context *VAR_0,
uint32_t VAR_1)
{
struct pipe_blend_state *VAR_2;
if (VAR_1 == 0) {
memset(&VAR_0->sub->blend_state, 0, sizeof(VAR_0->sub->blend_state));
vrend_blend_enable(VAR_0, false);
return;
}
VAR_2 = vrend_object_lookup(VAR_0->sub->object_hash, VAR_1, VAR_3);
if (!VAR_2) {
report_context_error(VAR_0, VAR_4, VAR_1);
return;
}
VAR_0->sub->blend_state = *VAR_2;
vrend_hw_emit_blend(VAR_0, &VAR_0->sub->blend_state);
}
|
virglrenderer/93761787b29f37fa627dea9082cdfc1a1ec608d6/vrend_renderer.c/non_vul/93.json
| null | null | false
|
CVE-2017-9520
|
['CWE-416']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
radareorg/radare2
|
Fix #7698 - UAF in r_config_set when loading a dex
|
f85bc674b2a2256a364fe796351bc1971e106005
|
https://github.com/radareorg/radare2/commit/f85bc674b2a2256a364fe796351bc1971e106005
|
libr/config/config.c
|
r_config_save_char
| null | null | null |
R_API bool r_config_save_char(RConfigHold *h, ...) {
va_list ap;
char *key;
if (!h->list_char) {
h->list_char = r_list_newf ((RListFree) free);
if (!h->list_char) {
return false;
}
}
va_start (ap, h);
while ((key = va_arg (ap, char *))) {
RConfigHoldChar *hc = R_NEW0 (RConfigHoldChar);
if (!hc) {
continue;
}
hc->key = key;
hc->value = r_config_get (h->cfg, key);
r_list_append (h->list_char, hc);
}
va_end (ap);
return true;
}
|
R_API bool r_config_save_char(RConfigHold *VAR_0, ...) {
va_list VAR_1;
char *VAR_2;
if (!VAR_0->list_char) {
VAR_0->list_char = r_list_newf ((RListFree) VAR_3);
if (!VAR_0->list_char) {
return false;
}
}
va_start (VAR_1, VAR_0);
while ((VAR_2 = va_arg (VAR_1, char *))) {
RConfigHoldChar *VAR_4 = R_NEW0 (RConfigHoldChar);
if (!VAR_4) {
continue;
}
VAR_4->key = VAR_2;
VAR_4->value = r_config_get (VAR_0->cfg, VAR_2);
r_list_append (VAR_0->list_char, VAR_4);
}
va_end (VAR_1);
return true;
}
| null | null | null | false
|
CVE-2022-27147
|
['CWE-416']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
gpac
|
fixed #2109
|
9723dd0955894f2cb7be13b94cf7a47f2754b893
|
https://github.com/gpac/gpac/commit/9723dd0955894f2cb7be13b94cf7a47f2754b893
|
src/scenegraph/base_scenegraph.c
|
insert_node_def
| null | null | null |
static GFINLINE void insert_node_def(GF_SceneGraph *sg, GF_Node *def, u32 ID, const char *name)
{
NodeIDedItem *reg_node, *cur;
reg_node = (NodeIDedItem *) gf_malloc(sizeof(NodeIDedItem));
reg_node->node = def;
reg_node->NodeID = ID;
reg_node->NodeName = name ? gf_strdup(name) : NULL;
if (!sg->id_node) {
sg->id_node = reg_node;
sg->id_node_last = sg->id_node;
reg_node->next = NULL;
} else if (sg->id_node_last->NodeID < ID) {
sg->id_node_last->next = reg_node;
sg->id_node_last = reg_node;
reg_node->next = NULL;
} else if (sg->id_node->NodeID>ID) {
reg_node->next = sg->id_node;
sg->id_node = reg_node;
} else {
cur = sg->id_node;
while (cur->next) {
if (cur->next->NodeID>ID) {
reg_node->next = cur->next;
cur->next = reg_node;
return;
}
cur = cur->next;
}
cur->next = reg_node;
sg->id_node_last = reg_node;
reg_node->next = NULL;
}
}
|
static GFINLINE VAR_0 insert_node_def(GF_SceneGraph *VAR_1, GF_Node *VAR_2, u32 VAR_3, const char *VAR_4)
{
NodeIDedItem *VAR_5, *VAR_6;
VAR_5 = (NodeIDedItem *) gf_malloc(sizeof(NodeIDedItem));
VAR_5->node = VAR_2;
VAR_5->NodeID = VAR_3;
VAR_5->NodeName = VAR_4 ? gf_strdup(VAR_4) : NULL;
if (!VAR_1->id_node) {
VAR_1->id_node = VAR_5;
VAR_1->id_node_last = VAR_1->id_node;
VAR_5->next = NULL;
} else if (VAR_1->id_node_last->NodeID < VAR_3) {
VAR_1->id_node_last->next = VAR_5;
VAR_1->id_node_last = VAR_5;
VAR_5->next = NULL;
} else if (VAR_1->id_node->NodeID>VAR_3) {
VAR_5->next = VAR_1->id_node;
VAR_1->id_node = VAR_5;
} else {
VAR_6 = VAR_1->id_node;
while (VAR_6->next) {
if (VAR_6->next->NodeID>VAR_3) {
VAR_5->next = VAR_6->next;
VAR_6->next = VAR_5;
return;
}
VAR_6 = VAR_6->next;
}
VAR_6->next = VAR_5;
VAR_1->id_node_last = VAR_5;
VAR_5->next = NULL;
}
}
| null | null | null | false
|
CVE-2015-6563
|
['CWE-20']
|
AV:L/AC:M/Au:N/C:N/I:P/A:N
| 0
|
openssh/openssh-portable
|
Don't resend username to PAM; it already has it.
Pointed out by Moritz Jodeit; ok dtucker@
|
d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
|
https://github.com/openssh/openssh-portable/commit/d4697fe9a28dab7255c60433e4dd23cf7fce8a8b
|
monitor.c
|
monitor_permit
| null | null | null |
static void
monitor_permit(struct mon_table *ent, enum monitor_reqtype type, int permit)
{
while (ent->f != NULL) {
if (ent->type == type) {
ent->flags &= ~MON_PERMIT;
ent->flags |= permit ? MON_PERMIT : 0;
return;
}
ent++;
}
}
|
static void
monitor_permit(struct mon_table *VAR_0, enum monitor_reqtype VAR_1, int VAR_2)
{
while (VAR_0->f != NULL) {
if (VAR_0->type == VAR_1) {
VAR_0->flags &= ~VAR_3;
VAR_0->flags |= VAR_2 ? VAR_3 : 0;
return;
}
VAR_0++;
}
}
|
openssh/openssh-portable/d4697fe9a28dab7255c60433e4dd23cf7fce8a8b/monitor.c/non_vul/7.json
| null | null | false
|
CVE-2017-12995
|
['CWE-835']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
the-tcpdump-group/tcpdump
|
CVE-2017-12995/Check for DNS compression pointers that don't point backwards.
This is what BIND 9.11.0-P2 does; it not only detects pointers that
loop, as "point backwards" means "point before anything we've processed
so far, including what we're processing right now", so the pointer can't
point to itself (as that's what we're processing right now).
This fixes an infinite loop discovered by Forcepoint's security
researchers Otto Airamo & Antti Levomäki.
Add a test using the capture file supplied by the reporter(s).
Also, add some infinite-pointer-loop captures.
More checks should be done. We might, for example, want to make sure
the upper 2 bits of the label length/pointer byte are 00 or 11, and that
if we encounter a pointer and jump backwards to what we think is a label
the label ends before the beginning of the last label we processed, to
make sure the pointer doesn't point backwards into the *middle* of a
label, and also make sure the entire name is <= 255 bytes long.
|
3a76fd7c95fced2c2f8c8148a9055c3a542eff29
|
https://github.com/the-tcpdump-group/tcpdump/commit/3a76fd7c95fced2c2f8c8148a9055c3a542eff29
|
print-domain.c
|
ns_nskip
| null | null | null |
static const u_char *
ns_nskip(netdissect_options *ndo,
register const u_char *cp)
{
register u_char i;
if (!ND_TTEST2(*cp, 1))
return (NULL);
i = *cp++;
while (i) {
if ((i & INDIR_MASK) == INDIR_MASK)
return (cp + 1);
if ((i & INDIR_MASK) == EDNS0_MASK) {
int bitlen, bytelen;
if ((i & ~INDIR_MASK) != EDNS0_ELT_BITLABEL)
return(NULL); /* unknown ELT */
if (!ND_TTEST2(*cp, 1))
return (NULL);
if ((bitlen = *cp++) == 0)
bitlen = 256;
bytelen = (bitlen + 7) / 8;
cp += bytelen;
} else
cp += i;
if (!ND_TTEST2(*cp, 1))
return (NULL);
i = *cp++;
}
return (cp);
}
|
static const u_char *
ns_nskip(netdissect_options *VAR_0,
register const u_char *VAR_1)
{
register u_char VAR_2;
if (!ND_TTEST2(*VAR_1, 1))
return (NULL);
VAR_2 = *VAR_1++;
while (VAR_2) {
if ((VAR_2 & VAR_3) == VAR_3)
return (VAR_1 + 1);
if ((VAR_2 & VAR_3) == VAR_4) {
int VAR_5, VAR_6;
if ((VAR_2 & ~VAR_3) != VAR_7)
return(NULL); /* COMMENT_0 */
if (!ND_TTEST2(*VAR_1, 1))
return (NULL);
if ((VAR_5 = *VAR_1++) == 0)
VAR_5 = 256;
VAR_6 = (VAR_5 + 7) / 8;
VAR_1 += VAR_6;
} else
VAR_1 += VAR_2;
if (!ND_TTEST2(*VAR_1, 1))
return (NULL);
VAR_2 = *VAR_1++;
}
return (VAR_1);
}
|
the-tcpdump-group/tcpdump/3a76fd7c95fced2c2f8c8148a9055c3a542eff29/print-domain.c/non_vul/4.json
| null | null | false
|
CVE-2020-29534
|
['CWE-Other']
|
AV:L/AC:L/Au:N/C:C/I:C/A:C
| 0
|
torvalds/linux
|
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
With that, we can grab proper references to the files table, and no
longer need to rely on stashing away ring_fd and ring_file to check
if the ring_fd may have been closed.
Cc: stable@vger.kernel.org # v5.5+
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
0f2122045b946241a9e549c2a76cea54fa58a7ff
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=0f2122045b946241a9e549c2a76cea54fa58a7ff
|
kernel/fork.c
|
exec_mm_release
| null | null | null |
void exec_mm_release(struct task_struct *tsk, struct mm_struct *mm)
{
futex_exec_release(tsk);
mm_release(tsk, mm);
}
|
void exec_mm_release(struct task_struct *VAR_0, struct mm_struct *VAR_1)
{
futex_exec_release(VAR_0);
mm_release(VAR_0, VAR_1);
}
|
torvalds/linux/0f2122045b946241a9e549c2a76cea54fa58a7ff/fork.c/non_vul/2.json
| null | null | false
|
CVE-2023-31618
|
['CWE-89']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| 1
|
openlink/virtuoso-opensource
|
Fixed non-terminal in union branch is not supported (fixes #1136)
|
030e47a29976709a50603e3f34e82278e5f462df
|
https://github.com/openlink/virtuoso-opensource/commit/030e47a29976709a50603e3f34e82278e5f462df
|
libsrc/Wi/sqldf.c
|
dfe_body_len
| null | null | null |
int
dfe_body_len (df_elt_t * body)
{
int ctr = 0;
df_elt_t * elt = body->_.sub.first;
while (elt)
{
ctr++;
elt = elt->dfe_next;
}
return ctr;
}
|
int
dfe_body_len (df_elt_t * VAR_0)
{
int VAR_1 = 0;
df_elt_t * VAR_2 = VAR_0->_.sub.first;
while (VAR_2)
{
VAR_1++;
VAR_2 = VAR_2->dfe_next;
}
return VAR_1;
}
|
openlink/virtuoso-opensource/030e47a29976709a50603e3f34e82278e5f462df/sqldf.c/non_vul/163.json
| null | null | false
|
CVE-2015-3400
|
['CWE-200']
|
AV:N/AC:M/Au:S/C:P/I:N/A:N
| 0
|
FransUrbo/zfs
|
Move nfs.c:foreach_nfs_shareopt() to libshare.c:foreach_shareopt()
so that it can be (re)used in other parts of libshare.
|
99aa4d2b4fd12c6bef62d02ffd1b375ddd42fcf4
|
https://github.com/FransUrbo/zfs/commit/99aa4d2b4fd12c6bef62d02ffd1b375ddd42fcf4
|
lib/libshare/nfs.c
|
libshare_nfs_init
| null | null | null |
void
libshare_nfs_init(void)
{
nfs_fstype = register_fstype("nfs", &nfs_shareops);
}
|
void
libshare_nfs_init(void)
{
VAR_0 = register_fstype("nfs", &VAR_1);
}
|
FransUrbo/zfs/99aa4d2b4fd12c6bef62d02ffd1b375ddd42fcf4/nfs.c/non_vul/13.json
| null | null | false
|
CVE-2017-8359
|
['CWE-787']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
grpc
|
Remove call from sibling list when it is not first child.
|
aab6992c006be6fb80df73fd9f218365099c016d
|
https://github.com/grpc/grpc/commit/aab6992c006be6fb80df73fd9f218365099c016d
|
src/core/lib/surface/call.c
|
cancel_with_error
| null | null | null |
static void cancel_with_error(grpc_exec_ctx *exec_ctx, grpc_call *c,
status_source source, grpc_error *error) {
GRPC_CALL_INTERNAL_REF(c, "termination");
set_status_from_error(exec_ctx, c, source, GRPC_ERROR_REF(error));
grpc_transport_stream_op *op = grpc_make_transport_stream_op(
grpc_closure_create(done_termination, c, grpc_schedule_on_exec_ctx));
op->cancel_error = error;
execute_op(exec_ctx, c, op);
}
|
static void cancel_with_error(grpc_exec_ctx *VAR_0, grpc_call *VAR_1,
status_source VAR_2, grpc_error *VAR_3) {
GRPC_CALL_INTERNAL_REF(VAR_1, "termination");
set_status_from_error(VAR_0, VAR_1, VAR_2, GRPC_ERROR_REF(VAR_3));
grpc_transport_stream_op *VAR_4 = grpc_make_transport_stream_op(
grpc_closure_create(VAR_5, VAR_1, VAR_6));
VAR_4->cancel_error = VAR_3;
execute_op(VAR_0, VAR_1, VAR_4);
}
|
grpc/aab6992c006be6fb80df73fd9f218365099c016d/call.c/non_vul/10.json
| null | null | false
|
CVE-2023-35848
|
['CWE-682', 'CWE-754']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| 1
|
virtualsquare/picotcp
|
More checks for correct header sizes
Reported-by: "P. Amsuo, Purdue University"
|
4b9a16764f2b12b611de9c34a50b4713d10ca401
|
https://github.com/virtualsquare/picotcp/commit/4b9a16764f2b12b611de9c34a50b4713d10ca401
|
modules/pico_ipv4.c
|
pico_ipv4_process_finally_try_forward
| null | null | null |
static void pico_ipv4_process_finally_try_forward(struct pico_stack *S, struct pico_frame *f)
{
struct pico_ipv4_hdr *hdr = (struct pico_ipv4_hdr *) f->net_hdr;
if ((pico_ipv4_is_broadcast(S, hdr->dst.addr)) || ((f->flags & PICO_FRAME_FLAG_BCAST) != 0)) {
/* don't forward broadcast frame, discard! */
pico_frame_discard(f);
} else if (pico_ipv4_forward(S, f) != 0) {
pico_frame_discard(f);
/* dbg("Forward failed.\n"); */
}
}
|
static void pico_ipv4_process_finally_try_forward(struct pico_stack *VAR_0, struct pico_frame *VAR_1)
{
struct pico_ipv4_hdr *VAR_2 = (struct pico_ipv4_hdr *) VAR_1->net_hdr;
if ((pico_ipv4_is_broadcast(VAR_0, VAR_2->dst.addr)) || ((VAR_1->flags & VAR_3) != 0)) {
/* COMMENT_0 */
pico_frame_discard(VAR_1);
} else if (pico_ipv4_forward(VAR_0, VAR_1) != 0) {
pico_frame_discard(VAR_1);
/* COMMENT_1 */
}
}
|
virtualsquare/picotcp/4b9a16764f2b12b611de9c34a50b4713d10ca401/pico_ipv4.c/non_vul/20.json
| null | null | false
|
CVE-2017-15951
|
['CWE-20']
|
AV:L/AC:L/Au:N/C:C/I:C/A:C
| 0
|
torvalds/linux
|
KEYS: Fix race between updating and finding a negative key
Consolidate KEY_FLAG_INSTANTIATED, KEY_FLAG_NEGATIVE and the rejection
error into one field such that:
(1) The instantiation state can be modified/read atomically.
(2) The error can be accessed atomically with the state.
(3) The error isn't stored unioned with the payload pointers.
This deals with the problem that the state is spread over three different
objects (two bits and a separate variable) and reading or updating them
atomically isn't practical, given that not only can uninstantiated keys
change into instantiated or rejected keys, but rejected keys can also turn
into instantiated keys - and someone accessing the key might not be using
any locking.
The main side effect of this problem is that what was held in the payload
may change, depending on the state. For instance, you might observe the
key to be in the rejected state. You then read the cached error, but if
the key semaphore wasn't locked, the key might've become instantiated
between the two reads - and you might now have something in hand that isn't
actually an error code.
The state is now KEY_IS_UNINSTANTIATED, KEY_IS_POSITIVE or a negative error
code if the key is negatively instantiated. The key_is_instantiated()
function is replaced with key_is_positive() to avoid confusion as negative
keys are also 'instantiated'.
Additionally, barriering is included:
(1) Order payload-set before state-set during instantiation.
(2) Order state-read before payload-read when using the key.
Further separate barriering is necessary if RCU is being used to access the
payload content after reading the payload pointers.
Fixes: 146aa8b1453b ("KEYS: Merge the type-specific data with the payload data")
Cc: stable@vger.kernel.org # v4.4+
Reported-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
|
363b02dab09b3226f3bd1420dad9c72b79a42a76
|
https://github.com/torvalds/linux/commit/363b02dab09b3226f3bd1420dad9c72b79a42a76
|
security/keys/proc.c
|
proc_key_users_open
| null | null | null |
static int proc_key_users_open(struct inode *inode, struct file *file)
{
return seq_open(file, &proc_key_users_ops);
}
|
static int proc_key_users_open(struct inode *inode, struct file *file)
{
return seq_open(file, &VAR_0);
}
|
torvalds/linux/363b02dab09b3226f3bd1420dad9c72b79a42a76/proc.c/non_vul/1.json
| null | null | false
|
CVE-2023-37464
|
['CWE-327']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
| 1
|
OpenIDC/cjose
|
use fixed authentication tag length of 16 octets in AES GCM decryption
see: https://github.com/cisco/cjose/issues/125
Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
|
7325e9a5e71e2fc0e350487ecac7d84acdf0ed5e
|
https://github.com/OpenIDC/cjose/commit/7325e9a5e71e2fc0e350487ecac7d84acdf0ed5e
|
src/jwe.c
|
cjose_jwe_import_json
| null | null | null |
cjose_jwe_t *cjose_jwe_import_json(const char *cser, size_t cser_len, cjose_err *err)
{
cjose_jwe_t *jwe = NULL;
json_t *form = NULL;
json_t *protected_header = NULL;
if (NULL == cser)
{
CJOSE_ERROR(err, CJOSE_ERR_INVALID_ARG);
return NULL;
}
// allocate and initialize a new JWE object
if (!_cjose_jwe_malloc(sizeof(cjose_jwe_t), false, (uint8_t **)&jwe, err))
{
return NULL;
}
form = _cjose_parse_json_object(cser, cser_len, err);
if (NULL == form)
{
goto _cjose_jwe_import_json_fail;
}
json_t *recipients = json_object_get(form, "recipients");
if (NULL != recipients)
{
if (!json_is_array(recipients))
{
CJOSE_ERROR(err, CJOSE_ERR_INVALID_ARG);
goto _cjose_jwe_import_json_fail;
}
jwe->to_count = json_array_size(recipients);
if (jwe->to_count < 1)
{
// TODO: is empty recipients array allowed?
CJOSE_ERROR(err, CJOSE_ERR_INVALID_ARG);
goto _cjose_jwe_import_json_fail;
}
}
else
{
jwe->to_count = 1;
}
if (!_cjose_jwe_malloc(sizeof(_jwe_int_recipient_t) * jwe->to_count, false, (uint8_t **)&jwe->to, err))
{
goto _cjose_jwe_import_json_fail;
}
if (!_cjose_jwe_import_json_part(&jwe->enc_header, false, json_object_get(form, "protected"), err))
{
goto _cjose_jwe_import_json_fail;
}
protected_header = _cjose_parse_json_object((const char *)jwe->enc_header.raw, jwe->enc_header.raw_len, err);
if (NULL == protected_header)
{
goto _cjose_jwe_import_json_fail;
}
if (NULL == recipients)
{
if (!_cjose_read_json_recipient(jwe, protected_header, false, jwe->to, form, err))
{
goto _cjose_jwe_import_json_fail;
}
}
else
{
for (size_t i = 0; i < jwe->to_count; i++)
{
if (!_cjose_read_json_recipient(jwe, protected_header, jwe->to_count > 1, jwe->to + i, json_array_get(recipients, i),
err))
{
goto _cjose_jwe_import_json_fail;
}
}
}
if (!_cjose_jwe_validate_enc(jwe, protected_header, err))
{
goto _cjose_jwe_import_json_fail;
}
if (!_cjose_jwe_import_json_part(&jwe->enc_iv, false, json_object_get(form, "iv"), err)
|| !_cjose_jwe_import_json_part(&jwe->enc_ct, false, json_object_get(form, "ciphertext"), err)
|| !_cjose_jwe_import_json_part(&jwe->enc_auth_tag, false, json_object_get(form, "tag"), err))
{
goto _cjose_jwe_import_json_fail;
}
jwe->hdr = json_incref(protected_header);
json_decref(form);
json_decref(protected_header);
return jwe;
_cjose_jwe_import_json_fail:
json_decref(form);
json_decref(protected_header);
cjose_jwe_release(jwe);
return NULL;
}
|
cjose_jwe_t *cjose_jwe_import_json(const char *VAR_0, size_t VAR_1, cjose_err *VAR_2)
{
cjose_jwe_t *VAR_3 = NULL;
json_t *VAR_4 = NULL;
json_t *VAR_5 = NULL;
if (NULL == VAR_0)
{
CJOSE_ERROR(VAR_2, VAR_6);
return NULL;
}
/* COMMENT_0 */
if (!_cjose_jwe_malloc(sizeof(cjose_jwe_t), false, (uint8_t **)&VAR_3, VAR_2))
{
return NULL;
}
VAR_4 = _cjose_parse_json_object(VAR_0, VAR_1, VAR_2);
if (NULL == VAR_4)
{
goto _cjose_jwe_import_json_fail;
}
json_t *VAR_7 = json_object_get(VAR_4, "recipients");
if (NULL != VAR_7)
{
if (!json_is_array(VAR_7))
{
CJOSE_ERROR(VAR_2, VAR_6);
goto _cjose_jwe_import_json_fail;
}
VAR_3->to_count = json_array_size(VAR_7);
if (VAR_3->to_count < 1)
{
/* COMMENT_1 */
CJOSE_ERROR(VAR_2, VAR_6);
goto _cjose_jwe_import_json_fail;
}
}
else
{
VAR_3->to_count = 1;
}
if (!_cjose_jwe_malloc(sizeof(VAR_8) * VAR_3->to_count, false, (uint8_t **)&VAR_3->to, VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
if (!_cjose_jwe_import_json_part(&VAR_3->enc_header, false, json_object_get(VAR_4, "protected"), VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
VAR_5 = _cjose_parse_json_object((const char *)VAR_3->enc_header.raw, VAR_3->enc_header.raw_len, VAR_2);
if (NULL == VAR_5)
{
goto _cjose_jwe_import_json_fail;
}
if (NULL == VAR_7)
{
if (!_cjose_read_json_recipient(VAR_3, VAR_5, false, VAR_3->to, VAR_4, VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
}
else
{
for (size_t VAR_9 = 0; VAR_9 < VAR_3->to_count; VAR_9++)
{
if (!_cjose_read_json_recipient(VAR_3, VAR_5, VAR_3->to_count > 1, VAR_3->to + VAR_9, json_array_get(VAR_7, VAR_9),
VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
}
}
if (!_cjose_jwe_validate_enc(VAR_3, VAR_5, VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
if (!_cjose_jwe_import_json_part(&VAR_3->enc_iv, false, json_object_get(VAR_4, "iv"), VAR_2)
|| !_cjose_jwe_import_json_part(&VAR_3->enc_ct, false, json_object_get(VAR_4, "ciphertext"), VAR_2)
|| !_cjose_jwe_import_json_part(&VAR_3->enc_auth_tag, false, json_object_get(VAR_4, "tag"), VAR_2))
{
goto _cjose_jwe_import_json_fail;
}
VAR_3->hdr = json_incref(VAR_5);
json_decref(VAR_4);
json_decref(VAR_5);
return VAR_3;
_cjose_jwe_import_json_fail:
json_decref(VAR_4);
json_decref(VAR_5);
cjose_jwe_release(VAR_3);
return NULL;
}
|
OpenIDC/cjose/7325e9a5e71e2fc0e350487ecac7d84acdf0ed5e/jwe.c/non_vul/36.json
| null | null | false
|
CVE-2014-1703
|
['CWE-399']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
chromium
|
Fix UAF in WebSocketDispatcherHost
If Send() fails in SendOrDrop(), then |message| will have been deleted,
but SendOrDrop() will still try to access its header fields.
Fixed.
BUG=338354
TEST=content_unittests
Review URL: https://codereview.chromium.org/148263009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247627 0039d316-1c4b-4281-b951-d872f2087c98
|
09b09312b9847e025249b9ba5bb2071dd77a19c3
|
https://github.com/chromium/chromium/commit/09b09312b9847e025249b9ba5bb2071dd77a19c3
|
content/browser/renderer_host/websocket_dispatcher_host.cc
|
WebSocketDispatcherHost::CreateWebSocketHost
| null | null | null |
WebSocketHost* WebSocketDispatcherHost::CreateWebSocketHost(int routing_id) {
return new WebSocketHost(routing_id, this, get_context_callback_.Run());
}
|
WebSocketHost* WebSocketDispatcherHost::CreateWebSocketHost(int VAR_0) {
return new WebSocketHost(VAR_0, this, VAR_1.Run());
}
|
chromium/09b09312b9847e025249b9ba5bb2071dd77a19c3/websocket_dispatcher_host.cc/non_vul/13.json
| null | null | false
|
CVE-2020-21913
|
['CWE-416']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
unicode-org/icu
|
ICU-20850 Use LocalMemory for cmd to prevent use after free
|
657c326d4b8a6c4c6721957320fc8c3c68670cfb
|
https://github.com/unicode-org/icu/commit/657c326d4b8a6c4c6721957320fc8c3c68670cfb
|
icu4c/source/tools/pkgdata/pkgdata.cpp
|
pkg_installCommonMode
| null | null | null |
static int32_t pkg_installCommonMode(const char *installDir, const char *fileName) {
int32_t result = 0;
char cmd[SMALL_BUFFER_MAX_SIZE] = "";
if (!T_FileStream_file_exists(installDir)) {
UErrorCode status = U_ZERO_ERROR;
uprv_mkdir(installDir, &status);
if (U_FAILURE(status)) {
fprintf(stderr, "Error creating installation directory: %s\n", installDir);
return -1;
}
}
#ifndef U_WINDOWS_WITH_MSVC
sprintf(cmd, "%s %s %s", pkgDataFlags[INSTALL_CMD], fileName, installDir);
#else
sprintf(cmd, "%s %s %s %s", WIN_INSTALL_CMD, fileName, installDir, WIN_INSTALL_CMD_FLAGS);
#endif
result = runCommand(cmd);
if (result != 0) {
fprintf(stderr, "Failed to install data file with command: %s\n", cmd);
}
return result;
}
|
static int32_t pkg_installCommonMode(const char *VAR_0, const char *VAR_1) {
int32_t VAR_2 = 0;
char VAR_3[VAR_4] = "";
if (!T_FileStream_file_exists(VAR_0)) {
UErrorCode VAR_5 = VAR_6;
uprv_mkdir(VAR_0, &VAR_5);
if (U_FAILURE(VAR_5)) {
fprintf(VAR_7, "Error creating installation directory: %s\n", VAR_0);
return -1;
}
}
#ifndef VAR_8
sprintf(VAR_3, "%s %s %s", VAR_9[VAR_10], VAR_1, VAR_0);
#else
sprintf(VAR_3, "%s %s %s %s", VAR_11, VAR_1, VAR_0, VAR_12);
#endif
VAR_2 = runCommand(VAR_3);
if (VAR_2 != 0) {
fprintf(VAR_7, "Failed to install data file with command: %s\n", VAR_3);
}
return VAR_2;
}
|
unicode-org/icu/657c326d4b8a6c4c6721957320fc8c3c68670cfb/pkgdata.cpp/non_vul/11.json
| null | null | false
|
CVE-2012-1584
|
['CWE-189']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
taglib
|
Avoid uint overflow in case the length + index is over UINT_MAX
|
dcdf4fd954e3213c355746fa15b7480461972308
|
https://github.com/taglib/taglib/commit/dcdf4fd954e3213c355746fa15b7480461972308
|
taglib/toolkit/tbytevector.cpp
|
at
| null | null | null |
char at(int index) const
{
return v.at(v.size() - index - 1);
}
|
char at(int VAR_0) const
{
return VAR_1.at(VAR_1.size() - VAR_0 - 1);
}
|
taglib/dcdf4fd954e3213c355746fa15b7480461972308/tbytevector.cpp/non_vul/18.json
| null | null | false
|
CVE-2016-2451
|
['CWE-264']
|
AV:N/AC:M/Au:N/C:C/I:C/A:C
| 0
|
android
|
Add VPX output buffer size check
and handle dead observers more gracefully
Bug: 27597103
Change-Id: Id7acb25d5ef69b197da15ec200a9e4f9e7b03518
|
f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
|
https://android.googlesource.com/platform/frameworks/av/+/f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba
|
media/libstagefright/omx/OMX.cpp
|
OMX::signalEndOfInputStream
| null | null | null |
status_t OMX::signalEndOfInputStream(node_id node) {
return findInstance(node)->signalEndOfInputStream();
}
|
status_t OMX::signalEndOfInputStream(node_id VAR_0) {
return findInstance(VAR_0)->signalEndOfInputStream();
}
|
android/f9ed2fe6d61259e779a37d4c2d7edb33a1c1f8ba/OMX.cpp/non_vul/25.json
| null | null | false
|
CVE-2017-11721
|
['CWE-119']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
ioquake/ioq3
|
Fix/improve buffer overflow in MSG_ReadBits/MSG_WriteBits
Prevent reading past end of message in MSG_ReadBits. If read past
end of msg->data buffer (16348 bytes) the engine could SEGFAULT.
Make MSG_WriteBits use an exact buffer overflow check instead of
possibly failing with a few bytes left.
|
d2b1d124d4055c2fcbe5126863487c52fd58cca1
|
https://github.com/ioquake/ioq3/commit/d2b1d124d4055c2fcbe5126863487c52fd58cca1
|
code/qcommon/msg.c
|
MSG_ReadByte
| null | null | null |
int MSG_ReadByte( msg_t *msg ) {
int c;
c = (unsigned char)MSG_ReadBits( msg, 8 );
if ( msg->readcount > msg->cursize ) {
c = -1;
}
return c;
}
|
int MSG_ReadByte( msg_t *VAR_0 ) {
int VAR_1;
VAR_1 = (unsigned char)MSG_ReadBits( VAR_0, 8 );
if ( VAR_0->readcount > VAR_0->cursize ) {
VAR_1 = -1;
}
return VAR_1;
}
|
ioquake/ioq3/d2b1d124d4055c2fcbe5126863487c52fd58cca1/msg.c/non_vul/31.json
| null | null | false
|
CVE-2023-39615
|
['CWE-119']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
| 1
|
GNOME/libxml2
|
parser: Fix old SAX1 parser with custom callbacks
For some reason, xmlCtxtUseOptionsInternal set the start and end element
SAX handlers to the internal DOM builder functions when XML_PARSE_SAX1
was specified. This means that custom SAX handlers could never work with
that flag because these functions would receive the wrong user data
argument and crash immediately.
Fixes #535.
|
d0c3f01e110d54415611c5fa0040cdf4a56053f9
|
https://github.com/GNOME/libxml2/commit/d0c3f01e110d54415611c5fa0040cdf4a56053f9
|
parser.c
|
xmlParseCharDataComplex
| null | null | null |
static void
xmlParseCharDataComplex(xmlParserCtxtPtr ctxt) {
xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
int nbchar = 0;
int cur, l;
cur = CUR_CHAR(l);
while ((cur != '<') && /* checked */
(cur != '&') &&
(IS_CHAR(cur))) /* test also done in xmlCurrentChar() */ {
if ((cur == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
}
COPY_BUF(l,buf,nbchar,cur);
/* move current position before possible calling of ctxt->sax->characters */
NEXTL(l);
if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
/*
* OK the segment is to be consumed as chars.
*/
if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
if (areBlanks(ctxt, buf, nbchar, 0)) {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(ctxt->userData,
buf, nbchar);
} else {
if (ctxt->sax->characters != NULL)
ctxt->sax->characters(ctxt->userData, buf, nbchar);
if ((ctxt->sax->characters !=
ctxt->sax->ignorableWhitespace) &&
(*ctxt->space == -1))
*ctxt->space = -2;
}
}
nbchar = 0;
/* something really bad happened in the SAX callback */
if (ctxt->instate != XML_PARSER_CONTENT)
return;
SHRINK;
}
cur = CUR_CHAR(l);
}
if (ctxt->instate == XML_PARSER_EOF)
return;
if (nbchar != 0) {
buf[nbchar] = 0;
/*
* OK the segment is to be consumed as chars.
*/
if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
if (areBlanks(ctxt, buf, nbchar, 0)) {
if (ctxt->sax->ignorableWhitespace != NULL)
ctxt->sax->ignorableWhitespace(ctxt->userData, buf, nbchar);
} else {
if (ctxt->sax->characters != NULL)
ctxt->sax->characters(ctxt->userData, buf, nbchar);
if ((ctxt->sax->characters != ctxt->sax->ignorableWhitespace) &&
(*ctxt->space == -1))
*ctxt->space = -2;
}
}
}
if ((ctxt->input->cur < ctxt->input->end) && (!IS_CHAR(cur))) {
/* Generate the error and skip the offending character */
xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
"PCDATA invalid Char value %d\n",
cur ? cur : CUR);
NEXT;
}
}
|
static void
xmlParseCharDataComplex(xmlParserCtxtPtr VAR_0) {
xmlChar VAR_1[VAR_2 + 5];
int VAR_3 = 0;
int VAR_4, VAR_5;
VAR_4 = CUR_CHAR(VAR_5);
while ((VAR_4 != '<') && /* COMMENT_0 */
(VAR_4 != '&') &&
(IS_CHAR(VAR_4))) /* COMMENT_1 */ {
if ((VAR_4 == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
xmlFatalErr(VAR_0, VAR_6, NULL);
}
COPY_BUF(VAR_5,VAR_1,VAR_3,VAR_4);
/* COMMENT_2 */
NEXTL(VAR_5);
if (VAR_3 >= VAR_2) {
VAR_1[VAR_3] = 0;
/* COMMENT_3 */
if ((VAR_0->sax != NULL) && (!VAR_0->disableSAX)) {
if (areBlanks(VAR_0, VAR_1, VAR_3, 0)) {
if (VAR_0->sax->ignorableWhitespace != NULL)
VAR_0->sax->ignorableWhitespace(VAR_0->userData,
VAR_1, VAR_3);
} else {
if (VAR_0->sax->characters != NULL)
VAR_0->sax->characters(VAR_0->userData, VAR_1, VAR_3);
if ((VAR_0->sax->characters !=
VAR_0->sax->ignorableWhitespace) &&
(*VAR_0->space == -1))
*VAR_0->space = -2;
}
}
VAR_3 = 0;
/* COMMENT_6 */
if (VAR_0->instate != VAR_7)
return;
VAR_8;
}
VAR_4 = CUR_CHAR(VAR_5);
}
if (VAR_0->instate == VAR_9)
return;
if (VAR_3 != 0) {
VAR_1[VAR_3] = 0;
/* COMMENT_7 */
if ((VAR_0->sax != NULL) && (!VAR_0->disableSAX)) {
if (areBlanks(VAR_0, VAR_1, VAR_3, 0)) {
if (VAR_0->sax->ignorableWhitespace != NULL)
VAR_0->sax->ignorableWhitespace(VAR_0->userData, VAR_1, VAR_3);
} else {
if (VAR_0->sax->characters != NULL)
VAR_0->sax->characters(VAR_0->userData, VAR_1, VAR_3);
if ((VAR_0->sax->characters != VAR_0->sax->ignorableWhitespace) &&
(*VAR_0->space == -1))
*VAR_0->space = -2;
}
}
}
if ((VAR_0->input->cur < VAR_0->input->end) && (!IS_CHAR(VAR_4))) {
/* COMMENT_10 */
xmlFatalErrMsgInt(VAR_0, VAR_10,
"PCDATA invalid Char value %d\n",
VAR_4 ? VAR_4 : VAR_11);
VAR_12;
}
}
|
GNOME/libxml2/d0c3f01e110d54415611c5fa0040cdf4a56053f9/parser.c/non_vul/57.json
| null | null | false
|
CVE-2011-2723
|
['CWE-20']
|
AV:A/AC:M/Au:N/C:N/I:N/A:C
| 0
|
torvalds/linux
|
Currently skb_gro_header_slow unconditionally resets frag0 and
frag0_len. However, when we can't pull on the skb this leaves
the GRO fields in an inconsistent state.
This patch fixes this by only resetting those fields after the
pskb_may_pull test.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
17dd759c67f21e34f2156abcf415e1f60605a188
|
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=17dd759c67f21e34f2156abcf415e1f60605a188
|
include/linux/netdevice.h
|
netif_oper_up
| null | null | null |
static inline int netif_oper_up(const struct net_device *dev)
{
return (dev->operstate == IF_OPER_UP ||
dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
}
|
static inline int netif_oper_up(const struct net_device *VAR_0)
{
return (VAR_0->operstate == VAR_1 ||
VAR_0->operstate == VAR_2 /* COMMENT_0 */);
}
|
torvalds/linux/17dd759c67f21e34f2156abcf415e1f60605a188/netdevice.h/non_vul/74.json
| null | null | false
|
CVE-2021-3975
|
['CWE-416']
|
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
| 1
|
libvirt
|
qemu: Add missing lock in qemuProcessHandleMonitorEOF
qemuMonitorUnregister will be called in multiple threads (e.g. threads
in rpc worker pool and the vm event thread). In some cases, it isn't
protected by the monitor lock, which may lead to call g_source_unref
more than one time and a use-after-free problem eventually.
Add the missing lock in qemuProcessHandleMonitorEOF (which is the only
position missing lock of monitor I found).
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
1ac703a7d0789e46833f4013a3876c2e3af18ec7
|
https://github.com/libvirt/libvirt/commit/1ac703a7d0789e46833f4013a3876c2e3af18ec7
|
src/qemu/qemu_process.c
|
qemuProcessQMPInitMonitor
| null | null | null |
int
qemuProcessQMPInitMonitor(qemuMonitorPtr mon)
{
if (qemuMonitorSetCapabilities(mon) < 0) {
VIR_DEBUG("Failed to set monitor capabilities %s",
virGetLastErrorMessage());
return -1;
}
return 0;
}
|
int
qemuProcessQMPInitMonitor(qemuMonitorPtr VAR_0)
{
if (qemuMonitorSetCapabilities(VAR_0) < 0) {
VIR_DEBUG("Failed to set monitor capabilities %s",
virGetLastErrorMessage());
return -1;
}
return 0;
}
|
libvirt/1ac703a7d0789e46833f4013a3876c2e3af18ec7/qemu_process.c/non_vul/18.json
| null | null | false
|
CVE-2016-3750
|
['CWE-20']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
android
|
Correctly handle dup() failure in Parcel::readNativeHandle
bail out if dup() fails, instead of creating an invalid native_handle_t
Bug: 28395952
Change-Id: Ia1a6198c0f45165b9c6a55a803e5f64d8afa0572
|
54cb02ad733fb71b1bdf78590428817fb780aff8
|
https://android.googlesource.com/platform/frameworks/native/+/54cb02ad733fb71b1bdf78590428817fb780aff8
|
libs/binder/Parcel.cpp
|
unflatten_binder
| null | null | null |
status_t unflatten_binder(const sp<ProcessState>& proc,
const Parcel& in, sp<IBinder>* out)
{
const flat_binder_object* flat = in.readObject(false);
if (flat) {
switch (flat->type) {
case BINDER_TYPE_BINDER:
*out = reinterpret_cast<IBinder*>(flat->cookie);
return finish_unflatten_binder(NULL, *flat, in);
case BINDER_TYPE_HANDLE:
*out = proc->getStrongProxyForHandle(flat->handle);
return finish_unflatten_binder(
static_cast<BpBinder*>(out->get()), *flat, in);
}
}
return BAD_TYPE;
}
|
status_t unflatten_binder(const sp<ProcessState>& VAR_0,
const Parcel& VAR_1, sp<IBinder>* VAR_2)
{
const flat_binder_object* VAR_3 = VAR_1.readObject(false);
if (VAR_3) {
switch (VAR_3->type) {
case VAR_4:
*VAR_2 = VAR_5<IBinder*>(VAR_3->cookie);
return finish_unflatten_binder(NULL, *VAR_3, VAR_1);
case VAR_6:
*VAR_2 = VAR_0->getStrongProxyForHandle(VAR_3->handle);
return finish_unflatten_binder(
VAR_7<BpBinder*>(VAR_2->get()), *VAR_3, VAR_1);
}
}
return VAR_8;
}
|
android/54cb02ad733fb71b1bdf78590428817fb780aff8/Parcel.cpp/non_vul/76.json
| null | null | false
|
CVE-2014-1438
|
['CWE-264']
|
AV:L/AC:M/Au:N/C:N/I:N/A:C
| 0
|
torvalds/linux
|
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
Before we do an EMMS in the AMD FXSAVE information leak workaround we
need to clear any pending exceptions, otherwise we trap with a
floating-point exception inside this code.
Reported-by: halfdog <me@halfdog.net>
Tested-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/CA%2B55aFxQnY_PCG_n4=0w-VG=YLXL-yr7oMxyy0WU2gCBAf3ydg@mail.gmail.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
26bef1318adc1b3a530ecc807ef99346db2aa8b0
|
https://github.com/torvalds/linux/commit/26bef1318adc1b3a530ecc807ef99346db2aa8b0
|
arch/x86/include/asm/fpu-internal.h
|
fpu_restore_checking
| null | null | null |
static inline int fpu_restore_checking(struct fpu *fpu)
{
if (use_xsave())
return fpu_xrstor_checking(&fpu->state->xsave);
else if (use_fxsr())
return fxrstor_checking(&fpu->state->fxsave);
else
return frstor_checking(&fpu->state->fsave);
}
|
static inline int fpu_restore_checking(struct fpu *fpu)
{
if (use_xsave())
return fpu_xrstor_checking(&fpu->state->xsave);
else if (use_fxsr())
return fxrstor_checking(&fpu->state->fxsave);
else
return frstor_checking(&fpu->state->fsave);
}
|
torvalds/linux/26bef1318adc1b3a530ecc807ef99346db2aa8b0/fpu-internal.h/non_vul/37.json
| null | null | false
|
CVE-2010-2713
|
['CWE-Other']
|
AV:N/AC:M/Au:N/C:P/I:P/A:P
| 0
|
GNOME/vte
|
Fix terminal title reporting
Fixed CVE-2003-0070 again.
See also http://marc.info/?l=bugtraq&m=104612710031920&w=2 .
(cherry picked from commit 6042c75b5a6daa0e499e61c8e07242d890d38ff1)
|
8b971a7b2c59902914ecbbc3915c45dd21530a91
|
https://github.com/GNOME/vte/commit/8b971a7b2c59902914ecbbc3915c45dd21530a91
|
src/vteseq.c
|
vte_sequence_handler_AL
| null | null | null |
static void
vte_sequence_handler_AL (VteTerminal *terminal, GValueArray *params)
{
vte_sequence_handler_al (terminal, params);
}
|
static void
vte_sequence_handler_AL (VteTerminal *VAR_0, GValueArray *VAR_1)
{
vte_sequence_handler_al (VAR_0, VAR_1);
}
|
GNOME/vte/8b971a7b2c59902914ecbbc3915c45dd21530a91/vteseq.c/non_vul/27.json
| null | null | false
|
CVE-2016-10132
|
['CWE-476']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
ArtifexSoftware/mujs
|
Fix 697381: check allocation when compiling regular expressions.
Also use allocator callback function.
|
fd003eceda531e13fbdd1aeb6e9c73156496e569
|
https://github.com/ArtifexSoftware/mujs/commit/fd003eceda531e13fbdd1aeb6e9c73156496e569
|
regexp.c
|
incclasscanon
| null | null | null |
static int incclasscanon(Reclass *cc, Rune c)
{
Rune *p, r;
for (p = cc->spans; p < cc->end; p += 2)
for (r = p[0]; r <= p[1]; ++r)
if (c == canon(r))
return 1;
return 0;
}
|
static int incclasscanon(Reclass *VAR_0, Rune VAR_1)
{
Rune *VAR_2, VAR_3;
for (VAR_2 = VAR_0->spans; VAR_2 < VAR_0->end; VAR_2 += 2)
for (VAR_3 = VAR_2[0]; VAR_3 <= VAR_2[1]; ++VAR_3)
if (VAR_1 == canon(VAR_3))
return 1;
return 0;
}
|
ArtifexSoftware/mujs/fd003eceda531e13fbdd1aeb6e9c73156496e569/regexp.c/non_vul/3.json
| null | null | false
|
CVE-2022-3543
|
['CWE-401']
|
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
| 1
|
kernel/git/bpf/bpf-next
|
syzbot reported a sequence of memory leaks, and one of them indicated we
failed to free a whole sk:
unreferenced object 0xffff8880126e0000 (size 1088):
comm "syz-executor419", pid 326, jiffies 4294773607 (age 12.609s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 7d 00 00 00 00 00 00 00 ........}.......
01 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<000000006fefe750>] sk_prot_alloc+0x64/0x2a0 net/core/sock.c:1970
[<0000000074006db5>] sk_alloc+0x3b/0x800 net/core/sock.c:2029
[<00000000728cd434>] unix_create1+0xaf/0x920 net/unix/af_unix.c:928
[<00000000a279a139>] unix_create+0x113/0x1d0 net/unix/af_unix.c:997
[<0000000068259812>] __sock_create+0x2ab/0x550 net/socket.c:1516
[<00000000da1521e1>] sock_create net/socket.c:1566 [inline]
[<00000000da1521e1>] __sys_socketpair+0x1a8/0x550 net/socket.c:1698
[<000000007ab259e1>] __do_sys_socketpair net/socket.c:1751 [inline]
[<000000007ab259e1>] __se_sys_socketpair net/socket.c:1748 [inline]
[<000000007ab259e1>] __x64_sys_socketpair+0x97/0x100 net/socket.c:1748
[<000000007dedddc1>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<000000007dedddc1>] do_syscall_64+0x38/0x90 arch/x86/entry/common.c:80
[<000000009456679f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
We can reproduce this issue by creating two AF_UNIX SOCK_STREAM sockets,
send()ing an OOB skb to each other, and close()ing them without consuming
the OOB skbs.
int skpair[2];
socketpair(AF_UNIX, SOCK_STREAM, 0, skpair);
send(skpair[0], "x", 1, MSG_OOB);
send(skpair[1], "x", 1, MSG_OOB);
close(skpair[0]);
close(skpair[1]);
Currently, we free an OOB skb in unix_sock_destructor() which is called via
__sk_free(), but it's too late because the receiver's unix_sk(sk)->oob_skb
is accounted against the sender's sk->sk_wmem_alloc and __sk_free() is
called only when sk->sk_wmem_alloc is 0.
In the repro sequences, we do not consume the OOB skb, so both two sk's
sock_put() never reach __sk_free() due to the positive sk->sk_wmem_alloc.
Then, no one can consume the OOB skb nor call __sk_free(), and we finally
leak the two whole sk.
Thus, we must free the unconsumed OOB skb earlier when close()ing the
socket.
Fixes: 314001f0bf92 ("af_unix: Add OOB support")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
7a62ed61367b8fd01bae1e18e30602c25060d824
|
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?h=7a62ed61367b8fd01bae1e18e30602c25060d824
|
net/unix/af_unix.c
|
unix_dgram_recvmsg
| null | null | null |
static int unix_dgram_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
int flags)
{
struct sock *sk = sock->sk;
#ifdef CONFIG_BPF_SYSCALL
const struct proto *prot = READ_ONCE(sk->sk_prot);
if (prot != &unix_dgram_proto)
return prot->recvmsg(sk, msg, size, flags, NULL);
#endif
return __unix_dgram_recvmsg(sk, msg, size, flags);
}
|
static int unix_dgram_recvmsg(struct socket *VAR_0, struct msghdr *VAR_1, size_t VAR_2,
int VAR_3)
{
struct sock *VAR_4 = sock->sk;
#ifdef VAR_5
const struct proto *VAR_6 = READ_ONCE(VAR_4->sk_prot);
if (VAR_6 != &VAR_7)
return VAR_6->recvmsg(VAR_4, VAR_1, VAR_2, VAR_3, NULL);
#endif
return __unix_dgram_recvmsg(VAR_4, VAR_1, VAR_2, VAR_3);
}
|
kernel/git/bpf/bpf-next/7a62ed61367b8fd01bae1e18e30602c25060d824/af_unix.c/non_vul/85.json
| null | null | false
|
CVE-2022-25299
|
['CWE-552']
|
AV:N/AC:L/Au:N/C:N/I:P/A:N
| 0
|
cesanta/mongoose
|
Protect against the directory traversal in mg_upload()
|
c65c8fdaaa257e0487ab0aaae9e8f6b439335945
|
https://github.com/cesanta/mongoose/commit/c65c8fdaaa257e0487ab0aaae9e8f6b439335945
|
src/http.c
|
printdirentry
| null | null | null |
static void printdirentry(const char *name, void *userdata) {
struct printdirentrydata *d = (struct printdirentrydata *) userdata;
struct mg_fs *fs = d->opts->fs == NULL ? &mg_fs_posix : d->opts->fs;
size_t size = 0;
time_t t = 0;
char path[MG_PATH_MAX], sz[64], mod[64];
int flags, n = 0;
// LOG(LL_DEBUG, ("[%s] [%s]", d->dir, name));
if (snprintf(path, sizeof(path), "%s%c%s", d->dir, '/', name) < 0) {
LOG(LL_ERROR, ("%s truncated", name));
} else if ((flags = fs->stat(path, &size, &t)) == 0) {
LOG(LL_ERROR, ("%lu stat(%s): %d", d->c->id, path, errno));
} else {
const char *slash = flags & MG_FS_DIR ? "/" : "";
struct tm tm;
if (flags & MG_FS_DIR) {
snprintf(sz, sizeof(sz), "%s", "[DIR]");
} else if (size < 1024) {
snprintf(sz, sizeof(sz), "%d", (int) size);
} else if (size < 0x100000) {
snprintf(sz, sizeof(sz), "%.1fk", (double) size / 1024.0);
} else if (size < 0x40000000) {
snprintf(sz, sizeof(sz), "%.1fM", (double) size / 1048576);
} else {
snprintf(sz, sizeof(sz), "%.1fG", (double) size / 1073741824);
}
strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime_r(&t, &tm));
n = (int) mg_url_encode(name, strlen(name), path, sizeof(path));
mg_printf(d->c,
" <tr><td><a href=\"%.*s%s\">%s%s</a></td>"
"<td name=%lu>%s</td><td name=" MG_INT64_FMT ">%s</td></tr>\n",
n, path, slash, name, slash, (unsigned long) t, mod,
flags & MG_FS_DIR ? (int64_t) -1 : (int64_t) size, sz);
}
}
|
static void printdirentry(const char *VAR_0, void *VAR_1) {
struct printdirentrydata *VAR_2 = (struct printdirentrydata *) VAR_1;
struct mg_fs *VAR_3 = VAR_2->opts->fs == NULL ? &VAR_4 : VAR_2->opts->fs;
size_t VAR_5 = 0;
time_t VAR_6 = 0;
char VAR_7[VAR_8], VAR_9[64], VAR_10[64];
int VAR_11, VAR_12 = 0;
/* COMMENT_0 */
if (snprintf(VAR_7, sizeof(VAR_7), "%s%c%s", VAR_2->dir, '/', VAR_0) < 0) {
LOG(VAR_13, ("%s truncated", VAR_0));
} else if ((VAR_11 = VAR_3->stat(VAR_7, &VAR_5, &VAR_6)) == 0) {
LOG(VAR_13, ("%lu stat(%s): %d", VAR_2->c->id, VAR_7, VAR_14));
} else {
const char *VAR_15 = VAR_11 & VAR_16 ? "/" : "";
struct tm tm;
if (VAR_11 & VAR_16) {
snprintf(VAR_9, sizeof(VAR_9), "%s", "[DIR]");
} else if (VAR_5 < 1024) {
snprintf(VAR_9, sizeof(VAR_9), "%d", (int) VAR_5);
} else if (VAR_5 < 0x100000) {
snprintf(VAR_9, sizeof(VAR_9), "%.1fk", (double) VAR_5 / 1024.0);
} else if (VAR_5 < 0x40000000) {
snprintf(VAR_9, sizeof(VAR_9), "%.1fM", (double) VAR_5 / 1048576);
} else {
snprintf(VAR_9, sizeof(VAR_9), "%.1fG", (double) VAR_5 / 1073741824);
}
strftime(VAR_10, sizeof(VAR_10), "%d-%b-%Y %H:%M", localtime_r(&VAR_6, &tm));
VAR_12 = (int) mg_url_encode(VAR_0, strlen(VAR_0), VAR_7, sizeof(VAR_7));
mg_printf(VAR_2->c,
" <tr><td><a href=\"%.*s%s\">%s%s</a></td>"
"<td name=%lu>%s</td><td name=" VAR_17 ">%s</td></tr>\n",
VAR_12, VAR_7, VAR_15, VAR_0, VAR_15, (unsigned long) VAR_6, VAR_10,
VAR_11 & VAR_16 ? (int64_t) -1 : (int64_t) VAR_5, VAR_9);
}
}
|
cesanta/mongoose/c65c8fdaaa257e0487ab0aaae9e8f6b439335945/http.c/non_vul/11.json
| null | null | false
|
CVE-2019-11599
|
['CWE-667']
|
AV:L/AC:M/Au:N/C:C/I:C/A:C
| 0
|
torvalds/linux
|
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
The core dumping code has always run without holding the mmap_sem for
writing, despite that is the only way to ensure that the entire vma
layout will not change from under it. Only using some signal
serialization on the processes belonging to the mm is not nearly enough.
This was pointed out earlier. For example in Hugh's post from Jul 2017:
https://lkml.kernel.org/r/alpine.LSU.2.11.1707191716030.2055@eggly.anvils
"Not strictly relevant here, but a related note: I was very surprised
to discover, only quite recently, how handle_mm_fault() may be called
without down_read(mmap_sem) - when core dumping. That seems a
misguided optimization to me, which would also be nice to correct"
In particular because the growsdown and growsup can move the
vm_start/vm_end the various loops the core dump does around the vma will
not be consistent if page faults can happen concurrently.
Pretty much all users calling mmget_not_zero()/get_task_mm() and then
taking the mmap_sem had the potential to introduce unexpected side
effects in the core dumping code.
Adding mmap_sem for writing around the ->core_dump invocation is a
viable long term fix, but it requires removing all copy user and page
faults and to replace them with get_dump_page() for all binary formats
which is not suitable as a short term fix.
For the time being this solution manually covers the places that can
confuse the core dump either by altering the vma layout or the vma flags
while it runs. Once ->core_dump runs under mmap_sem for writing the
function mmget_still_valid() can be dropped.
Allowing mmap_sem protected sections to run in parallel with the
coredump provides some minor parallelism advantage to the swapoff code
(which seems to be safe enough by never mangling any vma field and can
keep doing swapins in parallel to the core dumping) and to some other
corner case.
In order to facilitate the backporting I added "Fixes: 86039bd3b4e6"
however the side effect of this same race condition in /proc/pid/mem
should be reproducible since before 2.6.12-rc2 so I couldn't add any
other "Fixes:" because there's no hash beyond the git genesis commit.
Because find_extend_vma() is the only location outside of the process
context that could modify the "mm" structures under mmap_sem for
reading, by adding the mmget_still_valid() check to it, all other cases
that take the mmap_sem for reading don't need the new check after
mmget_not_zero()/get_task_mm(). The expand_stack() in page fault
context also doesn't need the new check, because all tasks under core
dumping are frozen.
Link: http://lkml.kernel.org/r/20190325224949.11068-1-aarcange@redhat.com
Fixes: 86039bd3b4e6 ("userfaultfd: add new syscall to provide memory externalization")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: Jann Horn <jannh@google.com>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Jann Horn <jannh@google.com>
Acked-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
04f5866e41fb70690e28397487d8bd8eea7d712a
|
https://github.com/torvalds/linux/commit/04f5866e41fb70690e28397487d8bd8eea7d712a
|
drivers/infiniband/core/uverbs_main.c
|
ib_uverbs_comp_event_fasync
| null | null | null |
static int ib_uverbs_comp_event_fasync(int fd, struct file *filp, int on)
{
struct ib_uverbs_completion_event_file *comp_ev_file =
filp->private_data;
return fasync_helper(fd, filp, on, &comp_ev_file->ev_queue.async_queue);
}
|
static int ib_uverbs_comp_event_fasync(int VAR_0, struct file *VAR_1, int VAR_2)
{
struct ib_uverbs_completion_event_file *VAR_3 =
VAR_1->private_data;
return fasync_helper(VAR_0, VAR_1, VAR_2, &VAR_3->ev_queue.async_queue);
}
|
torvalds/linux/04f5866e41fb70690e28397487d8bd8eea7d712a/uverbs_main.c/non_vul/19.json
| null | null | false
|
CVE-2015-1241
|
['CWE-1021']
|
AV:N/AC:M/Au:N/C:N/I:P/A:N
| 0
|
chromium
|
[Android] Thoroughly reset gesture detection upon page navigation
The current gesture reset logic on Android uses a cancellation event
synthesized from the active touch sequence. However, this fails to reset
detection for timeout-based events, e.g. delayed tap and double-tap,
just after the pointer has just been released. Expose an explicit gesture
detection reset hook on the GestureProvider, called when the main
frame navigates or the window loses focus.
BUG=418402
Review URL: https://codereview.chromium.org/717573004
Cr-Commit-Position: refs/heads/master@{#303749}
|
d47c1e4b6bb7e9b485f6dfede0236ddd5c823878
|
https://chromium.googlesource.com/chromium/src/+/d47c1e4b6bb7e9b485f6dfede0236ddd5c823878
|
content/browser/renderer_host/render_widget_host_view_android.cc
|
RenderWidgetHostViewAndroid::DestroyDelegatedContent
| null | null | null |
void RenderWidgetHostViewAndroid::DestroyDelegatedContent() {
RemoveLayers();
frame_provider_ = NULL;
layer_ = NULL;
// This gets called when ever any eviction, loosing resources, swapping
// problems are encountered and so we abort any pending readbacks here.
AbortPendingReadbackRequests();
}
|
void RenderWidgetHostViewAndroid::DestroyDelegatedContent() {
RemoveLayers();
VAR_0 = NULL;
VAR_1 = NULL;
/* COMMENT_0 */
/* COMMENT_1 */
AbortPendingReadbackRequests();
}
|
chromium/d47c1e4b6bb7e9b485f6dfede0236ddd5c823878/render_widget_host_view_android.cc/non_vul/70.json
| null | null | false
|
CVE-2020-23258
|
['CWE-787', 'CWE-476']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
| 1
|
pcmacdon/jsish
|
Release "3.0.10": Fix issues #12, #13, and #14.
FossilOrigin-Name: 70747c8d1c4e7bf176bec8cfb9d3cac3e64a696e7df0b1e3712d3f6b952164c3
|
20ff8e2f6f66493b65f20c00c53d4f1e9f426631
|
https://github.com/pcmacdon/jsish/commit/20ff8e2f6f66493b65f20c00c53d4f1e9f426631
|
src/jsiSqlite.c
|
jsi_DbOptionTypeStr
| null | null | null |
const char *jsi_DbOptionTypeStr(Jsi_OptionId typ, bool cname)
{
const Jsi_OptionTypedef* ti = Jsi_OptionTypeInfo(typ);
if (ti)
return (cname?ti->cName:ti->idName);
return NULL;
}
|
const char *jsi_DbOptionTypeStr(Jsi_OptionId VAR_0, bool VAR_1)
{
const Jsi_OptionTypedef* VAR_2 = Jsi_OptionTypeInfo(VAR_0);
if (VAR_2)
return (VAR_1?VAR_2->cName:VAR_2->idName);
return NULL;
}
|
pcmacdon/jsish/20ff8e2f6f66493b65f20c00c53d4f1e9f426631/jsiSqlite.c/non_vul/46.json
| null | null | false
|
CVE-2014-9939
|
['CWE-119']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
binutils-gdb
|
Fix stack buffer overflows when parsing corrupt ihex files.
PR binutils/18750
* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
and stack overflow when char is signed and \200-\376 was in place of hex
digit; also fixes \377 was handled as EOF instead of "incorrect character".
(ihex_read_section): Changed for consistency.
(ihex_bad_byte): Prevent (now impossible to trigger) stack
overflow and incorrect escape sequence handling.
* srec.c (srec_bad_byte): Likewise.
* readelf.c (process_mips_specific): Fix incorrect escape
sequence handling.
|
7e27a9d5f22f9f7ead11738b1546d0b5c737266b
|
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7e27a9d5f22f9f7ead11738b1546d0b5c737266b
|
bfd/ihex.c
|
ihex_write_record
| null | null | null |
static bfd_boolean
ihex_write_record (bfd *abfd,
size_t count,
unsigned int addr,
unsigned int type,
bfd_byte *data)
{
static const char digs[] = "0123456789ABCDEF";
char buf[9 + CHUNK * 2 + 4];
char *p;
unsigned int chksum;
unsigned int i;
size_t total;
#define TOHEX(buf, v) \
((buf)[0] = digs[((v) >> 4) & 0xf], (buf)[1] = digs[(v) & 0xf])
buf[0] = ':';
TOHEX (buf + 1, count);
TOHEX (buf + 3, (addr >> 8) & 0xff);
TOHEX (buf + 5, addr & 0xff);
TOHEX (buf + 7, type);
chksum = count + addr + (addr >> 8) + type;
for (i = 0, p = buf + 9; i < count; i++, p += 2, data++)
{
TOHEX (p, *data);
chksum += *data;
}
TOHEX (p, (- chksum) & 0xff);
p[2] = '\r';
p[3] = '\n';
total = 9 + count * 2 + 4;
if (bfd_bwrite (buf, (bfd_size_type) total, abfd) != total)
return FALSE;
return TRUE;
}
|
static bfd_boolean
ihex_write_record (bfd *VAR_0,
size_t VAR_1,
unsigned int VAR_2,
unsigned int VAR_3,
bfd_byte *VAR_4)
{
static const char VAR_5[] = "0123456789ABCDEF";
char VAR_6[9 + VAR_7 * 2 + 4];
char *VAR_8;
unsigned int VAR_9;
unsigned int VAR_10;
size_t VAR_11;
#define TOHEX(VAR_6, VAR_12) \
((buf)[0] = digs[((v) >> 4) & 0xf], (buf)[1] = digs[(v) & 0xf])
VAR_6[0] = ':';
TOHEX (VAR_6 + 1, VAR_1);
TOHEX (VAR_6 + 3, (VAR_2 >> 8) & 0xff);
TOHEX (VAR_6 + 5, VAR_2 & 0xff);
TOHEX (VAR_6 + 7, VAR_3);
VAR_9 = VAR_1 + VAR_2 + (VAR_2 >> 8) + VAR_3;
for (VAR_10 = 0, VAR_8 = VAR_6 + 9; VAR_10 < VAR_1; VAR_10++, VAR_8 += 2, VAR_4++)
{
TOHEX (VAR_8, *VAR_4);
VAR_9 += *VAR_4;
}
TOHEX (VAR_8, (- VAR_9) & 0xff);
VAR_8[2] = '\r';
VAR_8[3] = '\n';
VAR_11 = 9 + VAR_1 * 2 + 4;
if (bfd_bwrite (VAR_6, (bfd_size_type) VAR_11, VAR_0) != VAR_11)
return FALSE;
return TRUE;
}
|
binutils-gdb/7e27a9d5f22f9f7ead11738b1546d0b5c737266b/ihex.c/non_vul/0.json
| null | null | false
|
CVE-2023-46752
|
['CWE-Other']
|
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
| 1
|
FRRouting/frr
|
bgpd: Handle MP_REACH_NLRI malformed packets with session reset
Avoid crashing bgpd.
```
(gdb)
bgp_mp_reach_parse (args=<optimized out>, mp_update=0x7fffffffe140) at bgpd/bgp_attr.c:2341
2341 stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN);
(gdb)
stream_get (dst=0x7fffffffe1ac, s=0x7ffff0006e80, size=16) at lib/stream.c:320
320 {
(gdb)
321 STREAM_VERIFY_SANE(s);
(gdb)
323 if (STREAM_READABLE(s) < size) {
(gdb)
34 return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb)
Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault.
0x00005555556e37be in route_set_aspath_prepend (rule=0x555555aac0d0, prefix=0x7fffffffe050,
object=0x7fffffffdb00) at bgpd/bgp_routemap.c:2282
2282 if (path->attr->aspath->refcnt)
(gdb)
```
With the configuration:
```
neighbor 127.0.0.1 remote-as external
neighbor 127.0.0.1 passive
neighbor 127.0.0.1 ebgp-multihop
neighbor 127.0.0.1 disable-connected-check
neighbor 127.0.0.1 update-source 127.0.0.2
neighbor 127.0.0.1 timers 3 90
neighbor 127.0.0.1 timers connect 1
address-family ipv4 unicast
redistribute connected
neighbor 127.0.0.1 default-originate
neighbor 127.0.0.1 route-map RM_IN in
exit-address-family
!
route-map RM_IN permit 10
set as-path prepend 200
exit
```
Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
|
b08afc81c60607a4f736f418f2e3eb06087f1a35
|
https://github.com/FRRouting/frr/commit/b08afc81c60607a4f736f418f2e3eb06087f1a35
|
bgpd/bgp_attr.c
|
encap_hash_alloc
| null | null | null |
static void *encap_hash_alloc(void *p)
{
/* Encap structure is already allocated. */
return p;
}
|
static void *encap_hash_alloc(void *VAR_0)
{
/* COMMENT_0 */
return VAR_0;
}
|
FRRouting/frr/b08afc81c60607a4f736f418f2e3eb06087f1a35/bgp_attr.c/non_vul/20.json
| null | null | false
|
CVE-2017-0196
|
['CWE-200']
|
AV:N/AC:M/Au:N/C:P/I:N/A:N
| 0
|
chakra-core/ChakraCore
|
[CVE-2017-0196] Fixing an heap overread during slice.
The MissingItem check is happening on the array in a loop. It is possible that we get called into script and that mutates the array. So the Array's head is newly created with length.
However the loop is still performing over the old length.
Fixed this by checking the length In IsMissingItem function.
Added a unittest.
|
065b7978c40ded35c356ced6cd922a40156c9c46
|
https://github.com/chakra-core/ChakraCore/commit/065b7978c40ded35c356ced6cd922a40156c9c46
|
lib/Runtime/Library/JavascriptArray.cpp
|
SegmentBTree::GetLazyCrossOverLimit
| null | null | null |
uint32 SegmentBTree::GetLazyCrossOverLimit()
{
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
if (Js::Configuration::Global.flags.DisableArrayBTree)
{
return Js::JavascriptArray::InvalidIndex;
}
else if (Js::Configuration::Global.flags.ForceArrayBTree)
{
return ARRAY_CROSSOVER_FOR_VALIDATE;
}
#endif
#ifdef VALIDATE_ARRAY
if (Js::Configuration::Global.flags.ArrayValidate)
{
return ARRAY_CROSSOVER_FOR_VALIDATE;
}
#endif
return SegmentBTree::MinDegree * 3;
}
|
uint32 SegmentBTree::GetLazyCrossOverLimit()
{
#ifdef VAR_0
if (Js::Configuration::Global.flags.DisableArrayBTree)
{
return Js::JavascriptArray::InvalidIndex;
}
else if (Js::Configuration::Global.flags.ForceArrayBTree)
{
return VAR_1;
}
#endif
#ifdef VAR_2
if (Js::Configuration::Global.flags.ArrayValidate)
{
return VAR_1;
}
#endif
return SegmentBTree::MinDegree * 3;
}
|
chakra-core/ChakraCore/065b7978c40ded35c356ced6cd922a40156c9c46/JavascriptArray.cpp/non_vul/106.json
| null | null | false
|
CVE-2020-7105
|
['CWE-476']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
redis/hiredis
|
Safe allocation wrappers (#754)
Create allocation wrappers with a configurable OOM handler (defaults to abort()).
See #752, #747
|
a15378861368a4267c2c2c73b90db2849f943ebd
|
https://github.com/redis/hiredis/commit/a15378861368a4267c2c2c73b90db2849f943ebd
|
adapters/libev.h
|
redisLibevWriteEvent
| null | null | null |
static void redisLibevWriteEvent(EV_P_ ev_io *watcher, int revents) {
#if EV_MULTIPLICITY
((void)loop);
#endif
((void)revents);
redisLibevEvents *e = (redisLibevEvents*)watcher->data;
redisAsyncHandleWrite(e->context);
}
|
static void redisLibevWriteEvent(EV_P_ VAR_0 *VAR_1, int VAR_2) {
#if VAR_3
((void)VAR_4);
#endif
((void)VAR_2);
redisLibevEvents *VAR_5 = (redisLibevEvents*)VAR_1->data;
redisAsyncHandleWrite(VAR_5->context);
}
| null | null | null | false
|
CVE-2015-8744
|
['CWE-20']
|
AV:L/AC:L/Au:N/C:N/I:N/A:P
| 0
|
qemu
|
net/vmxnet3: Refine l2 header validation
Validation of l2 header length assumed minimal packet size as
eth_header + 2 * vlan_header regardless of the actual protocol.
This caused crash for valid non-IP packets shorter than 22 bytes, as
'tx_pkt->packet_type' hasn't been assigned for such packets, and
'vmxnet3_on_tx_done_update_stats()' expects it to be properly set.
Refine header length validation in 'vmxnet_tx_pkt_parse_headers'.
Check its return value during packet processing flow.
As a side effect, in case IPv4 and IPv6 header validation failure,
corrupt packets will be dropped.
Signed-off-by: Dana Rubin <dana.rubin@ravellosystems.com>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
|
a7278b36fcab9af469563bd7b
|
https://github.com/qemu/qemu/commit/a7278b36fcab9af469563bd7b9dadebe2ae25e48
|
hw/net/vmxnet3.c
|
vmxnet3_setup_tx_offloads
| null | null | null |
static bool
vmxnet3_setup_tx_offloads(VMXNET3State *s)
{
switch (s->offload_mode) {
case VMXNET3_OM_NONE:
vmxnet_tx_pkt_build_vheader(s->tx_pkt, false, false, 0);
break;
case VMXNET3_OM_CSUM:
vmxnet_tx_pkt_build_vheader(s->tx_pkt, false, true, 0);
VMW_PKPRN("L4 CSO requested\n");
break;
case VMXNET3_OM_TSO:
vmxnet_tx_pkt_build_vheader(s->tx_pkt, true, true,
s->cso_or_gso_size);
vmxnet_tx_pkt_update_ip_checksums(s->tx_pkt);
VMW_PKPRN("GSO offload requested.");
break;
default:
g_assert_not_reached();
return false;
}
return true;
}
|
static bool
vmxnet3_setup_tx_offloads(VMXNET3State *VAR_0)
{
switch (VAR_0->offload_mode) {
case VAR_1:
vmxnet_tx_pkt_build_vheader(VAR_0->tx_pkt, false, false, 0);
break;
case VAR_2:
vmxnet_tx_pkt_build_vheader(VAR_0->tx_pkt, false, true, 0);
VMW_PKPRN("L4 CSO requested\n");
break;
case VAR_3:
vmxnet_tx_pkt_build_vheader(VAR_0->tx_pkt, true, true,
VAR_0->cso_or_gso_size);
vmxnet_tx_pkt_update_ip_checksums(VAR_0->tx_pkt);
VMW_PKPRN("GSO offload requested.");
break;
default:
g_assert_not_reached();
return false;
}
return true;
}
|
qemu/a7278b36fcab9af469563bd7b/vmxnet3.c/non_vul/7.json
| null | null | false
|
CVE-2020-26247
|
['CWE-611']
|
AV:N/AC:L/Au:S/C:P/I:N/A:N
| 0
|
sparklemotion/nokogiri
|
feat: XML::Schema and RelaxNG creation accept optional ParseOptions
I'm trying out a new pattern, which is that the parsed object carries
around the ParseOptions it was created with, which should make some
testing a bit easier.
I'm also not implementing the "config block" pattern in use for
Documents, because I think the UX is weird and I'm hoping to change
everything to use kwargs in a 2.0 release, anyway.
|
9c87439d9afa14a365ff13e73adc809cb2c3d97b
|
https://github.com/sparklemotion/nokogiri/commit/9c87439d9afa14a365ff13e73adc809cb2c3d97b
|
ext/nokogiri/xml_relax_ng.c
|
validate_document
| null | null | null |
static VALUE validate_document(VALUE self, VALUE document)
{
xmlDocPtr doc;
xmlRelaxNGPtr schema;
VALUE errors;
xmlRelaxNGValidCtxtPtr valid_ctxt;
Data_Get_Struct(self, xmlRelaxNG, schema);
Data_Get_Struct(document, xmlDoc, doc);
errors = rb_ary_new();
valid_ctxt = xmlRelaxNGNewValidCtxt(schema);
if(NULL == valid_ctxt) {
/* we have a problem */
rb_raise(rb_eRuntimeError, "Could not create a validation context");
}
#ifdef HAVE_XMLRELAXNGSETVALIDSTRUCTUREDERRORS
xmlRelaxNGSetValidStructuredErrors(
valid_ctxt,
Nokogiri_error_array_pusher,
(void *)errors
);
#endif
xmlRelaxNGValidateDoc(valid_ctxt, doc);
xmlRelaxNGFreeValidCtxt(valid_ctxt);
return errors;
}
|
static VALUE validate_document(VALUE VAR_0, VALUE VAR_1)
{
xmlDocPtr VAR_2;
xmlRelaxNGPtr VAR_3;
VALUE VAR_4;
xmlRelaxNGValidCtxtPtr VAR_5;
Data_Get_Struct(VAR_0, VAR_6, VAR_3);
Data_Get_Struct(VAR_1, VAR_7, VAR_2);
VAR_4 = rb_ary_new();
VAR_5 = xmlRelaxNGNewValidCtxt(VAR_3);
if(NULL == VAR_5) {
/* COMMENT_0 */
rb_raise(VAR_8, "Could not create a validation context");
}
#ifdef VAR_9
xmlRelaxNGSetValidStructuredErrors(
VAR_5,
VAR_10,
(void *)VAR_4
);
#endif
xmlRelaxNGValidateDoc(VAR_5, VAR_2);
xmlRelaxNGFreeValidCtxt(VAR_5);
return VAR_4;
}
|
sparklemotion/nokogiri/9c87439d9afa14a365ff13e73adc809cb2c3d97b/xml_relax_ng.c/non_vul/0.json
| null | null | false
|
CVE-2024-22050
|
['CWE-22']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
| 1
|
boazsegev/iodine
|
update to facil.io 0.7.3
|
5558233fb7defda706b4f9c87c17759705949889
|
https://github.com/boazsegev/iodine/commit/5558233fb7defda706b4f9c87c17759705949889
|
ext/iodine/fio.c
|
fio_cluster_on_close
| null | null | null |
static void fio_cluster_on_close(intptr_t uuid, fio_protocol_s *pr_) {
cluster_pr_s *c = (cluster_pr_s *)pr_;
if (!fio_data->is_worker) {
/* a child was lost, respawning is handled elsewhere. */
fio_lock(&cluster_data.lock);
FIO_LS_FOR(&cluster_data.clients, pos) {
if (pos->obj == (void *)uuid) {
fio_ls_remove(pos);
break;
}
}
fio_unlock(&cluster_data.lock);
} else if (fio_data->active) {
/* no shutdown message received - parent crashed. */
if (c->type != FIO_CLUSTER_MSG_SHUTDOWN && fio_is_running()) {
FIO_LOG_FATAL("(%d) Parent Process crash detected!", (int)getpid());
fio_state_callback_force(FIO_CALL_ON_PARENT_CRUSH);
fio_state_callback_clear(FIO_CALL_ON_PARENT_CRUSH);
fio_cluster_data_cleanup(1);
kill(getpid(), SIGINT);
}
}
if (c->msg)
fio_msg_internal_free(c->msg);
c->msg = NULL;
fio_sub_hash_free(&c->pubsub);
fio_cluster_protocol_free(c);
(void)uuid;
}
|
static void fio_cluster_on_close(intptr_t VAR_0, fio_protocol_s *VAR_1) {
cluster_pr_s *VAR_2 = (cluster_pr_s *)VAR_1;
if (!VAR_3->is_worker) {
/* COMMENT_0 */
fio_lock(&VAR_4.lock);
FIO_LS_FOR(&VAR_4.clients, VAR_5) {
if (VAR_5->obj == (void *)VAR_0) {
fio_ls_remove(VAR_5);
break;
}
}
fio_unlock(&VAR_4.lock);
} else if (VAR_3->active) {
/* COMMENT_1 */
if (VAR_2->type != VAR_6 && fio_is_running()) {
FIO_LOG_FATAL("(%d) Parent Process crash detected!", (int)getpid());
fio_state_callback_force(VAR_7);
fio_state_callback_clear(VAR_7);
fio_cluster_data_cleanup(1);
kill(getpid(), VAR_8);
}
}
if (VAR_2->msg)
fio_msg_internal_free(VAR_2->msg);
VAR_2->msg = NULL;
fio_sub_hash_free(&VAR_2->pubsub);
fio_cluster_protocol_free(VAR_2);
(void)VAR_0;
}
|
boazsegev/iodine/5558233fb7defda706b4f9c87c17759705949889/fio.c/non_vul/174.json
| null | null | false
|
CVE-2012-0855
|
['CWE-119']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
ffmpeg
|
j2kdec: Check curtileno for validity
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
|
3eedf9f716733b3b4c5205726d2c1ca52b3d3d78
|
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=3eedf9f716733b3b4c5205726d2c1ca52b3d3d78
|
libavcodec/j2kdec.c
|
decode_cblk
| null | null | null |
static int decode_cblk(J2kDecoderContext *s, J2kCodingStyle *codsty, J2kT1Context *t1, J2kCblk *cblk,
int width, int height, int bandpos)
{
int passno = cblk->npasses, pass_t = 2, bpno = cblk->nonzerobits - 1, y, clnpass_cnt = 0;
int bpass_csty_symbol = J2K_CBLK_BYPASS & codsty->cblk_style;
int vert_causal_ctx_csty_symbol = J2K_CBLK_VSC & codsty->cblk_style;
for (y = 0; y < height+2; y++)
memset(t1->flags[y], 0, (width+2)*sizeof(int));
for (y = 0; y < height; y++)
memset(t1->data[y], 0, width*sizeof(int));
cblk->data[cblk->length] = 0xff;
cblk->data[cblk->length+1] = 0xff;
ff_mqc_initdec(&t1->mqc, cblk->data);
while(passno--){
switch(pass_t){
case 0: decode_sigpass(t1, width, height, bpno+1, bandpos,
bpass_csty_symbol && (clnpass_cnt >= 4), vert_causal_ctx_csty_symbol);
break;
case 1: decode_refpass(t1, width, height, bpno+1);
if (bpass_csty_symbol && clnpass_cnt >= 4)
ff_mqc_initdec(&t1->mqc, cblk->data);
break;
case 2: decode_clnpass(s, t1, width, height, bpno+1, bandpos,
codsty->cblk_style & J2K_CBLK_SEGSYM);
clnpass_cnt = clnpass_cnt + 1;
if (bpass_csty_symbol && clnpass_cnt >= 4)
ff_mqc_initdec(&t1->mqc, cblk->data);
break;
}
pass_t++;
if (pass_t == 3){
bpno--;
pass_t = 0;
}
}
return 0;
}
|
static int decode_cblk(J2kDecoderContext *VAR_0, J2kCodingStyle *VAR_1, J2kT1Context *VAR_2, J2kCblk *VAR_3,
int VAR_4, int VAR_5, int VAR_6)
{
int VAR_7 = VAR_3->npasses, VAR_8 = 2, VAR_9 = VAR_3->nonzerobits - 1, VAR_10, VAR_11 = 0;
int VAR_12 = VAR_13 & VAR_1->cblk_style;
int VAR_14 = VAR_15 & VAR_1->cblk_style;
for (VAR_10 = 0; VAR_10 < VAR_5+2; VAR_10++)
memset(VAR_2->flags[VAR_10], 0, (VAR_4+2)*sizeof(int));
for (VAR_10 = 0; VAR_10 < VAR_5; VAR_10++)
memset(VAR_2->data[VAR_10], 0, VAR_4*sizeof(int));
VAR_3->data[VAR_3->length] = 0xff;
VAR_3->data[VAR_3->length+1] = 0xff;
ff_mqc_initdec(&VAR_2->mqc, VAR_3->data);
while(VAR_7--){
switch(VAR_8){
case 0: decode_sigpass(VAR_2, VAR_4, VAR_5, VAR_9+1, VAR_6,
VAR_12 && (VAR_11 >= 4), VAR_14);
break;
case 1: decode_refpass(VAR_2, VAR_4, VAR_5, VAR_9+1);
if (VAR_12 && VAR_11 >= 4)
ff_mqc_initdec(&VAR_2->mqc, VAR_3->data);
break;
case 2: decode_clnpass(VAR_0, VAR_2, VAR_4, VAR_5, VAR_9+1, VAR_6,
VAR_1->cblk_style & VAR_16);
VAR_11 = VAR_11 + 1;
if (VAR_12 && VAR_11 >= 4)
ff_mqc_initdec(&VAR_2->mqc, VAR_3->data);
break;
}
VAR_8++;
if (VAR_8 == 3){
VAR_9--;
VAR_8 = 0;
}
}
return 0;
}
|
ffmpeg/3eedf9f716733b3b4c5205726d2c1ca52b3d3d78/j2kdec.c/non_vul/3.json
| null | null | false
|
CVE-2020-14394
|
['CWE-835']
|
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:C/C:N/I:N/A:L
| 1
|
qemu-project/qemu
|
hw/usb/hcd-xhci: Fix unbounded loop in xhci_ring_chain_length() (CVE-2020-14394)
The loop condition in xhci_ring_chain_length() is under control of
the guest, and additionally the code does not check for failed DMA
transfers (e.g. if reaching the end of the RAM), so the loop there
could run for a very long time or even forever. Fix it by checking
the return value of dma_memory_read() and by introducing a maximum
loop length.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/646
Message-Id: <20220804131300.96368-1-thuth@redhat.com>
Reviewed-by: Mauro Matteo Cascella <mcascell@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
effaf5a240e03020f4ae953e10b764622c3e87cc
|
https://gitlab.com/qemu-project/qemu/-/commit/effaf5a240e03020f4ae953e10b764622c3e87cc
|
hw/usb/hcd-xhci.c
|
xhci_alloc_streams
| null | null | null |
static void xhci_alloc_streams(XHCIEPContext *epctx, dma_addr_t base)
{
assert(epctx->pstreams == NULL);
epctx->nr_pstreams = 2 << epctx->max_pstreams;
epctx->pstreams = xhci_alloc_stream_contexts(epctx->nr_pstreams, base);
}
|
static void xhci_alloc_streams(XHCIEPContext *VAR_0, dma_addr_t VAR_1)
{
assert(VAR_0->pstreams == NULL);
VAR_0->nr_pstreams = 2 << VAR_0->max_pstreams;
VAR_0->pstreams = xhci_alloc_stream_contexts(VAR_0->nr_pstreams, VAR_1);
}
|
qemu-project/qemu/effaf5a240e03020f4ae953e10b764622c3e87cc/hcd-xhci.c/non_vul/45.json
| null | null | false
|
CVE-2019-19242
|
['CWE-476']
|
AV:N/AC:M/Au:N/C:N/I:N/A:P
| 0
|
sqlite
|
Fix a problem that comes up when using generated columns that evaluate to a
constant in an index and then making use of that index in a join.
FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af
|
57f7ece78410a8aae86aa4625fb7556897db384c
|
https://github.com/sqlite/sqlite/commit/57f7ece78410a8aae86aa4625fb7556897db384c
|
src/expr.c
|
sqlite3ExprIsTableConstant
| null | null | null |
int sqlite3ExprIsTableConstant(Expr *p, int iCur){
return exprIsConst(p, 3, iCur);
}
|
int sqlite3ExprIsTableConstant(Expr *VAR_0, int VAR_1){
return exprIsConst(VAR_0, 3, VAR_1);
}
|
sqlite/57f7ece78410a8aae86aa4625fb7556897db384c/expr.c/non_vul/92.json
| null | null | false
|
CVE-2015-5069
|
['CWE-200']
|
AV:N/AC:L/Au:S/C:P/I:N/A:N
| 0
|
wesnoth
|
Disallow inclusion of .pbl files from WML (bug #23504)
Note that this will also cause Lua wesnoth.have_file() to return false
on .pbl files.
|
f8914468182e8d0a1551b430c0879ba236fe4d6d
|
https://github.com/wesnoth/wesnoth/commit/f8914468182e8d0a1551b430c0879ba236fe4d6d
|
src/filesystem.cpp
|
create_directory_if_missing_recursive
| null | null | null |
bool create_directory_if_missing_recursive(const std::string& dirname)
{
DBG_FS<<"creating recursive directory: "<<dirname<<'\n';
if (is_directory(dirname) == false && dirname.empty() == false)
{
std::string tmp_dirname = dirname;
// remove trailing slashes or backslashes
while ((tmp_dirname[tmp_dirname.size()-1] == '/' ||
tmp_dirname[tmp_dirname.size()-1] == '\\') &&
!tmp_dirname.empty())
{
tmp_dirname.erase(tmp_dirname.size()-1);
}
// create the first non-existing directory
size_t pos = tmp_dirname.rfind("/");
// we get the most right directory and *skip* it
// we are creating it when we get back here
if (tmp_dirname.rfind('\\') != std::string::npos &&
tmp_dirname.rfind('\\') > pos )
pos = tmp_dirname.rfind('\\');
if (pos != std::string::npos)
create_directory_if_missing_recursive(tmp_dirname.substr(0,pos));
return create_directory_if_missing(tmp_dirname);
}
return create_directory_if_missing(dirname);
}
|
bool create_directory_if_missing_recursive(const std::string& VAR_0)
{
VAR_1<<"creating recursive directory: "<<VAR_0<<'\n';
if (is_directory(VAR_0) == false && VAR_0.empty() == false)
{
std::string VAR_2 = VAR_0;
/* COMMENT_0 */
while ((VAR_2[VAR_2.size()-1] == '/' ||
VAR_2[VAR_2.size()-1] == '\\') &&
!VAR_2.empty())
{
VAR_2.erase(VAR_2.size()-1);
}
/* COMMENT_1 */
size_t VAR_3 = VAR_2.rfind("/");
/* COMMENT_2 */
/* COMMENT_3 */
if (VAR_2.rfind('\\') != std::string::npos &&
VAR_2.rfind('\\') > VAR_3 )
VAR_3 = VAR_2.rfind('\\');
if (VAR_3 != std::string::npos)
create_directory_if_missing_recursive(VAR_2.substr(0,VAR_3));
return create_directory_if_missing(VAR_2);
}
return create_directory_if_missing(VAR_0);
}
|
wesnoth/f8914468182e8d0a1551b430c0879ba236fe4d6d/filesystem.cpp/non_vul/6.json
| null | null | false
|
CVE-2018-18883
|
['CWE-476']
|
AV:L/AC:L/Au:N/C:C/I:C/A:C
| 0
|
xen-project/xen
|
x86/vvmx: Disallow the use of VT-x instructions when nested virt is disabled
c/s ac6a4500b "vvmx: set vmxon_region_pa of vcpu out of VMX operation to an
invalid address" was a real bugfix as described, but has a very subtle bug
which results in all VT-x instructions being usable by a guest.
The toolstack constructs a guest by issuing:
XEN_DOMCTL_createdomain
XEN_DOMCTL_max_vcpus
and optionally later, HVMOP_set_param to enable nested virt.
As a result, the call to nvmx_vcpu_initialise() in hvm_vcpu_initialise()
(which is what makes the above patch look correct during review) is actually
dead code. In practice, nvmx_vcpu_initialise() first gets called when nested
virt is enabled, which is typically never.
As a result, the zeroed memory of struct vcpu causes nvmx_vcpu_in_vmx() to
return true before nested virt is enabled for the guest.
Fixing the order of initialisation is a work in progress for other reasons,
but not viable for security backports.
A compounding factor is that the vmexit handlers for all instructions, other
than VMXON, pass 0 into vmx_inst_check_privilege()'s vmxop_check parameter,
which skips the CR4.VMXE check. (This is one of many reasons why nested virt
isn't a supported feature yet.)
However, the overall result is that when nested virt is not enabled by the
toolstack (i.e. the default configuration for all production guests), the VT-x
instructions (other than VMXON) are actually usable, and Xen very quickly
falls over the fact that the nvmx structure is uninitialised.
In order to fail safe in the supported case, re-implement all the VT-x
instruction handling using a single function with a common prologue, covering
all the checks which should cause #UD or #GP faults. This deliberately
doesn't use any state from the nvmx structure, in case there are other lurking
issues.
This is XSA-278
Reported-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@citrix.com>
|
35cd5ba367515ffbd274ca529c5e946447f4ba48
|
https://github.com/xen-project/xen/commit/35cd5ba367515ffbd274ca529c5e946447f4ba48
|
xen/arch/x86/hvm/vmx/vvmx.c
|
load_vvmcs_host_state
| null | null | null |
static void load_vvmcs_host_state(struct vcpu *v)
{
int i, rc;
u64 r;
u32 control;
for ( i = 0; i < ARRAY_SIZE(vmcs_h2g_field); i++ )
{
r = get_vvmcs(v, vmcs_h2g_field[i].host_field);
__vmwrite(vmcs_h2g_field[i].guest_field, r);
}
rc = hvm_set_cr0(get_vvmcs(v, HOST_CR0), 1);
if ( rc == X86EMUL_EXCEPTION )
hvm_inject_hw_exception(TRAP_gp_fault, 0);
rc = hvm_set_cr4(get_vvmcs(v, HOST_CR4), 1);
if ( rc == X86EMUL_EXCEPTION )
hvm_inject_hw_exception(TRAP_gp_fault, 0);
rc = hvm_set_cr3(get_vvmcs(v, HOST_CR3), 1);
if ( rc == X86EMUL_EXCEPTION )
hvm_inject_hw_exception(TRAP_gp_fault, 0);
control = get_vvmcs(v, VM_EXIT_CONTROLS);
if ( control & VM_EXIT_LOAD_HOST_PAT )
hvm_set_guest_pat(v, get_vvmcs(v, HOST_PAT));
if ( control & VM_EXIT_LOAD_PERF_GLOBAL_CTRL )
{
rc = hvm_msr_write_intercept(MSR_CORE_PERF_GLOBAL_CTRL,
get_vvmcs(v, HOST_PERF_GLOBAL_CTRL), 1);
if ( rc == X86EMUL_EXCEPTION )
hvm_inject_hw_exception(TRAP_gp_fault, 0);
}
hvm_set_tsc_offset(v, v->arch.hvm.cache_tsc_offset, 0);
set_vvmcs(v, VM_ENTRY_INTR_INFO, 0);
}
|
static void load_vvmcs_host_state(struct vcpu *VAR_0)
{
int VAR_1, VAR_2;
u64 VAR_3;
u32 VAR_4;
for ( VAR_1 = 0; VAR_1 < ARRAY_SIZE(VAR_5); VAR_1++ )
{
VAR_3 = get_vvmcs(VAR_0, VAR_5[VAR_1].host_field);
__vmwrite(VAR_5[VAR_1].guest_field, VAR_3);
}
VAR_2 = hvm_set_cr0(get_vvmcs(VAR_0, VAR_6), 1);
if ( VAR_2 == VAR_7 )
hvm_inject_hw_exception(VAR_8, 0);
VAR_2 = hvm_set_cr4(get_vvmcs(VAR_0, VAR_9), 1);
if ( VAR_2 == VAR_7 )
hvm_inject_hw_exception(VAR_8, 0);
VAR_2 = hvm_set_cr3(get_vvmcs(VAR_0, VAR_10), 1);
if ( VAR_2 == VAR_7 )
hvm_inject_hw_exception(VAR_8, 0);
VAR_4 = get_vvmcs(VAR_0, VAR_11);
if ( VAR_4 & VAR_12 )
hvm_set_guest_pat(VAR_0, get_vvmcs(VAR_0, VAR_13));
if ( VAR_4 & VAR_14 )
{
VAR_2 = hvm_msr_write_intercept(VAR_15,
get_vvmcs(VAR_0, VAR_16), 1);
if ( VAR_2 == VAR_7 )
hvm_inject_hw_exception(VAR_8, 0);
}
hvm_set_tsc_offset(VAR_0, VAR_0->arch.hvm.cache_tsc_offset, 0);
set_vvmcs(VAR_0, VAR_17, 0);
}
|
xen-project/xen/35cd5ba367515ffbd274ca529c5e946447f4ba48/vvmx.c/non_vul/51.json
| null | null | false
|
CVE-2022-0480
|
['CWE-770']
|
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
| 1
|
torvalds/linux
|
User can create file locks for each open file and force kernel to allocate
small but long-living objects per each open file.
It makes sense to account for these objects to limit the host's memory
consumption from inside the memcg-limited container.
Link: https://lkml.kernel.org/r/b009f4c7-f0ab-c0ec-8e83-918f47d677da@virtuozzo.com
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrei Vagin <avagin@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Roman Gushchin <guro@fb.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Yutian Yang <nglaive@gmail.com>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
0f12156dff2862ac54235fc72703f18770769042
|
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=0f12156dff2862ac54235fc72703f18770769042
|
fs/locks.c
|
posix_same_owner
| null | null | null |
static int posix_same_owner(struct file_lock *fl1, struct file_lock *fl2)
{
return fl1->fl_owner == fl2->fl_owner;
}
|
static int posix_same_owner(struct file_lock *VAR_0, struct file_lock *VAR_1)
{
return VAR_0->fl_owner == VAR_1->fl_owner;
}
|
torvalds/linux/0f12156dff2862ac54235fc72703f18770769042/locks.c/non_vul/30.json
| null | null | false
|
CVE-2010-4157
|
['CWE-190']
|
AV:L/AC:H/Au:N/C:C/I:C/A:C
| 0
|
torvalds/linux
|
gdth_ioctl_alloc() takes the size variable as an int.
copy_from_user() takes the size variable as an unsigned long.
gen.data_len and gen.sense_len are unsigned longs.
On x86_64 longs are 64 bit and ints are 32 bit.
We could pass in a very large number and the allocation would truncate
the size to 32 bits and allocate a small buffer. Then when we do the
copy_from_user(), it would result in a memory corruption.
CC: stable@kernel.org
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
|
f63ae56e4e97fb12053590e41a4fa59e7daa74a4
|
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=f63ae56e4e97fb12053590e41a4fa59e7daa74a4
|
drivers/scsi/gdth.c
|
gdth_internal_cache_cmd
| null | null | null |
static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
{
u8 t;
gdth_inq_data inq;
gdth_rdcap_data rdc;
gdth_sense_data sd;
gdth_modep_data mpd;
struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
t = scp->device->id;
TRACE(("gdth_internal_cache_cmd() cmd 0x%x hdrive %d\n",
scp->cmnd[0],t));
scp->result = DID_OK << 16;
scp->sense_buffer[0] = 0;
switch (scp->cmnd[0]) {
case TEST_UNIT_READY:
case VERIFY:
case START_STOP:
TRACE2(("Test/Verify/Start hdrive %d\n",t));
break;
case INQUIRY:
TRACE2(("Inquiry hdrive %d devtype %d\n",
t,ha->hdr[t].devtype));
inq.type_qual = (ha->hdr[t].devtype&4) ? TYPE_ROM:TYPE_DISK;
/* you can here set all disks to removable, if you want to do
a flush using the ALLOW_MEDIUM_REMOVAL command */
inq.modif_rmb = 0x00;
if ((ha->hdr[t].devtype & 1) ||
(ha->hdr[t].cluster_type & CLUSTER_DRIVE))
inq.modif_rmb = 0x80;
inq.version = 2;
inq.resp_aenc = 2;
inq.add_length= 32;
strcpy(inq.vendor,ha->oem_name);
sprintf(inq.product,"Host Drive #%02d",t);
strcpy(inq.revision," ");
gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
break;
case REQUEST_SENSE:
TRACE2(("Request sense hdrive %d\n",t));
sd.errorcode = 0x70;
sd.segno = 0x00;
sd.key = NO_SENSE;
sd.info = 0;
sd.add_length= 0;
gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
break;
case MODE_SENSE:
TRACE2(("Mode sense hdrive %d\n",t));
memset((char*)&mpd,0,sizeof(gdth_modep_data));
mpd.hd.data_length = sizeof(gdth_modep_data);
mpd.hd.dev_par = (ha->hdr[t].devtype&2) ? 0x80:0;
mpd.hd.bd_length = sizeof(mpd.bd);
mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
break;
case READ_CAPACITY:
TRACE2(("Read capacity hdrive %d\n",t));
if (ha->hdr[t].size > (u64)0xffffffff)
rdc.last_block_no = 0xffffffff;
else
rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
rdc.block_length = cpu_to_be32(SECTOR_SIZE);
gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
break;
case SERVICE_ACTION_IN:
if ((scp->cmnd[1] & 0x1f) == SAI_READ_CAPACITY_16 &&
(ha->cache_feat & GDT_64BIT)) {
gdth_rdcap16_data rdc16;
TRACE2(("Read capacity (16) hdrive %d\n",t));
rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
rdc16.block_length = cpu_to_be32(SECTOR_SIZE);
gdth_copy_internal_data(ha, scp, (char*)&rdc16,
sizeof(gdth_rdcap16_data));
} else {
scp->result = DID_ABORT << 16;
}
break;
default:
TRACE2(("Internal cache cmd 0x%x unknown\n",scp->cmnd[0]));
break;
}
if (!cmndinfo->wait_for_completion)
cmndinfo->wait_for_completion++;
else
return 1;
return 0;
}
|
static int gdth_internal_cache_cmd(gdth_ha_str *VAR_0, Scsi_Cmnd *VAR_1)
{
u8 VAR_2;
gdth_inq_data VAR_3;
gdth_rdcap_data VAR_4;
gdth_sense_data VAR_5;
gdth_modep_data VAR_6;
struct gdth_cmndinfo *VAR_7 = gdth_cmnd_priv(VAR_1);
VAR_2 = VAR_1->device->id;
TRACE(("gdth_internal_cache_cmd() cmd 0x%x hdrive %d\n",
VAR_1->cmnd[0],VAR_2));
VAR_1->result = VAR_8 << 16;
VAR_1->sense_buffer[0] = 0;
switch (VAR_1->cmnd[0]) {
case VAR_9:
case VAR_10:
case VAR_11:
TRACE2(("Test/Verify/Start hdrive %d\n",VAR_2));
break;
case VAR_12:
TRACE2(("Inquiry hdrive %d devtype %d\n",
VAR_2,VAR_0->hdr[VAR_2].devtype));
VAR_3.type_qual = (VAR_0->hdr[VAR_2].devtype&4) ? VAR_13:VAR_14;
/* COMMENT_0 */
VAR_3.modif_rmb = 0x00;
if ((VAR_0->hdr[VAR_2].devtype & 1) ||
(VAR_0->hdr[VAR_2].cluster_type & VAR_15))
VAR_3.modif_rmb = 0x80;
VAR_3.version = 2;
VAR_3.resp_aenc = 2;
VAR_3.add_length= 32;
strcpy(VAR_3.vendor,VAR_0->oem_name);
sprintf(VAR_3.product,"Host Drive #%02d",VAR_2);
strcpy(VAR_3.revision," ");
gdth_copy_internal_data(VAR_0, VAR_1, (char*)&VAR_3, sizeof(gdth_inq_data));
break;
case VAR_16:
TRACE2(("Request sense hdrive %d\n",VAR_2));
VAR_5.errorcode = 0x70;
VAR_5.segno = 0x00;
VAR_5.key = VAR_17;
VAR_5.info = 0;
VAR_5.add_length= 0;
gdth_copy_internal_data(VAR_0, VAR_1, (char*)&VAR_5, sizeof(gdth_sense_data));
break;
case VAR_18:
TRACE2(("Mode sense hdrive %d\n",VAR_2));
memset((char*)&VAR_6,0,sizeof(gdth_modep_data));
VAR_6.hd.data_length = sizeof(gdth_modep_data);
VAR_6.hd.dev_par = (VAR_0->hdr[VAR_2].devtype&2) ? 0x80:0;
VAR_6.hd.bd_length = sizeof(VAR_6.bd);
VAR_6.bd.block_length[0] = (VAR_19 & 0x00ff0000) >> 16;
VAR_6.bd.block_length[1] = (VAR_19 & 0x0000ff00) >> 8;
VAR_6.bd.block_length[2] = (VAR_19 & 0x000000ff);
gdth_copy_internal_data(VAR_0, VAR_1, (char*)&VAR_6, sizeof(gdth_modep_data));
break;
case VAR_20:
TRACE2(("Read capacity hdrive %d\n",VAR_2));
if (VAR_0->hdr[VAR_2].size > (u64)0xffffffff)
VAR_4.last_block_no = 0xffffffff;
else
VAR_4.last_block_no = cpu_to_be32(VAR_0->hdr[VAR_2].size-1);
VAR_4.block_length = cpu_to_be32(VAR_19);
gdth_copy_internal_data(VAR_0, VAR_1, (char*)&VAR_4, sizeof(gdth_rdcap_data));
break;
case VAR_21:
if ((VAR_1->cmnd[1] & 0x1f) == VAR_22 &&
(VAR_0->cache_feat & VAR_23)) {
gdth_rdcap16_data VAR_24;
TRACE2(("Read capacity (16) hdrive %d\n",VAR_2));
VAR_24.last_block_no = cpu_to_be64(VAR_0->hdr[VAR_2].size-1);
VAR_24.block_length = cpu_to_be32(VAR_19);
gdth_copy_internal_data(VAR_0, VAR_1, (char*)&VAR_24,
sizeof(gdth_rdcap16_data));
} else {
VAR_1->result = VAR_25 << 16;
}
break;
default:
TRACE2(("Internal cache cmd 0x%x unknown\n",VAR_1->cmnd[0]));
break;
}
if (!VAR_7->wait_for_completion)
VAR_7->wait_for_completion++;
else
return 1;
return 0;
}
|
torvalds/linux/f63ae56e4e97fb12053590e41a4fa59e7daa74a4/gdth.c/non_vul/5.json
| null | null | false
|
CVE-2012-0789
|
['CWE-399']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
php/php-src
|
- Fixed bug #53502 (strtotime with timezone memory leak).
- Fixed bug #52062 (large timestamps with DateTime::getTimestamp and
DateTime::setTimestamp).
- Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
format).
- Fixed bug #51223 (Seg fault while creating (by unserialization)
DatePeriod).
|
4c9fad8b362a7d2b6a94b4961e4b2dc037b2766d
|
https://github.com/php/php-src/commit/4c9fad8b362a7d2b6a94b4961e4b2dc037b2766d
|
ext/date/lib/parse_date.c
|
timelib_meridian_with_check
| null | null | null |
static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
{
timelib_sll retval = 0;
while (!strchr("AaPp", **ptr)) {
++*ptr;
}
if (**ptr == 'a' || **ptr == 'A') {
if (h == 12) {
retval = -12;
}
} else if (h != 12) {
retval = 12;
}
++*ptr;
if (**ptr == '.') {
++*ptr;
if (**ptr != 'm' && **ptr != 'M') {
return TIMELIB_UNSET;
}
++*ptr;
if (**ptr != '.' ) {
return TIMELIB_UNSET;
}
++*ptr;
} else if (**ptr == 'm' || **ptr == 'M') {
++*ptr;
} else {
return TIMELIB_UNSET;
}
return retval;
}
|
static timelib_sll timelib_meridian_with_check(char **VAR_0, timelib_sll VAR_1)
{
timelib_sll VAR_2 = 0;
while (!strchr("AaPp", **VAR_0)) {
++*VAR_0;
}
if (**VAR_0 == 'a' || **VAR_0 == 'A') {
if (VAR_1 == 12) {
VAR_2 = -12;
}
} else if (VAR_1 != 12) {
VAR_2 = 12;
}
++*VAR_0;
if (**VAR_0 == '.') {
++*VAR_0;
if (**VAR_0 != 'm' && **VAR_0 != 'M') {
return VAR_3;
}
++*VAR_0;
if (**VAR_0 != '.' ) {
return VAR_3;
}
++*VAR_0;
} else if (**VAR_0 == 'm' || **VAR_0 == 'M') {
++*VAR_0;
} else {
return VAR_3;
}
return VAR_2;
}
|
php/php-src/4c9fad8b362a7d2b6a94b4961e4b2dc037b2766d/parse_date.c/non_vul/21.json
| null | null | false
|
CVE-2022-3566
|
['CWE-362']
|
CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
| 1
|
torvalds/linux
|
setsockopt(IPV6_ADDRFORM) and tcp_v6_connect() change icsk->icsk_af_ops
under lock_sock(), but tcp_(get|set)sockopt() read it locklessly. To
avoid load/store tearing, we need to add READ_ONCE() and WRITE_ONCE()
for the reads and writes.
Thanks to Eric Dumazet for providing the syzbot report:
BUG: KCSAN: data-race in tcp_setsockopt / tcp_v6_connect
write to 0xffff88813c624518 of 8 bytes by task 23936 on cpu 0:
tcp_v6_connect+0x5b3/0xce0 net/ipv6/tcp_ipv6.c:240
__inet_stream_connect+0x159/0x6d0 net/ipv4/af_inet.c:660
inet_stream_connect+0x44/0x70 net/ipv4/af_inet.c:724
__sys_connect_file net/socket.c:1976 [inline]
__sys_connect+0x197/0x1b0 net/socket.c:1993
__do_sys_connect net/socket.c:2003 [inline]
__se_sys_connect net/socket.c:2000 [inline]
__x64_sys_connect+0x3d/0x50 net/socket.c:2000
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
read to 0xffff88813c624518 of 8 bytes by task 23937 on cpu 1:
tcp_setsockopt+0x147/0x1c80 net/ipv4/tcp.c:3789
sock_common_setsockopt+0x5d/0x70 net/core/sock.c:3585
__sys_setsockopt+0x212/0x2b0 net/socket.c:2252
__do_sys_setsockopt net/socket.c:2263 [inline]
__se_sys_setsockopt net/socket.c:2260 [inline]
__x64_sys_setsockopt+0x62/0x70 net/socket.c:2260
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
value changed: 0xffffffff8539af68 -> 0xffffffff8539aff8
Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 23937 Comm: syz-executor.5 Not tainted
6.0.0-rc4-syzkaller-00331-g4ed9c1e971b1-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine,
BIOS Google 08/26/2022
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot <syzkaller@googlegroups.com>
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57
|
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57
|
net/ipv4/tcp.c
|
tcp_inq_hint
| null | null | null |
static int tcp_inq_hint(struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);
u32 copied_seq = READ_ONCE(tp->copied_seq);
u32 rcv_nxt = READ_ONCE(tp->rcv_nxt);
int inq;
inq = rcv_nxt - copied_seq;
if (unlikely(inq < 0 || copied_seq != READ_ONCE(tp->copied_seq))) {
lock_sock(sk);
inq = tp->rcv_nxt - tp->copied_seq;
release_sock(sk);
}
/* After receiving a FIN, tell the user-space to continue reading
* by returning a non-zero inq.
*/
if (inq == 0 && sock_flag(sk, SOCK_DONE))
inq = 1;
return inq;
}
|
static int tcp_inq_hint(struct sock *VAR_0)
{
const struct tcp_sock *VAR_1 = tcp_sk(VAR_0);
u32 VAR_2 = READ_ONCE(VAR_1->copied_seq);
u32 VAR_3 = READ_ONCE(VAR_1->rcv_nxt);
int VAR_4;
VAR_4 = VAR_3 - VAR_2;
if (unlikely(VAR_4 < 0 || VAR_2 != READ_ONCE(VAR_1->copied_seq))) {
lock_sock(VAR_0);
VAR_4 = VAR_1->rcv_nxt - VAR_1->copied_seq;
release_sock(VAR_0);
}
/* COMMENT_0 */
if (VAR_4 == 0 && sock_flag(VAR_0, VAR_5))
VAR_4 = 1;
return VAR_4;
}
|
torvalds/linux/f49cd2f4d6170d27a2c61f1fecb03d8a70c91f57/tcp.c/non_vul/39.json
| null | null | false
|
CVE-2023-0414
|
['CWE-404']
|
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
| 1
|
wireshark
|
eap: tweak conversation tracking to avoid breaking pinfo horribly
Looks like conversation_set_conv_addr_port_endpoints() from 66b441f3d is
designed with this use case in mind.
This should resolve issue #18622
|
a8b16d74e1946c4d32bd6b880ab13b7850cc70be
|
https://gitlab.com/wireshark/wireshark/-/commit/a8b16d74e1946c4d32bd6b880ab13b7850cc70be
|
epan/dissectors/packet-eap.c
|
dissect_eap_mschapv2
| null | null | null |
static void
dissect_eap_mschapv2(proto_tree *eap_tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
gint size)
{
proto_item *item;
gint left = size;
gint ms_len;
guint8 value_size;
guint8 opcode;
/* OpCode (1 byte), MS-CHAPv2-ID (1 byte), MS-Length (2 bytes), Data */
opcode = tvb_get_guint8(tvb, offset);
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
left -= 1;
if (left <= 0)
return;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
left -= 1;
if (left <= 0)
return;
item = proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_length, tvb, offset, 2, ENC_BIG_ENDIAN);
ms_len = tvb_get_ntohs(tvb, offset);
if (ms_len != size)
expert_add_info(pinfo, item, &ei_eap_ms_chap_v2_length);
offset += 2;
left -= 2;
switch (opcode) {
case MS_CHAP_V2_CHALLENGE:
if (left <= 0)
break;
value_size = tvb_get_guint8(tvb, offset);
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_value_size,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
left -= 1;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_challenge,
tvb, offset, value_size, ENC_NA);
offset += value_size;
left -= value_size;
if (left <= 0)
break;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_name,
tvb, offset, left, ENC_ASCII);
break;
case MS_CHAP_V2_RESPONSE:
if (left <= 0)
break;
value_size = tvb_get_guint8(tvb, offset);
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_value_size,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
left -= 1;
if (value_size == 49) {
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_peer_challenge,
tvb, offset, 16, ENC_NA);
offset += 16;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_reserved,
tvb, offset, 8, ENC_NA);
offset += 8;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_nt_response,
tvb, offset, 24, ENC_NA);
offset += 24;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_flags,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
left -= value_size;
} else {
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_response, tvb, offset, value_size, ENC_NA);
offset += value_size;
left -= value_size;
}
if (left <= 0)
break;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_name, tvb, offset, left, ENC_ASCII);
break;
case MS_CHAP_V2_SUCCESS:
if (left <= 0)
break;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_message,
tvb, offset, left, ENC_ASCII);
break;
case MS_CHAP_V2_FAILURE:
if (left <= 0)
break;
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_failure_request,
tvb, offset, left, ENC_ASCII);
break;
default:
proto_tree_add_item(eap_tree, hf_eap_ms_chap_v2_data, tvb, offset, left, ENC_NA);
break;
}
}
|
static void
dissect_eap_mschapv2(proto_tree *VAR_0, tvbuff_t *VAR_1, packet_info *VAR_2, int VAR_3,
gint VAR_4)
{
proto_item *VAR_5;
gint VAR_6 = VAR_4;
gint VAR_7;
guint8 VAR_8;
guint8 VAR_9;
/* COMMENT_0 */
VAR_9 = tvb_get_guint8(VAR_1, VAR_3);
proto_tree_add_item(VAR_0, VAR_10, VAR_1, VAR_3, 1, VAR_11);
VAR_3 += 1;
VAR_6 -= 1;
if (VAR_6 <= 0)
return;
proto_tree_add_item(VAR_0, VAR_12, VAR_1, VAR_3, 1, VAR_11);
VAR_3 += 1;
VAR_6 -= 1;
if (VAR_6 <= 0)
return;
VAR_5 = proto_tree_add_item(VAR_0, VAR_13, VAR_1, VAR_3, 2, VAR_11);
VAR_7 = tvb_get_ntohs(VAR_1, VAR_3);
if (VAR_7 != VAR_4)
expert_add_info(VAR_2, VAR_5, &VAR_14);
VAR_3 += 2;
VAR_6 -= 2;
switch (VAR_9) {
case VAR_15:
if (VAR_6 <= 0)
break;
VAR_8 = tvb_get_guint8(VAR_1, VAR_3);
proto_tree_add_item(VAR_0, VAR_16,
VAR_1, VAR_3, 1, VAR_11);
VAR_3 += 1;
VAR_6 -= 1;
proto_tree_add_item(VAR_0, VAR_17,
VAR_1, VAR_3, VAR_8, VAR_18);
VAR_3 += VAR_8;
VAR_6 -= VAR_8;
if (VAR_6 <= 0)
break;
proto_tree_add_item(VAR_0, VAR_19,
VAR_1, VAR_3, VAR_6, VAR_20);
break;
case VAR_21:
if (VAR_6 <= 0)
break;
VAR_8 = tvb_get_guint8(VAR_1, VAR_3);
proto_tree_add_item(VAR_0, VAR_16,
VAR_1, VAR_3, 1, VAR_11);
VAR_3 += 1;
VAR_6 -= 1;
if (VAR_8 == 49) {
proto_tree_add_item(VAR_0, VAR_22,
VAR_1, VAR_3, 16, VAR_18);
VAR_3 += 16;
proto_tree_add_item(VAR_0, VAR_23,
VAR_1, VAR_3, 8, VAR_18);
VAR_3 += 8;
proto_tree_add_item(VAR_0, VAR_24,
VAR_1, VAR_3, 24, VAR_18);
VAR_3 += 24;
proto_tree_add_item(VAR_0, VAR_25,
VAR_1, VAR_3, 1, VAR_11);
VAR_3 += 1;
VAR_6 -= VAR_8;
} else {
proto_tree_add_item(VAR_0, VAR_26, VAR_1, VAR_3, VAR_8, VAR_18);
VAR_3 += VAR_8;
VAR_6 -= VAR_8;
}
if (VAR_6 <= 0)
break;
proto_tree_add_item(VAR_0, VAR_19, VAR_1, VAR_3, VAR_6, VAR_20);
break;
case VAR_27:
if (VAR_6 <= 0)
break;
proto_tree_add_item(VAR_0, VAR_28,
VAR_1, VAR_3, VAR_6, VAR_20);
break;
case VAR_29:
if (VAR_6 <= 0)
break;
proto_tree_add_item(VAR_0, VAR_30,
VAR_1, VAR_3, VAR_6, VAR_20);
break;
default:
proto_tree_add_item(VAR_0, VAR_31, VAR_1, VAR_3, VAR_6, VAR_18);
break;
}
}
|
wireshark/a8b16d74e1946c4d32bd6b880ab13b7850cc70be/packet-eap.c/non_vul/10.json
| null | null | false
|
CVE-2015-7972
|
['CWE-399']
|
AV:L/AC:L/Au:N/C:N/I:N/A:P
| 0
|
xen-project/xen
|
libxl: adjust PoD target by memory fudge, too
PoD guests need to balloon at least as far as required by PoD, or risk
crashing. Currently they don't necessarily know what the right value
is, because our memory accounting is (at the very least) confusing.
Apply the memory limit fudge factor to the in-hypervisor PoD memory
target, too. This will increase the size of the guest's PoD cache by
the fudge factor LIBXL_MAXMEM_CONSTANT (currently 1Mby). This ensures
that even with a slightly-off balloon driver, the guest will be
stable even under memory pressure.
There are two call sites of xc_domain_set_pod_target that need fixing:
The one in libxl_set_memory_target is straightforward.
The one in xc_hvm_build_x86.c:setup_guest is more awkward. Simply
setting the PoD target differently does not work because the various
amounts of memory during domain construction no longer match up.
Instead, we adjust the guest memory target in xenstore (but only for
PoD guests).
This introduces a 1Mby discrepancy between the balloon target of a PoD
guest at boot, and the target set by an apparently-equivalent `xl
mem-set' (or similar) later. This approach is low-risk for a security
fix but we need to fix this up properly in xen.git#staging and
probably also in stable trees.
This is XSA-153.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
(cherry picked from commit 56fb5fd62320eb40a7517206f9706aa9188d6f7b)
|
e294a0c3af9f4443dc692b180fb1771b1cb075e8
|
https://github.com/xen-project/xen/commit/e294a0c3af9f4443dc692b180fb1771b1cb075e8
|
tools/libxl/libxl.c
|
libxl_string_list_length
| null | null | null |
int libxl_string_list_length(const libxl_string_list *psl)
{
int i = 0;
if (*psl)
while ((*psl)[i])
i++;
return i;
}
|
int libxl_string_list_length(const libxl_string_list *VAR_0)
{
int VAR_1 = 0;
if (*VAR_0)
while ((*VAR_0)[VAR_1])
VAR_1++;
return VAR_1;
}
|
xen-project/xen/e294a0c3af9f4443dc692b180fb1771b1cb075e8/libxl.c/non_vul/50.json
| null | null | false
|
CVE-2023-5377
|
['CWE-125']
|
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
| 1
|
gpac
|
fixed #2606
|
8e9d6b38c036a97020c462ad48e1132e0ddc57ce
|
https://github.com/gpac/gpac/commit/8e9d6b38c036a97020c462ad48e1132e0ddc57ce
|
src/isomedia/box_code_base.c
|
esds_box_write
| null | null | null |
GF_Err esds_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u8 *enc_desc;
u32 descSize = 0;
GF_ESDBox *ptr = (GF_ESDBox *)s;
//make sure we write with no ESID and no OCRESID
if (ptr->desc) {
ptr->desc->ESID = 0;
ptr->desc->OCRESID = 0;
}
e = gf_isom_full_box_write(s, bs);
if (e) return e;
e = gf_odf_desc_write((GF_Descriptor *)ptr->desc, &enc_desc, &descSize);
if (e) return e;
gf_bs_write_data(bs, enc_desc, descSize);
//free our buffer
gf_free(enc_desc);
return GF_OK;
}
|
GF_Err esds_box_write(GF_Box *VAR_0, GF_BitStream *VAR_1)
{
GF_Err VAR_2;
u8 *VAR_3;
u32 VAR_4 = 0;
GF_ESDBox *VAR_5 = (GF_ESDBox *)VAR_0;
/* COMMENT_0 */
if (VAR_5->desc) {
VAR_5->desc->ESID = 0;
VAR_5->desc->OCRESID = 0;
}
VAR_2 = gf_isom_full_box_write(VAR_0, VAR_1);
if (VAR_2) return VAR_2;
VAR_2 = gf_odf_desc_write((GF_Descriptor *)VAR_5->desc, &VAR_3, &VAR_4);
if (VAR_2) return VAR_2;
gf_bs_write_data(VAR_1, VAR_3, VAR_4);
/* COMMENT_1 */
gf_free(VAR_3);
return VAR_6;
}
|
gpac/8e9d6b38c036a97020c462ad48e1132e0ddc57ce/box_code_base.c/non_vul/447.json
| null | null | false
|
CVE-2011-0523
|
['CWE-264']
|
AV:L/AC:M/Au:N/C:P/I:N/A:N
| 0
|
gypsy
|
Fixes part of 33431
|
40101707cddb319481133b2a137294b6b669bd16
|
http://cgit.freedesktop.org/gypsy/commit/?id=40101707cddb319481133b2a137294b6b669bd16
|
src/gypsy-server.c
|
gypsy_server_error_quark
| null | null | null |
GQuark
gypsy_server_error_quark (void)
{
static GQuark quark = 0;
if (quark == 0) {
quark = g_quark_from_static_string ("gypsy-server-error-quark");
}
return quark;
}
|
GQuark
gypsy_server_error_quark (void)
{
static GQuark VAR_0 = 0;
if (VAR_0 == 0) {
VAR_0 = g_quark_from_static_string ("gypsy-server-error-quark");
}
return VAR_0;
}
|
gypsy/40101707cddb319481133b2a137294b6b669bd16/gypsy-server.c/non_vul/3.json
| null | null | false
|
CVE-2019-19012
|
['CWE-190', 'CWE-125']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
kkos/oniguruma
|
fix #164: Integer overflow related to reg->dmax in search_in_range()
|
0463e21432515631a9bc925ce5eb95b097c73719
|
https://github.com/kkos/oniguruma/commit/0463e21432515631a9bc925ce5eb95b097c73719
|
src/regexec.c
|
onig_region_copy
| null | null | null |
extern void
onig_region_copy(OnigRegion* to, OnigRegion* from)
{
#define RREGC_SIZE (sizeof(int) * from->num_regs)
int i;
if (to == from) return;
if (to->allocated == 0) {
if (from->num_regs > 0) {
to->beg = (int* )xmalloc(RREGC_SIZE);
if (IS_NULL(to->beg)) return;
to->end = (int* )xmalloc(RREGC_SIZE);
if (IS_NULL(to->end)) return;
to->allocated = from->num_regs;
}
}
else if (to->allocated < from->num_regs) {
to->beg = (int* )xrealloc(to->beg, RREGC_SIZE);
if (IS_NULL(to->beg)) return;
to->end = (int* )xrealloc(to->end, RREGC_SIZE);
if (IS_NULL(to->end)) return;
to->allocated = from->num_regs;
}
for (i = 0; i < from->num_regs; i++) {
to->beg[i] = from->beg[i];
to->end[i] = from->end[i];
}
to->num_regs = from->num_regs;
#ifdef USE_CAPTURE_HISTORY
history_root_free(to);
if (IS_NOT_NULL(from->history_root)) {
to->history_root = history_tree_clone(from->history_root);
}
#endif
}
|
extern void
onig_region_copy(OnigRegion* VAR_0, OnigRegion* VAR_1)
{
#define VAR_2 (sizeof(int) * from->num_regs)
int VAR_3;
if (VAR_0 == VAR_1) return;
if (VAR_0->allocated == 0) {
if (VAR_1->num_regs > 0) {
VAR_0->beg = (int* )xmalloc(VAR_2);
if (IS_NULL(VAR_0->beg)) return;
VAR_0->end = (int* )xmalloc(VAR_2);
if (IS_NULL(VAR_0->end)) return;
VAR_0->allocated = VAR_1->num_regs;
}
}
else if (VAR_0->allocated < VAR_1->num_regs) {
VAR_0->beg = (int* )xrealloc(VAR_0->beg, VAR_2);
if (IS_NULL(VAR_0->beg)) return;
VAR_0->end = (int* )xrealloc(VAR_0->end, VAR_2);
if (IS_NULL(VAR_0->end)) return;
VAR_0->allocated = VAR_1->num_regs;
}
for (VAR_3 = 0; VAR_3 < VAR_1->num_regs; VAR_3++) {
VAR_0->beg[VAR_3] = VAR_1->beg[VAR_3];
VAR_0->end[VAR_3] = VAR_1->end[VAR_3];
}
VAR_0->num_regs = VAR_1->num_regs;
#ifdef VAR_4
history_root_free(VAR_0);
if (IS_NOT_NULL(VAR_1->history_root)) {
VAR_0->history_root = history_tree_clone(VAR_1->history_root);
}
#endif
}
|
kkos/oniguruma/0463e21432515631a9bc925ce5eb95b097c73719/regexec.c/non_vul/69.json
| null | null | false
|
CVE-2018-1000115
|
['CWE-400']
|
AV:N/AC:L/Au:N/C:N/I:N/A:P
| 0
|
memcached
|
disable UDP port by default
As reported, UDP amplification attacks have started to use insecure
internet-exposed memcached instances. UDP used to be a lot more popular as a
transport for memcached many years ago, but I'm not aware of many recent
users.
Ten years ago, the TCP connection overhead from many clients was relatively
high (dozens or hundreds per client server), but these days many clients are
batched, or user fewer processes, or simply anre't worried about it.
While changing the default to listen on localhost only would also help, the
true culprit is UDP. There are many more use cases for using memcached over
the network than there are for using the UDP protocol.
|
dbb7a8af90054bf4ef51f5814ef7ceb17d83d974
|
https://github.com/memcached/memcached/commit/dbb7a8af90054bf4ef51f5814ef7ceb17d83d974
|
memcached.c
|
process_stats_conns
| null | null | null |
static void process_stats_conns(ADD_STAT add_stats, void *c) {
int i;
char key_str[STAT_KEY_LEN];
char val_str[STAT_VAL_LEN];
char conn_name[MAXPATHLEN + sizeof("unix:") + sizeof("65535")];
int klen = 0, vlen = 0;
assert(add_stats);
for (i = 0; i < max_fds; i++) {
if (conns[i]) {
/* This is safe to do unlocked because conns are never freed; the
* worst that'll happen will be a minor inconsistency in the
* output -- not worth the complexity of the locking that'd be
* required to prevent it.
*/
if (conns[i]->state != conn_closed) {
conn_to_str(conns[i], conn_name);
APPEND_NUM_STAT(i, "addr", "%s", conn_name);
APPEND_NUM_STAT(i, "state", "%s",
state_text(conns[i]->state));
APPEND_NUM_STAT(i, "secs_since_last_cmd", "%d",
current_time - conns[i]->last_cmd_time);
}
}
}
}
|
static void process_stats_conns(ADD_STAT VAR_0, void *VAR_1) {
int VAR_2;
char VAR_3[VAR_4];
char VAR_5[VAR_6];
char VAR_7[VAR_8 + sizeof("unix:") + sizeof("65535")];
int VAR_9 = 0, VAR_10 = 0;
assert(VAR_0);
for (VAR_2 = 0; VAR_2 < VAR_11; VAR_2++) {
if (VAR_12[VAR_2]) {
/* COMMENT_0 */
if (VAR_12[VAR_2]->state != VAR_13) {
conn_to_str(VAR_12[VAR_2], VAR_7);
APPEND_NUM_STAT(VAR_2, "addr", "%s", VAR_7);
APPEND_NUM_STAT(VAR_2, "state", "%s",
state_text(VAR_12[VAR_2]->state));
APPEND_NUM_STAT(VAR_2, "secs_since_last_cmd", "%d",
VAR_14 - VAR_12[VAR_2]->last_cmd_time);
}
}
}
}
|
memcached/dbb7a8af90054bf4ef51f5814ef7ceb17d83d974/memcached.c/non_vul/6.json
| null | null | false
|
CVE-2016-7031
|
['CWE-254', 'CWE-200']
|
AV:N/AC:M/Au:N/C:P/I:N/A:N
| 0
|
ceph
|
13207: Rados Gateway: Anonymous user is able to read bucket with authenticated read ACL
Signed-off-by: root <rahul.1aggarwal@gmail.com>
|
99ba6610a8f437604cadf68cbe9969def893e870
|
https://github.com/ceph/ceph/commit/99ba6610a8f437604cadf68cbe9969def893e870
|
src/rgw/rgw_op.cc
|
RGWGetACLs::execute
| null | null | null |
void RGWGetACLs::execute()
{
stringstream ss;
RGWAccessControlPolicy *acl = (!s->object.empty() ? s->object_acl : s->bucket_acl);
RGWAccessControlPolicy_S3 *s3policy = static_cast<RGWAccessControlPolicy_S3 *>(acl);
s3policy->to_xml(ss);
acls = ss.str();
}
|
void RGWGetACLs::execute()
{
stringstream VAR_0;
RGWAccessControlPolicy *VAR_1 = (!VAR_2->object.empty() ? VAR_2->object_acl : VAR_2->bucket_acl);
RGWAccessControlPolicy_S3 *VAR_3 = VAR_4<RGWAccessControlPolicy_S3 *>(VAR_1);
VAR_3->to_xml(VAR_0);
VAR_5 = VAR_0.str();
}
|
ceph/99ba6610a8f437604cadf68cbe9969def893e870/rgw_op.cc/non_vul/91.json
| null | null | false
|
CVE-2016-1636
|
['CWE-264']
|
AV:N/AC:L/Au:N/C:P/I:P/A:P
| 0
|
chromium
|
Fix SRI bypass by loading same resource twice in same origin.
This fixes a bug where the memory cache was bypassing subresource
integrity checks when a resource is loaded for a second time in the same
origin. The resource in the memory cache was correctly storing that an
integrity check had already been done so whene it was retrieved later,
it wouldn't need to be checked again, but it didn't store the fact that
this was a *failure*, so when the load happened a second time, it
assumed it was a good integrity.
This modifies the resources to store a disposition for the integrity
check, rather than just that the integrity check occurred. On a reload
of the resource, if the integrity had failed the first time, the
resource will fail to load.
BUG=584155
Review URL: https://codereview.chromium.org/1675183003
Cr-Commit-Position: refs/heads/master@{#374336}
(cherry picked from commit bf24693238d407f90bec71453b18aae8dd1c0f43)
Review URL: https://codereview.chromium.org/1713093002 .
Cr-Commit-Position: refs/branch-heads/2623@{#452}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
|
0979e9712439b056355af462d68fe5c6d9ee5466
|
https://chromium.googlesource.com/chromium/src/+/0979e9712439b056355af462d68fe5c6d9ee5466
|
third_party/WebKit/Source/core/dom/PendingScript.cpp
|
PendingScript::PendingScript
| null | null | null |
PendingScript::PendingScript()
: m_watchingForLoad(false)
, m_startingPosition(TextPosition::belowRangePosition())
, m_integrityFailure(false)
{
}
|
PendingScript::PendingScript()
: m_watchingForLoad(false)
, m_startingPosition(TextPosition::belowRangePosition())
, m_integrityFailure(false)
{
}
|
chromium/0979e9712439b056355af462d68fe5c6d9ee5466/PendingScript.cpp/non_vul/2.json
| null | null | false
|
CVE-2014-4014
|
['CWE-264']
|
AV:L/AC:H/Au:N/C:C/I:C/A:C
| 0
|
torvalds/linux
|
fs,userns: Change inode_capable to capable_wrt_inode_uidgid
The kernel has no concept of capabilities with respect to inodes; inodes
exist independently of namespaces. For example, inode_capable(inode,
CAP_LINUX_IMMUTABLE) would be nonsense.
This patch changes inode_capable to check for uid and gid mappings and
renames it to capable_wrt_inode_uidgid, which should make it more
obvious what it does.
Fixes CVE-2014-4014.
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: stable@vger.kernel.org
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
23adbe12ef7d3d4195e80800ab36b37bee28cd03
|
https://github.com/torvalds/linux/commit/23adbe12ef7d3d4195e80800ab36b37bee28cd03
|
fs/namei.c
|
kern_path_mountpoint
| null | null | null |
int
kern_path_mountpoint(int dfd, const char *name, struct path *path,
unsigned int flags)
{
struct filename s = {.name = name};
return filename_mountpoint(dfd, &s, path, flags);
}
|
int
kern_path_mountpoint(int VAR_0, const char *VAR_1, struct path *path,
unsigned int VAR_2)
{
struct filename VAR_3 = {.name = VAR_1};
return filename_mountpoint(VAR_0, &VAR_3, path, VAR_2);
}
|
torvalds/linux/23adbe12ef7d3d4195e80800ab36b37bee28cd03/namei.c/non_vul/33.json
| null | null | false
|
CVE-2016-5128
|
['CWE-254']
|
AV:N/AC:M/Au:N/C:P/I:P/A:P
| 0
|
chromium
|
Make sure api interceptors don't change the store target w/o storing
BUG=chromium:619166
R=verwaest@chromium.org
Review-Url: https://codereview.chromium.org/2082633002
Cr-Commit-Position: refs/heads/master@{#37152}
|
2c8ca9ad09281d4138ae363566051e45afd0838c
|
https://chromium.googlesource.com/v8/v8/+/2c8ca9ad09281d4138ae363566051e45afd0838c
|
src/objects.cc
|
PropertyKeyToArrayLength
| null | null | null |
bool PropertyKeyToArrayLength(Handle<Object> value, uint32_t* length) {
DCHECK(value->IsNumber() || value->IsName());
if (value->ToArrayLength(length)) return true;
if (value->IsString()) return String::cast(*value)->AsArrayIndex(length);
return false;
}
|
bool PropertyKeyToArrayLength(Handle<Object> VAR_0, uint32_t* VAR_1) {
DCHECK(VAR_0->IsNumber() || VAR_0->IsName());
if (VAR_0->ToArrayLength(VAR_1)) return true;
if (VAR_0->IsString()) return String::cast(*VAR_0)->AsArrayIndex(VAR_1);
return false;
}
|
chromium/2c8ca9ad09281d4138ae363566051e45afd0838c/objects.cc/non_vul/610.json
| null | null | false
|
CVE-2016-2449
|
['CWE-264']
|
AV:N/AC:M/Au:N/C:C/I:C/A:C
| 0
|
android
|
Camera3Device: Validate template ID
Validate template ID before creating a default request.
Bug: 26866110
Bug: 27568958
Change-Id: Ifda457024f1d5c2b1382f189c1a8d5fda852d30d
|
b04aee833c5cfb6b31b8558350feb14bb1a0f353
|
https://android.googlesource.com/platform/frameworks/av/+/b04aee833c5cfb6b31b8558350feb14bb1a0f353
|
services/camera/libcameraservice/device3/Camera3Device.cpp
|
Camera3Device::setStreamingRequest
| null | null | null |
status_t Camera3Device::setStreamingRequest(const CameraMetadata &request,
int64_t* /*lastFrameNumber*/) {
ATRACE_CALL();
List<const CameraMetadata> requests;
requests.push_back(request);
return setStreamingRequestList(requests, /*lastFrameNumber*/NULL);
}
|
status_t Camera3Device::setStreamingRequest(const CameraMetadata &VAR_0,
int64_t* /* COMMENT_0 */) {
ATRACE_CALL();
List<const CameraMetadata> VAR_1;
VAR_1.push_back(VAR_0);
return setStreamingRequestList(VAR_1, /* COMMENT_0 */NULL);
}
|
android/b04aee833c5cfb6b31b8558350feb14bb1a0f353/Camera3Device.cpp/non_vul/67.json
| null | null | false
|
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 3