idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
29,600 | bool has_ns_capability(struct task_struct *t,
struct user_namespace *ns, int cap)
{
int ret;
rcu_read_lock();
ret = security_capable(__task_cred(t), ns, cap);
rcu_read_unlock();
return (ret == 0);
}
| Bypass | 0 | bool has_ns_capability(struct task_struct *t,
struct user_namespace *ns, int cap)
{
int ret;
rcu_read_lock();
ret = security_capable(__task_cred(t), ns, cap);
rcu_read_unlock();
return (ret == 0);
}
| @@ -424,23 +424,19 @@ bool capable(int cap)
EXPORT_SYMBOL(capable);
/**
- * inode_capable - Check superior capability over inode
+ * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
* @inode: The inode in question
* @cap: The capability in question
*
- * Return true if the current task ha... | CWE-264 | null | null |
29,601 | bool has_ns_capability_noaudit(struct task_struct *t,
struct user_namespace *ns, int cap)
{
int ret;
rcu_read_lock();
ret = security_capable_noaudit(__task_cred(t), ns, cap);
rcu_read_unlock();
return (ret == 0);
}
| Bypass | 0 | bool has_ns_capability_noaudit(struct task_struct *t,
struct user_namespace *ns, int cap)
{
int ret;
rcu_read_lock();
ret = security_capable_noaudit(__task_cred(t), ns, cap);
rcu_read_unlock();
return (ret == 0);
}
| @@ -424,23 +424,19 @@ bool capable(int cap)
EXPORT_SYMBOL(capable);
/**
- * inode_capable - Check superior capability over inode
+ * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
* @inode: The inode in question
* @cap: The capability in question
*
- * Return true if the current task ha... | CWE-264 | null | null |
29,602 | bool ns_capable(struct user_namespace *ns, int cap)
{
if (unlikely(!cap_valid(cap))) {
pr_crit("capable() called with invalid cap=%u\n", cap);
BUG();
}
if (security_capable(current_cred(), ns, cap) == 0) {
current->flags |= PF_SUPERPRIV;
return true;
}
return false;
}
| Bypass | 0 | bool ns_capable(struct user_namespace *ns, int cap)
{
if (unlikely(!cap_valid(cap))) {
pr_crit("capable() called with invalid cap=%u\n", cap);
BUG();
}
if (security_capable(current_cred(), ns, cap) == 0) {
current->flags |= PF_SUPERPRIV;
return true;
}
return false;
}
| @@ -424,23 +424,19 @@ bool capable(int cap)
EXPORT_SYMBOL(capable);
/**
- * inode_capable - Check superior capability over inode
+ * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
* @inode: The inode in question
* @cap: The capability in question
*
- * Return true if the current task ha... | CWE-264 | null | null |
29,603 | static void warn_deprecated_v2(void)
{
char name[sizeof(current->comm)];
pr_info_once("warning: `%s' uses deprecated v2 capabilities in a way that may be insecure\n",
get_task_comm(name, current));
}
| Bypass | 0 | static void warn_deprecated_v2(void)
{
char name[sizeof(current->comm)];
pr_info_once("warning: `%s' uses deprecated v2 capabilities in a way that may be insecure\n",
get_task_comm(name, current));
}
| @@ -424,23 +424,19 @@ bool capable(int cap)
EXPORT_SYMBOL(capable);
/**
- * inode_capable - Check superior capability over inode
+ * capable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped
* @inode: The inode in question
* @cap: The capability in question
*
- * Return true if the current task ha... | CWE-264 | null | null |
29,604 | miniwget2(const char * host,
unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len,
unsigned int scope_id)
{
char * respbuffer;
#if 1
respbuffer = miniwget3(host, port, path, size,
addr_str, addr_str_len, "1.1", scope_id);
#else
respbuffer = ... | DoS Overflow | 0 | miniwget2(const char * host,
unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len,
unsigned int scope_id)
{
char * respbuffer;
#if 1
respbuffer = miniwget3(host, port, path, size,
addr_str, addr_str_len, "1.1", scope_id);
#else
respbuffer = ... | @@ -162,7 +162,7 @@ getHTTPResponse(int s, int * size)
chunked = 1;
}
}
- while(header_buf[i]=='\r' || header_buf[i] == '\n')
+ while((i < (int)header_buf_used) && (header_buf[i]=='\r' || header_buf[i] == '\n'))
i++;
linestart = i;
colon = linestart; | CWE-119 | null | null |
29,605 | miniwget3(const char * host,
unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len,
const char * httpversion, unsigned int scope_id)
{
char buf[2048];
int s;
int n;
int len;
int sent;
void * content;
*size = 0;
s = connecthostport(host, port, sco... | DoS Overflow | 0 | miniwget3(const char * host,
unsigned short port, const char * path,
int * size, char * addr_str, int addr_str_len,
const char * httpversion, unsigned int scope_id)
{
char buf[2048];
int s;
int n;
int len;
int sent;
void * content;
*size = 0;
s = connecthostport(host, port, sco... | @@ -162,7 +162,7 @@ getHTTPResponse(int s, int * size)
chunked = 1;
}
}
- while(header_buf[i]=='\r' || header_buf[i] == '\n')
+ while((i < (int)header_buf_used) && (header_buf[i]=='\r' || header_buf[i] == '\n'))
i++;
linestart = i;
colon = linestart; | CWE-119 | null | null |
29,606 | parseURL(const char * url,
char * hostname, unsigned short * port,
char * * path, unsigned int * scope_id)
{
char * p1, *p2, *p3;
if(!url)
return 0;
p1 = strstr(url, "://");
if(!p1)
return 0;
p1 += 3;
if( (url[0]!='h') || (url[1]!='t')
||(url[2]!='t') || (url[3]!='p'))
return 0;
mems... | DoS Overflow | 0 | parseURL(const char * url,
char * hostname, unsigned short * port,
char * * path, unsigned int * scope_id)
{
char * p1, *p2, *p3;
if(!url)
return 0;
p1 = strstr(url, "://");
if(!p1)
return 0;
p1 += 3;
if( (url[0]!='h') || (url[1]!='t')
||(url[2]!='t') || (url[3]!='p'))
return 0;
mems... | @@ -162,7 +162,7 @@ getHTTPResponse(int s, int * size)
chunked = 1;
}
}
- while(header_buf[i]=='\r' || header_buf[i] == '\n')
+ while((i < (int)header_buf_used) && (header_buf[i]=='\r' || header_buf[i] == '\n'))
i++;
linestart = i;
colon = linestart; | CWE-119 | null | null |
29,607 | _fep_close_control_socket (Fep *fep)
{
if (fep->server >= 0)
close (fep->server);
remove_control_socket (fep->control_socket_path);
free (fep->control_socket_path);
}
| +Priv | 0 | _fep_close_control_socket (Fep *fep)
{
if (fep->server >= 0)
close (fep->server);
remove_control_socket (fep->control_socket_path);
free (fep->control_socket_path);
}
| @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,608 | _fep_read_control_message_from_fd (Fep *fep,
int fd,
FepControlMessage *message)
{
int i;
if (_fep_read_control_message (fd, message) < 0)
{
for (i = 0; i < fep->n_clients; i++)
if (fep->clients[i] == fd)
... | +Priv | 0 | _fep_read_control_message_from_fd (Fep *fep,
int fd,
FepControlMessage *message)
{
int i;
if (_fep_read_control_message (fd, message) < 0)
{
for (i = 0; i < fep->n_clients; i++)
if (fep->clients[i] == fd)
... | @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,609 | _fep_transceive_control_message (Fep *fep,
int fd,
FepControlMessage *request,
FepControlMessage *response)
{
FepList *messages = NULL;
int retval = 0;
retval = _fep_write_control_messa... | +Priv | 0 | _fep_transceive_control_message (Fep *fep,
int fd,
FepControlMessage *request,
FepControlMessage *response)
{
FepList *messages = NULL;
int retval = 0;
retval = _fep_write_control_messa... | @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,610 | command_forward_key_event (Fep *fep,
FepControlMessage *request)
{
uint32_t keyval, modifiers;
if (_fep_control_message_read_uint32_arg (request, 0, &keyval) == 0
&& _fep_control_message_read_uint32_arg (request, 1, &modifiers) == 0)
{
size_t length;
char *data = _fep_key_to_string (keyv... | +Priv | 0 | command_forward_key_event (Fep *fep,
FepControlMessage *request)
{
uint32_t keyval, modifiers;
if (_fep_control_message_read_uint32_arg (request, 0, &keyval) == 0
&& _fep_control_message_read_uint32_arg (request, 1, &modifiers) == 0)
{
size_t length;
char *data = _fep_key_to_string (keyv... | @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,611 | command_send_data (Fep *fep,
FepControlMessage *request)
{
ssize_t total = 0;
while (total < request->args[0].len)
{
ssize_t bytes_sent = _fep_output_send_data (fep,
request->args[0].str + total,
request->args[0].len - total);
if (bytes_sent < 0)
break;
total += bytes_se... | +Priv | 0 | command_send_data (Fep *fep,
FepControlMessage *request)
{
ssize_t total = 0;
while (total < request->args[0].len)
{
ssize_t bytes_sent = _fep_output_send_data (fep,
request->args[0].str + total,
request->args[0].len - total);
if (bytes_sent < 0)
break;
total += bytes_se... | @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,612 | command_send_text (Fep *fep,
FepControlMessage *request)
{
_fep_output_send_text (fep, request->args[0].str);
}
| +Priv | 0 | command_send_text (Fep *fep,
FepControlMessage *request)
{
_fep_output_send_text (fep, request->args[0].str);
}
| @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,613 | command_set_cursor_text (Fep *fep,
FepControlMessage *request)
{
FepAttribute attr;
if (_fep_control_message_read_attribute_arg (request, 1, &attr) == 0)
_fep_output_cursor_text (fep, request->args[0].str, &attr);
}
| +Priv | 0 | command_set_cursor_text (Fep *fep,
FepControlMessage *request)
{
FepAttribute attr;
if (_fep_control_message_read_attribute_arg (request, 1, &attr) == 0)
_fep_output_cursor_text (fep, request->args[0].str, &attr);
}
| @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,614 | command_set_status_text (Fep *fep,
FepControlMessage *request)
{
FepAttribute attr;
if (_fep_control_message_read_attribute_arg (request, 1, &attr) == 0)
_fep_output_status_text (fep, request->args[0].str, &attr);
}
| +Priv | 0 | command_set_status_text (Fep *fep,
FepControlMessage *request)
{
FepAttribute attr;
if (_fep_control_message_read_attribute_arg (request, 1, &attr) == 0)
_fep_output_status_text (fep, request->args[0].str, &attr);
}
| @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,615 | create_socket_name (const char *template)
{
char *name, *p;
size_t len;
/* Prepend the tmp directory to the template. */
p = getenv ("TMPDIR");
if (!p || !*p)
p = "/tmp";
len = strlen (p) + strlen (template) + 2;
name = xcharalloc (len);
memset (name, 0, len);
memcpy (name, p, strlen (p));
if... | +Priv | 0 | create_socket_name (const char *template)
{
char *name, *p;
size_t len;
/* Prepend the tmp directory to the template. */
p = getenv ("TMPDIR");
if (!p || !*p)
p = "/tmp";
len = strlen (p) + strlen (template) + 2;
name = xcharalloc (len);
memset (name, 0, len);
memcpy (name, p, strlen (p));
if... | @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,616 | remove_control_socket (const char *path)
{
char *_path = xstrdup (path), *p;
unlink (_path);
p = strrchr (_path, '/');
assert (p != NULL);
*p = '\0';
rmdir (_path);
free (_path);
}
| +Priv | 0 | remove_control_socket (const char *path)
{
char *_path = xstrdup (path), *p;
unlink (_path);
p = strrchr (_path, '/');
assert (p != NULL);
*p = '\0';
rmdir (_path);
free (_path);
}
| @@ -97,15 +97,8 @@ _fep_open_control_socket (Fep *fep)
memset (&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, path, strlen (path));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (path) + 1;
- remove_control_socket (path... | CWE-264 | null | null |
29,617 | command_key_event (FepClient *client,
FepControlMessage *request,
FepControlMessage *response)
{
FepEventKey event;
int retval;
uint32_t intval;
retval = _fep_control_message_read_uint32_arg (request, 0, &intval);
if (retval < 0)
{
fep_log (FEP_LOG_LEVEL_WARNING, "can't read keyval");
... | +Priv | 0 | command_key_event (FepClient *client,
FepControlMessage *request,
FepControlMessage *response)
{
FepEventKey event;
int retval;
uint32_t intval;
retval = _fep_control_message_read_uint32_arg (request, 0, &intval);
if (retval < 0)
{
fep_log (FEP_LOG_LEVEL_WARNING, "can't read keyval");
... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,618 | command_resize_event (FepClient *client,
FepControlMessage *request,
FepControlMessage *response)
{
FepEventResize event;
int retval;
uint32_t intval;
retval = _fep_control_message_read_uint32_arg (request, 0, &intval);
if (retval < 0)
{
fep_log (... | +Priv | 0 | command_resize_event (FepClient *client,
FepControlMessage *request,
FepControlMessage *response)
{
FepEventResize event;
int retval;
uint32_t intval;
retval = _fep_control_message_read_uint32_arg (request, 0, &intval);
if (retval < 0)
{
fep_log (... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,619 | fep_client_forward_key_event (FepClient *client,
unsigned int keyval,
FepModifierType modifiers)
{
FepControlMessage message;
message.command = FEP_CONTROL_FORWARD_KEY_EVENT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_... | +Priv | 0 | fep_client_forward_key_event (FepClient *client,
unsigned int keyval,
FepModifierType modifiers)
{
FepControlMessage message;
message.command = FEP_CONTROL_FORWARD_KEY_EVENT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,620 | fep_client_get_poll_fd (FepClient *client)
{
return client->control;
}
| +Priv | 0 | fep_client_get_poll_fd (FepClient *client)
{
return client->control;
}
| @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,621 | fep_client_send_data (FepClient *client, const char *data, size_t length)
{
FepControlMessage message;
message.command = FEP_CONTROL_SEND_DATA;
_fep_control_message_alloc_args (&message, 1);
_fep_control_message_write_string_arg (&message, 0, data, length);
if (client->filter_running)
client->messages =... | +Priv | 0 | fep_client_send_data (FepClient *client, const char *data, size_t length)
{
FepControlMessage message;
message.command = FEP_CONTROL_SEND_DATA;
_fep_control_message_alloc_args (&message, 1);
_fep_control_message_write_string_arg (&message, 0, data, length);
if (client->filter_running)
client->messages =... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,622 | fep_client_send_text (FepClient *client, const char *text)
{
FepControlMessage message;
message.command = FEP_CONTROL_SEND_TEXT;
_fep_control_message_alloc_args (&message, 1);
_fep_control_message_write_string_arg (&message, 0, text, strlen (text) + 1);
if (client->filter_running)
client->messages = _fe... | +Priv | 0 | fep_client_send_text (FepClient *client, const char *text)
{
FepControlMessage message;
message.command = FEP_CONTROL_SEND_TEXT;
_fep_control_message_alloc_args (&message, 1);
_fep_control_message_write_string_arg (&message, 0, text, strlen (text) + 1);
if (client->filter_running)
client->messages = _fe... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,623 | fep_client_set_cursor_text (FepClient *client,
const char *text,
FepAttribute *attr)
{
FepControlMessage message;
message.command = FEP_CONTROL_SET_CURSOR_TEXT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_write_string_arg (&me... | +Priv | 0 | fep_client_set_cursor_text (FepClient *client,
const char *text,
FepAttribute *attr)
{
FepControlMessage message;
message.command = FEP_CONTROL_SET_CURSOR_TEXT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_write_string_arg (&me... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,624 | fep_client_set_event_filter (FepClient *client,
FepEventFilter filter,
void *data)
{
client->filter = filter;
client->filter_data = data;
}
| +Priv | 0 | fep_client_set_event_filter (FepClient *client,
FepEventFilter filter,
void *data)
{
client->filter = filter;
client->filter_data = data;
}
| @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,625 | fep_client_set_status_text (FepClient *client,
const char *text,
FepAttribute *attr)
{
FepControlMessage message;
message.command = FEP_CONTROL_SET_STATUS_TEXT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_write_string_arg (&me... | +Priv | 0 | fep_client_set_status_text (FepClient *client,
const char *text,
FepAttribute *attr)
{
FepControlMessage message;
message.command = FEP_CONTROL_SET_STATUS_TEXT;
_fep_control_message_alloc_args (&message, 2);
_fep_control_message_write_string_arg (&me... | @@ -90,14 +90,8 @@ fep_client_open (const char *address)
memset (&sun, 0, sizeof(struct sockaddr_un));
sun.sun_family = AF_UNIX;
-#ifdef __linux__
- sun.sun_path[0] = '\0';
- memcpy (sun.sun_path + 1, address, strlen (address));
- sun_len = offsetof (struct sockaddr_un, sun_path) + strlen (address) + 1;
-#el... | CWE-264 | null | null |
29,626 | doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
size_t size, off_t fsize, int *flags, int mach, int strtab)
{
Elf32_Shdr sh32;
Elf64_Shdr sh64;
int stripped = 1;
void *nbuf;
off_t noff, coff, name_off;
uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
uint64_t cap_sf1 = ... | DoS | 0 | doshn(struct magic_set *ms, int clazz, int swap, int fd, off_t off, int num,
size_t size, off_t fsize, int *flags, int mach, int strtab)
{
Elf32_Shdr sh32;
Elf64_Shdr sh64;
int stripped = 1;
void *nbuf;
off_t noff, coff, name_off;
uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
uint64_t cap_sf1 = ... | @@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.102 2014/03/11 21:00:13 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -477,6 +477,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, si... | CWE-20 | null | null |
29,627 | file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
size_t nbytes)
{
union {
int32_t l;
char c[sizeof (int32_t)];
} u;
int clazz;
int swap;
struct stat st;
off_t fsize;
int flags = 0;
Elf32_Ehdr elf32hdr;
Elf64_Ehdr elf64hdr;
uint16_t type;
if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
... | DoS | 0 | file_tryelf(struct magic_set *ms, int fd, const unsigned char *buf,
size_t nbytes)
{
union {
int32_t l;
char c[sizeof (int32_t)];
} u;
int clazz;
int swap;
struct stat st;
off_t fsize;
int flags = 0;
Elf32_Ehdr elf32hdr;
Elf64_Ehdr elf64hdr;
uint16_t type;
if (ms->flags & (MAGIC_MIME|MAGIC_APPLE))
... | @@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.102 2014/03/11 21:00:13 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $")
#endif
#ifdef BUILTIN_ELF
@@ -477,6 +477,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, si... | CWE-20 | null | null |
29,628 | static int __find_msr_index(struct vcpu_vmx *vmx, u32 msr)
{
int i;
for (i = 0; i < vmx->nmsrs; ++i)
if (vmx_msr_index[vmx->guest_msrs[i].index] == msr)
return i;
return -1;
}
| DoS | 0 | static int __find_msr_index(struct vcpu_vmx *vmx, u32 msr)
{
int i;
for (i = 0; i < vmx->nmsrs; ++i)
if (vmx_msr_index[vmx->guest_msrs[i].index] == msr)
return i;
return -1;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,629 | static inline void __invept(int ext, u64 eptp, gpa_t gpa)
{
struct {
u64 eptp, gpa;
} operand = {eptp, gpa};
asm volatile (__ex(ASM_VMX_INVEPT)
/* CF==1 or ZF==1 --> rc = -1 */
"; ja 1f ; ud2 ; 1:\n"
: : "a" (&operand), "c" (ext) : "cc", "memory");
}
| DoS | 0 | static inline void __invept(int ext, u64 eptp, gpa_t gpa)
{
struct {
u64 eptp, gpa;
} operand = {eptp, gpa};
asm volatile (__ex(ASM_VMX_INVEPT)
/* CF==1 or ZF==1 --> rc = -1 */
"; ja 1f ; ud2 ; 1:\n"
: : "a" (&operand), "c" (ext) : "cc", "memory");
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,630 | static inline void __invvpid(int ext, u16 vpid, gva_t gva)
{
struct {
u64 vpid : 16;
u64 rsvd : 48;
u64 gva;
} operand = { vpid, 0, gva };
asm volatile (__ex(ASM_VMX_INVVPID)
/* CF==1 or ZF==1 --> rc = -1 */
"; ja 1f ; ud2 ; 1:"
: : "a"(&operand), "c"(ext) : "cc", "memory");
}
| DoS | 0 | static inline void __invvpid(int ext, u16 vpid, gva_t gva)
{
struct {
u64 vpid : 16;
u64 rsvd : 48;
u64 gva;
} operand = { vpid, 0, gva };
asm volatile (__ex(ASM_VMX_INVVPID)
/* CF==1 or ZF==1 --> rc = -1 */
"; ja 1f ; ud2 ; 1:"
: : "a"(&operand), "c"(ext) : "cc", "memory");
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,631 | static void __loaded_vmcs_clear(void *arg)
{
struct loaded_vmcs *loaded_vmcs = arg;
int cpu = raw_smp_processor_id();
if (loaded_vmcs->cpu != cpu)
return; /* vcpu migration can race with cpu offline */
if (per_cpu(current_vmcs, cpu) == loaded_vmcs->vmcs)
per_cpu(current_vmcs, cpu) = NULL;
crash_disable_local_... | DoS | 0 | static void __loaded_vmcs_clear(void *arg)
{
struct loaded_vmcs *loaded_vmcs = arg;
int cpu = raw_smp_processor_id();
if (loaded_vmcs->cpu != cpu)
return; /* vcpu migration can race with cpu offline */
if (per_cpu(current_vmcs, cpu) == loaded_vmcs->vmcs)
per_cpu(current_vmcs, cpu) = NULL;
crash_disable_local_... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,632 | static int __shrink_ple_window(int val, int modifier, int minimum)
{
if (modifier < 1)
return ple_window;
if (modifier < ple_window)
val /= modifier;
else
val -= modifier;
return max(val, minimum);
}
| DoS | 0 | static int __shrink_ple_window(int val, int modifier, int minimum)
{
if (modifier < 1)
return ple_window;
if (modifier < ple_window)
val /= modifier;
else
val -= modifier;
return max(val, minimum);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,633 | static void __vmx_complete_interrupts(struct kvm_vcpu *vcpu,
u32 idt_vectoring_info,
int instr_len_field,
int error_code_field)
{
u8 vector;
int type;
bool idtv_info_valid;
idtv_info_valid = idt_vectoring_info & VECTORING_INFO_VALID_MASK;
vcpu->arch.nmi_injected = false;
kvm_clear_... | DoS | 0 | static void __vmx_complete_interrupts(struct kvm_vcpu *vcpu,
u32 idt_vectoring_info,
int instr_len_field,
int error_code_field)
{
u8 vector;
int type;
bool idtv_info_valid;
idtv_info_valid = idt_vectoring_info & VECTORING_INFO_VALID_MASK;
vcpu->arch.nmi_injected = false;
kvm_clear_... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,634 | static void __vmx_disable_intercept_for_msr(unsigned long *msr_bitmap,
u32 msr, int type)
{
int f = sizeof(unsigned long);
if (!cpu_has_vmx_msr_bitmap())
return;
/*
* See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
* have the write-low and read-high bitmap offsets the wrong way round.
... | DoS | 0 | static void __vmx_disable_intercept_for_msr(unsigned long *msr_bitmap,
u32 msr, int type)
{
int f = sizeof(unsigned long);
if (!cpu_has_vmx_msr_bitmap())
return;
/*
* See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
* have the write-low and read-high bitmap offsets the wrong way round.
... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,635 | static void __vmx_enable_intercept_for_msr(unsigned long *msr_bitmap,
u32 msr, int type)
{
int f = sizeof(unsigned long);
if (!cpu_has_vmx_msr_bitmap())
return;
/*
* See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
* have the write-low and read-high bitmap offsets the wrong way round.
... | DoS | 0 | static void __vmx_enable_intercept_for_msr(unsigned long *msr_bitmap,
u32 msr, int type)
{
int f = sizeof(unsigned long);
if (!cpu_has_vmx_msr_bitmap())
return;
/*
* See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
* have the write-low and read-high bitmap offsets the wrong way round.
... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,636 | static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
u64 guest_val, u64 host_val)
{
unsigned i;
struct msr_autoload *m = &vmx->msr_autoload;
switch (msr) {
case MSR_EFER:
if (cpu_has_load_ia32_efer) {
add_atomic_switch_msr_special(vmx,
VM_ENTRY_LOAD_IA32_EFER,
VM_EXIT_LOAD_IA3... | DoS | 0 | static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
u64 guest_val, u64 host_val)
{
unsigned i;
struct msr_autoload *m = &vmx->msr_autoload;
switch (msr) {
case MSR_EFER:
if (cpu_has_load_ia32_efer) {
add_atomic_switch_msr_special(vmx,
VM_ENTRY_LOAD_IA32_EFER,
VM_EXIT_LOAD_IA3... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,637 | static void add_atomic_switch_msr_special(struct vcpu_vmx *vmx,
unsigned long entry, unsigned long exit,
unsigned long guest_val_vmcs, unsigned long host_val_vmcs,
u64 guest_val, u64 host_val)
{
vmcs_write64(guest_val_vmcs, guest_val);
vmcs_write64(host_val_vmcs, host_val);
vm_entry_controls_setbit(vmx, entry)... | DoS | 0 | static void add_atomic_switch_msr_special(struct vcpu_vmx *vmx,
unsigned long entry, unsigned long exit,
unsigned long guest_val_vmcs, unsigned long host_val_vmcs,
u64 guest_val, u64 host_val)
{
vmcs_write64(guest_val_vmcs, guest_val);
vmcs_write64(host_val_vmcs, host_val);
vm_entry_controls_setbit(vmx, entry)... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,638 | static int alloc_identity_pagetable(struct kvm *kvm)
{
/* Called with kvm->slots_lock held. */
struct kvm_userspace_memory_region kvm_userspace_mem;
int r = 0;
BUG_ON(kvm->arch.ept_identity_pagetable_done);
kvm_userspace_mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;
kvm_userspace_mem.flags = 0;
kvm_userspace... | DoS | 0 | static int alloc_identity_pagetable(struct kvm *kvm)
{
/* Called with kvm->slots_lock held. */
struct kvm_userspace_memory_region kvm_userspace_mem;
int r = 0;
BUG_ON(kvm->arch.ept_identity_pagetable_done);
kvm_userspace_mem.slot = IDENTITY_PAGETABLE_PRIVATE_MEMSLOT;
kvm_userspace_mem.flags = 0;
kvm_userspace... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,639 | static __init int alloc_kvm_area(void)
{
int cpu;
for_each_possible_cpu(cpu) {
struct vmcs *vmcs;
vmcs = alloc_vmcs_cpu(cpu);
if (!vmcs) {
free_kvm_area();
return -ENOMEM;
}
per_cpu(vmxarea, cpu) = vmcs;
}
return 0;
}
| DoS | 0 | static __init int alloc_kvm_area(void)
{
int cpu;
for_each_possible_cpu(cpu) {
struct vmcs *vmcs;
vmcs = alloc_vmcs_cpu(cpu);
if (!vmcs) {
free_kvm_area();
return -ENOMEM;
}
per_cpu(vmxarea, cpu) = vmcs;
}
return 0;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,640 | static struct vmcs *alloc_vmcs(void)
{
return alloc_vmcs_cpu(raw_smp_processor_id());
}
| DoS | 0 | static struct vmcs *alloc_vmcs(void)
{
return alloc_vmcs_cpu(raw_smp_processor_id());
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,641 | static struct vmcs *alloc_vmcs_cpu(int cpu)
{
int node = cpu_to_node(cpu);
struct page *pages;
struct vmcs *vmcs;
pages = alloc_pages_exact_node(node, GFP_KERNEL, vmcs_config.order);
if (!pages)
return NULL;
vmcs = page_address(pages);
memset(vmcs, 0, vmcs_config.size);
vmcs->revision_id = vmcs_config.revisi... | DoS | 0 | static struct vmcs *alloc_vmcs_cpu(int cpu)
{
int node = cpu_to_node(cpu);
struct page *pages;
struct vmcs *vmcs;
pages = alloc_pages_exact_node(node, GFP_KERNEL, vmcs_config.order);
if (!pages)
return NULL;
vmcs = page_address(pages);
memset(vmcs, 0, vmcs_config.size);
vmcs->revision_id = vmcs_config.revisi... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,642 | static void allocate_vpid(struct vcpu_vmx *vmx)
{
int vpid;
vmx->vpid = 0;
if (!enable_vpid)
return;
spin_lock(&vmx_vpid_lock);
vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);
if (vpid < VMX_NR_VPIDS) {
vmx->vpid = vpid;
__set_bit(vpid, vmx_vpid_bitmap);
}
spin_unlock(&vmx_vpid_lock);
}
| DoS | 0 | static void allocate_vpid(struct vcpu_vmx *vmx)
{
int vpid;
vmx->vpid = 0;
if (!enable_vpid)
return;
spin_lock(&vmx_vpid_lock);
vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);
if (vpid < VMX_NR_VPIDS) {
vmx->vpid = vpid;
__set_bit(vpid, vmx_vpid_bitmap);
}
spin_unlock(&vmx_vpid_lock);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,643 | static __init bool allow_1_setting(u32 msr, u32 ctl)
{
u32 vmx_msr_low, vmx_msr_high;
rdmsr(msr, vmx_msr_low, vmx_msr_high);
return vmx_msr_high & ctl;
}
| DoS | 0 | static __init bool allow_1_setting(u32 msr, u32 ctl)
{
u32 vmx_msr_low, vmx_msr_high;
rdmsr(msr, vmx_msr_low, vmx_msr_high);
return vmx_msr_high & ctl;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,644 | static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx)
{
int i, nr_msrs;
struct perf_guest_switch_msr *msrs;
msrs = perf_guest_get_msrs(&nr_msrs);
if (!msrs)
return;
for (i = 0; i < nr_msrs; i++)
if (msrs[i].host == msrs[i].guest)
clear_atomic_switch_msr(vmx, msrs[i].msr);
else
add_atomic_switch_... | DoS | 0 | static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx)
{
int i, nr_msrs;
struct perf_guest_switch_msr *msrs;
msrs = perf_guest_get_msrs(&nr_msrs);
if (!msrs)
return;
for (i = 0; i < nr_msrs; i++)
if (msrs[i].host == msrs[i].guest)
clear_atomic_switch_msr(vmx, msrs[i].msr);
else
add_atomic_switch_... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,645 | static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr)
{
unsigned i;
struct msr_autoload *m = &vmx->msr_autoload;
switch (msr) {
case MSR_EFER:
if (cpu_has_load_ia32_efer) {
clear_atomic_switch_msr_special(vmx,
VM_ENTRY_LOAD_IA32_EFER,
VM_EXIT_LOAD_IA32_EFER);
return;
}
break... | DoS | 0 | static void clear_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr)
{
unsigned i;
struct msr_autoload *m = &vmx->msr_autoload;
switch (msr) {
case MSR_EFER:
if (cpu_has_load_ia32_efer) {
clear_atomic_switch_msr_special(vmx,
VM_ENTRY_LOAD_IA32_EFER,
VM_EXIT_LOAD_IA32_EFER);
return;
}
break... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,646 | static bool code_segment_valid(struct kvm_vcpu *vcpu)
{
struct kvm_segment cs;
unsigned int cs_rpl;
vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
cs_rpl = cs.selector & SELECTOR_RPL_MASK;
if (cs.unusable)
return false;
if (~cs.type & (AR_TYPE_CODE_MASK|AR_TYPE_ACCESSES_MASK))
return false;
if (!cs.s)
return ... | DoS | 0 | static bool code_segment_valid(struct kvm_vcpu *vcpu)
{
struct kvm_segment cs;
unsigned int cs_rpl;
vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
cs_rpl = cs.selector & SELECTOR_RPL_MASK;
if (cs.unusable)
return false;
if (~cs.type & (AR_TYPE_CODE_MASK|AR_TYPE_ACCESSES_MASK))
return false;
if (!cs.s)
return ... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,647 | static u64 construct_eptp(unsigned long root_hpa)
{
u64 eptp;
/* TODO write the value reading from MSR */
eptp = VMX_EPT_DEFAULT_MT |
VMX_EPT_DEFAULT_GAW << VMX_EPT_GAW_EPTP_SHIFT;
if (enable_ept_ad_bits)
eptp |= VMX_EPT_AD_ENABLE_BIT;
eptp |= (root_hpa & PAGE_MASK);
return eptp;
}
| DoS | 0 | static u64 construct_eptp(unsigned long root_hpa)
{
u64 eptp;
/* TODO write the value reading from MSR */
eptp = VMX_EPT_DEFAULT_MT |
VMX_EPT_DEFAULT_GAW << VMX_EPT_GAW_EPTP_SHIFT;
if (enable_ept_ad_bits)
eptp |= VMX_EPT_AD_ENABLE_BIT;
eptp |= (root_hpa & PAGE_MASK);
return eptp;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,648 | static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx)
{
const unsigned long *fields[] = {
shadow_read_write_fields,
shadow_read_only_fields
};
const int max_fields[] = {
max_shadow_read_write_fields,
max_shadow_read_only_fields
};
int i, q;
unsigned long field;
u64 field_value = 0;
struct vmcs *shadow... | DoS | 0 | static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx)
{
const unsigned long *fields[] = {
shadow_read_write_fields,
shadow_read_only_fields
};
const int max_fields[] = {
max_shadow_read_write_fields,
max_shadow_read_only_fields
};
int i, q;
unsigned long field;
u64 field_value = 0;
struct vmcs *shadow... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,649 | static inline bool cpu_has_secondary_exec_ctrls(void)
{
return vmcs_config.cpu_based_exec_ctrl &
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
}
| DoS | 0 | static inline bool cpu_has_secondary_exec_ctrls(void)
{
return vmcs_config.cpu_based_exec_ctrl &
CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,650 | static inline bool cpu_has_virtual_nmis(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS;
}
| DoS | 0 | static inline bool cpu_has_virtual_nmis(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,651 | static inline bool cpu_has_vmx_apic_register_virt(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_APIC_REGISTER_VIRT;
}
| DoS | 0 | static inline bool cpu_has_vmx_apic_register_virt(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_APIC_REGISTER_VIRT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,652 | static inline bool cpu_has_vmx_apicv(void)
{
return cpu_has_vmx_apic_register_virt() &&
cpu_has_vmx_virtual_intr_delivery() &&
cpu_has_vmx_posted_intr();
}
| DoS | 0 | static inline bool cpu_has_vmx_apicv(void)
{
return cpu_has_vmx_apic_register_virt() &&
cpu_has_vmx_virtual_intr_delivery() &&
cpu_has_vmx_posted_intr();
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,653 | static inline bool cpu_has_vmx_ept_1g_page(void)
{
return vmx_capability.ept & VMX_EPT_1GB_PAGE_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_ept_1g_page(void)
{
return vmx_capability.ept & VMX_EPT_1GB_PAGE_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,654 | static inline bool cpu_has_vmx_ept_2m_page(void)
{
return vmx_capability.ept & VMX_EPT_2MB_PAGE_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_ept_2m_page(void)
{
return vmx_capability.ept & VMX_EPT_2MB_PAGE_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,655 | static inline bool cpu_has_vmx_ept_4levels(void)
{
return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_ept_4levels(void)
{
return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,656 | static inline bool cpu_has_vmx_ept_ad_bits(void)
{
return vmx_capability.ept & VMX_EPT_AD_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_ept_ad_bits(void)
{
return vmx_capability.ept & VMX_EPT_AD_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,657 | static inline bool cpu_has_vmx_ept_execute_only(void)
{
return vmx_capability.ept & VMX_EPT_EXECUTE_ONLY_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_ept_execute_only(void)
{
return vmx_capability.ept & VMX_EPT_EXECUTE_ONLY_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,658 | static inline bool cpu_has_vmx_eptp_uncacheable(void)
{
return vmx_capability.ept & VMX_EPTP_UC_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_eptp_uncacheable(void)
{
return vmx_capability.ept & VMX_EPTP_UC_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,659 | static inline bool cpu_has_vmx_eptp_writeback(void)
{
return vmx_capability.ept & VMX_EPTP_WB_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_eptp_writeback(void)
{
return vmx_capability.ept & VMX_EPTP_WB_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,660 | static inline bool cpu_has_vmx_flexpriority(void)
{
return cpu_has_vmx_tpr_shadow() &&
cpu_has_vmx_virtualize_apic_accesses();
}
| DoS | 0 | static inline bool cpu_has_vmx_flexpriority(void)
{
return cpu_has_vmx_tpr_shadow() &&
cpu_has_vmx_virtualize_apic_accesses();
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,661 | static inline bool cpu_has_vmx_invept_context(void)
{
return vmx_capability.ept & VMX_EPT_EXTENT_CONTEXT_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_invept_context(void)
{
return vmx_capability.ept & VMX_EPT_EXTENT_CONTEXT_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,662 | static inline bool cpu_has_vmx_invpcid(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_ENABLE_INVPCID;
}
| DoS | 0 | static inline bool cpu_has_vmx_invpcid(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_ENABLE_INVPCID;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,663 | static inline bool cpu_has_vmx_invvpid_global(void)
{
return vmx_capability.vpid & VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_invvpid_global(void)
{
return vmx_capability.vpid & VMX_VPID_EXTENT_GLOBAL_CONTEXT_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,664 | static inline bool cpu_has_vmx_invvpid_single(void)
{
return vmx_capability.vpid & VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT;
}
| DoS | 0 | static inline bool cpu_has_vmx_invvpid_single(void)
{
return vmx_capability.vpid & VMX_VPID_EXTENT_SINGLE_CONTEXT_BIT;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,665 | static inline bool cpu_has_vmx_msr_bitmap(void)
{
return vmcs_config.cpu_based_exec_ctrl & CPU_BASED_USE_MSR_BITMAPS;
}
| DoS | 0 | static inline bool cpu_has_vmx_msr_bitmap(void)
{
return vmcs_config.cpu_based_exec_ctrl & CPU_BASED_USE_MSR_BITMAPS;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,666 | static inline bool cpu_has_vmx_ple(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_PAUSE_LOOP_EXITING;
}
| DoS | 0 | static inline bool cpu_has_vmx_ple(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_PAUSE_LOOP_EXITING;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,667 | static inline bool cpu_has_vmx_posted_intr(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_POSTED_INTR;
}
| DoS | 0 | static inline bool cpu_has_vmx_posted_intr(void)
{
return vmcs_config.pin_based_exec_ctrl & PIN_BASED_POSTED_INTR;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,668 | static inline bool cpu_has_vmx_virtual_intr_delivery(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
}
| DoS | 0 | static inline bool cpu_has_vmx_virtual_intr_delivery(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,669 | static inline bool cpu_has_vmx_virtualize_apic_accesses(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
}
| DoS | 0 | static inline bool cpu_has_vmx_virtualize_apic_accesses(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,670 | static inline bool cpu_has_vmx_virtualize_x2apic_mode(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
}
| DoS | 0 | static inline bool cpu_has_vmx_virtualize_x2apic_mode(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,671 | static inline bool cpu_has_vmx_vpid(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_ENABLE_VPID;
}
| DoS | 0 | static inline bool cpu_has_vmx_vpid(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_ENABLE_VPID;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,672 | static inline bool cpu_has_vmx_wbinvd_exit(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_WBINVD_EXITING;
}
| DoS | 0 | static inline bool cpu_has_vmx_wbinvd_exit(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl &
SECONDARY_EXEC_WBINVD_EXITING;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,673 | static inline void crash_disable_local_vmclear(int cpu)
{
cpumask_clear_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| DoS | 0 | static inline void crash_disable_local_vmclear(int cpu)
{
cpumask_clear_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,674 | static inline void crash_disable_local_vmclear(int cpu) { }
| DoS | 0 | static inline void crash_disable_local_vmclear(int cpu) { }
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,675 | static inline void crash_enable_local_vmclear(int cpu)
{
cpumask_set_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| DoS | 0 | static inline void crash_enable_local_vmclear(int cpu)
{
cpumask_set_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,676 | static inline int crash_local_vmclear_enabled(int cpu)
{
return cpumask_test_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| DoS | 0 | static inline int crash_local_vmclear_enabled(int cpu)
{
return cpumask_test_cpu(cpu, &crash_vmclear_enabled_bitmap);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,677 | static void crash_vmclear_local_loaded_vmcss(void)
{
int cpu = raw_smp_processor_id();
struct loaded_vmcs *v;
if (!crash_local_vmclear_enabled(cpu))
return;
list_for_each_entry(v, &per_cpu(loaded_vmcss_on_cpu, cpu),
loaded_vmcss_on_cpu_link)
vmcs_clear(v->vmcs);
}
| DoS | 0 | static void crash_vmclear_local_loaded_vmcss(void)
{
int cpu = raw_smp_processor_id();
struct loaded_vmcs *v;
if (!crash_local_vmclear_enabled(cpu))
return;
list_for_each_entry(v, &per_cpu(loaded_vmcss_on_cpu, cpu),
loaded_vmcss_on_cpu_link)
vmcs_clear(v->vmcs);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,678 | static bool cs_ss_rpl_check(struct kvm_vcpu *vcpu)
{
struct kvm_segment cs, ss;
vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
vmx_get_segment(vcpu, &ss, VCPU_SREG_SS);
return ((cs.selector & SELECTOR_RPL_MASK) ==
(ss.selector & SELECTOR_RPL_MASK));
}
| DoS | 0 | static bool cs_ss_rpl_check(struct kvm_vcpu *vcpu)
{
struct kvm_segment cs, ss;
vmx_get_segment(vcpu, &cs, VCPU_SREG_CS);
vmx_get_segment(vcpu, &ss, VCPU_SREG_SS);
return ((cs.selector & SELECTOR_RPL_MASK) ==
(ss.selector & SELECTOR_RPL_MASK));
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,679 | static bool data_segment_valid(struct kvm_vcpu *vcpu, int seg)
{
struct kvm_segment var;
unsigned int rpl;
vmx_get_segment(vcpu, &var, seg);
rpl = var.selector & SELECTOR_RPL_MASK;
if (var.unusable)
return true;
if (!var.s)
return false;
if (!var.present)
return false;
if (~var.type & (AR_TYPE_CODE_MASK... | DoS | 0 | static bool data_segment_valid(struct kvm_vcpu *vcpu, int seg)
{
struct kvm_segment var;
unsigned int rpl;
vmx_get_segment(vcpu, &var, seg);
rpl = var.selector & SELECTOR_RPL_MASK;
if (var.unusable)
return true;
if (!var.s)
return false;
if (!var.present)
return false;
if (~var.type & (AR_TYPE_CODE_MASK... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,680 | static bool emulation_required(struct kvm_vcpu *vcpu)
{
return emulate_invalid_guest_state && !guest_state_valid(vcpu);
}
| DoS | 0 | static bool emulation_required(struct kvm_vcpu *vcpu)
{
return emulate_invalid_guest_state && !guest_state_valid(vcpu);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,681 | static void enter_lmode(struct kvm_vcpu *vcpu)
{
u32 guest_tr_ar;
vmx_segment_cache_clear(to_vmx(vcpu));
guest_tr_ar = vmcs_read32(GUEST_TR_AR_BYTES);
if ((guest_tr_ar & AR_TYPE_MASK) != AR_TYPE_BUSY_64_TSS) {
pr_debug_ratelimited("%s: tss fixup for long mode. \n",
__func__);
vmcs_write32(GUEST_TR_AR... | DoS | 0 | static void enter_lmode(struct kvm_vcpu *vcpu)
{
u32 guest_tr_ar;
vmx_segment_cache_clear(to_vmx(vcpu));
guest_tr_ar = vmcs_read32(GUEST_TR_AR_BYTES);
if ((guest_tr_ar & AR_TYPE_MASK) != AR_TYPE_BUSY_64_TSS) {
pr_debug_ratelimited("%s: tss fixup for long mode. \n",
__func__);
vmcs_write32(GUEST_TR_AR... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,682 | static void enter_pmode(struct kvm_vcpu *vcpu)
{
unsigned long flags;
struct vcpu_vmx *vmx = to_vmx(vcpu);
/*
* Update real mode segment cache. It may be not up-to-date if sement
* register was written while vcpu was in a guest mode.
*/
vmx_get_segment(vcpu, &vmx->rmode.segs[VCPU_SREG_ES], VCPU_SREG_ES);
vm... | DoS | 0 | static void enter_pmode(struct kvm_vcpu *vcpu)
{
unsigned long flags;
struct vcpu_vmx *vmx = to_vmx(vcpu);
/*
* Update real mode segment cache. It may be not up-to-date if sement
* register was written while vcpu was in a guest mode.
*/
vmx_get_segment(vcpu, &vmx->rmode.segs[VCPU_SREG_ES], VCPU_SREG_ES);
vm... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,683 | static void ept_load_pdptrs(struct kvm_vcpu *vcpu)
{
struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
if (!test_bit(VCPU_EXREG_PDPTR,
(unsigned long *)&vcpu->arch.regs_dirty))
return;
if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]);
vmcs_write64(GUES... | DoS | 0 | static void ept_load_pdptrs(struct kvm_vcpu *vcpu)
{
struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
if (!test_bit(VCPU_EXREG_PDPTR,
(unsigned long *)&vcpu->arch.regs_dirty))
return;
if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
vmcs_write64(GUEST_PDPTR0, mmu->pdptrs[0]);
vmcs_write64(GUES... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,684 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu)
{
struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
mmu->pdptrs[3] = vm... | DoS | 0 | static void ept_save_pdptrs(struct kvm_vcpu *vcpu)
{
struct kvm_mmu *mmu = vcpu->arch.walk_mmu;
if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) {
mmu->pdptrs[0] = vmcs_read64(GUEST_PDPTR0);
mmu->pdptrs[1] = vmcs_read64(GUEST_PDPTR1);
mmu->pdptrs[2] = vmcs_read64(GUEST_PDPTR2);
mmu->pdptrs[3] = vm... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,685 | static inline void ept_sync_context(u64 eptp)
{
if (enable_ept) {
if (cpu_has_vmx_invept_context())
__invept(VMX_EPT_EXTENT_CONTEXT, eptp, 0);
else
ept_sync_global();
}
}
| DoS | 0 | static inline void ept_sync_context(u64 eptp)
{
if (enable_ept) {
if (cpu_has_vmx_invept_context())
__invept(VMX_EPT_EXTENT_CONTEXT, eptp, 0);
else
ept_sync_global();
}
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,686 | static inline void ept_sync_global(void)
{
if (cpu_has_vmx_invept_global())
__invept(VMX_EPT_EXTENT_GLOBAL, 0, 0);
}
| DoS | 0 | static inline void ept_sync_global(void)
{
if (cpu_has_vmx_invept_global())
__invept(VMX_EPT_EXTENT_GLOBAL, 0, 0);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,687 | static struct shared_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)
{
int i;
i = __find_msr_index(vmx, msr);
if (i >= 0)
return &vmx->guest_msrs[i];
return NULL;
}
| DoS | 0 | static struct shared_msr_entry *find_msr_entry(struct vcpu_vmx *vmx, u32 msr)
{
int i;
i = __find_msr_index(vmx, msr);
if (i >= 0)
return &vmx->guest_msrs[i];
return NULL;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,688 | static void fix_pmode_seg(struct kvm_vcpu *vcpu, int seg,
struct kvm_segment *save)
{
if (!emulate_invalid_guest_state) {
/*
* CS and SS RPL should be equal during guest entry according
* to VMX spec, but in reality it is not always so. Since vcpu
* is in the middle of the transition from real mode to
... | DoS | 0 | static void fix_pmode_seg(struct kvm_vcpu *vcpu, int seg,
struct kvm_segment *save)
{
if (!emulate_invalid_guest_state) {
/*
* CS and SS RPL should be equal during guest entry according
* to VMX spec, but in reality it is not always so. Since vcpu
* is in the middle of the transition from real mode to
... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,689 | static void fix_rmode_seg(int seg, struct kvm_segment *save)
{
const struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg];
struct kvm_segment var = *save;
var.dpl = 0x3;
if (seg == VCPU_SREG_CS)
var.type = 0x3;
if (!emulate_invalid_guest_state) {
var.selector = var.base >> 4;
var.base = var.base... | DoS | 0 | static void fix_rmode_seg(int seg, struct kvm_segment *save)
{
const struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg];
struct kvm_segment var = *save;
var.dpl = 0x3;
if (seg == VCPU_SREG_CS)
var.type = 0x3;
if (!emulate_invalid_guest_state) {
var.selector = var.base >> 4;
var.base = var.base... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,690 | static void free_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
{
if (!loaded_vmcs->vmcs)
return;
loaded_vmcs_clear(loaded_vmcs);
free_vmcs(loaded_vmcs->vmcs);
loaded_vmcs->vmcs = NULL;
}
| DoS | 0 | static void free_loaded_vmcs(struct loaded_vmcs *loaded_vmcs)
{
if (!loaded_vmcs->vmcs)
return;
loaded_vmcs_clear(loaded_vmcs);
free_vmcs(loaded_vmcs->vmcs);
loaded_vmcs->vmcs = NULL;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,691 | static void free_nested(struct vcpu_vmx *vmx)
{
if (!vmx->nested.vmxon)
return;
vmx->nested.vmxon = false;
nested_release_vmcs12(vmx);
if (enable_shadow_vmcs)
free_vmcs(vmx->nested.current_shadow_vmcs);
/* Unpin physical memory we referred to in current vmcs02 */
if (vmx->nested.apic_access_page) {
nested_... | DoS | 0 | static void free_nested(struct vcpu_vmx *vmx)
{
if (!vmx->nested.vmxon)
return;
vmx->nested.vmxon = false;
nested_release_vmcs12(vmx);
if (enable_shadow_vmcs)
free_vmcs(vmx->nested.current_shadow_vmcs);
/* Unpin physical memory we referred to in current vmcs02 */
if (vmx->nested.apic_access_page) {
nested_... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,692 | static void free_vpid(struct vcpu_vmx *vmx)
{
if (!enable_vpid)
return;
spin_lock(&vmx_vpid_lock);
if (vmx->vpid != 0)
__clear_bit(vmx->vpid, vmx_vpid_bitmap);
spin_unlock(&vmx_vpid_lock);
}
| DoS | 0 | static void free_vpid(struct vcpu_vmx *vmx)
{
if (!enable_vpid)
return;
spin_lock(&vmx_vpid_lock);
if (vmx->vpid != 0)
__clear_bit(vmx->vpid, vmx_vpid_bitmap);
spin_unlock(&vmx_vpid_lock);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,693 | static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
{
return to_vmx(vcpu)->nested.current_vmcs12;
}
| DoS | 0 | static inline struct vmcs12 *get_vmcs12(struct kvm_vcpu *vcpu)
{
return to_vmx(vcpu)->nested.current_vmcs12;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,694 | static int get_vmx_mem_address(struct kvm_vcpu *vcpu,
unsigned long exit_qualification,
u32 vmx_instruction_info, gva_t *ret)
{
/*
* According to Vol. 3B, "Information for VM Exits Due to Instruction
* Execution", on an exit, vmx_instruction_info holds most of the
* addressing components of the operand... | DoS | 0 | static int get_vmx_mem_address(struct kvm_vcpu *vcpu,
unsigned long exit_qualification,
u32 vmx_instruction_info, gva_t *ret)
{
/*
* According to Vol. 3B, "Information for VM Exits Due to Instruction
* Execution", on an exit, vmx_instruction_info holds most of the
* addressing components of the operand... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,695 | static void grow_ple_window(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int old = vmx->ple_window;
vmx->ple_window = __grow_ple_window(old);
if (vmx->ple_window != old)
vmx->ple_window_dirty = true;
trace_kvm_ple_window_grow(vcpu->vcpu_id, vmx->ple_window, old);
}
| DoS | 0 | static void grow_ple_window(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
int old = vmx->ple_window;
vmx->ple_window = __grow_ple_window(old);
if (vmx->ple_window != old)
vmx->ple_window_dirty = true;
trace_kvm_ple_window_grow(vcpu->vcpu_id, vmx->ple_window, old);
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,696 | static bool guest_cpuid_has_vmx(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best = kvm_find_cpuid_entry(vcpu, 1, 0);
return best && (best->ecx & (1 << (X86_FEATURE_VMX & 31)));
}
| DoS | 0 | static bool guest_cpuid_has_vmx(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *best = kvm_find_cpuid_entry(vcpu, 1, 0);
return best && (best->ecx & (1 << (X86_FEATURE_VMX & 31)));
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,697 | static u64 guest_read_tsc(void)
{
u64 host_tsc, tsc_offset;
rdtscll(host_tsc);
tsc_offset = vmcs_read64(TSC_OFFSET);
return host_tsc + tsc_offset;
}
| DoS | 0 | static u64 guest_read_tsc(void)
{
u64 host_tsc, tsc_offset;
rdtscll(host_tsc);
tsc_offset = vmcs_read64(TSC_OFFSET);
return host_tsc + tsc_offset;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,698 | static int handle_apic_access(struct kvm_vcpu *vcpu)
{
if (likely(fasteoi)) {
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int access_type, offset;
access_type = exit_qualification & APIC_ACCESS_TYPE;
offset = exit_qualification & APIC_ACCESS_OFFSET;
/*
* Sane guest uses MOV to writ... | DoS | 0 | static int handle_apic_access(struct kvm_vcpu *vcpu)
{
if (likely(fasteoi)) {
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int access_type, offset;
access_type = exit_qualification & APIC_ACCESS_TYPE;
offset = exit_qualification & APIC_ACCESS_OFFSET;
/*
* Sane guest uses MOV to writ... | @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
29,699 | static int handle_apic_eoi_induced(struct kvm_vcpu *vcpu)
{
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int vector = exit_qualification & 0xff;
/* EOI-induced VM exit is trap-like and thus no need to adjust IP */
kvm_apic_set_eoi_accelerated(vcpu, vector);
return 1;
}
| DoS | 0 | static int handle_apic_eoi_induced(struct kvm_vcpu *vcpu)
{
unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
int vector = exit_qualification & 0xff;
/* EOI-induced VM exit is trap-like and thus no need to adjust IP */
kvm_apic_set_eoi_accelerated(vcpu, vector);
return 1;
}
| @@ -472,6 +472,7 @@ struct vcpu_vmx {
int gs_ldt_reload_needed;
int fs_reload_needed;
u64 msr_host_bndcfgs;
+ unsigned long vmcs_host_cr4; /* May not match real cr4 */
} host_state;
struct {
int vm86_active;
@@ -4267,11 +4268,16 @@ static void vmx_set_constant_host_state(s... | CWE-399 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.