CVE ID
stringlengths 13
43
⌀ | CVE Page
stringlengths 45
48
⌀ | CWE ID
stringclasses 90
values | codeLink
stringlengths 46
139
| commit_id
stringlengths 6
81
| commit_message
stringlengths 3
13.3k
⌀ | func_after
stringlengths 14
241k
| func_before
stringlengths 14
241k
| lang
stringclasses 3
values | project
stringclasses 309
values | vul
int8 0
1
|
---|---|---|---|---|---|---|---|---|---|---|
null | null | null | https://github.com/chromium/chromium/commit/ee8d6fd30b022ac2c87b7a190c954e7bb3c9b21e | ee8d6fd30b022ac2c87b7a190c954e7bb3c9b21e | Clean up calls like "gfx::Rect(0, 0, size().width(), size().height()".
The caller can use the much shorter "gfx::Rect(size())", since gfx::Rect
has a constructor that just takes a Size.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2204001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48283 0039d316-1c4b-4281-b951-d872f2087c98 | void WebPluginDelegateProxy::ResetWindowlessBitmaps() {
#if defined(OS_MACOSX)
DCHECK(!background_store_.get());
if (transport_store_.get()) {
int ack_key = transport_store_->handle().fd;
DCHECK_NE(ack_key, -1);
DCHECK(old_transport_dibs_.find(ack_key) == old_transport_dibs_.end());
old_transport_dibs_[ack_key] =
linked_ptr<TransportDIB>(transport_store_.release());
}
#else
transport_store_.reset();
background_store_.reset();
#endif
#if defined(OS_WIN)
backing_store_.reset();
#else
backing_store_.resize(0);
#endif
backing_store_canvas_.reset();
transport_store_canvas_.reset();
background_store_canvas_.reset();
backing_store_painted_ = gfx::Rect();
}
| void WebPluginDelegateProxy::ResetWindowlessBitmaps() {
#if defined(OS_MACOSX)
DCHECK(!background_store_.get());
if (transport_store_.get()) {
int ack_key = transport_store_->handle().fd;
DCHECK_NE(ack_key, -1);
DCHECK(old_transport_dibs_.find(ack_key) == old_transport_dibs_.end());
old_transport_dibs_[ack_key] =
linked_ptr<TransportDIB>(transport_store_.release());
}
#else
transport_store_.reset();
background_store_.reset();
#endif
#if defined(OS_WIN)
backing_store_.reset();
#else
backing_store_.resize(0);
#endif
backing_store_canvas_.reset();
transport_store_canvas_.reset();
background_store_canvas_.reset();
backing_store_painted_ = gfx::Rect();
}
| C | Chrome | 0 |
CVE-2018-6560 | https://www.cvedetails.com/cve/CVE-2018-6560/ | CWE-436 | https://github.com/flatpak/flatpak/commit/52346bf187b5a7f1c0fe9075b328b7ad6abe78f6 | 52346bf187b5a7f1c0fe9075b328b7ad6abe78f6 | Fix vulnerability in dbus proxy
During the authentication all client data is directly forwarded
to the dbus daemon as is, until we detect the BEGIN command after
which we start filtering the binary dbus protocol.
Unfortunately the detection of the BEGIN command in the proxy
did not exactly match the detection in the dbus daemon. A BEGIN
followed by a space or tab was considered ok in the daemon but
not by the proxy. This could be exploited to send arbitrary
dbus messages to the host, which can be used to break out of
the sandbox.
This was noticed by Gabriel Campana of The Google Security Team.
This fix makes the detection of the authentication phase end
match the dbus code. In addition we duplicate the authentication
line validation from dbus, which includes ensuring all data is
ASCII, and limiting the size of a line to 16k. In fact, we add
some extra stringent checks, disallowing ASCII control chars and
requiring that auth lines start with a capital letter. | flatpak_proxy_client_get_policy (FlatpakProxyClient *client, const char *source)
{
if (source == NULL)
return FLATPAK_POLICY_TALK; /* All clients can talk to the bus itself */
if (source[0] == ':')
return GPOINTER_TO_UINT (g_hash_table_lookup (client->unique_id_policy, source));
return flatpak_proxy_get_policy (client->proxy, source);
}
| flatpak_proxy_client_get_policy (FlatpakProxyClient *client, const char *source)
{
if (source == NULL)
return FLATPAK_POLICY_TALK; /* All clients can talk to the bus itself */
if (source[0] == ':')
return GPOINTER_TO_UINT (g_hash_table_lookup (client->unique_id_policy, source));
return flatpak_proxy_get_policy (client->proxy, source);
}
| C | flatpak | 0 |
CVE-2013-1957 | https://www.cvedetails.com/cve/CVE-2013-1957/ | CWE-264 | https://github.com/torvalds/linux/commit/132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 | 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 | vfs: Carefully propogate mounts across user namespaces
As a matter of policy MNT_READONLY should not be changable if the
original mounter had more privileges than creator of the mount
namespace.
Add the flag CL_UNPRIVILEGED to note when we are copying a mount from
a mount namespace that requires more privileges to a mount namespace
that requires fewer privileges.
When the CL_UNPRIVILEGED flag is set cause clone_mnt to set MNT_NO_REMOUNT
if any of the mnt flags that should never be changed are set.
This protects both mount propagation and the initial creation of a less
privileged mount namespace.
Cc: stable@vger.kernel.org
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> | static inline bool may_mount(void)
{
return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
}
| static inline bool may_mount(void)
{
return ns_capable(current->nsproxy->mnt_ns->user_ns, CAP_SYS_ADMIN);
}
| C | linux | 0 |
CVE-2015-1281 | https://www.cvedetails.com/cve/CVE-2015-1281/ | CWE-254 | https://github.com/chromium/chromium/commit/dff368031150a1033a1a3c913f8857679a0279be | dff368031150a1033a1a3c913f8857679a0279be | Correctly keep track of isolates for microtask execution
BUG=487155
R=haraken@chromium.org
Review URL: https://codereview.chromium.org/1161823002
git-svn-id: svn://svn.chromium.org/blink/trunk@195985 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void Document::processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content)
{
if (importLoader())
return;
if (equalIgnoringCase(equiv, "content-security-policy"))
contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicyHeaderTypeEnforce, ContentSecurityPolicyHeaderSourceMeta);
else if (equalIgnoringCase(equiv, "content-security-policy-report-only"))
contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicyHeaderTypeReport, ContentSecurityPolicyHeaderSourceMeta);
else
ASSERT_NOT_REACHED();
}
| void Document::processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content)
{
if (importLoader())
return;
if (equalIgnoringCase(equiv, "content-security-policy"))
contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicyHeaderTypeEnforce, ContentSecurityPolicyHeaderSourceMeta);
else if (equalIgnoringCase(equiv, "content-security-policy-report-only"))
contentSecurityPolicy()->didReceiveHeader(content, ContentSecurityPolicyHeaderTypeReport, ContentSecurityPolicyHeaderSourceMeta);
else
ASSERT_NOT_REACHED();
}
| C | Chrome | 0 |
CVE-2018-7191 | https://www.cvedetails.com/cve/CVE-2018-7191/ | CWE-476 | https://github.com/torvalds/linux/commit/0ad646c81b2182f7fa67ec0c8c825e0ee165696d | 0ad646c81b2182f7fa67ec0c8c825e0ee165696d | tun: call dev_get_valid_name() before register_netdevice()
register_netdevice() could fail early when we have an invalid
dev name, in which case ->ndo_uninit() is not called. For tun
device, this is a problem because a timer etc. are already
initialized and it expects ->ndo_uninit() to clean them up.
We could move these initializations into a ->ndo_init() so
that register_netdevice() knows better, however this is still
complicated due to the logic in tun_detach().
Therefore, I choose to just call dev_get_valid_name() before
register_netdevice(), which is quicker and much easier to audit.
And for this specific case, it is already enough.
Fixes: 96442e42429e ("tuntap: choose the txq based on rxq")
Reported-by: Dmitry Alexeev <avekceeb@gmail.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | static void tun_poll_controller(struct net_device *dev)
{
/*
* Tun only receives frames when:
* 1) the char device endpoint gets data from user space
* 2) the tun socket gets a sendmsg call from user space
* Since both of those are synchronous operations, we are guaranteed
* never to have pending data when we poll for it
* so there is nothing to do here but return.
* We need this though so netpoll recognizes us as an interface that
* supports polling, which enables bridge devices in virt setups to
* still use netconsole
*/
return;
}
| static void tun_poll_controller(struct net_device *dev)
{
/*
* Tun only receives frames when:
* 1) the char device endpoint gets data from user space
* 2) the tun socket gets a sendmsg call from user space
* Since both of those are synchronous operations, we are guaranteed
* never to have pending data when we poll for it
* so there is nothing to do here but return.
* We need this though so netpoll recognizes us as an interface that
* supports polling, which enables bridge devices in virt setups to
* still use netconsole
*/
return;
}
| C | linux | 0 |
CVE-2012-3520 | https://www.cvedetails.com/cve/CVE-2012-3520/ | CWE-287 | https://github.com/torvalds/linux/commit/e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea | e0e3cea46d31d23dc40df0a49a7a2c04fe8edfea | af_netlink: force credentials passing [CVE-2012-3520]
Pablo Neira Ayuso discovered that avahi and
potentially NetworkManager accept spoofed Netlink messages because of a
kernel bug. The kernel passes all-zero SCM_CREDENTIALS ancillary data
to the receiver if the sender did not provide such data, instead of not
including any such data at all or including the correct data from the
peer (as it is the case with AF_UNIX).
This bug was introduced in commit 16e572626961
(af_unix: dont send SCM_CREDENTIALS by default)
This patch forces passing credentials for netlink, as
before the regression.
Another fix would be to not add SCM_CREDENTIALS in
netlink messages if not provided by the sender, but it
might break some programs.
With help from Florian Weimer & Petr Matousek
This issue is designated as CVE-2012-3520
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net> | static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct netlink_sock *nlk = nlk_sk(sk);
struct sockaddr_nl *addr = msg->msg_name;
u32 dst_pid;
u32 dst_group;
struct sk_buff *skb;
int err;
struct scm_cookie scm;
if (msg->msg_flags&MSG_OOB)
return -EOPNOTSUPP;
if (NULL == siocb->scm)
siocb->scm = &scm;
err = scm_send(sock, msg, siocb->scm, true);
if (err < 0)
return err;
if (msg->msg_namelen) {
err = -EINVAL;
if (addr->nl_family != AF_NETLINK)
goto out;
dst_pid = addr->nl_pid;
dst_group = ffs(addr->nl_groups);
err = -EPERM;
if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
goto out;
} else {
dst_pid = nlk->dst_pid;
dst_group = nlk->dst_group;
}
if (!nlk->pid) {
err = netlink_autobind(sock);
if (err)
goto out;
}
err = -EMSGSIZE;
if (len > sk->sk_sndbuf - 32)
goto out;
err = -ENOBUFS;
skb = alloc_skb(len, GFP_KERNEL);
if (skb == NULL)
goto out;
NETLINK_CB(skb).pid = nlk->pid;
NETLINK_CB(skb).dst_group = dst_group;
memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
err = -EFAULT;
if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
kfree_skb(skb);
goto out;
}
err = security_netlink_send(sk, skb);
if (err) {
kfree_skb(skb);
goto out;
}
if (dst_group) {
atomic_inc(&skb->users);
netlink_broadcast(sk, skb, dst_pid, dst_group, GFP_KERNEL);
}
err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT);
out:
scm_destroy(siocb->scm);
return err;
}
| static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
struct msghdr *msg, size_t len)
{
struct sock_iocb *siocb = kiocb_to_siocb(kiocb);
struct sock *sk = sock->sk;
struct netlink_sock *nlk = nlk_sk(sk);
struct sockaddr_nl *addr = msg->msg_name;
u32 dst_pid;
u32 dst_group;
struct sk_buff *skb;
int err;
struct scm_cookie scm;
if (msg->msg_flags&MSG_OOB)
return -EOPNOTSUPP;
if (NULL == siocb->scm)
siocb->scm = &scm;
err = scm_send(sock, msg, siocb->scm);
if (err < 0)
return err;
if (msg->msg_namelen) {
err = -EINVAL;
if (addr->nl_family != AF_NETLINK)
goto out;
dst_pid = addr->nl_pid;
dst_group = ffs(addr->nl_groups);
err = -EPERM;
if (dst_group && !netlink_capable(sock, NL_NONROOT_SEND))
goto out;
} else {
dst_pid = nlk->dst_pid;
dst_group = nlk->dst_group;
}
if (!nlk->pid) {
err = netlink_autobind(sock);
if (err)
goto out;
}
err = -EMSGSIZE;
if (len > sk->sk_sndbuf - 32)
goto out;
err = -ENOBUFS;
skb = alloc_skb(len, GFP_KERNEL);
if (skb == NULL)
goto out;
NETLINK_CB(skb).pid = nlk->pid;
NETLINK_CB(skb).dst_group = dst_group;
memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
err = -EFAULT;
if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
kfree_skb(skb);
goto out;
}
err = security_netlink_send(sk, skb);
if (err) {
kfree_skb(skb);
goto out;
}
if (dst_group) {
atomic_inc(&skb->users);
netlink_broadcast(sk, skb, dst_pid, dst_group, GFP_KERNEL);
}
err = netlink_unicast(sk, skb, dst_pid, msg->msg_flags&MSG_DONTWAIT);
out:
scm_destroy(siocb->scm);
return err;
}
| C | linux | 1 |
CVE-2011-3353 | https://www.cvedetails.com/cve/CVE-2011-3353/ | CWE-119 | https://github.com/torvalds/linux/commit/c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae | c2183d1e9b3f313dd8ba2b1b0197c8d9fb86a7ae | fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
message processing could overrun and result in a "kernel BUG at
fs/fuse/dev.c:629!"
Reported-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: stable@kernel.org | static void put_reserved_req(struct fuse_conn *fc, struct fuse_req *req)
{
struct file *file = req->stolen_file;
struct fuse_file *ff = file->private_data;
spin_lock(&fc->lock);
fuse_request_init(req);
BUG_ON(ff->reserved_req);
ff->reserved_req = req;
wake_up_all(&fc->reserved_req_waitq);
spin_unlock(&fc->lock);
fput(file);
}
| static void put_reserved_req(struct fuse_conn *fc, struct fuse_req *req)
{
struct file *file = req->stolen_file;
struct fuse_file *ff = file->private_data;
spin_lock(&fc->lock);
fuse_request_init(req);
BUG_ON(ff->reserved_req);
ff->reserved_req = req;
wake_up_all(&fc->reserved_req_waitq);
spin_unlock(&fc->lock);
fput(file);
}
| C | linux | 0 |
CVE-2012-2136 | https://www.cvedetails.com/cve/CVE-2012-2136/ | CWE-20 | https://github.com/torvalds/linux/commit/cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc | cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc | net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
We need to validate the number of pages consumed by data_len, otherwise frags
array could be overflowed by userspace. So this patch validate data_len and
return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | int sock_prot_inuse_get(struct net *net, struct proto *prot)
{
int cpu, idx = prot->inuse_idx;
int res = 0;
for_each_possible_cpu(cpu)
res += per_cpu(prot_inuse, cpu).val[idx];
return res >= 0 ? res : 0;
}
| int sock_prot_inuse_get(struct net *net, struct proto *prot)
{
int cpu, idx = prot->inuse_idx;
int res = 0;
for_each_possible_cpu(cpu)
res += per_cpu(prot_inuse, cpu).val[idx];
return res >= 0 ? res : 0;
}
| C | linux | 0 |
CVE-2014-3173 | https://www.cvedetails.com/cve/CVE-2014-3173/ | CWE-119 | https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da | ee7579229ff7e9e5ae28bf53aea069251499d7da | Framebuffer clear() needs to consider the situation some draw buffers are disabled.
This is when we expose DrawBuffers extension.
BUG=376951
TEST=the attached test case, webgl conformance
R=kbr@chromium.org,bajones@chromium.org
Review URL: https://codereview.chromium.org/315283002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98 | void GLES2DecoderImpl::DoGetFloatv(GLenum pname, GLfloat* params) {
DCHECK(params);
GLsizei num_written = 0;
if (!state_.GetStateAsGLfloat(pname, params, &num_written)) {
if (GetHelper(pname, NULL, &num_written)) {
scoped_ptr<GLint[]> values(new GLint[num_written]);
GetHelper(pname, values.get(), &num_written);
for (GLsizei ii = 0; ii < num_written; ++ii) {
params[ii] = static_cast<GLfloat>(values[ii]);
}
} else {
pname = AdjustGetPname(pname);
glGetFloatv(pname, params);
}
}
}
| void GLES2DecoderImpl::DoGetFloatv(GLenum pname, GLfloat* params) {
DCHECK(params);
GLsizei num_written = 0;
if (!state_.GetStateAsGLfloat(pname, params, &num_written)) {
if (GetHelper(pname, NULL, &num_written)) {
scoped_ptr<GLint[]> values(new GLint[num_written]);
GetHelper(pname, values.get(), &num_written);
for (GLsizei ii = 0; ii < num_written; ++ii) {
params[ii] = static_cast<GLfloat>(values[ii]);
}
} else {
pname = AdjustGetPname(pname);
glGetFloatv(pname, params);
}
}
}
| C | Chrome | 0 |
CVE-2014-9718 | https://www.cvedetails.com/cve/CVE-2014-9718/ | CWE-399 | https://git.qemu.org/?p=qemu.git;a=commit;h=3251bdcf1c67427d964517053c3d185b46e618e8 | 3251bdcf1c67427d964517053c3d185b46e618e8 | null | static bool cmd_ibm_sense_condition(IDEState *s, uint8_t cmd)
{
switch (s->feature) {
case 0x01: /* sense temperature in device */
s->nsector = 0x50; /* +20 C */
break;
default:
ide_abort_command(s);
return true;
}
return true;
}
| static bool cmd_ibm_sense_condition(IDEState *s, uint8_t cmd)
{
switch (s->feature) {
case 0x01: /* sense temperature in device */
s->nsector = 0x50; /* +20 C */
break;
default:
ide_abort_command(s);
return true;
}
return true;
}
| C | qemu | 0 |
CVE-2018-15857 | https://www.cvedetails.com/cve/CVE-2018-15857/ | CWE-416 | https://github.com/xkbcommon/libxkbcommon/commit/c1e5ac16e77a21f87bdf3bc4dea61b037a17dddb | c1e5ac16e77a21f87bdf3bc4dea61b037a17dddb | xkbcomp: fix pointer value for FreeStmt
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> | IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge)
{
IncludeStmt *incl, *first;
char *file, *map, *stmt, *tmp, *extra_data;
char nextop;
incl = first = NULL;
file = map = NULL;
tmp = str;
stmt = strdup_safe(str);
while (tmp && *tmp)
{
if (!ParseIncludeMap(&tmp, &file, &map, &nextop, &extra_data))
goto err;
/*
* Given an RMLVO (here layout) like 'us,,fr', the rules parser
* will give out something like 'pc+us+:2+fr:3+inet(evdev)'.
* We should just skip the ':2' in this case and leave it to the
* appropriate section to deal with the empty group.
*/
if (isempty(file)) {
free(file);
free(map);
free(extra_data);
continue;
}
if (first == NULL) {
first = incl = malloc(sizeof(*first));
} else {
incl->next_incl = malloc(sizeof(*first));
incl = incl->next_incl;
}
if (!incl)
break;
incl->common.type = STMT_INCLUDE;
incl->common.next = NULL;
incl->merge = merge;
incl->stmt = NULL;
incl->file = file;
incl->map = map;
incl->modifier = extra_data;
incl->next_incl = NULL;
if (nextop == '|')
merge = MERGE_AUGMENT;
else
merge = MERGE_OVERRIDE;
}
if (first)
first->stmt = stmt;
else
free(stmt);
return first;
err:
log_err(ctx, "Illegal include statement \"%s\"; Ignored\n", stmt);
FreeInclude(first);
free(stmt);
return NULL;
}
| IncludeCreate(struct xkb_context *ctx, char *str, enum merge_mode merge)
{
IncludeStmt *incl, *first;
char *file, *map, *stmt, *tmp, *extra_data;
char nextop;
incl = first = NULL;
file = map = NULL;
tmp = str;
stmt = strdup_safe(str);
while (tmp && *tmp)
{
if (!ParseIncludeMap(&tmp, &file, &map, &nextop, &extra_data))
goto err;
/*
* Given an RMLVO (here layout) like 'us,,fr', the rules parser
* will give out something like 'pc+us+:2+fr:3+inet(evdev)'.
* We should just skip the ':2' in this case and leave it to the
* appropriate section to deal with the empty group.
*/
if (isempty(file)) {
free(file);
free(map);
free(extra_data);
continue;
}
if (first == NULL) {
first = incl = malloc(sizeof(*first));
} else {
incl->next_incl = malloc(sizeof(*first));
incl = incl->next_incl;
}
if (!incl)
break;
incl->common.type = STMT_INCLUDE;
incl->common.next = NULL;
incl->merge = merge;
incl->stmt = NULL;
incl->file = file;
incl->map = map;
incl->modifier = extra_data;
incl->next_incl = NULL;
if (nextop == '|')
merge = MERGE_AUGMENT;
else
merge = MERGE_OVERRIDE;
}
if (first)
first->stmt = stmt;
else
free(stmt);
return first;
err:
log_err(ctx, "Illegal include statement \"%s\"; Ignored\n", stmt);
FreeInclude(first);
free(stmt);
return NULL;
}
| C | libxkbcommon | 0 |
CVE-2012-0037 | https://www.cvedetails.com/cve/CVE-2012-0037/ | CWE-200 | https://github.com/dajobe/raptor/commit/a676f235309a59d4aa78eeffd2574ae5d341fcb0 | a676f235309a59d4aa78eeffd2574ae5d341fcb0 | CVE-2012-0037
Enforce entity loading policy in raptor_libxml_resolveEntity
and raptor_libxml_getEntity by checking for file URIs and network URIs.
Add RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES / loadExternalEntities for
turning on loading of XML external entity loading, disabled by default.
This affects all the parsers that use SAX2: rdfxml, rss-tag-soup (and
aliases) and rdfa. | raptor_libxml_fatal_error(void* user_data, const char *msg, ...)
{
va_list args;
va_start(args, msg);
raptor_libxml_error_common(user_data, msg, args, xml_fatal_error_prefix, 1);
va_end(args);
}
| raptor_libxml_fatal_error(void* user_data, const char *msg, ...)
{
va_list args;
va_start(args, msg);
raptor_libxml_error_common(user_data, msg, args, xml_fatal_error_prefix, 1);
va_end(args);
}
| C | raptor | 0 |
CVE-2015-8575 | https://www.cvedetails.com/cve/CVE-2015-8575/ | CWE-200 | https://github.com/torvalds/linux/commit/5233252fce714053f0151680933571a2da9cbfb4 | 5233252fce714053f0151680933571a2da9cbfb4 | bluetooth: Validate socket address length in sco_sock_bind().
Signed-off-by: David S. Miller <davem@davemloft.net> | void sco_exit(void)
{
bt_procfs_cleanup(&init_net, "sco");
debugfs_remove(sco_debugfs);
hci_unregister_cb(&sco_cb);
bt_sock_unregister(BTPROTO_SCO);
proto_unregister(&sco_proto);
}
| void sco_exit(void)
{
bt_procfs_cleanup(&init_net, "sco");
debugfs_remove(sco_debugfs);
hci_unregister_cb(&sco_cb);
bt_sock_unregister(BTPROTO_SCO);
proto_unregister(&sco_proto);
}
| C | linux | 0 |
CVE-2007-5199 | https://www.cvedetails.com/cve/CVE-2007-5199/ | CWE-119 | https://cgit.freedesktop.org/xorg/lib/libXfont/commit/?id=5bf703700ee4a5d6eae20da07cb7a29369667aef | 5bf703700ee4a5d6eae20da07cb7a29369667aef | null | CatalogueFreeFPE (FontPathElementPtr fpe)
{
CataloguePtr cat = fpe->private;
/* If the catalogue is modified while the xserver has fonts open
* from the previous subfpes, we'll unref the old subfpes when we
* reload the catalogue, and the xserver will the call FreeFPE on
* them once it drops its last reference. Thus, the FreeFPE call
* for the subfpe ends up here and we just forward it to
* FontFileFreeFPE. */
if (!CatalogueNameCheck (fpe->name))
return FontFileFreeFPE (fpe);
CatalogueUnrefFPEs (fpe);
xfree(cat->fpeList);
xfree(cat);
return Successful;
}
| CatalogueFreeFPE (FontPathElementPtr fpe)
{
CataloguePtr cat = fpe->private;
/* If the catalogue is modified while the xserver has fonts open
* from the previous subfpes, we'll unref the old subfpes when we
* reload the catalogue, and the xserver will the call FreeFPE on
* them once it drops its last reference. Thus, the FreeFPE call
* for the subfpe ends up here and we just forward it to
* FontFileFreeFPE. */
if (!CatalogueNameCheck (fpe->name))
return FontFileFreeFPE (fpe);
CatalogueUnrefFPEs (fpe);
xfree(cat->fpeList);
xfree(cat);
return Successful;
}
| C | libxfont | 0 |
CVE-2018-6942 | https://www.cvedetails.com/cve/CVE-2018-6942/ | CWE-476 | https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=29c759284e305ec428703c9a5831d0b1fc3497ef | 29c759284e305ec428703c9a5831d0b1fc3497ef | null | Compute_Point_Displacement( TT_ExecContext exc,
FT_F26Dot6* x,
FT_F26Dot6* y,
TT_GlyphZone zone,
FT_UShort* refp )
{
TT_GlyphZoneRec zp;
FT_UShort p;
FT_F26Dot6 d;
if ( exc->opcode & 1 )
{
zp = exc->zp0;
p = exc->GS.rp1;
}
else
{
zp = exc->zp1;
p = exc->GS.rp2;
}
if ( BOUNDS( p, zp.n_points ) )
{
if ( exc->pedantic_hinting )
exc->error = FT_THROW( Invalid_Reference );
*refp = 0;
return FAILURE;
}
*zone = zp;
*refp = p;
d = PROJECT( zp.cur + p, zp.org + p );
*x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P );
*y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P );
return SUCCESS;
}
| Compute_Point_Displacement( TT_ExecContext exc,
FT_F26Dot6* x,
FT_F26Dot6* y,
TT_GlyphZone zone,
FT_UShort* refp )
{
TT_GlyphZoneRec zp;
FT_UShort p;
FT_F26Dot6 d;
if ( exc->opcode & 1 )
{
zp = exc->zp0;
p = exc->GS.rp1;
}
else
{
zp = exc->zp1;
p = exc->GS.rp2;
}
if ( BOUNDS( p, zp.n_points ) )
{
if ( exc->pedantic_hinting )
exc->error = FT_THROW( Invalid_Reference );
*refp = 0;
return FAILURE;
}
*zone = zp;
*refp = p;
d = PROJECT( zp.cur + p, zp.org + p );
*x = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.x, exc->F_dot_P );
*y = FT_MulDiv( d, (FT_Long)exc->GS.freeVector.y, exc->F_dot_P );
return SUCCESS;
}
| C | savannah | 0 |
CVE-2017-5011 | https://www.cvedetails.com/cve/CVE-2017-5011/ | CWE-200 | https://github.com/chromium/chromium/commit/eea3300239f0b53e172a320eb8de59d0bea65f27 | eea3300239f0b53e172a320eb8de59d0bea65f27 | DevTools: move front-end URL handling to DevToolsUIBindingds
BUG=662859
Review-Url: https://codereview.chromium.org/2607833002
Cr-Commit-Position: refs/heads/master@{#440926} | void DevToolsUIBindings::ZoomIn() {
zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_IN);
}
| void DevToolsUIBindings::ZoomIn() {
zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_IN);
}
| C | Chrome | 0 |
CVE-2018-16541 | https://www.cvedetails.com/cve/CVE-2018-16541/ | CWE-416 | http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=241d91112771a6104de10b3948c3f350d6690c1d | 241d91112771a6104de10b3948c3f350d6690c1d | null | gs_pop_string(gs_main_instance * minst, gs_string * result)
{
i_ctx_t *i_ctx_p = minst->i_ctx_p;
ref vref;
int code = pop_value(i_ctx_p, &vref);
if (code < 0)
return code;
switch (r_type(&vref)) {
case t_name:
name_string_ref(minst->heap, &vref, &vref);
code = 1;
goto rstr;
case t_string:
code = (r_has_attr(&vref, a_write) ? 0 : 1);
rstr:result->data = vref.value.bytes;
result->size = r_size(&vref);
break;
default:
return_error(gs_error_typecheck);
}
ref_stack_pop(&o_stack, 1);
return code;
}
| gs_pop_string(gs_main_instance * minst, gs_string * result)
{
i_ctx_t *i_ctx_p = minst->i_ctx_p;
ref vref;
int code = pop_value(i_ctx_p, &vref);
if (code < 0)
return code;
switch (r_type(&vref)) {
case t_name:
name_string_ref(minst->heap, &vref, &vref);
code = 1;
goto rstr;
case t_string:
code = (r_has_attr(&vref, a_write) ? 0 : 1);
rstr:result->data = vref.value.bytes;
result->size = r_size(&vref);
break;
default:
return_error(gs_error_typecheck);
}
ref_stack_pop(&o_stack, 1);
return code;
}
| C | ghostscript | 0 |
CVE-2012-2890 | https://www.cvedetails.com/cve/CVE-2012-2890/ | CWE-399 | https://github.com/chromium/chromium/commit/a6f7726de20450074a01493e4e85409ce3f2595a | a6f7726de20450074a01493e4e85409ce3f2595a | Unreviewed, rolling out r147402.
http://trac.webkit.org/changeset/147402
https://bugs.webkit.org/show_bug.cgi?id=112903
Source/WebCore:
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
LayoutTests:
* http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html:
* http/tests/security/XFrameOptions/x-frame-options-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
git-svn-id: svn://svn.chromium.org/blink/trunk@147450 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void DocumentLoader::clearMainResourceLoader()
{
m_loadingMainResource = false;
if (this == frameLoader()->activeDocumentLoader())
checkLoadComplete();
}
| void DocumentLoader::clearMainResourceLoader()
{
m_loadingMainResource = false;
if (this == frameLoader()->activeDocumentLoader())
checkLoadComplete();
}
| C | Chrome | 0 |
null | null | null | https://github.com/chromium/chromium/commit/a46bcef82b29d30836a0f26226e3d4aca4fa9612 | a46bcef82b29d30836a0f26226e3d4aca4fa9612 | Access ChromotingHost::clients_ only on network thread.
Previously ChromotingHost was doing some work on the main thread and
some on the network thread. |clients_| and some other members were
accessed without lock on both of these threads. Moved most of the
ChromotingHost activity to the network thread to avoid possible
race conditions.
BUG=96325
TEST=Chromoting works
Review URL: http://codereview.chromium.org/8495024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109556 0039d316-1c4b-4281-b951-d872f2087c98 | void ChromotingHost::OnSessionClosed(ClientSession* client) {
DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
scoped_refptr<ClientSession> client_ref = client;
ClientList::iterator it = std::find(clients_.begin(), clients_.end(), client);
CHECK(it != clients_.end());
clients_.erase(it);
if (recorder_.get()) {
recorder_->RemoveConnection(client->connection());
}
for (StatusObserverList::iterator it = status_observers_.begin();
it != status_observers_.end(); ++it) {
(*it)->OnClientDisconnected(client->client_jid());
}
if (AuthenticatedClientsCount() == 0) {
if (recorder_.get()) {
// Stop the recorder if there are no more clients.
StopScreenRecorder();
}
// Disable the "curtain" if there are no more active clients.
EnableCurtainMode(false);
desktop_environment_->OnLastDisconnect();
}
}
| void ChromotingHost::OnSessionClosed(ClientSession* client) {
DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
VLOG(1) << "Connection to client closed.";
context_->main_message_loop()->PostTask(
FROM_HERE, base::Bind(&ChromotingHost::OnClientDisconnected, this,
make_scoped_refptr(client)));
}
| C | Chrome | 1 |
CVE-2017-6850 | https://www.cvedetails.com/cve/CVE-2017-6850/ | CWE-476 | https://github.com/mdadams/jasper/commit/e96fc4fdd525fa0ede28074a7e2b1caf94b58b0d | e96fc4fdd525fa0ede28074a7e2b1caf94b58b0d | Fixed bugs due to uninitialized data in the JP2 decoder.
Also, added some comments marking I/O stream interfaces that probably
need to be changed (in the long term) to fix integer overflow problems. | jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo)
{
unsigned int i;
jp2_cdefchan_t *cdefent;
for (i = 0; i < cdef->numchans; ++i) {
cdefent = &cdef->ents[i];
if (cdefent->channo == JAS_CAST(unsigned int, channo)) {
return cdefent;
}
}
return 0;
}
| jp2_cdefchan_t *jp2_cdef_lookup(jp2_cdef_t *cdef, int channo)
{
unsigned int i;
jp2_cdefchan_t *cdefent;
for (i = 0; i < cdef->numchans; ++i) {
cdefent = &cdef->ents[i];
if (cdefent->channo == JAS_CAST(unsigned int, channo)) {
return cdefent;
}
}
return 0;
}
| C | jasper | 0 |
CVE-2018-6144 | https://www.cvedetails.com/cve/CVE-2018-6144/ | CWE-787 | https://github.com/chromium/chromium/commit/9f6510f20ccd794c4a71d5779ae802241e6e3f9b | 9f6510f20ccd794c4a71d5779ae802241e6e3f9b | Add the method to check if offline archive is in internal dir
Bug: 758690
Change-Id: I8bb4283fc40a87fa7a87df2c7e513e2e16903290
Reviewed-on: https://chromium-review.googlesource.com/828049
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Commit-Queue: Jian Li <jianli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524232} | void OfflinePageModelTaskified::GetPagesByURL(
const GURL& url,
URLSearchMode url_search_mode,
const MultipleOfflinePageItemCallback& callback) {
auto task = GetPagesTask::CreateTaskMatchingUrl(store_.get(), callback, url);
task_queue_.AddTask(std::move(task));
}
| void OfflinePageModelTaskified::GetPagesByURL(
const GURL& url,
URLSearchMode url_search_mode,
const MultipleOfflinePageItemCallback& callback) {
auto task = GetPagesTask::CreateTaskMatchingUrl(store_.get(), callback, url);
task_queue_.AddTask(std::move(task));
}
| C | Chrome | 0 |
CVE-2011-2881 | https://www.cvedetails.com/cve/CVE-2011-2881/ | CWE-119 | https://github.com/chromium/chromium/commit/88c4913f11967abfd08a8b22b4423710322ac49b | 88c4913f11967abfd08a8b22b4423710322ac49b | [chromium] Fix shutdown race when posting main thread task to CCThreadProxy and enable tests
https://bugs.webkit.org/show_bug.cgi?id=70161
Reviewed by David Levin.
Source/WebCore:
Adds a weak pointer mechanism to cancel main thread tasks posted to CCThreadProxy instances from the compositor
thread. Previously there was a race condition where main thread tasks could run even after the CCThreadProxy was
destroyed.
This race does not exist in the other direction because when tearing down a CCThreadProxy we first post a quit
task to the compositor thread and then suspend execution of the main thread until all compositor tasks for the
CCThreadProxy have been drained.
Covered by the now-enabled CCLayerTreeHostTest* unit tests.
* WebCore.gypi:
* platform/graphics/chromium/cc/CCScopedMainThreadProxy.h: Added.
(WebCore::CCScopedMainThreadProxy::create):
(WebCore::CCScopedMainThreadProxy::postTask):
(WebCore::CCScopedMainThreadProxy::shutdown):
(WebCore::CCScopedMainThreadProxy::CCScopedMainThreadProxy):
(WebCore::CCScopedMainThreadProxy::runTaskIfNotShutdown):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::~CCThreadProxy):
(WebCore::CCThreadProxy::createBeginFrameAndCommitTaskOnCCThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
Source/WebKit/chromium:
Enables the CCLayerTreeHostTest* tests by default. Most tests are run twice in a single thread and multiple
thread configuration. Some tests run only in the multiple thread configuration if they depend on the compositor
thread scheduling draws by itself.
* tests/CCLayerTreeHostTest.cpp:
(::CCLayerTreeHostTest::timeout):
(::CCLayerTreeHostTest::clearTimeout):
(::CCLayerTreeHostTest::CCLayerTreeHostTest):
(::CCLayerTreeHostTest::onEndTest):
(::CCLayerTreeHostTest::TimeoutTask::TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::clearTest):
(::CCLayerTreeHostTest::TimeoutTask::~TimeoutTask):
(::CCLayerTreeHostTest::TimeoutTask::Run):
(::CCLayerTreeHostTest::runTest):
(::CCLayerTreeHostTest::doBeginTest):
(::CCLayerTreeHostTestThreadOnly::runTest):
(::CCLayerTreeHostTestSetNeedsRedraw::commitCompleteOnCCThread):
git-svn-id: svn://svn.chromium.org/blink/trunk@97784 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | virtual void afterTest()
{
}
| virtual void afterTest()
{
}
| C | Chrome | 0 |
CVE-2018-6109 | https://www.cvedetails.com/cve/CVE-2018-6109/ | null | https://github.com/chromium/chromium/commit/614dbccf01bf1f94427782719672dc5af4d4eb63 | 614dbccf01bf1f94427782719672dc5af4d4eb63 | Add Virtual Keyboard bordered key experiment to chrome flag
BUG: b/143232594
Change-Id: I76b160ad565649db32a21b984fbed1594b0ae6ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875347
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710190} | static bool IsFlagExpired(const flags_ui::FeatureEntry& entry) {
return flags::IsFlagExpired(entry.internal_name);
}
| static bool IsFlagExpired(const flags_ui::FeatureEntry& entry) {
return flags::IsFlagExpired(entry.internal_name);
}
| C | Chrome | 0 |
CVE-2017-16534 | https://www.cvedetails.com/cve/CVE-2017-16534/ | CWE-119 | https://github.com/torvalds/linux/commit/2e1c42391ff2556387b3cb6308b24f6f65619feb | 2e1c42391ff2556387b3cb6308b24f6f65619feb | USB: core: harden cdc_parse_cdc_header
Andrey Konovalov reported a possible out-of-bounds problem for the
cdc_parse_cdc_header function. He writes:
It looks like cdc_parse_cdc_header() doesn't validate buflen
before accessing buffer[1], buffer[2] and so on. The only check
present is while (buflen > 0).
So fix this issue up by properly validating the buffer length matches
what the descriptor says it is.
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | int usb_get_descriptor(struct usb_device *dev, unsigned char type,
unsigned char index, void *buf, int size)
{
int i;
int result;
memset(buf, 0, size); /* Make sure we parse really received data */
for (i = 0; i < 3; ++i) {
/* retry on length 0 or error; some devices are flakey */
result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
(type << 8) + index, 0, buf, size,
USB_CTRL_GET_TIMEOUT);
if (result <= 0 && result != -ETIMEDOUT)
continue;
if (result > 1 && ((u8 *)buf)[1] != type) {
result = -ENODATA;
continue;
}
break;
}
return result;
}
| int usb_get_descriptor(struct usb_device *dev, unsigned char type,
unsigned char index, void *buf, int size)
{
int i;
int result;
memset(buf, 0, size); /* Make sure we parse really received data */
for (i = 0; i < 3; ++i) {
/* retry on length 0 or error; some devices are flakey */
result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
(type << 8) + index, 0, buf, size,
USB_CTRL_GET_TIMEOUT);
if (result <= 0 && result != -ETIMEDOUT)
continue;
if (result > 1 && ((u8 *)buf)[1] != type) {
result = -ENODATA;
continue;
}
break;
}
return result;
}
| C | linux | 0 |
CVE-2017-13053 | https://www.cvedetails.com/cve/CVE-2017-13053/ | CWE-125 | https://github.com/the-tcpdump-group/tcpdump/commit/bd4e697ebd6c8457efa8f28f6831fc929b88a014 | bd4e697ebd6c8457efa8f28f6831fc929b88a014 | CVE-2017-13053/BGP: fix VPN route target bounds checks
decode_rt_routing_info() didn't check bounds before fetching 4 octets of
the origin AS field and could over-read the input buffer, put it right.
It also fetched the varying number of octets of the route target field
from 4 octets lower than the correct offset, put it right.
It also used the same temporary buffer explicitly through as_printf()
and implicitly through bgp_vpn_rd_print() so the end result of snprintf()
was not what was originally intended.
This fixes a buffer over-read discovered by Bhargava Shastry,
SecT/TU Berlin.
Add a test using the capture file supplied by the reporter(s). | decode_labeled_prefix6(netdissect_options *ndo,
const u_char *pptr, u_int itemlen, char *buf, u_int buflen)
{
struct in6_addr addr;
u_int plen, plenbytes;
/* prefix length and label = 4 bytes */
ND_TCHECK2(pptr[0], 4);
ITEMCHECK(4);
plen = pptr[0]; /* get prefix length */
if (24 > plen)
return -1;
plen-=24; /* adjust prefixlen - labellength */
if (128 < plen)
return -1;
itemlen -= 4;
memset(&addr, 0, sizeof(addr));
plenbytes = (plen + 7) / 8;
ND_TCHECK2(pptr[4], plenbytes);
memcpy(&addr, &pptr[4], plenbytes);
if (plen % 8) {
addr.s6_addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "%s/%d, label:%u %s",
ip6addr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
return 4 + plenbytes;
trunc:
return -2;
badtlv:
return -3;
}
| decode_labeled_prefix6(netdissect_options *ndo,
const u_char *pptr, u_int itemlen, char *buf, u_int buflen)
{
struct in6_addr addr;
u_int plen, plenbytes;
/* prefix length and label = 4 bytes */
ND_TCHECK2(pptr[0], 4);
ITEMCHECK(4);
plen = pptr[0]; /* get prefix length */
if (24 > plen)
return -1;
plen-=24; /* adjust prefixlen - labellength */
if (128 < plen)
return -1;
itemlen -= 4;
memset(&addr, 0, sizeof(addr));
plenbytes = (plen + 7) / 8;
ND_TCHECK2(pptr[4], plenbytes);
memcpy(&addr, &pptr[4], plenbytes);
if (plen % 8) {
addr.s6_addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
snprintf(buf, buflen, "%s/%d, label:%u %s",
ip6addr_string(ndo, &addr),
plen,
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
return 4 + plenbytes;
trunc:
return -2;
badtlv:
return -3;
}
| C | tcpdump | 0 |
CVE-2011-2802 | https://www.cvedetails.com/cve/CVE-2011-2802/ | CWE-399 | https://github.com/chromium/chromium/commit/4ab22cfc619ee8ff17a8c50e289ec3b30731ceba | 4ab22cfc619ee8ff17a8c50e289ec3b30731ceba | In chromedriver, add /log url to get the contents of the chromedriver log
remotely. Also add a 'chrome.verbose' boolean startup option.
Remove usage of VLOG(1) in chromedriver. We do not need as complicated
logging as in Chrome.
BUG=85241
TEST=none
Review URL: http://codereview.chromium.org/7104085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88591 0039d316-1c4b-4281-b951-d872f2087c98 | bool SendAcceptPromptAppModalDialogJSONRequest(
AutomationMessageSender* sender,
const std::string& prompt_text,
std::string* error_msg) {
DictionaryValue dict;
dict.SetString("command", "AcceptOrDismissAppModalDialog");
dict.SetBoolean("accept", true);
dict.SetString("prompt_text", prompt_text);
DictionaryValue reply_dict;
return SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg);
}
| bool SendAcceptPromptAppModalDialogJSONRequest(
AutomationMessageSender* sender,
const std::string& prompt_text,
std::string* error_msg) {
DictionaryValue dict;
dict.SetString("command", "AcceptOrDismissAppModalDialog");
dict.SetBoolean("accept", true);
dict.SetString("prompt_text", prompt_text);
DictionaryValue reply_dict;
return SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg);
}
| C | Chrome | 0 |
CVE-2018-6031 | https://www.cvedetails.com/cve/CVE-2018-6031/ | CWE-416 | https://github.com/chromium/chromium/commit/01c9a7e71ca435651723e8cbcab0b3ad4c5351e2 | 01c9a7e71ca435651723e8cbcab0b3ad4c5351e2 | [pdf] Use a temporary list when unloading pages
When traversing the |deferred_page_unloads_| list and handling the
unloads it's possible for new pages to get added to the list which will
invalidate the iterator.
This CL swaps the list with an empty list and does the iteration on the
list copy. New items that are unloaded while handling the defers will be
unloaded at a later point.
Bug: 780450
Change-Id: Ic7ced1c82227109784fb536ce19a4dd51b9119ac
Reviewed-on: https://chromium-review.googlesource.com/758916
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515056} | void PDFiumEngine::OnMultipleClick(int click_count,
int page_index,
int char_index) {
DCHECK_GE(click_count, 2);
bool is_double_click = click_count == 2;
int start_index = char_index;
do {
base::char16 cur = pages_[page_index]->GetCharAtIndex(start_index);
if (FindMultipleClickBoundary(is_double_click, cur))
break;
} while (--start_index >= 0);
if (start_index)
start_index++;
int end_index = char_index;
int total = pages_[page_index]->GetCharCount();
while (end_index++ <= total) {
base::char16 cur = pages_[page_index]->GetCharAtIndex(end_index);
if (FindMultipleClickBoundary(is_double_click, cur))
break;
}
selection_.push_back(PDFiumRange(pages_[page_index].get(), start_index,
end_index - start_index));
}
| void PDFiumEngine::OnMultipleClick(int click_count,
int page_index,
int char_index) {
DCHECK_GE(click_count, 2);
bool is_double_click = click_count == 2;
int start_index = char_index;
do {
base::char16 cur = pages_[page_index]->GetCharAtIndex(start_index);
if (FindMultipleClickBoundary(is_double_click, cur))
break;
} while (--start_index >= 0);
if (start_index)
start_index++;
int end_index = char_index;
int total = pages_[page_index]->GetCharCount();
while (end_index++ <= total) {
base::char16 cur = pages_[page_index]->GetCharAtIndex(end_index);
if (FindMultipleClickBoundary(is_double_click, cur))
break;
}
selection_.push_back(PDFiumRange(pages_[page_index].get(), start_index,
end_index - start_index));
}
| C | Chrome | 0 |
CVE-2019-1563 | https://www.cvedetails.com/cve/CVE-2019-1563/ | CWE-311 | https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=08229ad838c50f644d7e928e2eef147b4308ad64 | 08229ad838c50f644d7e928e2eef147b4308ad64 | null | CMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms)
{
if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_enveloped) {
CMSerr(CMS_F_CMS_GET0_ENVELOPED,
CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA);
return NULL;
}
return cms->d.envelopedData;
}
| CMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms)
{
if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_enveloped) {
CMSerr(CMS_F_CMS_GET0_ENVELOPED,
CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA);
return NULL;
}
return cms->d.envelopedData;
}
| C | openssl | 0 |
CVE-2013-4130 | https://www.cvedetails.com/cve/CVE-2013-4130/ | CWE-399 | https://cgit.freedesktop.org/spice/spice/commit/?id=53488f0275d6c8a121af49f7ac817d09ce68090d | 53488f0275d6c8a121af49f7ac817d09ce68090d | null | void red_channel_client_pipe_add(RedChannelClient *rcc, PipeItem *item)
{
spice_assert(rcc && item);
rcc->pipe_size++;
ring_add(&rcc->pipe, &item->link);
}
| void red_channel_client_pipe_add(RedChannelClient *rcc, PipeItem *item)
{
spice_assert(rcc && item);
rcc->pipe_size++;
ring_add(&rcc->pipe, &item->link);
}
| C | spice | 0 |
CVE-2013-2168 | https://www.cvedetails.com/cve/CVE-2013-2168/ | CWE-20 | https://cgit.freedesktop.org/dbus/dbus/commit/?id=954d75b2b64e4799f360d2a6bf9cff6d9fee37e7 | 954d75b2b64e4799f360d2a6bf9cff6d9fee37e7 | null | _dbus_delete_file (const DBusString *filename,
DBusError *error)
{
const char *filename_c;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
filename_c = _dbus_string_get_const_data (filename);
if (DeleteFileA (filename_c) == 0)
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Failed to delete file %s: %s\n",
filename_c, _dbus_strerror_from_errno ());
return FALSE;
}
else
return TRUE;
}
| _dbus_delete_file (const DBusString *filename,
DBusError *error)
{
const char *filename_c;
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
filename_c = _dbus_string_get_const_data (filename);
if (DeleteFileA (filename_c) == 0)
{
dbus_set_error (error, DBUS_ERROR_FAILED,
"Failed to delete file %s: %s\n",
filename_c, _dbus_strerror_from_errno ());
return FALSE;
}
else
return TRUE;
}
| C | dbus | 0 |
CVE-2018-15572 | https://www.cvedetails.com/cve/CVE-2018-15572/ | null | https://github.com/torvalds/linux/commit/fdf82a7856b32d905c39afc85e34364491e46346 | fdf82a7856b32d905c39afc85e34364491e46346 | x86/speculation: Protect against userspace-userspace spectreRSB
The article "Spectre Returns! Speculation Attacks using the Return Stack
Buffer" [1] describes two new (sub-)variants of spectrev2-like attacks,
making use solely of the RSB contents even on CPUs that don't fallback to
BTB on RSB underflow (Skylake+).
Mitigate userspace-userspace attacks by always unconditionally filling RSB on
context switch when the generic spectrev2 mitigation has been enabled.
[1] https://arxiv.org/pdf/1807.07940.pdf
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/nycvar.YFH.7.76.1807261308190.997@cbobk.fhfr.pm | static int ssb_prctl_get(struct task_struct *task)
{
switch (ssb_mode) {
case SPEC_STORE_BYPASS_DISABLE:
return PR_SPEC_DISABLE;
case SPEC_STORE_BYPASS_SECCOMP:
case SPEC_STORE_BYPASS_PRCTL:
if (task_spec_ssb_force_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
if (task_spec_ssb_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
default:
if (boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS))
return PR_SPEC_ENABLE;
return PR_SPEC_NOT_AFFECTED;
}
}
| static int ssb_prctl_get(struct task_struct *task)
{
switch (ssb_mode) {
case SPEC_STORE_BYPASS_DISABLE:
return PR_SPEC_DISABLE;
case SPEC_STORE_BYPASS_SECCOMP:
case SPEC_STORE_BYPASS_PRCTL:
if (task_spec_ssb_force_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_FORCE_DISABLE;
if (task_spec_ssb_disable(task))
return PR_SPEC_PRCTL | PR_SPEC_DISABLE;
return PR_SPEC_PRCTL | PR_SPEC_ENABLE;
default:
if (boot_cpu_has_bug(X86_BUG_SPEC_STORE_BYPASS))
return PR_SPEC_ENABLE;
return PR_SPEC_NOT_AFFECTED;
}
}
| C | linux | 0 |
CVE-2014-9644 | https://www.cvedetails.com/cve/CVE-2014-9644/ | CWE-264 | https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560 | 4943ba16bbc2db05115707b3ff7b4874e9e3c560 | crypto: include crypto- module prefix in template
This adds the module loading prefix "crypto-" to the template lookup
as well.
For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
includes the "crypto-" prefix at every level, correctly rejecting "vfat":
net-pf-38
algif-hash
crypto-vfat(blowfish)
crypto-vfat(blowfish)-all
crypto-vfat
Reported-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> | static int hmac_init_tfm(struct crypto_tfm *tfm)
{
struct crypto_shash *parent = __crypto_shash_cast(tfm);
struct crypto_shash *hash;
struct crypto_instance *inst = (void *)tfm->__crt_alg;
struct crypto_shash_spawn *spawn = crypto_instance_ctx(inst);
struct hmac_ctx *ctx = hmac_ctx(parent);
hash = crypto_spawn_shash(spawn);
if (IS_ERR(hash))
return PTR_ERR(hash);
parent->descsize = sizeof(struct shash_desc) +
crypto_shash_descsize(hash);
ctx->hash = hash;
return 0;
}
| static int hmac_init_tfm(struct crypto_tfm *tfm)
{
struct crypto_shash *parent = __crypto_shash_cast(tfm);
struct crypto_shash *hash;
struct crypto_instance *inst = (void *)tfm->__crt_alg;
struct crypto_shash_spawn *spawn = crypto_instance_ctx(inst);
struct hmac_ctx *ctx = hmac_ctx(parent);
hash = crypto_spawn_shash(spawn);
if (IS_ERR(hash))
return PTR_ERR(hash);
parent->descsize = sizeof(struct shash_desc) +
crypto_shash_descsize(hash);
ctx->hash = hash;
return 0;
}
| C | linux | 0 |
CVE-2011-2802 | https://www.cvedetails.com/cve/CVE-2011-2802/ | CWE-399 | https://github.com/chromium/chromium/commit/4ab22cfc619ee8ff17a8c50e289ec3b30731ceba | 4ab22cfc619ee8ff17a8c50e289ec3b30731ceba | In chromedriver, add /log url to get the contents of the chromedriver log
remotely. Also add a 'chrome.verbose' boolean startup option.
Remove usage of VLOG(1) in chromedriver. We do not need as complicated
logging as in Chrome.
BUG=85241
TEST=none
Review URL: http://codereview.chromium.org/7104085
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88591 0039d316-1c4b-4281-b951-d872f2087c98 | bool SendGetAppModalDialogMessageJSONRequest(
AutomationMessageSender* sender,
std::string* message,
std::string* error_msg) {
DictionaryValue dict;
dict.SetString("command", "GetAppModalDialogMessage");
DictionaryValue reply_dict;
if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg))
return false;
return reply_dict.GetString("message", message);
}
| bool SendGetAppModalDialogMessageJSONRequest(
AutomationMessageSender* sender,
std::string* message,
std::string* error_msg) {
DictionaryValue dict;
dict.SetString("command", "GetAppModalDialogMessage");
DictionaryValue reply_dict;
if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error_msg))
return false;
return reply_dict.GetString("message", message);
}
| C | Chrome | 0 |
CVE-2016-1690 | https://www.cvedetails.com/cve/CVE-2016-1690/ | null | https://github.com/chromium/chromium/commit/9de81f45c73a8f9f215fc234a6adfe087b0eab74 | 9de81f45c73a8f9f215fc234a6adfe087b0eab74 | Remove WeakPtrFactory from PasswordAutofillAgent
Unlike in AutofillAgent, the factory is no longer used in PAA.
R=dvadym@chromium.org
BUG=609010,609007,608100,608101,433486
Review-Url: https://codereview.chromium.org/1945723003
Cr-Commit-Position: refs/heads/master@{#391475} | bool PasswordAutofillAgent::OriginCanAccessPasswordManager(
const blink::WebSecurityOrigin& origin) {
return origin.canAccessPasswordManager();
}
| bool PasswordAutofillAgent::OriginCanAccessPasswordManager(
const blink::WebSecurityOrigin& origin) {
return origin.canAccessPasswordManager();
}
| C | Chrome | 0 |
CVE-2019-16995 | https://www.cvedetails.com/cve/CVE-2019-16995/ | CWE-772 | https://github.com/torvalds/linux/commit/6caabe7f197d3466d238f70915d65301f1716626 | 6caabe7f197d3466d238f70915d65301f1716626 | net: hsr: fix memory leak in hsr_dev_finalize()
If hsr_add_port(hsr, hsr_dev, HSR_PT_MASTER) failed to
add port, it directly returns res and forgets to free the node
that allocated in hsr_create_self_node(), and forgets to delete
the node->mac_list linked in hsr->self_node_db.
BUG: memory leak
unreferenced object 0xffff8881cfa0c780 (size 64):
comm "syz-executor.0", pid 2077, jiffies 4294717969 (age 2415.377s)
hex dump (first 32 bytes):
e0 c7 a0 cf 81 88 ff ff 00 02 00 00 00 00 ad de ................
00 e6 49 cd 81 88 ff ff c0 9b 87 d0 81 88 ff ff ..I.............
backtrace:
[<00000000e2ff5070>] hsr_dev_finalize+0x736/0x960 [hsr]
[<000000003ed2e597>] hsr_newlink+0x2b2/0x3e0 [hsr]
[<000000003fa8c6b6>] __rtnl_newlink+0xf1f/0x1600 net/core/rtnetlink.c:3182
[<000000001247a7ad>] rtnl_newlink+0x66/0x90 net/core/rtnetlink.c:3240
[<00000000e7d1b61d>] rtnetlink_rcv_msg+0x54e/0xb90 net/core/rtnetlink.c:5130
[<000000005556bd3a>] netlink_rcv_skb+0x129/0x340 net/netlink/af_netlink.c:2477
[<00000000741d5ee6>] netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
[<00000000741d5ee6>] netlink_unicast+0x49a/0x650 net/netlink/af_netlink.c:1336
[<000000009d56f9b7>] netlink_sendmsg+0x88b/0xdf0 net/netlink/af_netlink.c:1917
[<0000000046b35c59>] sock_sendmsg_nosec net/socket.c:621 [inline]
[<0000000046b35c59>] sock_sendmsg+0xc3/0x100 net/socket.c:631
[<00000000d208adc9>] __sys_sendto+0x33e/0x560 net/socket.c:1786
[<00000000b582837a>] __do_sys_sendto net/socket.c:1798 [inline]
[<00000000b582837a>] __se_sys_sendto net/socket.c:1794 [inline]
[<00000000b582837a>] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:1794
[<00000000c866801d>] do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
[<00000000fea382d9>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[<00000000e01dacb3>] 0xffffffffffffffff
Fixes: c5a759117210 ("net/hsr: Use list_head (and rcu) instead of array for slave devices.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | static void hsr_announce(struct timer_list *t)
{
struct hsr_priv *hsr;
struct hsr_port *master;
hsr = from_timer(hsr, t, announce_timer);
rcu_read_lock();
master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
if (hsr->announce_count < 3 && hsr->protVersion == 0) {
send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE,
hsr->protVersion);
hsr->announce_count++;
hsr->announce_timer.expires = jiffies +
msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL);
} else {
send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK,
hsr->protVersion);
hsr->announce_timer.expires = jiffies +
msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL);
}
if (is_admin_up(master->dev))
add_timer(&hsr->announce_timer);
rcu_read_unlock();
}
| static void hsr_announce(struct timer_list *t)
{
struct hsr_priv *hsr;
struct hsr_port *master;
hsr = from_timer(hsr, t, announce_timer);
rcu_read_lock();
master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
if (hsr->announce_count < 3 && hsr->protVersion == 0) {
send_hsr_supervision_frame(master, HSR_TLV_ANNOUNCE,
hsr->protVersion);
hsr->announce_count++;
hsr->announce_timer.expires = jiffies +
msecs_to_jiffies(HSR_ANNOUNCE_INTERVAL);
} else {
send_hsr_supervision_frame(master, HSR_TLV_LIFE_CHECK,
hsr->protVersion);
hsr->announce_timer.expires = jiffies +
msecs_to_jiffies(HSR_LIFE_CHECK_INTERVAL);
}
if (is_admin_up(master->dev))
add_timer(&hsr->announce_timer);
rcu_read_unlock();
}
| C | linux | 0 |
CVE-2014-3690 | https://www.cvedetails.com/cve/CVE-2014-3690/ | CWE-399 | https://github.com/torvalds/linux/commit/d974baa398f34393db76be45f7d4d04fbdbb4a0a | d974baa398f34393db76be45f7d4d04fbdbb4a0a | x86,kvm,vmx: Preserve CR4 across VM entry
CR4 isn't constant; at least the TSD and PCE bits can vary.
TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks
like it's correct.
This adds a branch and a read from cr4 to each vm entry. Because it is
extremely likely that consecutive entries into the same vcpu will have
the same host cr4 value, this fixes up the vmcs instead of restoring cr4
after the fact. A subsequent patch will add a kernel-wide cr4 shadow,
reducing the overhead in the common case to just two memory reads and a
branch.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: stable@vger.kernel.org
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | static void vmx_set_rvi(int vector)
{
u16 status;
u8 old;
status = vmcs_read16(GUEST_INTR_STATUS);
old = (u8)status & 0xff;
if ((u8)vector != old) {
status &= ~0xff;
status |= (u8)vector;
vmcs_write16(GUEST_INTR_STATUS, status);
}
}
| static void vmx_set_rvi(int vector)
{
u16 status;
u8 old;
status = vmcs_read16(GUEST_INTR_STATUS);
old = (u8)status & 0xff;
if ((u8)vector != old) {
status &= ~0xff;
status |= (u8)vector;
vmcs_write16(GUEST_INTR_STATUS, status);
}
}
| C | linux | 0 |
CVE-2011-2200 | https://www.cvedetails.com/cve/CVE-2011-2200/ | CWE-20 | https://cgit.freedesktop.org/dbus/dbus/commit/?h=dbus-1.4&id=c3223ba6c401ba81df1305851312a47c485e6cd7 | c3223ba6c401ba81df1305851312a47c485e6cd7 | null | _dbus_header_create (DBusHeader *header,
int message_type,
const char *destination,
const char *path,
const char *interface,
const char *member,
const char *error_name)
{
unsigned char v_BYTE;
dbus_uint32_t v_UINT32;
DBusTypeWriter writer;
DBusTypeWriter array;
_dbus_assert (((interface || message_type != DBUS_MESSAGE_TYPE_SIGNAL) && member) ||
(error_name) ||
!(interface || member || error_name));
_dbus_assert (_dbus_string_get_length (&header->data) == 0);
if (!reserve_header_padding (header))
return FALSE;
_dbus_type_writer_init_values_only (&writer, header->byte_order,
&_dbus_header_signature_str, 0,
&header->data,
HEADER_END_BEFORE_PADDING (header));
v_BYTE = header->byte_order;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = message_type;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = 0; /* flags */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = DBUS_MAJOR_PROTOCOL_VERSION;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_UINT32 = 0; /* body length */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
&v_UINT32))
goto oom;
v_UINT32 = 0; /* serial */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
&v_UINT32))
goto oom;
if (!_dbus_type_writer_recurse (&writer, DBUS_TYPE_ARRAY,
&_dbus_header_signature_str,
FIELDS_ARRAY_SIGNATURE_OFFSET,
&array))
goto oom;
/* Marshal all the fields (Marshall Fields?) */
if (path != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_PATH,
DBUS_TYPE_OBJECT_PATH,
&path))
goto oom;
}
if (destination != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_DESTINATION,
DBUS_TYPE_STRING,
&destination))
goto oom;
}
if (interface != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_INTERFACE,
DBUS_TYPE_STRING,
&interface))
goto oom;
}
if (member != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_MEMBER,
DBUS_TYPE_STRING,
&member))
goto oom;
}
if (error_name != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_ERROR_NAME,
DBUS_TYPE_STRING,
&error_name))
goto oom;
}
if (!_dbus_type_writer_unrecurse (&writer, &array))
goto oom;
correct_header_padding (header);
return TRUE;
oom:
_dbus_string_delete (&header->data, 0,
_dbus_string_get_length (&header->data) - header->padding);
correct_header_padding (header);
return FALSE;
}
| _dbus_header_create (DBusHeader *header,
int message_type,
const char *destination,
const char *path,
const char *interface,
const char *member,
const char *error_name)
{
unsigned char v_BYTE;
dbus_uint32_t v_UINT32;
DBusTypeWriter writer;
DBusTypeWriter array;
_dbus_assert (((interface || message_type != DBUS_MESSAGE_TYPE_SIGNAL) && member) ||
(error_name) ||
!(interface || member || error_name));
_dbus_assert (_dbus_string_get_length (&header->data) == 0);
if (!reserve_header_padding (header))
return FALSE;
_dbus_type_writer_init_values_only (&writer, header->byte_order,
&_dbus_header_signature_str, 0,
&header->data,
HEADER_END_BEFORE_PADDING (header));
v_BYTE = header->byte_order;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = message_type;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = 0; /* flags */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_BYTE = DBUS_MAJOR_PROTOCOL_VERSION;
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_BYTE,
&v_BYTE))
goto oom;
v_UINT32 = 0; /* body length */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
&v_UINT32))
goto oom;
v_UINT32 = 0; /* serial */
if (!_dbus_type_writer_write_basic (&writer, DBUS_TYPE_UINT32,
&v_UINT32))
goto oom;
if (!_dbus_type_writer_recurse (&writer, DBUS_TYPE_ARRAY,
&_dbus_header_signature_str,
FIELDS_ARRAY_SIGNATURE_OFFSET,
&array))
goto oom;
/* Marshal all the fields (Marshall Fields?) */
if (path != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_PATH,
DBUS_TYPE_OBJECT_PATH,
&path))
goto oom;
}
if (destination != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_DESTINATION,
DBUS_TYPE_STRING,
&destination))
goto oom;
}
if (interface != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_INTERFACE,
DBUS_TYPE_STRING,
&interface))
goto oom;
}
if (member != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_MEMBER,
DBUS_TYPE_STRING,
&member))
goto oom;
}
if (error_name != NULL)
{
if (!write_basic_field (&array,
DBUS_HEADER_FIELD_ERROR_NAME,
DBUS_TYPE_STRING,
&error_name))
goto oom;
}
if (!_dbus_type_writer_unrecurse (&writer, &array))
goto oom;
correct_header_padding (header);
return TRUE;
oom:
_dbus_string_delete (&header->data, 0,
_dbus_string_get_length (&header->data) - header->padding);
correct_header_padding (header);
return FALSE;
}
| C | dbus | 0 |
CVE-2018-12896 | https://www.cvedetails.com/cve/CVE-2018-12896/ | CWE-190 | https://github.com/torvalds/linux/commit/78c9c4dfbf8c04883941445a195276bb4bb92c76 | 78c9c4dfbf8c04883941445a195276bb4bb92c76 | posix-timers: Sanitize overrun handling
The posix timer overrun handling is broken because the forwarding functions
can return a huge number of overruns which does not fit in an int. As a
consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
random number generators.
The k_clock::timer_forward() callbacks return a 64 bit value now. Make
k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal
accounting is correct. 3Remove the temporary (int) casts.
Add a helper function which clamps the overrun value returned to user space
via timer_getoverrun(2) or siginfo::si_overrun limited to a positive value
between 0 and INT_MAX. INT_MAX is an indicator for user space that the
overrun value has been clamped.
Reported-by: Team OWL337 <icytxw@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Link: https://lkml.kernel.org/r/20180626132705.018623573@linutronix.de | static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
{
struct k_itimer *timr;
unsigned long flags;
int si_private = 0;
enum hrtimer_restart ret = HRTIMER_NORESTART;
timr = container_of(timer, struct k_itimer, it.real.timer);
spin_lock_irqsave(&timr->it_lock, flags);
timr->it_active = 0;
if (timr->it_interval != 0)
si_private = ++timr->it_requeue_pending;
if (posix_timer_event(timr, si_private)) {
/*
* signal was not sent because of sig_ignor
* we will not get a call back to restart it AND
* it should be restarted.
*/
if (timr->it_interval != 0) {
ktime_t now = hrtimer_cb_get_time(timer);
/*
* FIXME: What we really want, is to stop this
* timer completely and restart it in case the
* SIG_IGN is removed. This is a non trivial
* change which involves sighand locking
* (sigh !), which we don't want to do late in
* the release cycle.
*
* For now we just let timers with an interval
* less than a jiffie expire every jiffie to
* avoid softirq starvation in case of SIG_IGN
* and a very small interval, which would put
* the timer right back on the softirq pending
* list. By moving now ahead of time we trick
* hrtimer_forward() to expire the timer
* later, while we still maintain the overrun
* accuracy, but have some inconsistency in
* the timer_gettime() case. This is at least
* better than a starved softirq. A more
* complex fix which solves also another related
* inconsistency is already in the pipeline.
*/
#ifdef CONFIG_HIGH_RES_TIMERS
{
ktime_t kj = NSEC_PER_SEC / HZ;
if (timr->it_interval < kj)
now = ktime_add(now, kj);
}
#endif
timr->it_overrun += hrtimer_forward(timer, now,
timr->it_interval);
ret = HRTIMER_RESTART;
++timr->it_requeue_pending;
timr->it_active = 1;
}
}
unlock_timer(timr, flags);
return ret;
}
| static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
{
struct k_itimer *timr;
unsigned long flags;
int si_private = 0;
enum hrtimer_restart ret = HRTIMER_NORESTART;
timr = container_of(timer, struct k_itimer, it.real.timer);
spin_lock_irqsave(&timr->it_lock, flags);
timr->it_active = 0;
if (timr->it_interval != 0)
si_private = ++timr->it_requeue_pending;
if (posix_timer_event(timr, si_private)) {
/*
* signal was not sent because of sig_ignor
* we will not get a call back to restart it AND
* it should be restarted.
*/
if (timr->it_interval != 0) {
ktime_t now = hrtimer_cb_get_time(timer);
/*
* FIXME: What we really want, is to stop this
* timer completely and restart it in case the
* SIG_IGN is removed. This is a non trivial
* change which involves sighand locking
* (sigh !), which we don't want to do late in
* the release cycle.
*
* For now we just let timers with an interval
* less than a jiffie expire every jiffie to
* avoid softirq starvation in case of SIG_IGN
* and a very small interval, which would put
* the timer right back on the softirq pending
* list. By moving now ahead of time we trick
* hrtimer_forward() to expire the timer
* later, while we still maintain the overrun
* accuracy, but have some inconsistency in
* the timer_gettime() case. This is at least
* better than a starved softirq. A more
* complex fix which solves also another related
* inconsistency is already in the pipeline.
*/
#ifdef CONFIG_HIGH_RES_TIMERS
{
ktime_t kj = NSEC_PER_SEC / HZ;
if (timr->it_interval < kj)
now = ktime_add(now, kj);
}
#endif
timr->it_overrun += (unsigned int)
hrtimer_forward(timer, now,
timr->it_interval);
ret = HRTIMER_RESTART;
++timr->it_requeue_pending;
timr->it_active = 1;
}
}
unlock_timer(timr, flags);
return ret;
}
| C | linux | 1 |
CVE-2011-3107 | https://www.cvedetails.com/cve/CVE-2011-3107/ | null | https://github.com/chromium/chromium/commit/89e4098439f73cb5c16996511cbfdb171a26e173 | 89e4098439f73cb5c16996511cbfdb171a26e173 | [Qt][WK2] There's no way to test the gesture tap on WTR
https://bugs.webkit.org/show_bug.cgi?id=92895
Reviewed by Kenneth Rohde Christiansen.
Source/WebKit2:
Add an instance of QtViewportHandler to QQuickWebViewPrivate, so it's
now available on mobile and desktop modes, as a side effect gesture tap
events can now be created and sent to WebCore.
This is needed to test tap gestures and to get tap gestures working
when you have a WebView (in desktop mode) on notebooks equipped with
touch screens.
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::onComponentComplete):
(QQuickWebViewFlickablePrivate::onComponentComplete): Implementation
moved to QQuickWebViewPrivate::onComponentComplete.
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
(QQuickWebViewFlickablePrivate):
Tools:
WTR doesn't create the QQuickItem from C++, not from QML, so a call
to componentComplete() was added to mimic the QML behaviour.
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):
git-svn-id: svn://svn.chromium.org/blink/trunk@124625 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void QQuickWebView::mousePressEvent(QMouseEvent* event)
{
Q_D(QQuickWebView);
forceActiveFocus();
d->handleMouseEvent(event);
}
| void QQuickWebView::mousePressEvent(QMouseEvent* event)
{
Q_D(QQuickWebView);
forceActiveFocus();
d->handleMouseEvent(event);
}
| C | Chrome | 0 |
null | null | null | https://github.com/chromium/chromium/commit/61b77165a1125a80f105f4382a99d9d7a1eb0cf2 | 61b77165a1125a80f105f4382a99d9d7a1eb0cf2 | 2010-08-12 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Adam Barth.
Ensure that parser doesn't attach children that have been removed by JavaScript event handlers.
https://bugs.webkit.org/show_bug.cgi?id=43813
This patch re-fixes bug 40742 in a way that keeps allowing HTMLLinkElement
to lazy-attach.
* html/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attach): Added parent check.
* html/HTMLLinkElement.cpp: Basically undoes changes introduced by r61424.
* html/HTMLLinkElement.h: Ditto.
git-svn-id: svn://svn.chromium.org/blink/trunk@65281 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | StyleSheet* HTMLLinkElement::sheet() const
{
return m_sheet.get();
}
| StyleSheet* HTMLLinkElement::sheet() const
{
return m_sheet.get();
}
| C | Chrome | 0 |
CVE-2010-2520 | https://www.cvedetails.com/cve/CVE-2010-2520/ | CWE-119 | https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=888cd1843e935fe675cf2ac303116d4ed5b9d54b | 888cd1843e935fe675cf2ac303116d4ed5b9d54b | null | Read_CVT( EXEC_OP_ FT_ULong idx )
{
return CUR.cvt[idx];
}
| Read_CVT( EXEC_OP_ FT_ULong idx )
{
return CUR.cvt[idx];
}
| C | savannah | 0 |
CVE-2016-10197 | https://www.cvedetails.com/cve/CVE-2016-10197/ | CWE-125 | https://github.com/libevent/libevent/commit/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e | ec65c42052d95d2c23d1d837136d1cf1d9ecef9e | evdns: fix searching empty hostnames
From #332:
Here follows a bug report by **Guido Vranken** via the _Tor bug bounty program_. Please credit Guido accordingly.
## Bug report
The DNS code of Libevent contains this rather obvious OOB read:
```c
static char *
search_make_new(const struct search_state *const state, int n, const char *const base_name) {
const size_t base_len = strlen(base_name);
const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
```
If the length of ```base_name``` is 0, then line 3125 reads 1 byte before the buffer. This will trigger a crash on ASAN-protected builds.
To reproduce:
Build libevent with ASAN:
```
$ CFLAGS='-fomit-frame-pointer -fsanitize=address' ./configure && make -j4
```
Put the attached ```resolv.conf``` and ```poc.c``` in the source directory and then do:
```
$ gcc -fsanitize=address -fomit-frame-pointer poc.c .libs/libevent.a
$ ./a.out
=================================================================
==22201== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60060000efdf at pc 0x4429da bp 0x7ffe1ed47300 sp 0x7ffe1ed472f8
READ of size 1 at 0x60060000efdf thread T0
```
P.S. we can add a check earlier, but since this is very uncommon, I didn't add it.
Fixes: #332 | evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
{
struct nameserver *server, *started_at;
int i;
EVDNS_LOCK(base);
server = base->server_head;
started_at = base->server_head;
if (!server) {
EVDNS_UNLOCK(base);
return 0;
}
while (1) {
struct nameserver *next = server->next;
(void) event_del(&server->event);
if (evtimer_initialized(&server->timeout_event))
(void) evtimer_del(&server->timeout_event);
if (server->probe_request) {
evdns_cancel_request(server->base, server->probe_request);
server->probe_request = NULL;
}
if (server->socket >= 0)
evutil_closesocket(server->socket);
mm_free(server);
if (next == started_at)
break;
server = next;
}
base->server_head = NULL;
base->global_good_nameservers = 0;
for (i = 0; i < base->n_req_heads; ++i) {
struct request *req, *req_started_at;
req = req_started_at = base->req_heads[i];
while (req) {
struct request *next = req->next;
req->tx_count = req->reissue_count = 0;
req->ns = NULL;
/* ???? What to do about searches? */
(void) evtimer_del(&req->timeout_event);
req->trans_id = 0;
req->transmit_me = 0;
base->global_requests_waiting++;
evdns_request_insert(req, &base->req_waiting_head);
/* We want to insert these suspended elements at the front of
* the waiting queue, since they were pending before any of
* the waiting entries were added. This is a circular list,
* so we can just shift the start back by one.*/
base->req_waiting_head = base->req_waiting_head->prev;
if (next == req_started_at)
break;
req = next;
}
base->req_heads[i] = NULL;
}
base->global_requests_inflight = 0;
EVDNS_UNLOCK(base);
return 0;
}
| evdns_base_clear_nameservers_and_suspend(struct evdns_base *base)
{
struct nameserver *server, *started_at;
int i;
EVDNS_LOCK(base);
server = base->server_head;
started_at = base->server_head;
if (!server) {
EVDNS_UNLOCK(base);
return 0;
}
while (1) {
struct nameserver *next = server->next;
(void) event_del(&server->event);
if (evtimer_initialized(&server->timeout_event))
(void) evtimer_del(&server->timeout_event);
if (server->probe_request) {
evdns_cancel_request(server->base, server->probe_request);
server->probe_request = NULL;
}
if (server->socket >= 0)
evutil_closesocket(server->socket);
mm_free(server);
if (next == started_at)
break;
server = next;
}
base->server_head = NULL;
base->global_good_nameservers = 0;
for (i = 0; i < base->n_req_heads; ++i) {
struct request *req, *req_started_at;
req = req_started_at = base->req_heads[i];
while (req) {
struct request *next = req->next;
req->tx_count = req->reissue_count = 0;
req->ns = NULL;
/* ???? What to do about searches? */
(void) evtimer_del(&req->timeout_event);
req->trans_id = 0;
req->transmit_me = 0;
base->global_requests_waiting++;
evdns_request_insert(req, &base->req_waiting_head);
/* We want to insert these suspended elements at the front of
* the waiting queue, since they were pending before any of
* the waiting entries were added. This is a circular list,
* so we can just shift the start back by one.*/
base->req_waiting_head = base->req_waiting_head->prev;
if (next == req_started_at)
break;
req = next;
}
base->req_heads[i] = NULL;
}
base->global_requests_inflight = 0;
EVDNS_UNLOCK(base);
return 0;
}
| C | libevent | 0 |
null | null | null | https://github.com/chromium/chromium/commit/3454ed7b88318dcd4539c6e1a50d27b0ca535686 | 3454ed7b88318dcd4539c6e1a50d27b0ca535686 | Allow automatic search engine detection on https
BUG=521128
Review URL: https://codereview.chromium.org/1393113002
Cr-Commit-Position: refs/heads/master@{#352982} | void SearchEngineTabHelper::GenerateKeywordIfNecessary(
const content::FrameNavigateParams& params) {
if (!params.searchable_form_url.is_valid())
return;
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
const NavigationController& controller = web_contents()->GetController();
int last_index = controller.GetLastCommittedEntryIndex();
if (last_index <= 0)
return;
base::string16 keyword(GenerateKeywordFromNavigationEntry(
controller.GetEntryAtIndex(last_index - 1),
profile->GetPrefs()->GetString(prefs::kAcceptLanguages)));
if (keyword.empty())
return;
TemplateURLService* url_service =
TemplateURLServiceFactory::GetForProfile(profile);
if (!url_service)
return;
if (!url_service->loaded()) {
url_service->Load();
return;
}
TemplateURL* current_url;
GURL url = params.searchable_form_url;
if (!url_service->CanAddAutogeneratedKeyword(keyword, url, ¤t_url))
return;
if (current_url) {
if (current_url->originating_url().is_valid()) {
return;
}
url_service->Remove(current_url);
}
TemplateURLData data;
data.SetShortName(keyword);
data.SetKeyword(keyword);
data.SetURL(url.spec());
DCHECK(controller.GetLastCommittedEntry());
const GURL& current_favicon =
controller.GetLastCommittedEntry()->GetFavicon().url;
data.favicon_url = current_favicon.is_valid() ?
current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url);
data.safe_for_autoreplace = true;
data.input_encodings.push_back(params.searchable_form_encoding);
url_service->Add(new TemplateURL(data));
}
| void SearchEngineTabHelper::GenerateKeywordIfNecessary(
const content::FrameNavigateParams& params) {
if (!params.searchable_form_url.is_valid())
return;
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
if (profile->IsOffTheRecord())
return;
const NavigationController& controller = web_contents()->GetController();
int last_index = controller.GetLastCommittedEntryIndex();
if (last_index <= 0)
return;
base::string16 keyword(GenerateKeywordFromNavigationEntry(
controller.GetEntryAtIndex(last_index - 1),
profile->GetPrefs()->GetString(prefs::kAcceptLanguages)));
if (keyword.empty())
return;
TemplateURLService* url_service =
TemplateURLServiceFactory::GetForProfile(profile);
if (!url_service)
return;
if (!url_service->loaded()) {
url_service->Load();
return;
}
TemplateURL* current_url;
GURL url = params.searchable_form_url;
if (!url_service->CanAddAutogeneratedKeyword(keyword, url, ¤t_url))
return;
if (current_url) {
if (current_url->originating_url().is_valid()) {
return;
}
url_service->Remove(current_url);
}
TemplateURLData data;
data.SetShortName(keyword);
data.SetKeyword(keyword);
data.SetURL(url.spec());
DCHECK(controller.GetLastCommittedEntry());
const GURL& current_favicon =
controller.GetLastCommittedEntry()->GetFavicon().url;
data.favicon_url = current_favicon.is_valid() ?
current_favicon : TemplateURL::GenerateFaviconURL(params.referrer.url);
data.safe_for_autoreplace = true;
data.input_encodings.push_back(params.searchable_form_encoding);
url_service->Add(new TemplateURL(data));
}
| C | Chrome | 0 |
CVE-2017-14976 | https://www.cvedetails.com/cve/CVE-2017-14976/ | CWE-125 | https://cgit.freedesktop.org/poppler/poppler/commit/?id=da63c35549e8852a410946ab016a3f25ac701bdf | da63c35549e8852a410946ab016a3f25ac701bdf | null | void FoFiType1C::readPrivateDict(int offset, int length,
Type1CPrivateDict *pDict) {
int pos;
pDict->hasFontMatrix = gFalse;
pDict->nBlueValues = 0;
pDict->nOtherBlues = 0;
pDict->nFamilyBlues = 0;
pDict->nFamilyOtherBlues = 0;
pDict->blueScale = 0.039625;
pDict->blueShift = 7;
pDict->blueFuzz = 1;
pDict->hasStdHW = gFalse;
pDict->hasStdVW = gFalse;
pDict->nStemSnapH = 0;
pDict->nStemSnapV = 0;
pDict->hasForceBold = gFalse;
pDict->forceBoldThreshold = 0;
pDict->languageGroup = 0;
pDict->expansionFactor = 0.06;
pDict->initialRandomSeed = 0;
pDict->subrsOffset = 0;
pDict->defaultWidthX = 0;
pDict->defaultWidthXFP = gFalse;
pDict->nominalWidthX = 0;
pDict->nominalWidthXFP = gFalse;
if (offset == 0 || length == 0) {
return;
}
pos = offset;
nOps = 0;
while (pos < offset + length) {
pos = getOp(pos, gFalse, &parsedOk);
if (!parsedOk) {
break;
}
if (!ops[nOps - 1].isNum) {
--nOps; // drop the operator
switch (ops[nOps].op) {
case 0x0006:
pDict->nBlueValues = getDeltaIntArray(pDict->blueValues,
type1CMaxBlueValues);
break;
case 0x0007:
pDict->nOtherBlues = getDeltaIntArray(pDict->otherBlues,
type1CMaxOtherBlues);
break;
case 0x0008:
pDict->nFamilyBlues = getDeltaIntArray(pDict->familyBlues,
type1CMaxBlueValues);
break;
case 0x0009:
pDict->nFamilyOtherBlues = getDeltaIntArray(pDict->familyOtherBlues,
type1CMaxOtherBlues);
break;
case 0x0c09:
pDict->blueScale = ops[0].num;
break;
case 0x0c0a:
pDict->blueShift = (int)ops[0].num;
break;
case 0x0c0b:
pDict->blueFuzz = (int)ops[0].num;
break;
case 0x000a:
pDict->stdHW = ops[0].num;
pDict->hasStdHW = gTrue;
break;
case 0x000b:
pDict->stdVW = ops[0].num;
pDict->hasStdVW = gTrue;
break;
case 0x0c0c:
pDict->nStemSnapH = getDeltaFPArray(pDict->stemSnapH,
type1CMaxStemSnap);
break;
case 0x0c0d:
pDict->nStemSnapV = getDeltaFPArray(pDict->stemSnapV,
type1CMaxStemSnap);
break;
case 0x0c0e:
pDict->forceBold = ops[0].num != 0;
pDict->hasForceBold = gTrue;
break;
case 0x0c0f:
pDict->forceBoldThreshold = ops[0].num;
break;
case 0x0c11:
pDict->languageGroup = (int)ops[0].num;
break;
case 0x0c12:
pDict->expansionFactor = ops[0].num;
break;
case 0x0c13:
pDict->initialRandomSeed = (int)ops[0].num;
break;
case 0x0013:
pDict->subrsOffset = offset + (int)ops[0].num;
break;
case 0x0014:
pDict->defaultWidthX = ops[0].num;
pDict->defaultWidthXFP = ops[0].isFP;
break;
case 0x0015:
pDict->nominalWidthX = ops[0].num;
pDict->nominalWidthXFP = ops[0].isFP;
break;
}
nOps = 0;
}
}
}
| void FoFiType1C::readPrivateDict(int offset, int length,
Type1CPrivateDict *pDict) {
int pos;
pDict->hasFontMatrix = gFalse;
pDict->nBlueValues = 0;
pDict->nOtherBlues = 0;
pDict->nFamilyBlues = 0;
pDict->nFamilyOtherBlues = 0;
pDict->blueScale = 0.039625;
pDict->blueShift = 7;
pDict->blueFuzz = 1;
pDict->hasStdHW = gFalse;
pDict->hasStdVW = gFalse;
pDict->nStemSnapH = 0;
pDict->nStemSnapV = 0;
pDict->hasForceBold = gFalse;
pDict->forceBoldThreshold = 0;
pDict->languageGroup = 0;
pDict->expansionFactor = 0.06;
pDict->initialRandomSeed = 0;
pDict->subrsOffset = 0;
pDict->defaultWidthX = 0;
pDict->defaultWidthXFP = gFalse;
pDict->nominalWidthX = 0;
pDict->nominalWidthXFP = gFalse;
if (offset == 0 || length == 0) {
return;
}
pos = offset;
nOps = 0;
while (pos < offset + length) {
pos = getOp(pos, gFalse, &parsedOk);
if (!parsedOk) {
break;
}
if (!ops[nOps - 1].isNum) {
--nOps; // drop the operator
switch (ops[nOps].op) {
case 0x0006:
pDict->nBlueValues = getDeltaIntArray(pDict->blueValues,
type1CMaxBlueValues);
break;
case 0x0007:
pDict->nOtherBlues = getDeltaIntArray(pDict->otherBlues,
type1CMaxOtherBlues);
break;
case 0x0008:
pDict->nFamilyBlues = getDeltaIntArray(pDict->familyBlues,
type1CMaxBlueValues);
break;
case 0x0009:
pDict->nFamilyOtherBlues = getDeltaIntArray(pDict->familyOtherBlues,
type1CMaxOtherBlues);
break;
case 0x0c09:
pDict->blueScale = ops[0].num;
break;
case 0x0c0a:
pDict->blueShift = (int)ops[0].num;
break;
case 0x0c0b:
pDict->blueFuzz = (int)ops[0].num;
break;
case 0x000a:
pDict->stdHW = ops[0].num;
pDict->hasStdHW = gTrue;
break;
case 0x000b:
pDict->stdVW = ops[0].num;
pDict->hasStdVW = gTrue;
break;
case 0x0c0c:
pDict->nStemSnapH = getDeltaFPArray(pDict->stemSnapH,
type1CMaxStemSnap);
break;
case 0x0c0d:
pDict->nStemSnapV = getDeltaFPArray(pDict->stemSnapV,
type1CMaxStemSnap);
break;
case 0x0c0e:
pDict->forceBold = ops[0].num != 0;
pDict->hasForceBold = gTrue;
break;
case 0x0c0f:
pDict->forceBoldThreshold = ops[0].num;
break;
case 0x0c11:
pDict->languageGroup = (int)ops[0].num;
break;
case 0x0c12:
pDict->expansionFactor = ops[0].num;
break;
case 0x0c13:
pDict->initialRandomSeed = (int)ops[0].num;
break;
case 0x0013:
pDict->subrsOffset = offset + (int)ops[0].num;
break;
case 0x0014:
pDict->defaultWidthX = ops[0].num;
pDict->defaultWidthXFP = ops[0].isFP;
break;
case 0x0015:
pDict->nominalWidthX = ops[0].num;
pDict->nominalWidthXFP = ops[0].isFP;
break;
}
nOps = 0;
}
}
}
| CPP | poppler | 0 |
CVE-2019-5774 | https://www.cvedetails.com/cve/CVE-2019-5774/ | CWE-20 | https://github.com/chromium/chromium/commit/b32471d5abb3b3a4fe56e1dd79871400b51a0cca | b32471d5abb3b3a4fe56e1dd79871400b51a0cca | Add .desktop file to download_file_types.asciipb
.desktop files act as shortcuts on Linux, allowing arbitrary code
execution. We should send pings for these files.
Bug: 904182
Change-Id: Ibc26141fb180e843e1ffaf3f78717a9109d2fa9a
Reviewed-on: https://chromium-review.googlesource.com/c/1344552
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611272} | void RecordDownloadImageType(const std::string& mime_type_string) {
DownloadImage download_image = DownloadImage(
GetMimeTypeMatch(mime_type_string, getMimeTypeToDownloadImageMap()));
UMA_HISTOGRAM_ENUMERATION("Download.ContentType.Image", download_image,
DOWNLOAD_IMAGE_MAX);
}
| void RecordDownloadImageType(const std::string& mime_type_string) {
DownloadImage download_image = DownloadImage(
GetMimeTypeMatch(mime_type_string, getMimeTypeToDownloadImageMap()));
UMA_HISTOGRAM_ENUMERATION("Download.ContentType.Image", download_image,
DOWNLOAD_IMAGE_MAX);
}
| C | Chrome | 0 |
CVE-2019-1010251 | https://www.cvedetails.com/cve/CVE-2019-1010251/ | CWE-20 | https://github.com/OISF/suricata/pull/3590/commits/11f3659f64a4e42e90cb3c09fcef66894205aefe | 11f3659f64a4e42e90cb3c09fcef66894205aefe | teredo: be stricter on what to consider valid teredo
Invalid Teredo can lead to valid DNS traffic (or other UDP traffic)
being misdetected as Teredo. This leads to false negatives in the
UDP payload inspection.
Make the teredo code only consider a packet teredo if the encapsulated
data was decoded without any 'invalid' events being set.
Bug #2736. | int DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
uint8_t *pkt, uint32_t len, PacketQueue *pq, enum DecodeTunnelProto proto)
{
switch (proto) {
case DECODE_TUNNEL_PPP:
return DecodePPP(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_IPV4:
return DecodeIPV4(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_IPV6:
case DECODE_TUNNEL_IPV6_TEREDO:
return DecodeIPV6(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_VLAN:
return DecodeVLAN(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_ETHERNET:
return DecodeEthernet(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_ERSPAN:
return DecodeERSPAN(tv, dtv, p, pkt, len, pq);
default:
SCLogDebug("FIXME: DecodeTunnel: protocol %" PRIu32 " not supported.", proto);
break;
}
return TM_ECODE_OK;
}
| int DecodeTunnel(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p,
uint8_t *pkt, uint32_t len, PacketQueue *pq, enum DecodeTunnelProto proto)
{
switch (proto) {
case DECODE_TUNNEL_PPP:
return DecodePPP(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_IPV4:
return DecodeIPV4(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_IPV6:
return DecodeIPV6(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_VLAN:
return DecodeVLAN(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_ETHERNET:
return DecodeEthernet(tv, dtv, p, pkt, len, pq);
case DECODE_TUNNEL_ERSPAN:
return DecodeERSPAN(tv, dtv, p, pkt, len, pq);
default:
SCLogInfo("FIXME: DecodeTunnel: protocol %" PRIu32 " not supported.", proto);
break;
}
return TM_ECODE_OK;
}
| C | suricata | 1 |
null | null | null | https://github.com/chromium/chromium/commit/1161a49d663dd395bd639549c2dfe7324f847938 | 1161a49d663dd395bd639549c2dfe7324f847938 | Don't populate URL data in WebDropData when dragging files.
This is considered a potential security issue as well, since it leaks
filesystem paths.
BUG=332579
Review URL: https://codereview.chromium.org/135633002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244538 0039d316-1c4b-4281-b951-d872f2087c98 | bool TabStrip::ShouldPaintTab(const Tab* tab, gfx::Rect* clip) {
if (!(touch_layout_.get() || IsStackingDraggedTabs()))
return true;
int index = GetModelIndexOfTab(tab);
if (index == -1)
return true; // Tab is closing, paint it all.
int active_index = IsStackingDraggedTabs() ?
controller_->GetActiveIndex() : touch_layout_->active_index();
if (active_index == tab_count())
active_index--;
if (index < active_index) {
if (tab_at(index)->x() == tab_at(index + 1)->x())
return false;
if (tab_at(index)->x() > tab_at(index + 1)->x())
return true; // Can happen during dragging.
clip->SetRect(0, 0, tab_at(index + 1)->x() - tab_at(index)->x() +
stacked_tab_left_clip(),
tab_at(index)->height());
} else if (index > active_index && index > 0) {
const gfx::Rect& tab_bounds(tab_at(index)->bounds());
const gfx::Rect& previous_tab_bounds(tab_at(index - 1)->bounds());
if (tab_bounds.x() == previous_tab_bounds.x())
return false;
if (tab_bounds.x() < previous_tab_bounds.x())
return true; // Can happen during dragging.
if (previous_tab_bounds.right() + tab_h_offset() != tab_bounds.x()) {
int x = previous_tab_bounds.right() - tab_bounds.x() -
stacked_tab_right_clip();
clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height());
}
}
return true;
}
| bool TabStrip::ShouldPaintTab(const Tab* tab, gfx::Rect* clip) {
if (!(touch_layout_.get() || IsStackingDraggedTabs()))
return true;
int index = GetModelIndexOfTab(tab);
if (index == -1)
return true; // Tab is closing, paint it all.
int active_index = IsStackingDraggedTabs() ?
controller_->GetActiveIndex() : touch_layout_->active_index();
if (active_index == tab_count())
active_index--;
if (index < active_index) {
if (tab_at(index)->x() == tab_at(index + 1)->x())
return false;
if (tab_at(index)->x() > tab_at(index + 1)->x())
return true; // Can happen during dragging.
clip->SetRect(0, 0, tab_at(index + 1)->x() - tab_at(index)->x() +
stacked_tab_left_clip(),
tab_at(index)->height());
} else if (index > active_index && index > 0) {
const gfx::Rect& tab_bounds(tab_at(index)->bounds());
const gfx::Rect& previous_tab_bounds(tab_at(index - 1)->bounds());
if (tab_bounds.x() == previous_tab_bounds.x())
return false;
if (tab_bounds.x() < previous_tab_bounds.x())
return true; // Can happen during dragging.
if (previous_tab_bounds.right() + tab_h_offset() != tab_bounds.x()) {
int x = previous_tab_bounds.right() - tab_bounds.x() -
stacked_tab_right_clip();
clip->SetRect(x, 0, tab_bounds.width() - x, tab_bounds.height());
}
}
return true;
}
| C | Chrome | 0 |
CVE-2011-2350 | https://www.cvedetails.com/cve/CVE-2011-2350/ | CWE-20 | https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201 | b944f670bb7a8a919daac497a4ea0536c954c201 | [JSC] Implement a helper method createNotEnoughArgumentsError()
https://bugs.webkit.org/show_bug.cgi?id=85102
Reviewed by Geoffrey Garen.
In bug 84787, kbr@ requested to avoid hard-coding
createTypeError(exec, "Not enough arguments") here and there.
This patch implements createNotEnoughArgumentsError(exec)
and uses it in JSC bindings.
c.f. a corresponding bug for V8 bindings is bug 85097.
Source/JavaScriptCore:
* runtime/Error.cpp:
(JSC::createNotEnoughArgumentsError):
(JSC):
* runtime/Error.h:
(JSC):
Source/WebCore:
Test: bindings/scripts/test/TestObj.idl
* bindings/scripts/CodeGeneratorJS.pm: Modified as described above.
(GenerateArgumentsCountCheck):
* bindings/js/JSDataViewCustom.cpp: Ditto.
(WebCore::getDataViewMember):
(WebCore::setDataViewMember):
* bindings/js/JSDeprecatedPeerConnectionCustom.cpp:
(WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection):
* bindings/js/JSDirectoryEntryCustom.cpp:
(WebCore::JSDirectoryEntry::getFile):
(WebCore::JSDirectoryEntry::getDirectory):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
* bindings/js/JSWebKitMutationObserverCustom.cpp:
(WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
(WebCore::JSWebKitMutationObserver::observe):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorkerConstructor::constructJSWorker):
* bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests.
(WebCore::jsFloat64ArrayPrototypeFunctionFoo):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
(WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
(WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
(WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::constructJSTestObj):
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
(WebCore::jsTestObjPrototypeFunctionIdbKey):
(WebCore::jsTestObjPrototypeFunctionOptionsObject):
(WebCore::jsTestObjPrototypeFunctionAddEventListener):
(WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjConstructorFunctionClassMethod2):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray):
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionConvert2):
(WebCore::jsTestObjPrototypeFunctionConvert3):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionConvert5):
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
return throwVMTypeError(exec);
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
JSC::JSValue result = jsNumber(impl->intMethod());
return JSValue::encode(result);
}
| EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIntMethod(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
return throwVMTypeError(exec);
JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
JSC::JSValue result = jsNumber(impl->intMethod());
return JSValue::encode(result);
}
| C | Chrome | 0 |
CVE-2016-7910 | https://www.cvedetails.com/cve/CVE-2016-7910/ | CWE-416 | https://github.com/torvalds/linux/commit/77da160530dd1dc94f6ae15a981f24e5f0021e84 | 77da160530dd1dc94f6ae15a981f24e5f0021e84 | block: fix use-after-free in seq file
I got a KASAN report of use-after-free:
==================================================================
BUG: KASAN: use-after-free in klist_iter_exit+0x61/0x70 at addr ffff8800b6581508
Read of size 8 by task trinity-c1/315
=============================================================================
BUG kmalloc-32 (Not tainted): kasan: bad access detected
-----------------------------------------------------------------------------
Disabling lock debugging due to kernel taint
INFO: Allocated in disk_seqf_start+0x66/0x110 age=144 cpu=1 pid=315
___slab_alloc+0x4f1/0x520
__slab_alloc.isra.58+0x56/0x80
kmem_cache_alloc_trace+0x260/0x2a0
disk_seqf_start+0x66/0x110
traverse+0x176/0x860
seq_read+0x7e3/0x11a0
proc_reg_read+0xbc/0x180
do_loop_readv_writev+0x134/0x210
do_readv_writev+0x565/0x660
vfs_readv+0x67/0xa0
do_preadv+0x126/0x170
SyS_preadv+0xc/0x10
do_syscall_64+0x1a1/0x460
return_from_SYSCALL_64+0x0/0x6a
INFO: Freed in disk_seqf_stop+0x42/0x50 age=160 cpu=1 pid=315
__slab_free+0x17a/0x2c0
kfree+0x20a/0x220
disk_seqf_stop+0x42/0x50
traverse+0x3b5/0x860
seq_read+0x7e3/0x11a0
proc_reg_read+0xbc/0x180
do_loop_readv_writev+0x134/0x210
do_readv_writev+0x565/0x660
vfs_readv+0x67/0xa0
do_preadv+0x126/0x170
SyS_preadv+0xc/0x10
do_syscall_64+0x1a1/0x460
return_from_SYSCALL_64+0x0/0x6a
CPU: 1 PID: 315 Comm: trinity-c1 Tainted: G B 4.7.0+ #62
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
ffffea0002d96000 ffff880119b9f918 ffffffff81d6ce81 ffff88011a804480
ffff8800b6581500 ffff880119b9f948 ffffffff8146c7bd ffff88011a804480
ffffea0002d96000 ffff8800b6581500 fffffffffffffff4 ffff880119b9f970
Call Trace:
[<ffffffff81d6ce81>] dump_stack+0x65/0x84
[<ffffffff8146c7bd>] print_trailer+0x10d/0x1a0
[<ffffffff814704ff>] object_err+0x2f/0x40
[<ffffffff814754d1>] kasan_report_error+0x221/0x520
[<ffffffff8147590e>] __asan_report_load8_noabort+0x3e/0x40
[<ffffffff83888161>] klist_iter_exit+0x61/0x70
[<ffffffff82404389>] class_dev_iter_exit+0x9/0x10
[<ffffffff81d2e8ea>] disk_seqf_stop+0x3a/0x50
[<ffffffff8151f812>] seq_read+0x4b2/0x11a0
[<ffffffff815f8fdc>] proc_reg_read+0xbc/0x180
[<ffffffff814b24e4>] do_loop_readv_writev+0x134/0x210
[<ffffffff814b4c45>] do_readv_writev+0x565/0x660
[<ffffffff814b8a17>] vfs_readv+0x67/0xa0
[<ffffffff814b8de6>] do_preadv+0x126/0x170
[<ffffffff814b92ec>] SyS_preadv+0xc/0x10
This problem can occur in the following situation:
open()
- pread()
- .seq_start()
- iter = kmalloc() // succeeds
- seqf->private = iter
- .seq_stop()
- kfree(seqf->private)
- pread()
- .seq_start()
- iter = kmalloc() // fails
- .seq_stop()
- class_dev_iter_exit(seqf->private) // boom! old pointer
As the comment in disk_seqf_stop() says, stop is called even if start
failed, so we need to reinitialise the private pointer to NULL when seq
iteration stops.
An alternative would be to set the private pointer to NULL when the
kmalloc() in disk_seqf_start() fails.
Cc: stable@vger.kernel.org
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@fb.com> | static unsigned long disk_events_poll_jiffies(struct gendisk *disk)
{
struct disk_events *ev = disk->ev;
long intv_msecs = 0;
/*
* If device-specific poll interval is set, always use it. If
* the default is being used, poll iff there are events which
* can't be monitored asynchronously.
*/
if (ev->poll_msecs >= 0)
intv_msecs = ev->poll_msecs;
else if (disk->events & ~disk->async_events)
intv_msecs = disk_events_dfl_poll_msecs;
return msecs_to_jiffies(intv_msecs);
}
| static unsigned long disk_events_poll_jiffies(struct gendisk *disk)
{
struct disk_events *ev = disk->ev;
long intv_msecs = 0;
/*
* If device-specific poll interval is set, always use it. If
* the default is being used, poll iff there are events which
* can't be monitored asynchronously.
*/
if (ev->poll_msecs >= 0)
intv_msecs = ev->poll_msecs;
else if (disk->events & ~disk->async_events)
intv_msecs = disk_events_dfl_poll_msecs;
return msecs_to_jiffies(intv_msecs);
}
| C | linux | 0 |
CVE-2016-5219 | https://www.cvedetails.com/cve/CVE-2016-5219/ | CWE-416 | https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae | a4150b688a754d3d10d2ca385155b1c95d77d6ae | Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM
This makes the query of GL_COMPLETION_STATUS_KHR to programs much
cheaper by minimizing the round-trip to the GPU thread.
Bug: 881152, 957001
Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657568} | GLenum GetBindTargetForSamplerType(GLenum type) {
switch (type) {
case GL_SAMPLER_2D:
case GL_SAMPLER_2D_SHADOW:
case GL_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D:
return GL_TEXTURE_2D;
case GL_SAMPLER_CUBE:
case GL_SAMPLER_CUBE_SHADOW:
case GL_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
return GL_TEXTURE_CUBE_MAP;
case GL_SAMPLER_EXTERNAL_OES:
return GL_TEXTURE_EXTERNAL_OES;
case GL_SAMPLER_2D_RECT_ARB:
return GL_TEXTURE_RECTANGLE_ARB;
case GL_SAMPLER_3D:
case GL_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_3D:
return GL_TEXTURE_3D;
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
return GL_TEXTURE_2D_ARRAY;
default:
NOTREACHED();
return 0;
}
}
| GLenum GetBindTargetForSamplerType(GLenum type) {
switch (type) {
case GL_SAMPLER_2D:
case GL_SAMPLER_2D_SHADOW:
case GL_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D:
return GL_TEXTURE_2D;
case GL_SAMPLER_CUBE:
case GL_SAMPLER_CUBE_SHADOW:
case GL_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
return GL_TEXTURE_CUBE_MAP;
case GL_SAMPLER_EXTERNAL_OES:
return GL_TEXTURE_EXTERNAL_OES;
case GL_SAMPLER_2D_RECT_ARB:
return GL_TEXTURE_RECTANGLE_ARB;
case GL_SAMPLER_3D:
case GL_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_3D:
return GL_TEXTURE_3D;
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
return GL_TEXTURE_2D_ARRAY;
default:
NOTREACHED();
return 0;
}
}
| C | Chrome | 0 |
CVE-2016-6327 | https://www.cvedetails.com/cve/CVE-2016-6327/ | CWE-476 | https://github.com/torvalds/linux/commit/51093254bf879bc9ce96590400a87897c7498463 | 51093254bf879bc9ce96590400a87897c7498463 | IB/srpt: Simplify srpt_handle_tsk_mgmt()
Let the target core check task existence instead of the SRP target
driver. Additionally, let the target core check the validity of the
task management request instead of the ib_srpt driver.
This patch fixes the following kernel crash:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
IP: [<ffffffffa0565f37>] srpt_handle_new_iu+0x6d7/0x790 [ib_srpt]
Oops: 0002 [#1] SMP
Call Trace:
[<ffffffffa05660ce>] srpt_process_completion+0xde/0x570 [ib_srpt]
[<ffffffffa056669f>] srpt_compl_thread+0x13f/0x160 [ib_srpt]
[<ffffffff8109726f>] kthread+0xcf/0xe0
[<ffffffff81613cfc>] ret_from_fork+0x7c/0xb0
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Fixes: 3e4f574857ee ("ib_srpt: Convert TMR path to target_submit_tmr")
Tested-by: Alex Estrin <alex.estrin@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com> | static void srpt_cm_rep_error(struct ib_cm_id *cm_id)
{
pr_info("Received IB REP error for cm_id %p.\n", cm_id);
srpt_drain_channel(cm_id);
}
| static void srpt_cm_rep_error(struct ib_cm_id *cm_id)
{
pr_info("Received IB REP error for cm_id %p.\n", cm_id);
srpt_drain_channel(cm_id);
}
| C | linux | 0 |
CVE-2016-10270 | https://www.cvedetails.com/cve/CVE-2016-10270/ | CWE-125 | https://github.com/vadz/libtiff/commit/9a72a69e035ee70ff5c41541c8c61cd97990d018 | 9a72a69e035ee70ff5c41541c8c61cd97990d018 | * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
instead of a logic based on the total size of data. Which is faulty is
the total size of data is not sufficient to fill the whole image, and thus
results in reading outside of the StripByCounts/StripOffsets arrays when
using TIFFReadScanline().
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
* libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
the above change is a better fix that makes it unnecessary. | static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value)
{
enum TIFFReadDirEntryErr err;
uint32 count;
void* origdata;
uint8* data;
switch (direntry->tdir_type)
{
case TIFF_ASCII:
case TIFF_UNDEFINED:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_SHORT:
case TIFF_SSHORT:
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_LONG8:
case TIFF_SLONG8:
break;
default:
return(TIFFReadDirEntryErrType);
}
err=TIFFReadDirEntryArray(tif,direntry,&count,1,&origdata);
if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
{
*value=0;
return(err);
}
switch (direntry->tdir_type)
{
case TIFF_ASCII:
case TIFF_UNDEFINED:
case TIFF_BYTE:
*value=(uint8*)origdata;
return(TIFFReadDirEntryErrOk);
case TIFF_SBYTE:
{
int8* m;
uint32 n;
m=(int8*)origdata;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeByteSbyte(*m);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(origdata);
return(err);
}
m++;
}
*value=(uint8*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
data=(uint8*)_TIFFmalloc(count);
if (data==0)
{
_TIFFfree(origdata);
return(TIFFReadDirEntryErrAlloc);
}
switch (direntry->tdir_type)
{
case TIFF_SHORT:
{
uint16* ma;
uint8* mb;
uint32 n;
ma=(uint16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
err=TIFFReadDirEntryCheckRangeByteShort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
int16* ma;
uint8* mb;
uint32 n;
ma=(int16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)ma);
err=TIFFReadDirEntryCheckRangeByteSshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_LONG:
{
uint32* ma;
uint8* mb;
uint32 n;
ma=(uint32*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
err=TIFFReadDirEntryCheckRangeByteLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SLONG:
{
int32* ma;
uint8* mb;
uint32 n;
ma=(int32*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong((uint32*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_LONG8:
{
uint64* ma;
uint8* mb;
uint32 n;
ma=(uint64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(ma);
err=TIFFReadDirEntryCheckRangeByteLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
int64* ma;
uint8* mb;
uint32 n;
ma=(int64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8((uint64*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
}
_TIFFfree(origdata);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
return(err);
}
*value=data;
return(TIFFReadDirEntryErrOk);
}
| static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value)
{
enum TIFFReadDirEntryErr err;
uint32 count;
void* origdata;
uint8* data;
switch (direntry->tdir_type)
{
case TIFF_ASCII:
case TIFF_UNDEFINED:
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_SHORT:
case TIFF_SSHORT:
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_LONG8:
case TIFF_SLONG8:
break;
default:
return(TIFFReadDirEntryErrType);
}
err=TIFFReadDirEntryArray(tif,direntry,&count,1,&origdata);
if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
{
*value=0;
return(err);
}
switch (direntry->tdir_type)
{
case TIFF_ASCII:
case TIFF_UNDEFINED:
case TIFF_BYTE:
*value=(uint8*)origdata;
return(TIFFReadDirEntryErrOk);
case TIFF_SBYTE:
{
int8* m;
uint32 n;
m=(int8*)origdata;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeByteSbyte(*m);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(origdata);
return(err);
}
m++;
}
*value=(uint8*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
data=(uint8*)_TIFFmalloc(count);
if (data==0)
{
_TIFFfree(origdata);
return(TIFFReadDirEntryErrAlloc);
}
switch (direntry->tdir_type)
{
case TIFF_SHORT:
{
uint16* ma;
uint8* mb;
uint32 n;
ma=(uint16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
err=TIFFReadDirEntryCheckRangeByteShort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
int16* ma;
uint8* mb;
uint32 n;
ma=(int16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)ma);
err=TIFFReadDirEntryCheckRangeByteSshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_LONG:
{
uint32* ma;
uint8* mb;
uint32 n;
ma=(uint32*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
err=TIFFReadDirEntryCheckRangeByteLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SLONG:
{
int32* ma;
uint8* mb;
uint32 n;
ma=(int32*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong((uint32*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_LONG8:
{
uint64* ma;
uint8* mb;
uint32 n;
ma=(uint64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(ma);
err=TIFFReadDirEntryCheckRangeByteLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
int64* ma;
uint8* mb;
uint32 n;
ma=(int64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8((uint64*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(uint8)(*ma++);
}
}
break;
}
_TIFFfree(origdata);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
return(err);
}
*value=data;
return(TIFFReadDirEntryErrOk);
}
| C | libtiff | 0 |
CVE-2011-4930 | https://www.cvedetails.com/cve/CVE-2011-4930/ | CWE-134 | https://htcondor-git.cs.wisc.edu/?p=condor.git;a=commitdiff;h=5e5571d1a431eb3c61977b6dd6ec90186ef79867 | 5e5571d1a431eb3c61977b6dd6ec90186ef79867 | null | void BaseShadow::removeJob( const char* reason )
{
this->removeJobPre(reason);
DC_Exit( JOB_SHOULD_REMOVE );
}
| void BaseShadow::removeJob( const char* reason )
{
this->removeJobPre(reason);
DC_Exit( JOB_SHOULD_REMOVE );
}
| CPP | htcondor | 0 |
CVE-2017-6991 | https://www.cvedetails.com/cve/CVE-2017-6991/ | CWE-119 | https://github.com/chromium/chromium/commit/3bfe67c9c4b45eb713326aae7a67c8f7390dae08 | 3bfe67c9c4b45eb713326aae7a67c8f7390dae08 | sqlite: safely move pointer values through SQL.
This lands https://www.sqlite.org/src/timeline?c=d6a44b35 in
third_party/sqlite/src/ and
third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch
and re-generates third_party/sqlite/amalgamation/* using the script at
third_party/sqlite/google_generate_amalgamation.sh.
The CL also adds a layout test that verifies the patch works as intended.
BUG=742407
Change-Id: I2e1a457459cd2e975e6241b630e7b79c82545981
Reviewed-on: https://chromium-review.googlesource.com/572976
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487275} | static int autoIncBegin(
Parse *pParse, /* Parsing context */
int iDb, /* Index of the database holding pTab */
Table *pTab /* The table we are writing to */
){
int memId = 0; /* Register holding maximum rowid */
if( (pTab->tabFlags & TF_Autoincrement)!=0
&& (pParse->db->flags & SQLITE_Vacuum)==0
){
Parse *pToplevel = sqlite3ParseToplevel(pParse);
AutoincInfo *pInfo;
pInfo = pToplevel->pAinc;
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; }
if( pInfo==0 ){
pInfo = sqlite3DbMallocRawNN(pParse->db, sizeof(*pInfo));
if( pInfo==0 ) return 0;
pInfo->pNext = pToplevel->pAinc;
pToplevel->pAinc = pInfo;
pInfo->pTab = pTab;
pInfo->iDb = iDb;
pToplevel->nMem++; /* Register to hold name of table */
pInfo->regCtr = ++pToplevel->nMem; /* Max rowid register */
pToplevel->nMem++; /* Rowid in sqlite_sequence */
}
memId = pInfo->regCtr;
}
return memId;
}
| static int autoIncBegin(
Parse *pParse, /* Parsing context */
int iDb, /* Index of the database holding pTab */
Table *pTab /* The table we are writing to */
){
int memId = 0; /* Register holding maximum rowid */
if( (pTab->tabFlags & TF_Autoincrement)!=0
&& (pParse->db->flags & SQLITE_Vacuum)==0
){
Parse *pToplevel = sqlite3ParseToplevel(pParse);
AutoincInfo *pInfo;
pInfo = pToplevel->pAinc;
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; }
if( pInfo==0 ){
pInfo = sqlite3DbMallocRawNN(pParse->db, sizeof(*pInfo));
if( pInfo==0 ) return 0;
pInfo->pNext = pToplevel->pAinc;
pToplevel->pAinc = pInfo;
pInfo->pTab = pTab;
pInfo->iDb = iDb;
pToplevel->nMem++; /* Register to hold name of table */
pInfo->regCtr = ++pToplevel->nMem; /* Max rowid register */
pToplevel->nMem++; /* Rowid in sqlite_sequence */
}
memId = pInfo->regCtr;
}
return memId;
}
| C | Chrome | 0 |
CVE-2016-9557 | https://www.cvedetails.com/cve/CVE-2016-9557/ | CWE-190 | https://github.com/mdadams/jasper/commit/d42b2388f7f8e0332c846675133acea151fc557a | d42b2388f7f8e0332c846675133acea151fc557a | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict the maximum size of image that they can decode. This change
was made as a (possibly temporary) fix to address security concerns.
A max_samples command-line option has also been added to imginfo.
Whether an image component (for jas_image_t) is stored in memory or on
disk is now based on the component size (rather than the image size).
Some debug log message were added.
Some new integer overflow checks were added.
Some new safe integer add/multiply functions were added.
More pre-C99 cruft was removed. JasPer has numerous "hacks" to
handle pre-C99 compilers. JasPer now assumes C99 support. So, this
pre-C99 cruft is unnecessary and can be removed.
The regression jasper-doublefree-mem_close.jpg has been re-enabled.
Theoretically, it should work more predictably now. | static int ras_getint(jas_stream_t *in, int_fast32_t *val)
{
int_fast32_t x;
int c;
int i;
x = 0;
for (i = 0; i < 4; i++) {
if ((c = jas_stream_getc(in)) == EOF) {
return -1;
}
x = (x << 8) | (c & 0xff);
}
*val = x;
return 0;
}
| static int ras_getint(jas_stream_t *in, int_fast32_t *val)
{
int_fast32_t x;
int c;
int i;
x = 0;
for (i = 0; i < 4; i++) {
if ((c = jas_stream_getc(in)) == EOF) {
return -1;
}
x = (x << 8) | (c & 0xff);
}
*val = x;
return 0;
}
| C | jasper | 0 |
CVE-2011-2347 | https://www.cvedetails.com/cve/CVE-2011-2347/ | CWE-119 | https://github.com/chromium/chromium/commit/60cc89e8d2e761dea28bb9e4cf9ebbad516bff09 | 60cc89e8d2e761dea28bb9e4cf9ebbad516bff09 | iwyu: Include callback_old.h where appropriate, final.
BUG=82098
TEST=none
Review URL: http://codereview.chromium.org/7003003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85003 0039d316-1c4b-4281-b951-d872f2087c98 | void UrlmonUrlRequestManager::DownloadRequestInHost(int request_id) {
DVLOG(1) << __FUNCTION__ << " " << request_id;
if (IsWindow(notification_window_)) {
scoped_refptr<UrlmonUrlRequest> request(LookupRequest(request_id));
if (request) {
UrlmonUrlRequest::TerminateBindCallback* callback = NewCallback(this,
&UrlmonUrlRequestManager::BindTerminated);
request->TerminateBind(callback);
} else {
NOTREACHED();
}
} else {
NOTREACHED() << "Cannot handle download if we don't have anyone to hand it "
"to.";
}
}
| void UrlmonUrlRequestManager::DownloadRequestInHost(int request_id) {
DVLOG(1) << __FUNCTION__ << " " << request_id;
if (IsWindow(notification_window_)) {
scoped_refptr<UrlmonUrlRequest> request(LookupRequest(request_id));
if (request) {
UrlmonUrlRequest::TerminateBindCallback* callback = NewCallback(this,
&UrlmonUrlRequestManager::BindTerminated);
request->TerminateBind(callback);
} else {
NOTREACHED();
}
} else {
NOTREACHED() << "Cannot handle download if we don't have anyone to hand it "
"to.";
}
}
| C | Chrome | 0 |
CVE-2013-2850 | https://www.cvedetails.com/cve/CVE-2013-2850/ | CWE-119 | https://github.com/torvalds/linux/commit/cea4dcfdad926a27a18e188720efe0f2c9403456 | cea4dcfdad926a27a18e188720efe0f2c9403456 | iscsi-target: fix heap buffer overflow on error
If a key was larger than 64 bytes, as checked by iscsi_check_key(), the
error response packet, generated by iscsi_add_notunderstood_response(),
would still attempt to copy the entire key into the packet, overflowing
the structure on the heap.
Remote preauthentication kernel memory corruption was possible if a
target was configured and listening on the network.
CVE-2013-2850
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> | static void iscsi_check_proposer_for_optional_reply(struct iscsi_param *param)
{
if (IS_TYPE_BOOL_AND(param)) {
if (!strcmp(param->value, NO))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_TYPE_BOOL_OR(param)) {
if (!strcmp(param->value, YES))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* Required for gPXE iSCSI boot client
*/
if (!strcmp(param->name, IMMEDIATEDATA))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_TYPE_NUMBER(param)) {
if (!strcmp(param->name, MAXRECVDATASEGMENTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* The GlobalSAN iSCSI Initiator for MacOSX does
* not respond to MaxBurstLength, FirstBurstLength,
* DefaultTime2Wait or DefaultTime2Retain parameter keys.
* So, we set them to 'reply optional' here, and assume the
* the defaults from iscsi_parameters.h if the initiator
* is not RFC compliant and the keys are not negotiated.
*/
if (!strcmp(param->name, MAXBURSTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, FIRSTBURSTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, DEFAULTTIME2WAIT))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, DEFAULTTIME2RETAIN))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* Required for gPXE iSCSI boot client
*/
if (!strcmp(param->name, MAXCONNECTIONS))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_PHASE_DECLARATIVE(param))
SET_PSTATE_REPLY_OPTIONAL(param);
}
| static void iscsi_check_proposer_for_optional_reply(struct iscsi_param *param)
{
if (IS_TYPE_BOOL_AND(param)) {
if (!strcmp(param->value, NO))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_TYPE_BOOL_OR(param)) {
if (!strcmp(param->value, YES))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* Required for gPXE iSCSI boot client
*/
if (!strcmp(param->name, IMMEDIATEDATA))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_TYPE_NUMBER(param)) {
if (!strcmp(param->name, MAXRECVDATASEGMENTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* The GlobalSAN iSCSI Initiator for MacOSX does
* not respond to MaxBurstLength, FirstBurstLength,
* DefaultTime2Wait or DefaultTime2Retain parameter keys.
* So, we set them to 'reply optional' here, and assume the
* the defaults from iscsi_parameters.h if the initiator
* is not RFC compliant and the keys are not negotiated.
*/
if (!strcmp(param->name, MAXBURSTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, FIRSTBURSTLENGTH))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, DEFAULTTIME2WAIT))
SET_PSTATE_REPLY_OPTIONAL(param);
if (!strcmp(param->name, DEFAULTTIME2RETAIN))
SET_PSTATE_REPLY_OPTIONAL(param);
/*
* Required for gPXE iSCSI boot client
*/
if (!strcmp(param->name, MAXCONNECTIONS))
SET_PSTATE_REPLY_OPTIONAL(param);
} else if (IS_PHASE_DECLARATIVE(param))
SET_PSTATE_REPLY_OPTIONAL(param);
}
| C | linux | 0 |
CVE-2013-1828 | https://www.cvedetails.com/cve/CVE-2013-1828/ | CWE-20 | https://github.com/torvalds/linux/commit/726bc6b092da4c093eb74d13c07184b18c1af0f1 | 726bc6b092da4c093eb74d13c07184b18c1af0f1 | net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS
Building sctp may fail with:
In function ‘copy_from_user’,
inlined from ‘sctp_getsockopt_assoc_stats’ at
net/sctp/socket.c:5656:20:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to
‘copy_from_user_overflow’ declared with attribute error: copy_from_user()
buffer size is not provably correct
if built with W=1 due to a missing parameter size validation
before the call to copy_from_user.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | static int sctp_getsockopt_fragment_interleave(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
int val;
if (len < sizeof(int))
return -EINVAL;
len = sizeof(int);
val = sctp_sk(sk)->frag_interleave;
if (put_user(len, optlen))
return -EFAULT;
if (copy_to_user(optval, &val, len))
return -EFAULT;
return 0;
}
| static int sctp_getsockopt_fragment_interleave(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
int val;
if (len < sizeof(int))
return -EINVAL;
len = sizeof(int);
val = sctp_sk(sk)->frag_interleave;
if (put_user(len, optlen))
return -EFAULT;
if (copy_to_user(optval, &val, len))
return -EFAULT;
return 0;
}
| C | linux | 0 |
CVE-2017-13673 | https://www.cvedetails.com/cve/CVE-2017-13673/ | CWE-617 | https://git.qemu.org/gitweb.cgi?p=qemu.git;a=commit;h=bfc56535f793c557aa754c50213fc5f882e6482d | bfc56535f793c557aa754c50213fc5f882e6482d | null | static int update_palette256(VGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
full_update = 0;
palette = s->last_palette;
v = 0;
for(i = 0; i < 256; i++) {
if (s->dac_8bit) {
col = rgb_to_pixel32(s->palette[v],
s->palette[v + 1],
s->palette[v + 2]);
} else {
col = rgb_to_pixel32(c6_to_8(s->palette[v]),
c6_to_8(s->palette[v + 1]),
c6_to_8(s->palette[v + 2]));
}
if (col != palette[i]) {
full_update = 1;
palette[i] = col;
}
v += 3;
}
return full_update;
}
| static int update_palette256(VGACommonState *s)
{
int full_update, i;
uint32_t v, col, *palette;
full_update = 0;
palette = s->last_palette;
v = 0;
for(i = 0; i < 256; i++) {
if (s->dac_8bit) {
col = rgb_to_pixel32(s->palette[v],
s->palette[v + 1],
s->palette[v + 2]);
} else {
col = rgb_to_pixel32(c6_to_8(s->palette[v]),
c6_to_8(s->palette[v + 1]),
c6_to_8(s->palette[v + 2]));
}
if (col != palette[i]) {
full_update = 1;
palette[i] = col;
}
v += 3;
}
return full_update;
}
| C | qemu | 0 |
CVE-2016-5353 | https://www.cvedetails.com/cve/CVE-2016-5353/ | CWE-20 | https://github.com/wireshark/wireshark/commit/7d7190695ce2ff269fdffb04e87139995cde21f4 | 7d7190695ce2ff269fdffb04e87139995cde21f4 | UMTS_FP: fix handling reserved C/T value
The spec puts the reserved value at 0xf but our internal table has 'unknown' at
0; since all the other values seem to be offset-by-one, just take the modulus
0xf to avoid running off the end of the table.
Bug: 12191
Change-Id: I83c8fb66797bbdee52a2246fb1eea6e37cbc7eb0
Reviewed-on: https://code.wireshark.org/review/15722
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net> | dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
dissector_handle_t *data_handle, void *data)
{
int chan, num_tbs = 0;
int bit_offset = 0;
int crci_bit_offset = (offset+1)<<3; /* Current offset + Quality estimate of 1 byte at the end*/
guint data_bits = 0;
guint8 crci_bit = 0;
proto_item *tree_ti = NULL;
proto_tree *data_tree = NULL;
gboolean dissected = FALSE;
if (tree) {
/* Add data subtree */
tree_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA);
proto_item_set_text(tree_ti, "TB data for %u chans", p_fp_info->num_chans);
data_tree = proto_item_add_subtree(tree_ti, ett_fp_data);
}
/* Calculate offset to CRCI bits */
if (p_fp_info->is_uplink) {
for (chan=0; chan < p_fp_info->num_chans; chan++) {
int n;
for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) {
/* Advance bit offset */
crci_bit_offset += p_fp_info->chan_tf_size[chan];
/* Pad out to next byte */
if (crci_bit_offset % 8) {
crci_bit_offset += (8 - (crci_bit_offset % 8));
}
}
}
}
/* Now for the TB data */
for (chan=0; chan < p_fp_info->num_chans; chan++) {
int n;
p_fp_info->cur_chan = chan; /*Set current channel?*/
/* Clearly show channels with no TBs */
if (p_fp_info->chan_num_tbs[chan] == 0) {
proto_item *no_tb_ti = proto_tree_add_uint(data_tree, hf_fp_chan_zero_tbs, tvb,
offset+(bit_offset/8),
0, chan+1);
proto_item_append_text(no_tb_ti, " (of size %d)",
p_fp_info->chan_tf_size[chan]);
PROTO_ITEM_SET_GENERATED(no_tb_ti);
}
/* Show TBs from non-empty channels */
pinfo->fd->subnum = chan; /* set subframe number to current TB */
for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) {
proto_item *ti;
p_fp_info->cur_tb = chan; /*Set current transport block?*/
if (data_tree) {
ti = proto_tree_add_item(data_tree, hf_fp_tb, tvb,
offset + (bit_offset/8),
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8,
ENC_NA);
proto_item_set_text(ti, "TB (chan %u, tb %u, %u bits)",
chan+1, n+1, p_fp_info->chan_tf_size[chan]);
}
if (preferences_call_mac_dissectors /*&& !rlc_is_ciphered(pinfo)*/ && data_handle &&
(p_fp_info->chan_tf_size[chan] > 0)) {
tvbuff_t *next_tvb;
proto_item *item;
/* If this is DL we should not care about crci bits (since they don't exists)*/
if (p_fp_info->is_uplink) {
if ( p_fp_info->channel == CHANNEL_RACH_FDD) { /*In RACH we don't have any QE field, hence go back 8 bits.*/
crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n-8, 1);
item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n-8)/8, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(item);
} else {
crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n, 1);
item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n)/8, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(item);
}
}
if (crci_bit == 0 || !p_fp_info->is_uplink) {
next_tvb = tvb_new_subset(tvb, offset + bit_offset/8,
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8, -1);
/****************/
/* TODO: maybe this decision can be based only on info available in fp_info */
call_dissector_with_data(*data_handle, next_tvb, pinfo, top_level_tree, data);
dissected = TRUE;
} else {
proto_tree_add_expert(tree, pinfo, &ei_fp_crci_no_subdissector, tvb, offset + bit_offset/8,
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8);
}
}
num_tbs++;
/* Advance bit offset */
bit_offset += p_fp_info->chan_tf_size[chan];
data_bits += p_fp_info->chan_tf_size[chan];
/* Pad out to next byte */
if (bit_offset % 8) {
bit_offset += (8 - (bit_offset % 8));
}
}
}
if (dissected == FALSE) {
col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)",
data_bits, num_tbs);
}
/* Data tree should cover entire length */
if (data_tree) {
proto_item_set_len(tree_ti, bit_offset/8);
proto_item_append_text(tree_ti, " (%u bits in %u tbs)", data_bits, num_tbs);
}
/* Move offset past TBs (we know it's already padded out to next byte) */
offset += (bit_offset / 8);
return offset;
}
| dissect_tb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset, struct fp_info *p_fp_info,
dissector_handle_t *data_handle, void *data)
{
int chan, num_tbs = 0;
int bit_offset = 0;
int crci_bit_offset = (offset+1)<<3; /* Current offset + Quality estimate of 1 byte at the end*/
guint data_bits = 0;
guint8 crci_bit = 0;
proto_item *tree_ti = NULL;
proto_tree *data_tree = NULL;
gboolean dissected = FALSE;
if (tree) {
/* Add data subtree */
tree_ti = proto_tree_add_item(tree, hf_fp_data, tvb, offset, -1, ENC_NA);
proto_item_set_text(tree_ti, "TB data for %u chans", p_fp_info->num_chans);
data_tree = proto_item_add_subtree(tree_ti, ett_fp_data);
}
/* Calculate offset to CRCI bits */
if (p_fp_info->is_uplink) {
for (chan=0; chan < p_fp_info->num_chans; chan++) {
int n;
for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) {
/* Advance bit offset */
crci_bit_offset += p_fp_info->chan_tf_size[chan];
/* Pad out to next byte */
if (crci_bit_offset % 8) {
crci_bit_offset += (8 - (crci_bit_offset % 8));
}
}
}
}
/* Now for the TB data */
for (chan=0; chan < p_fp_info->num_chans; chan++) {
int n;
p_fp_info->cur_chan = chan; /*Set current channel?*/
/* Clearly show channels with no TBs */
if (p_fp_info->chan_num_tbs[chan] == 0) {
proto_item *no_tb_ti = proto_tree_add_uint(data_tree, hf_fp_chan_zero_tbs, tvb,
offset+(bit_offset/8),
0, chan+1);
proto_item_append_text(no_tb_ti, " (of size %d)",
p_fp_info->chan_tf_size[chan]);
PROTO_ITEM_SET_GENERATED(no_tb_ti);
}
/* Show TBs from non-empty channels */
pinfo->fd->subnum = chan; /* set subframe number to current TB */
for (n=0; n < p_fp_info->chan_num_tbs[chan]; n++) {
proto_item *ti;
p_fp_info->cur_tb = chan; /*Set current transport block?*/
if (data_tree) {
ti = proto_tree_add_item(data_tree, hf_fp_tb, tvb,
offset + (bit_offset/8),
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8,
ENC_NA);
proto_item_set_text(ti, "TB (chan %u, tb %u, %u bits)",
chan+1, n+1, p_fp_info->chan_tf_size[chan]);
}
if (preferences_call_mac_dissectors /*&& !rlc_is_ciphered(pinfo)*/ && data_handle &&
(p_fp_info->chan_tf_size[chan] > 0)) {
tvbuff_t *next_tvb;
proto_item *item;
/* If this is DL we should not care about crci bits (since they don't exists)*/
if (p_fp_info->is_uplink) {
if ( p_fp_info->channel == CHANNEL_RACH_FDD) { /*In RACH we don't have any QE field, hence go back 8 bits.*/
crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n-8, 1);
item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n-8)/8, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(item);
} else {
crci_bit = tvb_get_bits8(tvb, crci_bit_offset+n, 1);
item = proto_tree_add_item(data_tree, hf_fp_crci[n%8], tvb, (crci_bit_offset+n)/8, 1, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(item);
}
}
if (crci_bit == 0 || !p_fp_info->is_uplink) {
next_tvb = tvb_new_subset(tvb, offset + bit_offset/8,
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8, -1);
/****************/
/* TODO: maybe this decision can be based only on info available in fp_info */
call_dissector_with_data(*data_handle, next_tvb, pinfo, top_level_tree, data);
dissected = TRUE;
} else {
proto_tree_add_expert(tree, pinfo, &ei_fp_crci_no_subdissector, tvb, offset + bit_offset/8,
((bit_offset % 8) + p_fp_info->chan_tf_size[chan] + 7) / 8);
}
}
num_tbs++;
/* Advance bit offset */
bit_offset += p_fp_info->chan_tf_size[chan];
data_bits += p_fp_info->chan_tf_size[chan];
/* Pad out to next byte */
if (bit_offset % 8) {
bit_offset += (8 - (bit_offset % 8));
}
}
}
if (dissected == FALSE) {
col_append_fstr(pinfo->cinfo, COL_INFO, "(%u bits in %u tbs)",
data_bits, num_tbs);
}
/* Data tree should cover entire length */
if (data_tree) {
proto_item_set_len(tree_ti, bit_offset/8);
proto_item_append_text(tree_ti, " (%u bits in %u tbs)", data_bits, num_tbs);
}
/* Move offset past TBs (we know it's already padded out to next byte) */
offset += (bit_offset / 8);
return offset;
}
| C | wireshark | 0 |
CVE-2016-10369 | https://www.cvedetails.com/cve/CVE-2016-10369/ | CWE-284 | https://git.lxde.org/gitweb/?p=lxde/lxterminal.git;a=commit;h=f99163c6ff8b2f57c5f37b1ce5d62cf7450d4648 | f99163c6ff8b2f57c5f37b1ce5d62cf7450d4648 | null | static gboolean lxterminal_socket_accept_client(GIOChannel * source, GIOCondition condition, LXTermWindow * lxtermwin)
{
if (condition & G_IO_IN)
{
/* Accept the new connection. */
int fd = accept(g_io_channel_unix_get_fd(source), NULL, NULL);
if (fd < 0)
g_warning("Accept failed: %s\n", g_strerror(errno));
/* Add O_NONBLOCK to the flags. */
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
/* Create a glib I/O channel. */
GIOChannel * gio = g_io_channel_unix_new(fd);
if (gio == NULL)
g_warning("Cannot create new GIOChannel\n");
else
{
/* Set up the glib I/O channel and add it to the event loop. */
g_io_channel_set_encoding(gio, NULL, NULL);
g_io_add_watch(gio, G_IO_IN | G_IO_HUP, (GIOFunc) lxterminal_socket_read_channel, lxtermwin);
g_io_channel_unref(gio);
}
}
/* Our listening socket hung up - we are dead. */
if (condition & G_IO_HUP)
g_error("Server listening socket closed unexpectedly\n");
return TRUE;
}
| static gboolean lxterminal_socket_accept_client(GIOChannel * source, GIOCondition condition, LXTermWindow * lxtermwin)
{
if (condition & G_IO_IN)
{
/* Accept the new connection. */
int fd = accept(g_io_channel_unix_get_fd(source), NULL, NULL);
if (fd < 0)
g_warning("Accept failed: %s\n", g_strerror(errno));
/* Add O_NONBLOCK to the flags. */
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
/* Create a glib I/O channel. */
GIOChannel * gio = g_io_channel_unix_new(fd);
if (gio == NULL)
g_warning("Cannot create new GIOChannel\n");
else
{
/* Set up the glib I/O channel and add it to the event loop. */
g_io_channel_set_encoding(gio, NULL, NULL);
g_io_add_watch(gio, G_IO_IN | G_IO_HUP, (GIOFunc) lxterminal_socket_read_channel, lxtermwin);
g_io_channel_unref(gio);
}
}
/* Our listening socket hung up - we are dead. */
if (condition & G_IO_HUP)
g_error("Server listening socket closed unexpectedly\n");
return TRUE;
}
| C | lxde | 0 |
CVE-2013-2061 | https://www.cvedetails.com/cve/CVE-2013-2061/ | CWE-200 | https://github.com/OpenVPN/openvpn/commit/11d21349a4e7e38a025849479b36ace7c2eec2ee | 11d21349a4e7e38a025849479b36ace7c2eec2ee | Use constant time memcmp when comparing HMACs in openvpn_decrypt.
Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de> | md5_digest_clear (struct md5_digest *digest)
{
CLEAR (*digest);
}
| md5_digest_clear (struct md5_digest *digest)
{
CLEAR (*digest);
}
| C | openvpn | 0 |
CVE-2012-2890 | https://www.cvedetails.com/cve/CVE-2012-2890/ | CWE-399 | https://github.com/chromium/chromium/commit/a6f7726de20450074a01493e4e85409ce3f2595a | a6f7726de20450074a01493e4e85409ce3f2595a | Unreviewed, rolling out r147402.
http://trac.webkit.org/changeset/147402
https://bugs.webkit.org/show_bug.cgi?id=112903
Source/WebCore:
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
LayoutTests:
* http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html:
* http/tests/security/XFrameOptions/x-frame-options-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
git-svn-id: svn://svn.chromium.org/blink/trunk@147450 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | String Document::readyState() const
{
DEFINE_STATIC_LOCAL(const String, loading, (ASCIILiteral("loading")));
DEFINE_STATIC_LOCAL(const String, interactive, (ASCIILiteral("interactive")));
DEFINE_STATIC_LOCAL(const String, complete, (ASCIILiteral("complete")));
switch (m_readyState) {
case Loading:
return loading;
case Interactive:
return interactive;
case Complete:
return complete;
}
ASSERT_NOT_REACHED();
return String();
}
| String Document::readyState() const
{
DEFINE_STATIC_LOCAL(const String, loading, (ASCIILiteral("loading")));
DEFINE_STATIC_LOCAL(const String, interactive, (ASCIILiteral("interactive")));
DEFINE_STATIC_LOCAL(const String, complete, (ASCIILiteral("complete")));
switch (m_readyState) {
case Loading:
return loading;
case Interactive:
return interactive;
case Complete:
return complete;
}
ASSERT_NOT_REACHED();
return String();
}
| C | Chrome | 0 |
CVE-2011-1300 | https://www.cvedetails.com/cve/CVE-2011-1300/ | CWE-189 | https://github.com/chromium/chromium/commit/b3ae5db129f88dae153880e84bdabea8ce2ca89b | b3ae5db129f88dae153880e84bdabea8ce2ca89b | chromeos: Replace copy-and-pasted code with macros.
This replaces a bunch of duplicated-per-library cros
function definitions and comments.
BUG=none
TEST=built it
Review URL: http://codereview.chromium.org/6086007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70070 0039d316-1c4b-4281-b951-d872f2087c98 | void CrosLibrary::TestApi::SetUpdateLibrary(
| void CrosLibrary::TestApi::SetUpdateLibrary(
UpdateLibrary* library, bool own) {
library_->update_lib_.SetImpl(library, own);
}
| C | Chrome | 1 |
CVE-2012-2824 | https://www.cvedetails.com/cve/CVE-2012-2824/ | CWE-399 | https://github.com/chromium/chromium/commit/7c2785fab1685c8735288dfbbbb617d9c4f5d8b2 | 7c2785fab1685c8735288dfbbbb617d9c4f5d8b2 | Set the access qualifier of two methods to query frame specific info of BitmapImage to protected.
https://bugs.webkit.org/show_bug.cgi?id=90505
Patch by Huang Dongsung <luxtella@company100.net> on 2012-08-12
Reviewed by Eric Seidel.
Following 4 methods are protected.
size_t frameCount();
NativeImagePtr frameAtIndex(size_t);
bool frameIsCompleteAtIndex(size_t);
float frameDurationAtIndex(size_t);
So, 2 methds also should be protected because the frame info is only specific of
BitmapImage.
bool frameHasAlphaAtIndex(size_t);
ImageOrientation frameOrientationAtIndex(size_t);
On the other hand, this patch amended GraphicsContext3DCG.
- static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0)
+ image->currentFrameHasAlpha()
This patch does not affect PNG, JPEG, BMP, and WEBP because those images
have only 0 indexed frame.
Thus, GIF, and ICO are affected. However, an above query to get Alpha
is for the image that is created by image->nativeImageForCurrentFrame(), so it
is proper to use image->currentFrameHasAlpha() instead of
image->frameHasAlphaAtIndex(0).
No new tests, because it is hard to test. We need an animated GIF that
one frame has alpha and another frame does not have alpha. However, I
cannot find the animated GIF file that suffices the requirement.
* platform/graphics/BitmapImage.h:
(BitmapImage):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::getImageData):
git-svn-id: svn://svn.chromium.org/blink/trunk@125374 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | bool GraphicsContext3D::getImageData(Image* image,
GC3Denum format,
GC3Denum type,
bool premultiplyAlpha,
bool ignoreGammaAndColorProfile,
Vector<uint8_t>& outputVector)
{
if (!image)
return false;
CGImageRef cgImage;
RetainPtr<CGImageRef> decodedImage;
bool hasAlpha = image->isBitmapImage() ? image->currentFrameHasAlpha() : true;
if ((ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
ImageSource decoder(ImageSource::AlphaNotPremultiplied,
ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);
decoder.setData(image->data(), true);
if (!decoder.frameCount())
return false;
decodedImage.adoptCF(decoder.createFrameAtIndex(0));
cgImage = decodedImage.get();
} else
cgImage = image->nativeImageForCurrentFrame();
if (!cgImage)
return false;
size_t width = CGImageGetWidth(cgImage);
size_t height = CGImageGetHeight(cgImage);
if (!width || !height)
return false;
CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage);
CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
if (model == kCGColorSpaceModelIndexed) {
RetainPtr<CGContextRef> bitmapContext;
bitmapContext.adoptCF(CGBitmapContextCreate(0, width, height, 8, width * 4,
deviceRGBColorSpaceRef(),
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
if (!bitmapContext)
return false;
CGContextSetBlendMode(bitmapContext.get(), kCGBlendModeCopy);
CGContextSetInterpolationQuality(bitmapContext.get(), kCGInterpolationNone);
CGContextDrawImage(bitmapContext.get(), CGRectMake(0, 0, width, height), cgImage);
decodedImage.adoptCF(CGBitmapContextCreateImage(bitmapContext.get()));
cgImage = decodedImage.get();
}
size_t bitsPerComponent = CGImageGetBitsPerComponent(cgImage);
size_t bitsPerPixel = CGImageGetBitsPerPixel(cgImage);
if (bitsPerComponent != 8 && bitsPerComponent != 16)
return false;
if (bitsPerPixel % bitsPerComponent)
return false;
size_t componentsPerPixel = bitsPerPixel / bitsPerComponent;
CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
bool bigEndianSource = false;
if (bitsPerComponent == 16) {
switch (bitInfo & kCGBitmapByteOrderMask) {
case kCGBitmapByteOrder16Big:
bigEndianSource = true;
break;
case kCGBitmapByteOrder16Little:
bigEndianSource = false;
break;
case kCGBitmapByteOrderDefault:
bigEndianSource = true;
break;
default:
return false;
}
} else {
switch (bitInfo & kCGBitmapByteOrderMask) {
case kCGBitmapByteOrder32Big:
bigEndianSource = true;
break;
case kCGBitmapByteOrder32Little:
bigEndianSource = false;
break;
case kCGBitmapByteOrderDefault:
bigEndianSource = true;
break;
default:
return false;
}
}
AlphaOp neededAlphaOp = AlphaDoNothing;
AlphaFormat alphaFormat = AlphaFormatNone;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
if (!premultiplyAlpha)
neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaFirst:
if (premultiplyAlpha)
neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaNoneSkipFirst:
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaPremultipliedLast:
if (!premultiplyAlpha)
neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaLast:
if (premultiplyAlpha)
neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNoneSkipLast:
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNone:
alphaFormat = AlphaFormatNone;
break;
default:
return false;
}
SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, bigEndianSource);
if (srcDataFormat == SourceFormatNumFormats)
return false;
RetainPtr<CFDataRef> pixelData;
pixelData.adoptCF(CGDataProviderCopyData(CGImageGetDataProvider(cgImage)));
if (!pixelData)
return false;
const UInt8* rgba = CFDataGetBytePtr(pixelData.get());
unsigned int packedSize;
if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
return false;
outputVector.resize(packedSize);
unsigned int srcUnpackAlignment = 0;
size_t bytesPerRow = CGImageGetBytesPerRow(cgImage);
unsigned int padding = bytesPerRow - bitsPerPixel / 8 * width;
if (padding) {
srcUnpackAlignment = padding + 1;
while (bytesPerRow % srcUnpackAlignment)
++srcUnpackAlignment;
}
bool rt = packPixels(rgba, srcDataFormat, width, height, srcUnpackAlignment,
format, type, neededAlphaOp, outputVector.data());
return rt;
}
| bool GraphicsContext3D::getImageData(Image* image,
GC3Denum format,
GC3Denum type,
bool premultiplyAlpha,
bool ignoreGammaAndColorProfile,
Vector<uint8_t>& outputVector)
{
if (!image)
return false;
CGImageRef cgImage;
RetainPtr<CGImageRef> decodedImage;
bool hasAlpha = image->isBitmapImage() ? static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0) : true;
if ((ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
ImageSource decoder(ImageSource::AlphaNotPremultiplied,
ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);
decoder.setData(image->data(), true);
if (!decoder.frameCount())
return false;
decodedImage.adoptCF(decoder.createFrameAtIndex(0));
cgImage = decodedImage.get();
} else
cgImage = image->nativeImageForCurrentFrame();
if (!cgImage)
return false;
size_t width = CGImageGetWidth(cgImage);
size_t height = CGImageGetHeight(cgImage);
if (!width || !height)
return false;
CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage);
CGColorSpaceModel model = CGColorSpaceGetModel(colorSpace);
if (model == kCGColorSpaceModelIndexed) {
RetainPtr<CGContextRef> bitmapContext;
bitmapContext.adoptCF(CGBitmapContextCreate(0, width, height, 8, width * 4,
deviceRGBColorSpaceRef(),
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
if (!bitmapContext)
return false;
CGContextSetBlendMode(bitmapContext.get(), kCGBlendModeCopy);
CGContextSetInterpolationQuality(bitmapContext.get(), kCGInterpolationNone);
CGContextDrawImage(bitmapContext.get(), CGRectMake(0, 0, width, height), cgImage);
decodedImage.adoptCF(CGBitmapContextCreateImage(bitmapContext.get()));
cgImage = decodedImage.get();
}
size_t bitsPerComponent = CGImageGetBitsPerComponent(cgImage);
size_t bitsPerPixel = CGImageGetBitsPerPixel(cgImage);
if (bitsPerComponent != 8 && bitsPerComponent != 16)
return false;
if (bitsPerPixel % bitsPerComponent)
return false;
size_t componentsPerPixel = bitsPerPixel / bitsPerComponent;
CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
bool bigEndianSource = false;
if (bitsPerComponent == 16) {
switch (bitInfo & kCGBitmapByteOrderMask) {
case kCGBitmapByteOrder16Big:
bigEndianSource = true;
break;
case kCGBitmapByteOrder16Little:
bigEndianSource = false;
break;
case kCGBitmapByteOrderDefault:
bigEndianSource = true;
break;
default:
return false;
}
} else {
switch (bitInfo & kCGBitmapByteOrderMask) {
case kCGBitmapByteOrder32Big:
bigEndianSource = true;
break;
case kCGBitmapByteOrder32Little:
bigEndianSource = false;
break;
case kCGBitmapByteOrderDefault:
bigEndianSource = true;
break;
default:
return false;
}
}
AlphaOp neededAlphaOp = AlphaDoNothing;
AlphaFormat alphaFormat = AlphaFormatNone;
switch (CGImageGetAlphaInfo(cgImage)) {
case kCGImageAlphaPremultipliedFirst:
if (!premultiplyAlpha)
neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaFirst:
if (premultiplyAlpha)
neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaNoneSkipFirst:
alphaFormat = AlphaFormatFirst;
break;
case kCGImageAlphaPremultipliedLast:
if (!premultiplyAlpha)
neededAlphaOp = AlphaDoUnmultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaLast:
if (premultiplyAlpha)
neededAlphaOp = AlphaDoPremultiply;
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNoneSkipLast:
alphaFormat = AlphaFormatLast;
break;
case kCGImageAlphaNone:
alphaFormat = AlphaFormatNone;
break;
default:
return false;
}
SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, bigEndianSource);
if (srcDataFormat == SourceFormatNumFormats)
return false;
RetainPtr<CFDataRef> pixelData;
pixelData.adoptCF(CGDataProviderCopyData(CGImageGetDataProvider(cgImage)));
if (!pixelData)
return false;
const UInt8* rgba = CFDataGetBytePtr(pixelData.get());
unsigned int packedSize;
if (computeImageSizeInBytes(format, type, width, height, 1, &packedSize, 0) != GraphicsContext3D::NO_ERROR)
return false;
outputVector.resize(packedSize);
unsigned int srcUnpackAlignment = 0;
size_t bytesPerRow = CGImageGetBytesPerRow(cgImage);
unsigned int padding = bytesPerRow - bitsPerPixel / 8 * width;
if (padding) {
srcUnpackAlignment = padding + 1;
while (bytesPerRow % srcUnpackAlignment)
++srcUnpackAlignment;
}
bool rt = packPixels(rgba, srcDataFormat, width, height, srcUnpackAlignment,
format, type, neededAlphaOp, outputVector.data());
return rt;
}
| C | Chrome | 1 |
CVE-2017-6991 | https://www.cvedetails.com/cve/CVE-2017-6991/ | CWE-119 | https://github.com/chromium/chromium/commit/3bfe67c9c4b45eb713326aae7a67c8f7390dae08 | 3bfe67c9c4b45eb713326aae7a67c8f7390dae08 | sqlite: safely move pointer values through SQL.
This lands https://www.sqlite.org/src/timeline?c=d6a44b35 in
third_party/sqlite/src/ and
third_party/sqlite/patches/0013-Add-new-interfaces-sqlite3_bind_pointer-sqlite3_resu.patch
and re-generates third_party/sqlite/amalgamation/* using the script at
third_party/sqlite/google_generate_amalgamation.sh.
The CL also adds a layout test that verifies the patch works as intended.
BUG=742407
Change-Id: I2e1a457459cd2e975e6241b630e7b79c82545981
Reviewed-on: https://chromium-review.googlesource.com/572976
Reviewed-by: Chris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487275} | static void codeOffset(
Vdbe *v, /* Generate code into this VM */
int iOffset, /* Register holding the offset counter */
int iContinue /* Jump here to skip the current record */
){
if( iOffset>0 ){
sqlite3VdbeAddOp3(v, OP_IfPos, iOffset, iContinue, 1); VdbeCoverage(v);
VdbeComment((v, "OFFSET"));
}
}
| static void codeOffset(
Vdbe *v, /* Generate code into this VM */
int iOffset, /* Register holding the offset counter */
int iContinue /* Jump here to skip the current record */
){
if( iOffset>0 ){
sqlite3VdbeAddOp3(v, OP_IfPos, iOffset, iContinue, 1); VdbeCoverage(v);
VdbeComment((v, "OFFSET"));
}
}
| C | Chrome | 0 |
CVE-2016-1639 | https://www.cvedetails.com/cve/CVE-2016-1639/ | null | https://github.com/chromium/chromium/commit/c66b1fc49870c514b1c1e8b53498153176d7ec2b | c66b1fc49870c514b1c1e8b53498153176d7ec2b | cros: Check initial auth type when showing views login.
Bug: 859611
Change-Id: I0298db9bbf4aed6bd40600aef2e1c5794e8cd058
Reviewed-on: https://chromium-review.googlesource.com/1123056
Reviewed-by: Xiaoyin Hu <xiaoyinh@chromium.org>
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572224} | KeyboardDrivenOobeKeyHandler() {
ash::Shell::Get()->AddPreTargetHandler(this);
}
| KeyboardDrivenOobeKeyHandler() {
ash::Shell::Get()->AddPreTargetHandler(this);
}
| C | Chrome | 0 |
CVE-2018-12714 | https://www.cvedetails.com/cve/CVE-2018-12714/ | CWE-787 | https://github.com/torvalds/linux/commit/81f9c4e4177d31ced6f52a89bb70e93bfb77ca03 | 81f9c4e4177d31ced6f52a89bb70e93bfb77ca03 | Merge tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt:
"This contains a few fixes and a clean up.
- a bad merge caused an "endif" to go in the wrong place in
scripts/Makefile.build
- softirq tracing fix for tracing that corrupts lockdep and causes a
false splat
- histogram documentation typo fixes
- fix a bad memory reference when passing in no filter to the filter
code
- simplify code by using the swap macro instead of open coding the
swap"
* tag 'trace-v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Fix SKIP_STACK_VALIDATION=1 build due to bad merge with -mrecord-mcount
tracing: Fix some errors in histogram documentation
tracing: Use swap macro in update_max_tr
softirq: Reorder trace_softirqs_on to prevent lockdep splat
tracing: Check for no filter when processing event filters | void tracing_reset_all_online_cpus(void)
{
struct trace_array *tr;
list_for_each_entry(tr, &ftrace_trace_arrays, list) {
if (!tr->clear_trace)
continue;
tr->clear_trace = false;
tracing_reset_online_cpus(&tr->trace_buffer);
#ifdef CONFIG_TRACER_MAX_TRACE
tracing_reset_online_cpus(&tr->max_buffer);
#endif
}
}
| void tracing_reset_all_online_cpus(void)
{
struct trace_array *tr;
list_for_each_entry(tr, &ftrace_trace_arrays, list) {
if (!tr->clear_trace)
continue;
tr->clear_trace = false;
tracing_reset_online_cpus(&tr->trace_buffer);
#ifdef CONFIG_TRACER_MAX_TRACE
tracing_reset_online_cpus(&tr->max_buffer);
#endif
}
}
| C | linux | 0 |
CVE-2019-5892 | https://www.cvedetails.com/cve/CVE-2019-5892/ | null | https://github.com/FRRouting/frr/commit/943d595a018e69b550db08cccba1d0778a86705a | 943d595a018e69b550db08cccba1d0778a86705a | bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Signed-off-by: Lou Berger <lberger@labn.net> | bgp_attr_large_community(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/*
* Large community follows new attribute format.
*/
if (length == 0) {
attr->lcommunity = NULL;
/* Empty extcomm doesn't seem to be invalid per se */
return BGP_ATTR_PARSE_PROCEED;
}
attr->lcommunity =
lcommunity_parse((uint8_t *)stream_pnt(peer->curr), length);
/* XXX: fix ecommunity_parse to use stream API */
stream_forward_getp(peer->curr, length);
if (!attr->lcommunity)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
return BGP_ATTR_PARSE_PROCEED;
}
| bgp_attr_large_community(struct bgp_attr_parser_args *args)
{
struct peer *const peer = args->peer;
struct attr *const attr = args->attr;
const bgp_size_t length = args->length;
/*
* Large community follows new attribute format.
*/
if (length == 0) {
attr->lcommunity = NULL;
/* Empty extcomm doesn't seem to be invalid per se */
return BGP_ATTR_PARSE_PROCEED;
}
attr->lcommunity =
lcommunity_parse((uint8_t *)stream_pnt(peer->curr), length);
/* XXX: fix ecommunity_parse to use stream API */
stream_forward_getp(peer->curr, length);
if (!attr->lcommunity)
return bgp_attr_malformed(args, BGP_NOTIFY_UPDATE_OPT_ATTR_ERR,
args->total);
attr->flag |= ATTR_FLAG_BIT(BGP_ATTR_LARGE_COMMUNITIES);
return BGP_ATTR_PARSE_PROCEED;
}
| C | frr | 0 |
CVE-2015-6763 | https://www.cvedetails.com/cve/CVE-2015-6763/ | null | https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4 | f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4 | MacViews: Enable secure text input for password Textfields.
In Cocoa the NSTextInputContext automatically enables secure text input
when activated and it's in the secure text entry mode.
RenderWidgetHostViewMac did the similar thing for ages following the
WebKit example.
views::Textfield needs to do the same thing in a fashion that's
sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions
are possible when the Textfield gets focus, activates the secure text
input mode and the RWHVM loses focus immediately afterwards and disables
the secure text input instead of leaving it in the enabled state.
BUG=818133,677220
Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b
Reviewed-on: https://chromium-review.googlesource.com/943064
Commit-Queue: Michail Pishchagin <mblsha@yandex-team.ru>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542517} | void Textfield::UpdateBorder() {
auto border = std::make_unique<views::FocusableBorder>();
const LayoutProvider* provider = LayoutProvider::Get();
border->SetInsets(
provider->GetDistanceMetric(DISTANCE_CONTROL_VERTICAL_TEXT_PADDING),
provider->GetDistanceMetric(DISTANCE_TEXTFIELD_HORIZONTAL_TEXT_PADDING));
if (invalid_)
border->SetColorId(ui::NativeTheme::kColorId_AlertSeverityHigh);
View::SetBorder(std::move(border));
}
| void Textfield::UpdateBorder() {
auto border = std::make_unique<views::FocusableBorder>();
const LayoutProvider* provider = LayoutProvider::Get();
border->SetInsets(
provider->GetDistanceMetric(DISTANCE_CONTROL_VERTICAL_TEXT_PADDING),
provider->GetDistanceMetric(DISTANCE_TEXTFIELD_HORIZONTAL_TEXT_PADDING));
if (invalid_)
border->SetColorId(ui::NativeTheme::kColorId_AlertSeverityHigh);
View::SetBorder(std::move(border));
}
| C | Chrome | 0 |
CVE-2016-1641 | https://www.cvedetails.com/cve/CVE-2016-1641/ | null | https://github.com/chromium/chromium/commit/75ca8ffd7bd7c58ace1144df05e1307d8d707662 | 75ca8ffd7bd7c58ace1144df05e1307d8d707662 | Don't call WebContents::DownloadImage() callback if the WebContents were deleted
BUG=583718
Review URL: https://codereview.chromium.org/1685343004
Cr-Commit-Position: refs/heads/master@{#375700} | WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
: delegate_(NULL),
controller_(this, browser_context),
render_view_host_delegate_view_(NULL),
created_with_opener_(false),
#if defined(OS_WIN)
accessible_parent_(NULL),
#endif
frame_tree_(new NavigatorImpl(&controller_, this),
this,
this,
this,
this),
is_loading_(false),
is_load_to_different_document_(false),
crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
crashed_error_code_(0),
waiting_for_response_(false),
load_state_(net::LOAD_STATE_IDLE, base::string16()),
upload_size_(0),
upload_position_(0),
is_resume_pending_(false),
displayed_insecure_content_(false),
has_accessed_initial_document_(false),
theme_color_(SK_ColorTRANSPARENT),
last_sent_theme_color_(SK_ColorTRANSPARENT),
did_first_visually_non_empty_paint_(false),
capturer_count_(0),
should_normally_be_visible_(true),
is_being_destroyed_(false),
notify_disconnection_(false),
dialog_manager_(NULL),
is_showing_before_unload_dialog_(false),
last_active_time_(base::TimeTicks::Now()),
closed_by_user_gesture_(false),
minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
zoom_scroll_remainder_(0),
render_view_message_source_(NULL),
render_frame_message_source_(NULL),
fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
fullscreen_widget_had_focus_at_shutdown_(false),
is_subframe_(false),
force_disable_overscroll_content_(false),
last_dialog_suppressed_(false),
geolocation_service_context_(new GeolocationServiceContext()),
accessibility_mode_(
BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()),
audio_stream_monitor_(this),
virtual_keyboard_requested_(false),
page_scale_factor_is_one_(true),
loading_weak_factory_(this),
weak_factory_(this) {
frame_tree_.SetFrameRemoveListener(
base::Bind(&WebContentsImpl::OnFrameRemoved,
base::Unretained(this)));
#if defined(OS_ANDROID)
media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this));
#else
media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
#endif
loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this));
wake_lock_service_context_.reset(new WakeLockServiceContext(this));
}
| WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
: delegate_(NULL),
controller_(this, browser_context),
render_view_host_delegate_view_(NULL),
created_with_opener_(false),
#if defined(OS_WIN)
accessible_parent_(NULL),
#endif
frame_tree_(new NavigatorImpl(&controller_, this),
this,
this,
this,
this),
is_loading_(false),
is_load_to_different_document_(false),
crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
crashed_error_code_(0),
waiting_for_response_(false),
load_state_(net::LOAD_STATE_IDLE, base::string16()),
upload_size_(0),
upload_position_(0),
is_resume_pending_(false),
displayed_insecure_content_(false),
has_accessed_initial_document_(false),
theme_color_(SK_ColorTRANSPARENT),
last_sent_theme_color_(SK_ColorTRANSPARENT),
did_first_visually_non_empty_paint_(false),
capturer_count_(0),
should_normally_be_visible_(true),
is_being_destroyed_(false),
notify_disconnection_(false),
dialog_manager_(NULL),
is_showing_before_unload_dialog_(false),
last_active_time_(base::TimeTicks::Now()),
closed_by_user_gesture_(false),
minimum_zoom_percent_(static_cast<int>(kMinimumZoomFactor * 100)),
maximum_zoom_percent_(static_cast<int>(kMaximumZoomFactor * 100)),
zoom_scroll_remainder_(0),
render_view_message_source_(NULL),
render_frame_message_source_(NULL),
fullscreen_widget_routing_id_(MSG_ROUTING_NONE),
fullscreen_widget_had_focus_at_shutdown_(false),
is_subframe_(false),
force_disable_overscroll_content_(false),
last_dialog_suppressed_(false),
geolocation_service_context_(new GeolocationServiceContext()),
accessibility_mode_(
BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode()),
audio_stream_monitor_(this),
virtual_keyboard_requested_(false),
page_scale_factor_is_one_(true),
loading_weak_factory_(this) {
frame_tree_.SetFrameRemoveListener(
base::Bind(&WebContentsImpl::OnFrameRemoved,
base::Unretained(this)));
#if defined(OS_ANDROID)
media_web_contents_observer_.reset(new MediaWebContentsObserverAndroid(this));
#else
media_web_contents_observer_.reset(new MediaWebContentsObserver(this));
#endif
loader_io_thread_notifier_.reset(new LoaderIOThreadNotifier(this));
wake_lock_service_context_.reset(new WakeLockServiceContext(this));
}
| C | Chrome | 1 |
CVE-2017-6903 | https://www.cvedetails.com/cve/CVE-2017-6903/ | CWE-269 | https://github.com/ioquake/ioq3/commit/b173ac05993f634a42be3d3535e1b158de0c3372 | b173ac05993f634a42be3d3535e1b158de0c3372 | Merge some file writing extension checks from OpenJK.
Thanks Ensiform.
https://github.com/JACoders/OpenJK/commit/05928a57f9e4aae15a3bd0
https://github.com/JACoders/OpenJK/commit/ef124fd0fc48af164581176 | static qboolean Field_Complete( void )
{
int completionOffset;
if( matchCount == 0 )
return qtrue;
completionOffset = strlen( completionField->buffer ) - strlen( completionString );
Q_strncpyz( &completionField->buffer[ completionOffset ], shortestMatch,
sizeof( completionField->buffer ) - completionOffset );
completionField->cursor = strlen( completionField->buffer );
if( matchCount == 1 )
{
Q_strcat( completionField->buffer, sizeof( completionField->buffer ), " " );
completionField->cursor++;
return qtrue;
}
Com_Printf( "]%s\n", completionField->buffer );
return qfalse;
}
| static qboolean Field_Complete( void )
{
int completionOffset;
if( matchCount == 0 )
return qtrue;
completionOffset = strlen( completionField->buffer ) - strlen( completionString );
Q_strncpyz( &completionField->buffer[ completionOffset ], shortestMatch,
sizeof( completionField->buffer ) - completionOffset );
completionField->cursor = strlen( completionField->buffer );
if( matchCount == 1 )
{
Q_strcat( completionField->buffer, sizeof( completionField->buffer ), " " );
completionField->cursor++;
return qtrue;
}
Com_Printf( "]%s\n", completionField->buffer );
return qfalse;
}
| C | OpenJK | 0 |
CVE-2017-5009 | https://www.cvedetails.com/cve/CVE-2017-5009/ | CWE-119 | https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60 | 1c40f9042ae2d6ee7483d72998aabb5e73b2ff60 | DevTools: send proper resource type in Network.RequestWillBeSent
This patch plumbs resoure type into the DispatchWillSendRequest
instrumenation. This allows us to report accurate type in
Network.RequestWillBeSent event, instead of "Other", that we report
today.
BUG=765501
R=dgozman
Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c
Reviewed-on: https://chromium-review.googlesource.com/667504
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507936} | String ResourcePriorityJSON(ResourceLoadPriority priority) {
switch (priority) {
case kResourceLoadPriorityVeryLow:
return protocol::Network::ResourcePriorityEnum::VeryLow;
case kResourceLoadPriorityLow:
return protocol::Network::ResourcePriorityEnum::Low;
case kResourceLoadPriorityMedium:
return protocol::Network::ResourcePriorityEnum::Medium;
case kResourceLoadPriorityHigh:
return protocol::Network::ResourcePriorityEnum::High;
case kResourceLoadPriorityVeryHigh:
return protocol::Network::ResourcePriorityEnum::VeryHigh;
case kResourceLoadPriorityUnresolved:
break;
}
NOTREACHED();
return protocol::Network::ResourcePriorityEnum::Medium;
}
| String ResourcePriorityJSON(ResourceLoadPriority priority) {
switch (priority) {
case kResourceLoadPriorityVeryLow:
return protocol::Network::ResourcePriorityEnum::VeryLow;
case kResourceLoadPriorityLow:
return protocol::Network::ResourcePriorityEnum::Low;
case kResourceLoadPriorityMedium:
return protocol::Network::ResourcePriorityEnum::Medium;
case kResourceLoadPriorityHigh:
return protocol::Network::ResourcePriorityEnum::High;
case kResourceLoadPriorityVeryHigh:
return protocol::Network::ResourcePriorityEnum::VeryHigh;
case kResourceLoadPriorityUnresolved:
break;
}
NOTREACHED();
return protocol::Network::ResourcePriorityEnum::Medium;
}
| C | Chrome | 0 |
CVE-2014-1713 | https://www.cvedetails.com/cve/CVE-2014-1713/ | CWE-399 | https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154 | f85a87ec670ad0fce9d98d90c9a705b72a288154 | document.location bindings fix
BUG=352374
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/196343011
git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | static void testInterfaceEmptyArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValue(info, v8Array(imp->testInterfaceEmptyArrayMethod(), info.GetIsolate()));
}
| static void testInterfaceEmptyArrayMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
v8SetReturnValue(info, v8Array(imp->testInterfaceEmptyArrayMethod(), info.GetIsolate()));
}
| C | Chrome | 0 |
CVE-2013-2853 | https://www.cvedetails.com/cve/CVE-2013-2853/ | null | https://github.com/chromium/chromium/commit/9c18dbcb79e5f700c453d1ac01fb6d8768e4844a | 9c18dbcb79e5f700c453d1ac01fb6d8768e4844a | net: don't process truncated headers on HTTPS connections.
This change causes us to not process any headers unless they are correctly
terminated with a \r\n\r\n sequence.
BUG=244260
Review URL: https://chromiumcodereview.appspot.com/15688012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202927 0039d316-1c4b-4281-b951-d872f2087c98 | bool HttpStreamParser::IsConnectionReusable() const {
return connection_->socket() && connection_->socket()->IsConnectedAndIdle();
}
| bool HttpStreamParser::IsConnectionReusable() const {
return connection_->socket() && connection_->socket()->IsConnectedAndIdle();
}
| C | Chrome | 0 |
CVE-2016-9588 | https://www.cvedetails.com/cve/CVE-2016-9588/ | CWE-388 | https://github.com/torvalds/linux/commit/ef85b67385436ddc1998f45f1d6a210f935b3388 | ef85b67385436ddc1998f45f1d6a210f935b3388 | kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
When L2 exits to L0 due to "exception or NMI", software exceptions
(#BP and #OF) for which L1 has requested an intercept should be
handled by L1 rather than L0. Previously, only hardware exceptions
were forwarded to L1.
Signed-off-by: Jim Mattson <jmattson@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> | static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
unsigned long debugctlmsr, cr4;
/* Record the guest's net vcpu time for enforced NMI injections. */
if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
vmx->entry_time = ktime_get();
/* Don't enter VMX if guest state is invalid, let the exit handler
start emulation until we arrive back to a valid state */
if (vmx->emulation_required)
return;
if (vmx->ple_window_dirty) {
vmx->ple_window_dirty = false;
vmcs_write32(PLE_WINDOW, vmx->ple_window);
}
if (vmx->nested.sync_shadow_vmcs) {
copy_vmcs12_to_shadow(vmx);
vmx->nested.sync_shadow_vmcs = false;
}
if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
cr4 = cr4_read_shadow();
if (unlikely(cr4 != vmx->host_state.vmcs_host_cr4)) {
vmcs_writel(HOST_CR4, cr4);
vmx->host_state.vmcs_host_cr4 = cr4;
}
/* When single-stepping over STI and MOV SS, we must clear the
* corresponding interruptibility bits in the guest state. Otherwise
* vmentry fails as it then expects bit 14 (BS) in pending debug
* exceptions being set, but that's not correct for the guest debugging
* case. */
if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
vmx_set_interrupt_shadow(vcpu, 0);
if (vmx->guest_pkru_valid)
__write_pkru(vmx->guest_pkru);
atomic_switch_perf_msrs(vmx);
debugctlmsr = get_debugctlmsr();
vmx_arm_hv_timer(vcpu);
vmx->__launched = vmx->loaded_vmcs->launched;
asm(
/* Store host registers */
"push %%" _ASM_DX "; push %%" _ASM_BP ";"
"push %%" _ASM_CX " \n\t" /* placeholder for guest rcx */
"push %%" _ASM_CX " \n\t"
"cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
"je 1f \n\t"
"mov %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
__ex(ASM_VMX_VMWRITE_RSP_RDX) "\n\t"
"1: \n\t"
/* Reload cr2 if changed */
"mov %c[cr2](%0), %%" _ASM_AX " \n\t"
"mov %%cr2, %%" _ASM_DX " \n\t"
"cmp %%" _ASM_AX ", %%" _ASM_DX " \n\t"
"je 2f \n\t"
"mov %%" _ASM_AX", %%cr2 \n\t"
"2: \n\t"
/* Check if vmlaunch of vmresume is needed */
"cmpl $0, %c[launched](%0) \n\t"
/* Load guest registers. Don't clobber flags. */
"mov %c[rax](%0), %%" _ASM_AX " \n\t"
"mov %c[rbx](%0), %%" _ASM_BX " \n\t"
"mov %c[rdx](%0), %%" _ASM_DX " \n\t"
"mov %c[rsi](%0), %%" _ASM_SI " \n\t"
"mov %c[rdi](%0), %%" _ASM_DI " \n\t"
"mov %c[rbp](%0), %%" _ASM_BP " \n\t"
#ifdef CONFIG_X86_64
"mov %c[r8](%0), %%r8 \n\t"
"mov %c[r9](%0), %%r9 \n\t"
"mov %c[r10](%0), %%r10 \n\t"
"mov %c[r11](%0), %%r11 \n\t"
"mov %c[r12](%0), %%r12 \n\t"
"mov %c[r13](%0), %%r13 \n\t"
"mov %c[r14](%0), %%r14 \n\t"
"mov %c[r15](%0), %%r15 \n\t"
#endif
"mov %c[rcx](%0), %%" _ASM_CX " \n\t" /* kills %0 (ecx) */
/* Enter guest mode */
"jne 1f \n\t"
__ex(ASM_VMX_VMLAUNCH) "\n\t"
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
"mov %%" _ASM_AX ", %c[rax](%0) \n\t"
"mov %%" _ASM_BX ", %c[rbx](%0) \n\t"
__ASM_SIZE(pop) " %c[rcx](%0) \n\t"
"mov %%" _ASM_DX ", %c[rdx](%0) \n\t"
"mov %%" _ASM_SI ", %c[rsi](%0) \n\t"
"mov %%" _ASM_DI ", %c[rdi](%0) \n\t"
"mov %%" _ASM_BP ", %c[rbp](%0) \n\t"
#ifdef CONFIG_X86_64
"mov %%r8, %c[r8](%0) \n\t"
"mov %%r9, %c[r9](%0) \n\t"
"mov %%r10, %c[r10](%0) \n\t"
"mov %%r11, %c[r11](%0) \n\t"
"mov %%r12, %c[r12](%0) \n\t"
"mov %%r13, %c[r13](%0) \n\t"
"mov %%r14, %c[r14](%0) \n\t"
"mov %%r15, %c[r15](%0) \n\t"
#endif
"mov %%cr2, %%" _ASM_AX " \n\t"
"mov %%" _ASM_AX ", %c[cr2](%0) \n\t"
"pop %%" _ASM_BP "; pop %%" _ASM_DX " \n\t"
"setbe %c[fail](%0) \n\t"
".pushsection .rodata \n\t"
".global vmx_return \n\t"
"vmx_return: " _ASM_PTR " 2b \n\t"
".popsection"
: : "c"(vmx), "d"((unsigned long)HOST_RSP),
[launched]"i"(offsetof(struct vcpu_vmx, __launched)),
[fail]"i"(offsetof(struct vcpu_vmx, fail)),
[host_rsp]"i"(offsetof(struct vcpu_vmx, host_rsp)),
[rax]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RAX])),
[rbx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RBX])),
[rcx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RCX])),
[rdx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RDX])),
[rsi]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RSI])),
[rdi]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RDI])),
[rbp]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RBP])),
#ifdef CONFIG_X86_64
[r8]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R8])),
[r9]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R9])),
[r10]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R10])),
[r11]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R11])),
[r12]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R12])),
[r13]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R13])),
[r14]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R14])),
[r15]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R15])),
#endif
[cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)),
[wordsize]"i"(sizeof(ulong))
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
, "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
#else
, "eax", "ebx", "edi", "esi"
#endif
);
/* MSR_IA32_DEBUGCTLMSR is zeroed on vmexit. Restore it if needed */
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
#ifndef CONFIG_X86_64
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
*
* We can't defer this to vmx_load_host_state() since that function
* may be executed in interrupt context, which saves and restore segments
* around it, nullifying its effect.
*/
loadsegment(ds, __USER_DS);
loadsegment(es, __USER_DS);
#endif
vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)
| (1 << VCPU_EXREG_RFLAGS)
| (1 << VCPU_EXREG_PDPTR)
| (1 << VCPU_EXREG_SEGMENTS)
| (1 << VCPU_EXREG_CR3));
vcpu->arch.regs_dirty = 0;
vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
vmx->loaded_vmcs->launched = 1;
vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
/*
* eager fpu is enabled if PKEY is supported and CR4 is switched
* back on host, so it is safe to read guest PKRU from current
* XSAVE.
*/
if (boot_cpu_has(X86_FEATURE_OSPKE)) {
vmx->guest_pkru = __read_pkru();
if (vmx->guest_pkru != vmx->host_pkru) {
vmx->guest_pkru_valid = true;
__write_pkru(vmx->host_pkru);
} else
vmx->guest_pkru_valid = false;
}
/*
* the KVM_REQ_EVENT optimization bit is only on for one entry, and if
* we did not inject a still-pending event to L1 now because of
* nested_run_pending, we need to re-enable this bit.
*/
if (vmx->nested.nested_run_pending)
kvm_make_request(KVM_REQ_EVENT, vcpu);
vmx->nested.nested_run_pending = 0;
vmx_complete_atomic_exit(vmx);
vmx_recover_nmi_blocking(vmx);
vmx_complete_interrupts(vmx);
}
| static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu)
{
struct vcpu_vmx *vmx = to_vmx(vcpu);
unsigned long debugctlmsr, cr4;
/* Record the guest's net vcpu time for enforced NMI injections. */
if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
vmx->entry_time = ktime_get();
/* Don't enter VMX if guest state is invalid, let the exit handler
start emulation until we arrive back to a valid state */
if (vmx->emulation_required)
return;
if (vmx->ple_window_dirty) {
vmx->ple_window_dirty = false;
vmcs_write32(PLE_WINDOW, vmx->ple_window);
}
if (vmx->nested.sync_shadow_vmcs) {
copy_vmcs12_to_shadow(vmx);
vmx->nested.sync_shadow_vmcs = false;
}
if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
cr4 = cr4_read_shadow();
if (unlikely(cr4 != vmx->host_state.vmcs_host_cr4)) {
vmcs_writel(HOST_CR4, cr4);
vmx->host_state.vmcs_host_cr4 = cr4;
}
/* When single-stepping over STI and MOV SS, we must clear the
* corresponding interruptibility bits in the guest state. Otherwise
* vmentry fails as it then expects bit 14 (BS) in pending debug
* exceptions being set, but that's not correct for the guest debugging
* case. */
if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
vmx_set_interrupt_shadow(vcpu, 0);
if (vmx->guest_pkru_valid)
__write_pkru(vmx->guest_pkru);
atomic_switch_perf_msrs(vmx);
debugctlmsr = get_debugctlmsr();
vmx_arm_hv_timer(vcpu);
vmx->__launched = vmx->loaded_vmcs->launched;
asm(
/* Store host registers */
"push %%" _ASM_DX "; push %%" _ASM_BP ";"
"push %%" _ASM_CX " \n\t" /* placeholder for guest rcx */
"push %%" _ASM_CX " \n\t"
"cmp %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
"je 1f \n\t"
"mov %%" _ASM_SP ", %c[host_rsp](%0) \n\t"
__ex(ASM_VMX_VMWRITE_RSP_RDX) "\n\t"
"1: \n\t"
/* Reload cr2 if changed */
"mov %c[cr2](%0), %%" _ASM_AX " \n\t"
"mov %%cr2, %%" _ASM_DX " \n\t"
"cmp %%" _ASM_AX ", %%" _ASM_DX " \n\t"
"je 2f \n\t"
"mov %%" _ASM_AX", %%cr2 \n\t"
"2: \n\t"
/* Check if vmlaunch of vmresume is needed */
"cmpl $0, %c[launched](%0) \n\t"
/* Load guest registers. Don't clobber flags. */
"mov %c[rax](%0), %%" _ASM_AX " \n\t"
"mov %c[rbx](%0), %%" _ASM_BX " \n\t"
"mov %c[rdx](%0), %%" _ASM_DX " \n\t"
"mov %c[rsi](%0), %%" _ASM_SI " \n\t"
"mov %c[rdi](%0), %%" _ASM_DI " \n\t"
"mov %c[rbp](%0), %%" _ASM_BP " \n\t"
#ifdef CONFIG_X86_64
"mov %c[r8](%0), %%r8 \n\t"
"mov %c[r9](%0), %%r9 \n\t"
"mov %c[r10](%0), %%r10 \n\t"
"mov %c[r11](%0), %%r11 \n\t"
"mov %c[r12](%0), %%r12 \n\t"
"mov %c[r13](%0), %%r13 \n\t"
"mov %c[r14](%0), %%r14 \n\t"
"mov %c[r15](%0), %%r15 \n\t"
#endif
"mov %c[rcx](%0), %%" _ASM_CX " \n\t" /* kills %0 (ecx) */
/* Enter guest mode */
"jne 1f \n\t"
__ex(ASM_VMX_VMLAUNCH) "\n\t"
"jmp 2f \n\t"
"1: " __ex(ASM_VMX_VMRESUME) "\n\t"
"2: "
/* Save guest registers, load host registers, keep flags */
"mov %0, %c[wordsize](%%" _ASM_SP ") \n\t"
"pop %0 \n\t"
"mov %%" _ASM_AX ", %c[rax](%0) \n\t"
"mov %%" _ASM_BX ", %c[rbx](%0) \n\t"
__ASM_SIZE(pop) " %c[rcx](%0) \n\t"
"mov %%" _ASM_DX ", %c[rdx](%0) \n\t"
"mov %%" _ASM_SI ", %c[rsi](%0) \n\t"
"mov %%" _ASM_DI ", %c[rdi](%0) \n\t"
"mov %%" _ASM_BP ", %c[rbp](%0) \n\t"
#ifdef CONFIG_X86_64
"mov %%r8, %c[r8](%0) \n\t"
"mov %%r9, %c[r9](%0) \n\t"
"mov %%r10, %c[r10](%0) \n\t"
"mov %%r11, %c[r11](%0) \n\t"
"mov %%r12, %c[r12](%0) \n\t"
"mov %%r13, %c[r13](%0) \n\t"
"mov %%r14, %c[r14](%0) \n\t"
"mov %%r15, %c[r15](%0) \n\t"
#endif
"mov %%cr2, %%" _ASM_AX " \n\t"
"mov %%" _ASM_AX ", %c[cr2](%0) \n\t"
"pop %%" _ASM_BP "; pop %%" _ASM_DX " \n\t"
"setbe %c[fail](%0) \n\t"
".pushsection .rodata \n\t"
".global vmx_return \n\t"
"vmx_return: " _ASM_PTR " 2b \n\t"
".popsection"
: : "c"(vmx), "d"((unsigned long)HOST_RSP),
[launched]"i"(offsetof(struct vcpu_vmx, __launched)),
[fail]"i"(offsetof(struct vcpu_vmx, fail)),
[host_rsp]"i"(offsetof(struct vcpu_vmx, host_rsp)),
[rax]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RAX])),
[rbx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RBX])),
[rcx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RCX])),
[rdx]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RDX])),
[rsi]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RSI])),
[rdi]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RDI])),
[rbp]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_RBP])),
#ifdef CONFIG_X86_64
[r8]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R8])),
[r9]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R9])),
[r10]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R10])),
[r11]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R11])),
[r12]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R12])),
[r13]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R13])),
[r14]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R14])),
[r15]"i"(offsetof(struct vcpu_vmx, vcpu.arch.regs[VCPU_REGS_R15])),
#endif
[cr2]"i"(offsetof(struct vcpu_vmx, vcpu.arch.cr2)),
[wordsize]"i"(sizeof(ulong))
: "cc", "memory"
#ifdef CONFIG_X86_64
, "rax", "rbx", "rdi", "rsi"
, "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
#else
, "eax", "ebx", "edi", "esi"
#endif
);
/* MSR_IA32_DEBUGCTLMSR is zeroed on vmexit. Restore it if needed */
if (debugctlmsr)
update_debugctlmsr(debugctlmsr);
#ifndef CONFIG_X86_64
/*
* The sysexit path does not restore ds/es, so we must set them to
* a reasonable value ourselves.
*
* We can't defer this to vmx_load_host_state() since that function
* may be executed in interrupt context, which saves and restore segments
* around it, nullifying its effect.
*/
loadsegment(ds, __USER_DS);
loadsegment(es, __USER_DS);
#endif
vcpu->arch.regs_avail = ~((1 << VCPU_REGS_RIP) | (1 << VCPU_REGS_RSP)
| (1 << VCPU_EXREG_RFLAGS)
| (1 << VCPU_EXREG_PDPTR)
| (1 << VCPU_EXREG_SEGMENTS)
| (1 << VCPU_EXREG_CR3));
vcpu->arch.regs_dirty = 0;
vmx->idt_vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD);
vmx->loaded_vmcs->launched = 1;
vmx->exit_reason = vmcs_read32(VM_EXIT_REASON);
/*
* eager fpu is enabled if PKEY is supported and CR4 is switched
* back on host, so it is safe to read guest PKRU from current
* XSAVE.
*/
if (boot_cpu_has(X86_FEATURE_OSPKE)) {
vmx->guest_pkru = __read_pkru();
if (vmx->guest_pkru != vmx->host_pkru) {
vmx->guest_pkru_valid = true;
__write_pkru(vmx->host_pkru);
} else
vmx->guest_pkru_valid = false;
}
/*
* the KVM_REQ_EVENT optimization bit is only on for one entry, and if
* we did not inject a still-pending event to L1 now because of
* nested_run_pending, we need to re-enable this bit.
*/
if (vmx->nested.nested_run_pending)
kvm_make_request(KVM_REQ_EVENT, vcpu);
vmx->nested.nested_run_pending = 0;
vmx_complete_atomic_exit(vmx);
vmx_recover_nmi_blocking(vmx);
vmx_complete_interrupts(vmx);
}
| C | linux | 0 |
CVE-2016-5219 | https://www.cvedetails.com/cve/CVE-2016-5219/ | CWE-416 | https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae | a4150b688a754d3d10d2ca385155b1c95d77d6ae | Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM
This makes the query of GL_COMPLETION_STATUS_KHR to programs much
cheaper by minimizing the round-trip to the GPU thread.
Bug: 881152, 957001
Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657568} | error::Error GLES2DecoderPassthroughImpl::DoOverlayPromotionHintCHROMIUM(
GLuint texture,
GLboolean promotion_hint,
GLint display_x,
GLint display_y,
GLint display_width,
GLint display_height) {
NOTIMPLEMENTED();
return error::kNoError;
}
| error::Error GLES2DecoderPassthroughImpl::DoOverlayPromotionHintCHROMIUM(
GLuint texture,
GLboolean promotion_hint,
GLint display_x,
GLint display_y,
GLint display_width,
GLint display_height) {
NOTIMPLEMENTED();
return error::kNoError;
}
| C | Chrome | 0 |
CVE-2015-4644 | https://www.cvedetails.com/cve/CVE-2015-4644/ | null | https://git.php.net/?p=php-src.git;a=commit;h=2cc4e69cc6d8dbc4b3568ad3dd583324a7c11d64 | 2cc4e69cc6d8dbc4b3568ad3dd583324a7c11d64 | null | PHP_FUNCTION(pg_copy_from)
{
zval *pgsql_link = NULL, *pg_rows;
zval **tmp;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL;
int table_name_len, pg_delim_len, pg_null_as_len;
int pg_null_as_free = 0;
char *query;
HashPosition pos;
int id = -1;
PGconn *pgsql;
PGresult *pgsql_result;
ExecStatusType status;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "rsa|ss",
&pgsql_link, &table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
}
if (!pg_delim) {
pg_delim = "\t";
}
if (!pg_null_as) {
pg_null_as = safe_estrdup("\\\\N");
pg_null_as_free = 1;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
}
pgsql_result = PQexec(pgsql, query);
if (pg_null_as_free) {
efree(pg_null_as);
}
efree(query);
if (pgsql_result) {
status = PQresultStatus(pgsql_result);
} else {
status = (ExecStatusType) PQstatus(pgsql);
}
switch (status) {
case PGRES_COPY_IN:
if (pgsql_result) {
int command_failed = 0;
PQclear(pgsql_result);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(pg_rows), &pos);
#if HAVE_PQPUTCOPYDATA
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
zval *value;
ALLOC_ZVAL(value);
INIT_PZVAL_COPY(value, *tmp);
zval_copy_ctor(value);
convert_to_string_ex(&value);
query = (char *)emalloc(Z_STRLEN_P(value) + 2);
strlcpy(query, Z_STRVAL_P(value), Z_STRLEN_P(value) + 2);
if(Z_STRLEN_P(value) > 0 && *(query + Z_STRLEN_P(value) - 1) != '\n') {
strlcat(query, "\n", Z_STRLEN_P(value) + 2);
}
if (PQputCopyData(pgsql, query, strlen(query)) != 1) {
efree(query);
zval_dtor(value);
efree(value);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
zval_dtor(value);
efree(value);
zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos);
}
if (PQputCopyEnd(pgsql, NULL) != 1) {
PHP_PQ_ERROR("putcopyend failed: %s", pgsql);
RETURN_FALSE;
}
#else
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
zval *value;
ALLOC_ZVAL(value);
INIT_PZVAL_COPY(value, *tmp);
zval_copy_ctor(value);
convert_to_string_ex(&value);
query = (char *)emalloc(Z_STRLEN_P(value) + 2);
strlcpy(query, Z_STRVAL_P(value), Z_STRLEN_P(value) + 2);
if(Z_STRLEN_P(value) > 0 && *(query + Z_STRLEN_P(value) - 1) != '\n') {
strlcat(query, "\n", Z_STRLEN_P(value) + 2);
}
if (PQputline(pgsql, query)==EOF) {
efree(query);
zval_dtor(value);
efree(value);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
zval_dtor(value);
efree(value);
zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos);
}
if (PQputline(pgsql, "\\.\n") == EOF) {
PHP_PQ_ERROR("putline failed: %s", pgsql);
RETURN_FALSE;
}
if (PQendcopy(pgsql)) {
PHP_PQ_ERROR("endcopy failed: %s", pgsql);
RETURN_FALSE;
}
#endif
while ((pgsql_result = PQgetResult(pgsql))) {
if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) {
PHP_PQ_ERROR("Copy command failed: %s", pgsql);
command_failed = 1;
}
PQclear(pgsql_result);
}
if (command_failed) {
RETURN_FALSE;
}
} else {
PQclear(pgsql_result);
RETURN_FALSE;
}
RETURN_TRUE;
break;
default:
PQclear(pgsql_result);
PHP_PQ_ERROR("Copy command failed: %s", pgsql);
RETURN_FALSE;
break;
}
}
| PHP_FUNCTION(pg_copy_from)
{
zval *pgsql_link = NULL, *pg_rows;
zval **tmp;
char *table_name, *pg_delim = NULL, *pg_null_as = NULL;
int table_name_len, pg_delim_len, pg_null_as_len;
int pg_null_as_free = 0;
char *query;
HashPosition pos;
int id = -1;
PGconn *pgsql;
PGresult *pgsql_result;
ExecStatusType status;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "rsa|ss",
&pgsql_link, &table_name, &table_name_len, &pg_rows,
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len) == FAILURE) {
return;
}
if (!pg_delim) {
pg_delim = "\t";
}
if (!pg_null_as) {
pg_null_as = safe_estrdup("\\\\N");
pg_null_as_free = 1;
}
ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
spprintf(&query, 0, "COPY %s FROM STDIN DELIMITERS E'%c' WITH NULL AS E'%s'", table_name, *pg_delim, pg_null_as);
while ((pgsql_result = PQgetResult(pgsql))) {
PQclear(pgsql_result);
}
pgsql_result = PQexec(pgsql, query);
if (pg_null_as_free) {
efree(pg_null_as);
}
efree(query);
if (pgsql_result) {
status = PQresultStatus(pgsql_result);
} else {
status = (ExecStatusType) PQstatus(pgsql);
}
switch (status) {
case PGRES_COPY_IN:
if (pgsql_result) {
int command_failed = 0;
PQclear(pgsql_result);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(pg_rows), &pos);
#if HAVE_PQPUTCOPYDATA
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
zval *value;
ALLOC_ZVAL(value);
INIT_PZVAL_COPY(value, *tmp);
zval_copy_ctor(value);
convert_to_string_ex(&value);
query = (char *)emalloc(Z_STRLEN_P(value) + 2);
strlcpy(query, Z_STRVAL_P(value), Z_STRLEN_P(value) + 2);
if(Z_STRLEN_P(value) > 0 && *(query + Z_STRLEN_P(value) - 1) != '\n') {
strlcat(query, "\n", Z_STRLEN_P(value) + 2);
}
if (PQputCopyData(pgsql, query, strlen(query)) != 1) {
efree(query);
zval_dtor(value);
efree(value);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
zval_dtor(value);
efree(value);
zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos);
}
if (PQputCopyEnd(pgsql, NULL) != 1) {
PHP_PQ_ERROR("putcopyend failed: %s", pgsql);
RETURN_FALSE;
}
#else
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(pg_rows), (void **) &tmp, &pos) == SUCCESS) {
zval *value;
ALLOC_ZVAL(value);
INIT_PZVAL_COPY(value, *tmp);
zval_copy_ctor(value);
convert_to_string_ex(&value);
query = (char *)emalloc(Z_STRLEN_P(value) + 2);
strlcpy(query, Z_STRVAL_P(value), Z_STRLEN_P(value) + 2);
if(Z_STRLEN_P(value) > 0 && *(query + Z_STRLEN_P(value) - 1) != '\n') {
strlcat(query, "\n", Z_STRLEN_P(value) + 2);
}
if (PQputline(pgsql, query)==EOF) {
efree(query);
zval_dtor(value);
efree(value);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
}
efree(query);
zval_dtor(value);
efree(value);
zend_hash_move_forward_ex(Z_ARRVAL_P(pg_rows), &pos);
}
if (PQputline(pgsql, "\\.\n") == EOF) {
PHP_PQ_ERROR("putline failed: %s", pgsql);
RETURN_FALSE;
}
if (PQendcopy(pgsql)) {
PHP_PQ_ERROR("endcopy failed: %s", pgsql);
RETURN_FALSE;
}
#endif
while ((pgsql_result = PQgetResult(pgsql))) {
if (PGRES_COMMAND_OK != PQresultStatus(pgsql_result)) {
PHP_PQ_ERROR("Copy command failed: %s", pgsql);
command_failed = 1;
}
PQclear(pgsql_result);
}
if (command_failed) {
RETURN_FALSE;
}
} else {
PQclear(pgsql_result);
RETURN_FALSE;
}
RETURN_TRUE;
break;
default:
PQclear(pgsql_result);
PHP_PQ_ERROR("Copy command failed: %s", pgsql);
RETURN_FALSE;
break;
}
}
| C | php | 0 |
CVE-2018-19052 | https://www.cvedetails.com/cve/CVE-2018-19052/ | null | https://github.com/lighttpd/lighttpd1.4/commit/2105dae0f9d7a964375ce681e53cb165375f84c1 | 2105dae0f9d7a964375ce681e53cb165375f84c1 | [mod_alias] security: potential path traversal with specific configs
Security: potential path traversal of a single directory above the alias
target with a specific mod_alias config where the alias which is matched
does not end in '/', but alias target filesystem path does end in '/'.
e.g. server.docroot = "/srv/www/host/HOSTNAME/docroot"
alias.url = ( "/img" => "/srv/www/hosts/HOSTNAME/images/" )
If a malicious URL "/img../" were passed, the request would be
for directory "/srv/www/hosts/HOSTNAME/images/../" which would resolve
to "/srv/www/hosts/HOSTNAME/". If mod_dirlisting were enabled, which
is not the default, this would result in listing the contents of the
directory above the alias. An attacker might also try to directly
access files anywhere under that path, which is one level above the
intended aliased path.
credit: Orange Tsai(@orange_8361) from DEVCORE | SETDEFAULTS_FUNC(mod_alias_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
config_values_t cv[] = {
{ "alias.url", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
if (!p) return HANDLER_ERROR;
p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = calloc(1, sizeof(plugin_config));
s->alias = array_init();
cv[0].destination = s->alias;
p->config_storage[i] = s;
if (0 != config_insert_values_global(srv, config->value, cv, i == 0 ? T_CONFIG_SCOPE_SERVER : T_CONFIG_SCOPE_CONNECTION)) {
return HANDLER_ERROR;
}
if (!array_is_kvstring(s->alias)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"unexpected value for alias.url; expected list of \"urlpath\" => \"filepath\"");
return HANDLER_ERROR;
}
if (s->alias->used >= 2) {
const array *a = s->alias;
size_t j, k;
for (j = 0; j < a->used; j ++) {
const buffer *prefix = a->data[a->sorted[j]]->key;
for (k = j + 1; k < a->used; k ++) {
const buffer *key = a->data[a->sorted[k]]->key;
if (buffer_string_length(key) < buffer_string_length(prefix)) {
break;
}
if (memcmp(key->ptr, prefix->ptr, buffer_string_length(prefix)) != 0) {
break;
}
/* ok, they have same prefix. check position */
if (a->sorted[j] < a->sorted[k]) {
log_error_write(srv, __FILE__, __LINE__, "SBSBS",
"url.alias: `", key, "' will never match as `", prefix, "' matched first");
return HANDLER_ERROR;
}
}
}
}
}
return HANDLER_GO_ON;
}
| SETDEFAULTS_FUNC(mod_alias_set_defaults) {
plugin_data *p = p_d;
size_t i = 0;
config_values_t cv[] = {
{ "alias.url", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
if (!p) return HANDLER_ERROR;
p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = calloc(1, sizeof(plugin_config));
s->alias = array_init();
cv[0].destination = s->alias;
p->config_storage[i] = s;
if (0 != config_insert_values_global(srv, config->value, cv, i == 0 ? T_CONFIG_SCOPE_SERVER : T_CONFIG_SCOPE_CONNECTION)) {
return HANDLER_ERROR;
}
if (!array_is_kvstring(s->alias)) {
log_error_write(srv, __FILE__, __LINE__, "s",
"unexpected value for alias.url; expected list of \"urlpath\" => \"filepath\"");
return HANDLER_ERROR;
}
if (s->alias->used >= 2) {
const array *a = s->alias;
size_t j, k;
for (j = 0; j < a->used; j ++) {
const buffer *prefix = a->data[a->sorted[j]]->key;
for (k = j + 1; k < a->used; k ++) {
const buffer *key = a->data[a->sorted[k]]->key;
if (buffer_string_length(key) < buffer_string_length(prefix)) {
break;
}
if (memcmp(key->ptr, prefix->ptr, buffer_string_length(prefix)) != 0) {
break;
}
/* ok, they have same prefix. check position */
if (a->sorted[j] < a->sorted[k]) {
log_error_write(srv, __FILE__, __LINE__, "SBSBS",
"url.alias: `", key, "' will never match as `", prefix, "' matched first");
return HANDLER_ERROR;
}
}
}
}
}
return HANDLER_GO_ON;
}
| C | lighttpd1.4 | 0 |
CVE-2014-3167 | https://www.cvedetails.com/cve/CVE-2014-3167/ | null | https://github.com/chromium/chromium/commit/44f1431b20c16d8f8da0ce8ff7bbf2adddcdd785 | 44f1431b20c16d8f8da0ce8ff7bbf2adddcdd785 | Avoid using forced layout to trigger paint invalidation for SVG containers
Currently, SVG containers in the LayoutObject hierarchy force layout of
their children if the transform changes. The main reason for this is to
trigger paint invalidation of the subtree. In some cases - changes to the
scale factor - there are other reasons to trigger layout, like computing
a new scale factor for <text> or re-layout nodes with non-scaling stroke.
Compute a "scale-factor change" in addition to the "transform change"
already computed, then use this new signal to determine if layout should
be forced for the subtree. Trigger paint invalidation using the
LayoutObject flags instead.
The downside to this is that paint invalidation will walk into "hidden"
containers which rarely require repaint (since they are not technically
visible). This will hopefully be rectified in a follow-up CL.
For the testcase from 603850, this essentially eliminates the cost of
layout (from ~350ms to ~0ms on authors machine; layout cost is related
to text metrics recalculation), bumping frame rate significantly.
BUG=603956,603850
Review-Url: https://codereview.chromium.org/1996543002
Cr-Commit-Position: refs/heads/master@{#400950} | AffineTransform::AffineTransform()
{
const Transform identity = IDENTITY_TRANSFORM;
setMatrix(identity);
}
| AffineTransform::AffineTransform()
{
const Transform identity = IDENTITY_TRANSFORM;
setMatrix(identity);
}
| C | Chrome | 0 |
CVE-2017-6903 | https://www.cvedetails.com/cve/CVE-2017-6903/ | CWE-269 | https://github.com/iortcw/iortcw/commit/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20 | b6ff2bcb1e4e6976d61e316175c6d7c99860fe20 | All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s | static void CL_CompleteDemoName( char *args, int argNum )
{
if( argNum == 2 )
{
char demoExt[ 16 ];
Com_sprintf(demoExt, sizeof(demoExt), ".%s%d", DEMOEXT, com_protocol->integer);
Field_CompleteFilename( "demos", demoExt, qtrue, qtrue );
}
}
| static void CL_CompleteDemoName( char *args, int argNum )
{
if( argNum == 2 )
{
char demoExt[ 16 ];
Com_sprintf(demoExt, sizeof(demoExt), ".%s%d", DEMOEXT, com_protocol->integer);
Field_CompleteFilename( "demos", demoExt, qtrue, qtrue );
}
}
| C | OpenJK | 0 |
CVE-2012-2842 | https://www.cvedetails.com/cve/CVE-2012-2842/ | CWE-399 | https://github.com/chromium/chromium/commit/e3171b346e6919f4162ea128d0f7b342cf878fd4 | e3171b346e6919f4162ea128d0f7b342cf878fd4 | ash: Fix right-alignment of power-status text.
It turns out setting ALING_RIGHT on a Label isn't enough to get proper
right-aligned text. Label has to be explicitly told that it is multi-lined.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9918026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129898 0039d316-1c4b-4281-b951-d872f2087c98 | TrayPower::TrayPower()
: power_(NULL),
power_tray_(NULL) {
}
| TrayPower::TrayPower()
: power_(NULL),
power_tray_(NULL) {
}
| C | Chrome | 0 |
CVE-2015-5296 | https://www.cvedetails.com/cve/CVE-2015-5296/ | CWE-20 | https://git.samba.org/?p=samba.git;a=commit;h=a819d2b440aafa3138d95ff6e8b824da885a70e9 | a819d2b440aafa3138d95ff6e8b824da885a70e9 | null | static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
{
size_t num_pending = talloc_array_length(conn->pending);
uint16_t result;
if (conn->protocol == PROTOCOL_NONE) {
/*
* This is what windows sends on the SMB1 Negprot request
* and some vendors reuse the SMB1 MID as SMB2 sequence number.
*/
return 0;
}
while (true) {
size_t i;
result = conn->smb1.mid++;
if ((result == 0) || (result == 0xffff)) {
continue;
}
for (i=0; i<num_pending; i++) {
if (result == smb1cli_req_mid(conn->pending[i])) {
break;
}
}
if (i == num_pending) {
return result;
}
}
}
| static uint16_t smb1cli_alloc_mid(struct smbXcli_conn *conn)
{
size_t num_pending = talloc_array_length(conn->pending);
uint16_t result;
if (conn->protocol == PROTOCOL_NONE) {
/*
* This is what windows sends on the SMB1 Negprot request
* and some vendors reuse the SMB1 MID as SMB2 sequence number.
*/
return 0;
}
while (true) {
size_t i;
result = conn->smb1.mid++;
if ((result == 0) || (result == 0xffff)) {
continue;
}
for (i=0; i<num_pending; i++) {
if (result == smb1cli_req_mid(conn->pending[i])) {
break;
}
}
if (i == num_pending) {
return result;
}
}
}
| C | samba | 0 |
CVE-2016-8666 | https://www.cvedetails.com/cve/CVE-2016-8666/ | CWE-400 | https://github.com/torvalds/linux/commit/fac8e0f579695a3ecbc4d3cac369139d7f819971 | fac8e0f579695a3ecbc4d3cac369139d7f819971 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsulation device expresses support for handling offloaded
encapsulated packets, so we won't generate these types of frames
in the transmit path. However, GRO doesn't have a check for
multiple levels of encapsulation and will attempt to build them.
UDP tunnel GRO actually does prevent this situation but it only
handles multiple UDP tunnels stacked on top of each other. This
generalizes that solution to prevent any kind of tunnel stacking
that would cause problems.
Fixes: bf5a755f ("net-gre-gro: Add GRE support to the GRO stack")
Signed-off-by: Jesse Gross <jesse@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net> | static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
netdev_features_t features)
{
struct sk_buff *segs = ERR_PTR(-EINVAL);
unsigned int mss;
__wsum csum;
struct udphdr *uh;
struct iphdr *iph;
if (skb->encapsulation &&
(skb_shinfo(skb)->gso_type &
(SKB_GSO_UDP_TUNNEL|SKB_GSO_UDP_TUNNEL_CSUM))) {
segs = skb_udp_tunnel_segment(skb, features, false);
goto out;
}
if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto out;
mss = skb_shinfo(skb)->gso_size;
if (unlikely(skb->len <= mss))
goto out;
if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
/* Packet is from an untrusted source, reset gso_segs. */
int type = skb_shinfo(skb)->gso_type;
if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY |
SKB_GSO_UDP_TUNNEL |
SKB_GSO_UDP_TUNNEL_CSUM |
SKB_GSO_TUNNEL_REMCSUM |
SKB_GSO_IPIP |
SKB_GSO_GRE | SKB_GSO_GRE_CSUM) ||
!(type & (SKB_GSO_UDP))))
goto out;
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
segs = NULL;
goto out;
}
/* Do software UFO. Complete and fill in the UDP checksum as
* HW cannot do checksum of UDP packets sent as multiple
* IP fragments.
*/
uh = udp_hdr(skb);
iph = ip_hdr(skb);
uh->check = 0;
csum = skb_checksum(skb, 0, skb->len, 0);
uh->check = udp_v4_check(skb->len, iph->saddr, iph->daddr, csum);
if (uh->check == 0)
uh->check = CSUM_MANGLED_0;
skb->ip_summed = CHECKSUM_NONE;
/* If there is no outer header we can fake a checksum offload
* due to the fact that we have already done the checksum in
* software prior to segmenting the frame.
*/
if (!skb->encap_hdr_csum)
features |= NETIF_F_HW_CSUM;
/* Fragment the skb. IP headers of the fragments are updated in
* inet_gso_segment()
*/
segs = skb_segment(skb, features);
out:
return segs;
}
| static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
netdev_features_t features)
{
struct sk_buff *segs = ERR_PTR(-EINVAL);
unsigned int mss;
__wsum csum;
struct udphdr *uh;
struct iphdr *iph;
if (skb->encapsulation &&
(skb_shinfo(skb)->gso_type &
(SKB_GSO_UDP_TUNNEL|SKB_GSO_UDP_TUNNEL_CSUM))) {
segs = skb_udp_tunnel_segment(skb, features, false);
goto out;
}
if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto out;
mss = skb_shinfo(skb)->gso_size;
if (unlikely(skb->len <= mss))
goto out;
if (skb_gso_ok(skb, features | NETIF_F_GSO_ROBUST)) {
/* Packet is from an untrusted source, reset gso_segs. */
int type = skb_shinfo(skb)->gso_type;
if (unlikely(type & ~(SKB_GSO_UDP | SKB_GSO_DODGY |
SKB_GSO_UDP_TUNNEL |
SKB_GSO_UDP_TUNNEL_CSUM |
SKB_GSO_TUNNEL_REMCSUM |
SKB_GSO_IPIP |
SKB_GSO_GRE | SKB_GSO_GRE_CSUM) ||
!(type & (SKB_GSO_UDP))))
goto out;
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
segs = NULL;
goto out;
}
/* Do software UFO. Complete and fill in the UDP checksum as
* HW cannot do checksum of UDP packets sent as multiple
* IP fragments.
*/
uh = udp_hdr(skb);
iph = ip_hdr(skb);
uh->check = 0;
csum = skb_checksum(skb, 0, skb->len, 0);
uh->check = udp_v4_check(skb->len, iph->saddr, iph->daddr, csum);
if (uh->check == 0)
uh->check = CSUM_MANGLED_0;
skb->ip_summed = CHECKSUM_NONE;
/* If there is no outer header we can fake a checksum offload
* due to the fact that we have already done the checksum in
* software prior to segmenting the frame.
*/
if (!skb->encap_hdr_csum)
features |= NETIF_F_HW_CSUM;
/* Fragment the skb. IP headers of the fragments are updated in
* inet_gso_segment()
*/
segs = skb_segment(skb, features);
out:
return segs;
}
| C | linux | 0 |
CVE-2018-12320 | https://www.cvedetails.com/cve/CVE-2018-12320/ | CWE-416 | https://github.com/radare/radare2/commit/90b71c017a7fa9732fe45fd21b245ee051b1f548 | 90b71c017a7fa9732fe45fd21b245ee051b1f548 | Fix #10293 - Use-after-free in r_anal_bb_free() | R_API RAnalBlock *r_anal_bb_get_failbb(RAnalFunction *fcn, RAnalBlock *bb) {
RListIter *iter;
RAnalBlock *b;
if (bb->fail == UT64_MAX) {
return NULL;
}
if (bb->failbb) {
return bb->failbb;
}
r_list_foreach (fcn->bbs, iter, b) {
if (b->addr == bb->fail) {
bb->failbb = b;
b->prev = bb;
return b;
}
}
return NULL;
}
| R_API RAnalBlock *r_anal_bb_get_failbb(RAnalFunction *fcn, RAnalBlock *bb) {
RListIter *iter;
RAnalBlock *b;
if (bb->fail == UT64_MAX) {
return NULL;
}
if (bb->failbb) {
return bb->failbb;
}
r_list_foreach (fcn->bbs, iter, b) {
if (b->addr == bb->fail) {
bb->failbb = b;
b->prev = bb;
return b;
}
}
return NULL;
}
| C | radare2 | 0 |
null | null | null | https://github.com/chromium/chromium/commit/1797c8188e7d42f0adf6ce0e607307cd313e1d7d | 1797c8188e7d42f0adf6ce0e607307cd313e1d7d | Set the original URL for downloads
https://bugs.webkit.org/show_bug.cgi?id=49628
Reviewed by John Sullivan.
WebCore:
Export symbols needed by WebKit2.
* WebCore.exp.in:
WebKit2:
* WebProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* WebProcess/Downloads/DownloadManager.h:
startDownload now takes the originating web page.
* WebProcess/Downloads/cf/DownloadCFNet.cpp:
(WebKit::Download::start):
start now takes the originating web page.
* WebProcess/Downloads/mac/DownloadMac.mm:
(WebKit::originatingURL):
(WebKit::setOriginalURLForDownload):
Port code over from WebKit1 that sets the download URL.
(WebKit::Download::start):
Call setOriginalURLForDownload.
* WebProcess/Downloads/qt/DownloadQt.cpp:
(WebKit::Download::start):
start now takes the originating web page.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
Pass the web page to DownloadManager::startDownload.
git-svn-id: svn://svn.chromium.org/blink/trunk@72145 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | JSValueRef WebFrame::jsWrapperForWorld(InjectedBundleRangeHandle* rangeHandle, InjectedBundleScriptWorld* world)
{
JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(world->coreWorld());
ExecState* exec = globalObject->globalExec();
JSLock lock(SilenceAssertionsOnly);
return toRef(exec, toJS(exec, globalObject, rangeHandle->coreRange()));
}
| JSValueRef WebFrame::jsWrapperForWorld(InjectedBundleRangeHandle* rangeHandle, InjectedBundleScriptWorld* world)
{
JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(world->coreWorld());
ExecState* exec = globalObject->globalExec();
JSLock lock(SilenceAssertionsOnly);
return toRef(exec, toJS(exec, globalObject, rangeHandle->coreRange()));
}
| C | Chrome | 0 |
CVE-2017-9059 | https://www.cvedetails.com/cve/CVE-2017-9059/ | CWE-404 | https://github.com/torvalds/linux/commit/c70422f760c120480fee4de6c38804c72aa26bc1 | c70422f760c120480fee4de6c38804c72aa26bc1 | Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields:
"Another RDMA update from Chuck Lever, and a bunch of miscellaneous
bugfixes"
* tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/linux: (26 commits)
nfsd: Fix up the "supattr_exclcreat" attributes
nfsd: encoders mustn't use unitialized values in error cases
nfsd: fix undefined behavior in nfsd4_layout_verify
lockd: fix lockd shutdown race
NFSv4: Fix callback server shutdown
SUNRPC: Refactor svc_set_num_threads()
NFSv4.x/callback: Create the callback service through svc_create_pooled
lockd: remove redundant check on block
svcrdma: Clean out old XDR encoders
svcrdma: Remove the req_map cache
svcrdma: Remove unused RDMA Write completion handler
svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt
svcrdma: Clean up RPC-over-RDMA backchannel reply processing
svcrdma: Report Write/Reply chunk overruns
svcrdma: Clean up RDMA_ERROR path
svcrdma: Use rdma_rw API in RPC reply path
svcrdma: Introduce local rdma_rw API helpers
svcrdma: Clean up svc_rdma_get_inv_rkey()
svcrdma: Add helper to save pages under I/O
svcrdma: Eliminate RPCRDMA_SQ_DEPTH_MULT
... | nfsd_collect_client_openowners(struct nfs4_client *clp,
struct list_head *collect, u64 max)
{
return nfsd_foreach_client_openowner(clp, max, collect,
unhash_openowner_locked);
}
| nfsd_collect_client_openowners(struct nfs4_client *clp,
struct list_head *collect, u64 max)
{
return nfsd_foreach_client_openowner(clp, max, collect,
unhash_openowner_locked);
}
| C | linux | 0 |
CVE-2017-11176 | https://www.cvedetails.com/cve/CVE-2017-11176/ | CWE-416 | https://github.com/torvalds/linux/commit/f991af3daabaecff34684fd51fac80319d1baad1 | f991af3daabaecff34684fd51fac80319d1baad1 | mqueue: fix a use-after-free in sys_mq_notify()
The retry logic for netlink_attachskb() inside sys_mq_notify()
is nasty and vulnerable:
1) The sock refcnt is already released when retry is needed
2) The fd is controllable by user-space because we already
release the file refcnt
so we when retry but the fd has been just closed by user-space
during this small window, we end up calling netlink_detachskb()
on the error path which releases the sock again, later when
the user-space closes this socket a use-after-free could be
triggered.
Setting 'sock' to NULL here should be sufficient to fix it.
Reported-by: GeneBlue <geneblue.mail@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr,
size_t msg_len, unsigned int __user *u_msg_prio,
struct timespec *ts)
{
ssize_t ret;
struct msg_msg *msg_ptr;
struct fd f;
struct inode *inode;
struct mqueue_inode_info *info;
struct ext_wait_queue wait;
ktime_t expires, *timeout = NULL;
struct posix_msg_tree_node *new_leaf = NULL;
if (ts) {
expires = timespec_to_ktime(*ts);
timeout = &expires;
}
audit_mq_sendrecv(mqdes, msg_len, 0, ts);
f = fdget(mqdes);
if (unlikely(!f.file)) {
ret = -EBADF;
goto out;
}
inode = file_inode(f.file);
if (unlikely(f.file->f_op != &mqueue_file_operations)) {
ret = -EBADF;
goto out_fput;
}
info = MQUEUE_I(inode);
audit_file(f.file);
if (unlikely(!(f.file->f_mode & FMODE_READ))) {
ret = -EBADF;
goto out_fput;
}
/* checks if buffer is big enough */
if (unlikely(msg_len < info->attr.mq_msgsize)) {
ret = -EMSGSIZE;
goto out_fput;
}
/*
* msg_insert really wants us to have a valid, spare node struct so
* it doesn't have to kmalloc a GFP_ATOMIC allocation, but it will
* fall back to that if necessary.
*/
if (!info->node_cache)
new_leaf = kmalloc(sizeof(*new_leaf), GFP_KERNEL);
spin_lock(&info->lock);
if (!info->node_cache && new_leaf) {
/* Save our speculative allocation into the cache */
INIT_LIST_HEAD(&new_leaf->msg_list);
info->node_cache = new_leaf;
} else {
kfree(new_leaf);
}
if (info->attr.mq_curmsgs == 0) {
if (f.file->f_flags & O_NONBLOCK) {
spin_unlock(&info->lock);
ret = -EAGAIN;
} else {
wait.task = current;
wait.state = STATE_NONE;
ret = wq_sleep(info, RECV, timeout, &wait);
msg_ptr = wait.msg;
}
} else {
DEFINE_WAKE_Q(wake_q);
msg_ptr = msg_get(info);
inode->i_atime = inode->i_mtime = inode->i_ctime =
current_time(inode);
/* There is now free space in queue. */
pipelined_receive(&wake_q, info);
spin_unlock(&info->lock);
wake_up_q(&wake_q);
ret = 0;
}
if (ret == 0) {
ret = msg_ptr->m_ts;
if ((u_msg_prio && put_user(msg_ptr->m_type, u_msg_prio)) ||
store_msg(u_msg_ptr, msg_ptr, msg_ptr->m_ts)) {
ret = -EFAULT;
}
free_msg(msg_ptr);
}
out_fput:
fdput(f);
out:
return ret;
}
| static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr,
size_t msg_len, unsigned int __user *u_msg_prio,
struct timespec *ts)
{
ssize_t ret;
struct msg_msg *msg_ptr;
struct fd f;
struct inode *inode;
struct mqueue_inode_info *info;
struct ext_wait_queue wait;
ktime_t expires, *timeout = NULL;
struct posix_msg_tree_node *new_leaf = NULL;
if (ts) {
expires = timespec_to_ktime(*ts);
timeout = &expires;
}
audit_mq_sendrecv(mqdes, msg_len, 0, ts);
f = fdget(mqdes);
if (unlikely(!f.file)) {
ret = -EBADF;
goto out;
}
inode = file_inode(f.file);
if (unlikely(f.file->f_op != &mqueue_file_operations)) {
ret = -EBADF;
goto out_fput;
}
info = MQUEUE_I(inode);
audit_file(f.file);
if (unlikely(!(f.file->f_mode & FMODE_READ))) {
ret = -EBADF;
goto out_fput;
}
/* checks if buffer is big enough */
if (unlikely(msg_len < info->attr.mq_msgsize)) {
ret = -EMSGSIZE;
goto out_fput;
}
/*
* msg_insert really wants us to have a valid, spare node struct so
* it doesn't have to kmalloc a GFP_ATOMIC allocation, but it will
* fall back to that if necessary.
*/
if (!info->node_cache)
new_leaf = kmalloc(sizeof(*new_leaf), GFP_KERNEL);
spin_lock(&info->lock);
if (!info->node_cache && new_leaf) {
/* Save our speculative allocation into the cache */
INIT_LIST_HEAD(&new_leaf->msg_list);
info->node_cache = new_leaf;
} else {
kfree(new_leaf);
}
if (info->attr.mq_curmsgs == 0) {
if (f.file->f_flags & O_NONBLOCK) {
spin_unlock(&info->lock);
ret = -EAGAIN;
} else {
wait.task = current;
wait.state = STATE_NONE;
ret = wq_sleep(info, RECV, timeout, &wait);
msg_ptr = wait.msg;
}
} else {
DEFINE_WAKE_Q(wake_q);
msg_ptr = msg_get(info);
inode->i_atime = inode->i_mtime = inode->i_ctime =
current_time(inode);
/* There is now free space in queue. */
pipelined_receive(&wake_q, info);
spin_unlock(&info->lock);
wake_up_q(&wake_q);
ret = 0;
}
if (ret == 0) {
ret = msg_ptr->m_ts;
if ((u_msg_prio && put_user(msg_ptr->m_type, u_msg_prio)) ||
store_msg(u_msg_ptr, msg_ptr, msg_ptr->m_ts)) {
ret = -EFAULT;
}
free_msg(msg_ptr);
}
out_fput:
fdput(f);
out:
return ret;
}
| C | linux | 0 |
CVE-2018-5730 | https://www.cvedetails.com/cve/CVE-2018-5730/ | CWE-90 | https://github.com/krb5/krb5/commit/e1caf6fb74981da62039846931ebdffed71309d1 | e1caf6fb74981da62039846931ebdffed71309d1 | Fix flaws in LDAP DN checking
KDB_TL_USER_INFO tl-data is intended to be internal to the LDAP KDB
module, and not used in disk or wire principal entries. Prevent
kadmin clients from sending KDB_TL_USER_INFO tl-data by giving it a
type number less than 256 and filtering out type numbers less than 256
in kadm5_create_principal_3(). (We already filter out low type
numbers in kadm5_modify_principal()).
In the LDAP KDB module, if containerdn and linkdn are both specified
in a put_principal operation, check both linkdn and the computed
standalone_principal_dn for container membership. To that end, factor
out the checks into helper functions and call them on all applicable
client-influenced DNs.
CVE-2018-5729:
In MIT krb5 1.6 or later, an authenticated kadmin user with permission
to add principals to an LDAP Kerberos database can cause a null
dereference in kadmind, or circumvent a DN container check, by
supplying tagged data intended to be internal to the database module.
Thanks to Sharwan Ram and Pooja Anil for discovering the potential
null dereference.
CVE-2018-5730:
In MIT krb5 1.6 or later, an authenticated kadmin user with permission
to add principals to an LDAP Kerberos database can circumvent a DN
containership check by supplying both a "linkdn" and "containerdn"
database argument, or by supplying a DN string which is a left
extension of a container DN string but is not hierarchically within
the container DN.
ticket: 8643 (new)
tags: pullup
target_version: 1.16-next
target_version: 1.15-next | kadm5_get_principal_keys(void *server_handle /* IN */,
krb5_principal principal /* IN */,
krb5_kvno kvno /* IN */,
kadm5_key_data **key_data_out /* OUT */,
int *n_key_data_out /* OUT */)
{
krb5_db_entry *kdb;
osa_princ_ent_rec adb;
kadm5_ret_t ret;
kadm5_server_handle_t handle = server_handle;
kadm5_key_data *key_data = NULL;
int i, nkeys = 0;
if (principal == NULL || key_data_out == NULL || n_key_data_out == NULL)
return EINVAL;
CHECK_HANDLE(server_handle);
if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
return(ret);
key_data = calloc(kdb->n_key_data, sizeof(kadm5_key_data));
if (key_data == NULL) {
ret = ENOMEM;
goto done;
}
for (i = 0, nkeys = 0; i < kdb->n_key_data; i++) {
if (kvno != 0 && kvno != kdb->key_data[i].key_data_kvno)
continue;
key_data[nkeys].kvno = kdb->key_data[i].key_data_kvno;
ret = krb5_dbe_decrypt_key_data(handle->context, NULL,
&kdb->key_data[i],
&key_data[nkeys].key,
&key_data[nkeys].salt);
if (ret)
goto done;
nkeys++;
}
*n_key_data_out = nkeys;
*key_data_out = key_data;
key_data = NULL;
nkeys = 0;
ret = KADM5_OK;
done:
kdb_free_entry(handle, kdb, &adb);
kadm5_free_kadm5_key_data(handle->context, nkeys, key_data);
return ret;
}
| kadm5_get_principal_keys(void *server_handle /* IN */,
krb5_principal principal /* IN */,
krb5_kvno kvno /* IN */,
kadm5_key_data **key_data_out /* OUT */,
int *n_key_data_out /* OUT */)
{
krb5_db_entry *kdb;
osa_princ_ent_rec adb;
kadm5_ret_t ret;
kadm5_server_handle_t handle = server_handle;
kadm5_key_data *key_data = NULL;
int i, nkeys = 0;
if (principal == NULL || key_data_out == NULL || n_key_data_out == NULL)
return EINVAL;
CHECK_HANDLE(server_handle);
if ((ret = kdb_get_entry(handle, principal, &kdb, &adb)))
return(ret);
key_data = calloc(kdb->n_key_data, sizeof(kadm5_key_data));
if (key_data == NULL) {
ret = ENOMEM;
goto done;
}
for (i = 0, nkeys = 0; i < kdb->n_key_data; i++) {
if (kvno != 0 && kvno != kdb->key_data[i].key_data_kvno)
continue;
key_data[nkeys].kvno = kdb->key_data[i].key_data_kvno;
ret = krb5_dbe_decrypt_key_data(handle->context, NULL,
&kdb->key_data[i],
&key_data[nkeys].key,
&key_data[nkeys].salt);
if (ret)
goto done;
nkeys++;
}
*n_key_data_out = nkeys;
*key_data_out = key_data;
key_data = NULL;
nkeys = 0;
ret = KADM5_OK;
done:
kdb_free_entry(handle, kdb, &adb);
kadm5_free_kadm5_key_data(handle->context, nkeys, key_data);
return ret;
}
| C | krb5 | 0 |
CVE-2019-5787 | https://www.cvedetails.com/cve/CVE-2019-5787/ | CWE-416 | https://github.com/chromium/chromium/commit/6a7063ae61cf031630b48bdcdb09863ffc199962 | 6a7063ae61cf031630b48bdcdb09863ffc199962 | Clean up CanvasResourceDispatcher on finalizer
We may have pending mojo messages after GC, so we want to drop the
dispatcher as soon as possible.
Bug: 929757,913964
Change-Id: I5789bcbb55aada4a74c67a28758f07686f8911c0
Reviewed-on: https://chromium-review.googlesource.com/c/1489175
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Commit-Queue: Fernando Serboncini <fserb@chromium.org>
Auto-Submit: Fernando Serboncini <fserb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635833} | void HTMLCanvasElement::DoDeferredPaintInvalidation() {
DCHECK(!dirty_rect_.IsEmpty());
if (LowLatencyEnabled()) {
return;
}
LayoutBox* layout_box = GetLayoutBox();
if (Is2d()) {
FloatRect src_rect(0, 0, Size().Width(), Size().Height());
dirty_rect_.Intersect(src_rect);
FloatRect invalidation_rect;
if (layout_box) {
FloatRect content_rect(layout_box->PhysicalContentBoxRect());
FloatRect mapped_dirty_rect =
MapRect(dirty_rect_, src_rect, content_rect);
if (context_->IsComposited()) {
mapped_dirty_rect.MoveBy(-content_rect.Location());
}
invalidation_rect = mapped_dirty_rect;
} else {
invalidation_rect = dirty_rect_;
}
if (dirty_rect_.IsEmpty())
return;
if (canvas2d_bridge_)
canvas2d_bridge_->DoPaintInvalidation(invalidation_rect);
}
if (context_ && HasImageBitmapContext() && context_->CcLayer())
context_->CcLayer()->SetNeedsDisplay();
NotifyListenersCanvasChanged();
did_notify_listeners_for_current_frame_ = true;
if (layout_box && (!context_ || !context_->IsComposited())) {
FloatRect src_rect(0, 0, Size().Width(), Size().Height());
FloatRect content_rect(layout_box->PhysicalContentBoxRect());
if (content_rect.Width() > src_rect.Width() ||
content_rect.Height() > src_rect.Height()) {
dirty_rect_.Inflate(0.5);
}
dirty_rect_.Intersect(src_rect);
LayoutRect mapped_dirty_rect(
EnclosingIntRect(MapRect(dirty_rect_, src_rect, content_rect)));
DisableCompositingQueryAsserts disabler;
layout_box->InvalidatePaintRectangle(mapped_dirty_rect);
}
dirty_rect_ = FloatRect();
DCHECK(dirty_rect_.IsEmpty());
}
| void HTMLCanvasElement::DoDeferredPaintInvalidation() {
DCHECK(!dirty_rect_.IsEmpty());
if (LowLatencyEnabled()) {
return;
}
LayoutBox* layout_box = GetLayoutBox();
if (Is2d()) {
FloatRect src_rect(0, 0, Size().Width(), Size().Height());
dirty_rect_.Intersect(src_rect);
FloatRect invalidation_rect;
if (layout_box) {
FloatRect content_rect(layout_box->PhysicalContentBoxRect());
FloatRect mapped_dirty_rect =
MapRect(dirty_rect_, src_rect, content_rect);
if (context_->IsComposited()) {
mapped_dirty_rect.MoveBy(-content_rect.Location());
}
invalidation_rect = mapped_dirty_rect;
} else {
invalidation_rect = dirty_rect_;
}
if (dirty_rect_.IsEmpty())
return;
if (canvas2d_bridge_)
canvas2d_bridge_->DoPaintInvalidation(invalidation_rect);
}
if (context_ && HasImageBitmapContext() && context_->CcLayer())
context_->CcLayer()->SetNeedsDisplay();
NotifyListenersCanvasChanged();
did_notify_listeners_for_current_frame_ = true;
if (layout_box && (!context_ || !context_->IsComposited())) {
FloatRect src_rect(0, 0, Size().Width(), Size().Height());
FloatRect content_rect(layout_box->PhysicalContentBoxRect());
if (content_rect.Width() > src_rect.Width() ||
content_rect.Height() > src_rect.Height()) {
dirty_rect_.Inflate(0.5);
}
dirty_rect_.Intersect(src_rect);
LayoutRect mapped_dirty_rect(
EnclosingIntRect(MapRect(dirty_rect_, src_rect, content_rect)));
DisableCompositingQueryAsserts disabler;
layout_box->InvalidatePaintRectangle(mapped_dirty_rect);
}
dirty_rect_ = FloatRect();
DCHECK(dirty_rect_.IsEmpty());
}
| C | Chrome | 0 |
null | null | null | https://github.com/chromium/chromium/commit/93dd81929416a0170935e6eeac03d10aed60df18 | 93dd81929416a0170935e6eeac03d10aed60df18 | Implement NPN_RemoveProperty
https://bugs.webkit.org/show_bug.cgi?id=43315
Reviewed by Sam Weinig.
WebKit2:
* WebProcess/Plugins/NPJSObject.cpp:
(WebKit::NPJSObject::removeProperty):
Try to remove the property.
(WebKit::NPJSObject::npClass):
Add NP_RemoveProperty.
(WebKit::NPJSObject::NP_RemoveProperty):
Call NPJSObject::removeProperty.
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_RemoveProperty):
Call the NPClass::removeProperty function.
WebKitTools:
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
Add NPRuntimeRemoveProperty.cpp
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
(PluginTest::NPN_GetStringIdentifier):
(PluginTest::NPN_GetIntIdentifier):
(PluginTest::NPN_RemoveProperty):
Add NPN_ helpers.
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
Support more NPClass functions.
* DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp: Added.
(NPRuntimeRemoveProperty::NPRuntimeRemoveProperty):
Test for NPN_RemoveProperty.
(NPRuntimeRemoveProperty::TestObject::hasMethod):
(NPRuntimeRemoveProperty::TestObject::invoke):
Add a testRemoveProperty method.
(NPRuntimeRemoveProperty::NPP_GetValue):
Return the test object.
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
* DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
* GNUmakefile.am:
Add NPRuntimeRemoveProperty.cpp
LayoutTests:
Add a test for NPN_RemoveProperty.
* plugins/npruntime/remove-property-expected.txt: Added.
* plugins/npruntime/remove-property.html: Added.
git-svn-id: svn://svn.chromium.org/blink/trunk@64444 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | static bool NPN_InvokeDefault(NPP, NPObject *npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
if (npObject->_class->invokeDefault)
return npObject->_class->invokeDefault(npObject, arguments, argumentCount, result);
return false;
}
| static bool NPN_InvokeDefault(NPP, NPObject *npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
{
if (npObject->_class->invokeDefault)
return npObject->_class->invokeDefault(npObject, arguments, argumentCount, result);
return false;
}
| C | Chrome | 0 |
CVE-2017-5016 | https://www.cvedetails.com/cve/CVE-2017-5016/ | CWE-1021 | https://github.com/chromium/chromium/commit/a8e17a3031b6ad69c399e5e04dd0084e577097fc | a8e17a3031b6ad69c399e5e04dd0084e577097fc | Form validation: Do not show validation bubble if the page is invisible.
BUG=673163
Review-Url: https://codereview.chromium.org/2572813003
Cr-Commit-Position: refs/heads/master@{#438476} | ValidationMessageClient* HTMLFormControlElement::validationMessageClient()
const {
Page* page = document().page();
if (!page)
return nullptr;
return &page->validationMessageClient();
}
| ValidationMessageClient* HTMLFormControlElement::validationMessageClient()
const {
Page* page = document().page();
if (!page)
return nullptr;
return &page->validationMessageClient();
}
| C | Chrome | 0 |
CVE-2014-3173 | https://www.cvedetails.com/cve/CVE-2014-3173/ | CWE-119 | https://github.com/chromium/chromium/commit/ee7579229ff7e9e5ae28bf53aea069251499d7da | ee7579229ff7e9e5ae28bf53aea069251499d7da | Framebuffer clear() needs to consider the situation some draw buffers are disabled.
This is when we expose DrawBuffers extension.
BUG=376951
TEST=the attached test case, webgl conformance
R=kbr@chromium.org,bajones@chromium.org
Review URL: https://codereview.chromium.org/315283002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275338 0039d316-1c4b-4281-b951-d872f2087c98 | void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, GLboolean* params) {
DCHECK(params);
GLsizei num_written = 0;
if (GetNumValuesReturnedForGLGet(pname, &num_written)) {
scoped_ptr<GLint[]> values(new GLint[num_written]);
if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) {
GetHelper(pname, values.get(), &num_written);
}
for (GLsizei ii = 0; ii < num_written; ++ii) {
params[ii] = static_cast<GLboolean>(values[ii]);
}
} else {
pname = AdjustGetPname(pname);
glGetBooleanv(pname, params);
}
}
| void GLES2DecoderImpl::DoGetBooleanv(GLenum pname, GLboolean* params) {
DCHECK(params);
GLsizei num_written = 0;
if (GetNumValuesReturnedForGLGet(pname, &num_written)) {
scoped_ptr<GLint[]> values(new GLint[num_written]);
if (!state_.GetStateAsGLint(pname, values.get(), &num_written)) {
GetHelper(pname, values.get(), &num_written);
}
for (GLsizei ii = 0; ii < num_written; ++ii) {
params[ii] = static_cast<GLboolean>(values[ii]);
}
} else {
pname = AdjustGetPname(pname);
glGetBooleanv(pname, params);
}
}
| C | Chrome | 0 |
CVE-2016-3751 | https://www.cvedetails.com/cve/CVE-2016-3751/ | null | https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca | 9d4853418ab2f754c2b63e091c29c5529b8b86ca | DO NOT MERGE Update libpng to 1.6.20
BUG:23265085
Change-Id: I85199805636d771f3597b691b63bc0bf46084833
(cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
| reread_4(struct file *file)
/* The same but for a four byte quantity */
{
png_uint_32 result = 0;
int i = 0;
while (++i <= 4)
result = (result << 8) + reread_byte(file);
return result;
}
| reread_4(struct file *file)
/* The same but for a four byte quantity */
{
png_uint_32 result = 0;
int i = 0;
while (++i <= 4)
result = (result << 8) + reread_byte(file);
return result;
}
| C | Android | 0 |
CVE-2013-1790 | https://www.cvedetails.com/cve/CVE-2013-1790/ | CWE-119 | https://cgit.freedesktop.org/poppler/poppler/commit/?h=poppler-0.22&id=b1026b5978c385328f2a15a2185c599a563edf91 | b1026b5978c385328f2a15a2185c599a563edf91 | null | int FlateStream::getChar() {
if (pred) {
return pred->getChar();
}
return doGetRawChar();
}
| int FlateStream::getChar() {
if (pred) {
return pred->getChar();
}
return doGetRawChar();
}
| CPP | poppler | 0 |
CVE-2017-5009 | https://www.cvedetails.com/cve/CVE-2017-5009/ | CWE-119 | https://github.com/chromium/chromium/commit/1c40f9042ae2d6ee7483d72998aabb5e73b2ff60 | 1c40f9042ae2d6ee7483d72998aabb5e73b2ff60 | DevTools: send proper resource type in Network.RequestWillBeSent
This patch plumbs resoure type into the DispatchWillSendRequest
instrumenation. This allows us to report accurate type in
Network.RequestWillBeSent event, instead of "Other", that we report
today.
BUG=765501
R=dgozman
Change-Id: I0134c08b841e8dd247fdc8ff208bfd51e462709c
Reviewed-on: https://chromium-review.googlesource.com/667504
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507936} | std::unique_ptr<TracedValue> InspectorParseAuthorStyleSheetEvent::Data(
const CSSStyleSheetResource* cached_style_sheet) {
std::unique_ptr<TracedValue> value = TracedValue::Create();
value->SetString("styleSheetUrl", cached_style_sheet->Url().GetString());
return value;
}
| std::unique_ptr<TracedValue> InspectorParseAuthorStyleSheetEvent::Data(
const CSSStyleSheetResource* cached_style_sheet) {
std::unique_ptr<TracedValue> value = TracedValue::Create();
value->SetString("styleSheetUrl", cached_style_sheet->Url().GetString());
return value;
}
| C | Chrome | 0 |
CVE-2013-2168 | https://www.cvedetails.com/cve/CVE-2013-2168/ | CWE-20 | https://cgit.freedesktop.org/dbus/dbus/commit/?id=954d75b2b64e4799f360d2a6bf9cff6d9fee37e7 | 954d75b2b64e4799f360d2a6bf9cff6d9fee37e7 | null | _dbus_append_system_config_file (DBusString *str)
{
return _dbus_get_config_file_name(str, "system.conf");
}
| _dbus_append_system_config_file (DBusString *str)
{
return _dbus_get_config_file_name(str, "system.conf");
}
| C | dbus | 0 |
CVE-2013-2882 | https://www.cvedetails.com/cve/CVE-2013-2882/ | null | https://github.com/chromium/chromium/commit/dbbcd55a666ab8389d5d223994a95a59ad20dd13 | dbbcd55a666ab8389d5d223994a95a59ad20dd13 | Disable AutofillInteractiveTest.OnChangeAfterAutofill test.
Failing due to http://src.chromium.org/viewvc/blink?view=revision&revision=170278.
BUG=353691
TBR=isherman@chromium.org, dbeam@chromium.org
Review URL: https://codereview.chromium.org/216853002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260106 0039d316-1c4b-4281-b951-d872f2087c98 | virtual ~WindowedPersonalDataManagerObserver() {
if (infobar_service_) {
while (infobar_service_->infobar_count() > 0) {
infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0));
}
}
}
| virtual ~WindowedPersonalDataManagerObserver() {
if (infobar_service_) {
while (infobar_service_->infobar_count() > 0) {
infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0));
}
}
}
| C | Chrome | 0 |
CVE-2018-17206 | https://www.cvedetails.com/cve/CVE-2018-17206/ | null | https://github.com/openvswitch/ovs/commit/9237a63c47bd314b807cda0bd2216264e82edbe8 | 9237a63c47bd314b807cda0bd2216264e82edbe8 | ofp-actions: Avoid buffer overread in BUNDLE action decoding.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9052
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org> | decode_NXAST_RAW_SAMPLE(const struct nx_action_sample *nas,
enum ofp_version ofp_version OVS_UNUSED,
struct ofpbuf *out)
{
struct ofpact_sample *sample;
sample = ofpact_put_SAMPLE(out);
sample->ofpact.raw = NXAST_RAW_SAMPLE;
sample->probability = ntohs(nas->probability);
sample->collector_set_id = ntohl(nas->collector_set_id);
sample->obs_domain_id = ntohl(nas->obs_domain_id);
sample->obs_point_id = ntohl(nas->obs_point_id);
sample->sampling_port = OFPP_NONE;
sample->direction = NX_ACTION_SAMPLE_DEFAULT;
if (sample->probability == 0) {
return OFPERR_OFPBAC_BAD_ARGUMENT;
}
return 0;
}
| decode_NXAST_RAW_SAMPLE(const struct nx_action_sample *nas,
enum ofp_version ofp_version OVS_UNUSED,
struct ofpbuf *out)
{
struct ofpact_sample *sample;
sample = ofpact_put_SAMPLE(out);
sample->ofpact.raw = NXAST_RAW_SAMPLE;
sample->probability = ntohs(nas->probability);
sample->collector_set_id = ntohl(nas->collector_set_id);
sample->obs_domain_id = ntohl(nas->obs_domain_id);
sample->obs_point_id = ntohl(nas->obs_point_id);
sample->sampling_port = OFPP_NONE;
sample->direction = NX_ACTION_SAMPLE_DEFAULT;
if (sample->probability == 0) {
return OFPERR_OFPBAC_BAD_ARGUMENT;
}
return 0;
}
| C | ovs | 0 |
CVE-2015-3288 | https://www.cvedetails.com/cve/CVE-2015-3288/ | CWE-20 | https://github.com/torvalds/linux/commit/6b7339f4c31ad69c8e9c0b2859276e22cf72176d | 6b7339f4c31ad69c8e9c0b2859276e22cf72176d | mm: avoid setting up anonymous pages into file mapping
Reading page fault handler code I've noticed that under right
circumstances kernel would map anonymous pages into file mappings: if
the VMA doesn't have vm_ops->fault() and the VMA wasn't fully populated
on ->mmap(), kernel would handle page fault to not populated pte with
do_anonymous_page().
Let's change page fault handler to use do_anonymous_page() only on
anonymous VMA (->vm_ops == NULL) and make sure that the VMA is not
shared.
For file mappings without vm_ops->fault() or shred VMA without vm_ops,
page fault on pte_none() entry would lead to SIGBUS.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Willy Tarreau <w@1wt.eu>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | static unsigned long zap_pte_range(struct mmu_gather *tlb,
struct vm_area_struct *vma, pmd_t *pmd,
unsigned long addr, unsigned long end,
struct zap_details *details)
{
struct mm_struct *mm = tlb->mm;
int force_flush = 0;
int rss[NR_MM_COUNTERS];
spinlock_t *ptl;
pte_t *start_pte;
pte_t *pte;
swp_entry_t entry;
again:
init_rss_vec(rss);
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
pte = start_pte;
arch_enter_lazy_mmu_mode();
do {
pte_t ptent = *pte;
if (pte_none(ptent)) {
continue;
}
if (pte_present(ptent)) {
struct page *page;
page = vm_normal_page(vma, addr, ptent);
if (unlikely(details) && page) {
/*
* unmap_shared_mapping_pages() wants to
* invalidate cache without truncating:
* unmap shared but keep private pages.
*/
if (details->check_mapping &&
details->check_mapping != page->mapping)
continue;
}
ptent = ptep_get_and_clear_full(mm, addr, pte,
tlb->fullmm);
tlb_remove_tlb_entry(tlb, pte, addr);
if (unlikely(!page))
continue;
if (PageAnon(page))
rss[MM_ANONPAGES]--;
else {
if (pte_dirty(ptent)) {
force_flush = 1;
set_page_dirty(page);
}
if (pte_young(ptent) &&
likely(!(vma->vm_flags & VM_SEQ_READ)))
mark_page_accessed(page);
rss[MM_FILEPAGES]--;
}
page_remove_rmap(page);
if (unlikely(page_mapcount(page) < 0))
print_bad_pte(vma, addr, ptent, page);
if (unlikely(!__tlb_remove_page(tlb, page))) {
force_flush = 1;
addr += PAGE_SIZE;
break;
}
continue;
}
/* If details->check_mapping, we leave swap entries. */
if (unlikely(details))
continue;
entry = pte_to_swp_entry(ptent);
if (!non_swap_entry(entry))
rss[MM_SWAPENTS]--;
else if (is_migration_entry(entry)) {
struct page *page;
page = migration_entry_to_page(entry);
if (PageAnon(page))
rss[MM_ANONPAGES]--;
else
rss[MM_FILEPAGES]--;
}
if (unlikely(!free_swap_and_cache(entry)))
print_bad_pte(vma, addr, ptent, NULL);
pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
} while (pte++, addr += PAGE_SIZE, addr != end);
add_mm_rss_vec(mm, rss);
arch_leave_lazy_mmu_mode();
/* Do the actual TLB flush before dropping ptl */
if (force_flush)
tlb_flush_mmu_tlbonly(tlb);
pte_unmap_unlock(start_pte, ptl);
/*
* If we forced a TLB flush (either due to running out of
* batch buffers or because we needed to flush dirty TLB
* entries before releasing the ptl), free the batched
* memory too. Restart if we didn't do everything.
*/
if (force_flush) {
force_flush = 0;
tlb_flush_mmu_free(tlb);
if (addr != end)
goto again;
}
return addr;
}
| static unsigned long zap_pte_range(struct mmu_gather *tlb,
struct vm_area_struct *vma, pmd_t *pmd,
unsigned long addr, unsigned long end,
struct zap_details *details)
{
struct mm_struct *mm = tlb->mm;
int force_flush = 0;
int rss[NR_MM_COUNTERS];
spinlock_t *ptl;
pte_t *start_pte;
pte_t *pte;
swp_entry_t entry;
again:
init_rss_vec(rss);
start_pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
pte = start_pte;
arch_enter_lazy_mmu_mode();
do {
pte_t ptent = *pte;
if (pte_none(ptent)) {
continue;
}
if (pte_present(ptent)) {
struct page *page;
page = vm_normal_page(vma, addr, ptent);
if (unlikely(details) && page) {
/*
* unmap_shared_mapping_pages() wants to
* invalidate cache without truncating:
* unmap shared but keep private pages.
*/
if (details->check_mapping &&
details->check_mapping != page->mapping)
continue;
}
ptent = ptep_get_and_clear_full(mm, addr, pte,
tlb->fullmm);
tlb_remove_tlb_entry(tlb, pte, addr);
if (unlikely(!page))
continue;
if (PageAnon(page))
rss[MM_ANONPAGES]--;
else {
if (pte_dirty(ptent)) {
force_flush = 1;
set_page_dirty(page);
}
if (pte_young(ptent) &&
likely(!(vma->vm_flags & VM_SEQ_READ)))
mark_page_accessed(page);
rss[MM_FILEPAGES]--;
}
page_remove_rmap(page);
if (unlikely(page_mapcount(page) < 0))
print_bad_pte(vma, addr, ptent, page);
if (unlikely(!__tlb_remove_page(tlb, page))) {
force_flush = 1;
addr += PAGE_SIZE;
break;
}
continue;
}
/* If details->check_mapping, we leave swap entries. */
if (unlikely(details))
continue;
entry = pte_to_swp_entry(ptent);
if (!non_swap_entry(entry))
rss[MM_SWAPENTS]--;
else if (is_migration_entry(entry)) {
struct page *page;
page = migration_entry_to_page(entry);
if (PageAnon(page))
rss[MM_ANONPAGES]--;
else
rss[MM_FILEPAGES]--;
}
if (unlikely(!free_swap_and_cache(entry)))
print_bad_pte(vma, addr, ptent, NULL);
pte_clear_not_present_full(mm, addr, pte, tlb->fullmm);
} while (pte++, addr += PAGE_SIZE, addr != end);
add_mm_rss_vec(mm, rss);
arch_leave_lazy_mmu_mode();
/* Do the actual TLB flush before dropping ptl */
if (force_flush)
tlb_flush_mmu_tlbonly(tlb);
pte_unmap_unlock(start_pte, ptl);
/*
* If we forced a TLB flush (either due to running out of
* batch buffers or because we needed to flush dirty TLB
* entries before releasing the ptl), free the batched
* memory too. Restart if we didn't do everything.
*/
if (force_flush) {
force_flush = 0;
tlb_flush_mmu_free(tlb);
if (addr != end)
goto again;
}
return addr;
}
| C | linux | 0 |