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
CVE-2011-1019
https://www.cvedetails.com/cve/CVE-2011-1019/
CWE-264
https://github.com/torvalds/linux/commit/8909c9ad8ff03611c9c96c9a92656213e4bb495b
8909c9ad8ff03611c9c96c9a92656213e4bb495b
net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules Since a8f80e8ff94ecba629542d9b4b5f5a8ee3eb565c any process with CAP_NET_ADMIN may load any module from /lib/modules/. This doesn't mean that CAP_NET_ADMIN is a superset of CAP_SYS_MODULE as modules are limited to /lib/modules/**. However, CAP_NET_ADMIN capability shouldn't allow anybody load any module not related to networking. This patch restricts an ability of autoloading modules to netdev modules with explicit aliases. This fixes CVE-2011-1019. Arnd Bergmann suggested to leave untouched the old pre-v2.6.32 behavior of loading netdev modules by name (without any prefix) for processes with CAP_SYS_MODULE to maintain the compatibility with network scripts that use autoloading netdev modules by aliases like "eth0", "wlan0". Currently there are only three users of the feature in the upstream kernel: ipip, ip_gre and sit. root@albatros:~# capsh --drop=$(seq -s, 0 11),$(seq -s, 13 34) -- root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: fffffff800001000 CapEff: fffffff800001000 CapBnd: fffffff800001000 root@albatros:~# modprobe xfs FATAL: Error inserting xfs (/lib/modules/2.6.38-rc6-00001-g2bf4ca3/kernel/fs/xfs/xfs.ko): Operation not permitted root@albatros:~# lsmod | grep xfs root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit sit: error fetching interface information: Device not found root@albatros:~# lsmod | grep sit root@albatros:~# ifconfig sit0 sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 root@albatros:~# lsmod | grep sit sit 10457 0 tunnel4 2957 1 sit For CAP_SYS_MODULE module loading is still relaxed: root@albatros:~# grep Cap /proc/$$/status CapInh: 0000000000000000 CapPrm: ffffffffffffffff CapEff: ffffffffffffffff CapBnd: ffffffffffffffff root@albatros:~# ifconfig xfs xfs: error fetching interface information: Device not found root@albatros:~# lsmod | grep xfs xfs 745319 0 Reference: https://lkml.org/lkml/2011/2/24/203 Signed-off-by: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: James Morris <jmorris@namei.org>
static void ipip6_tunnel_bind_dev(struct net_device *dev) { struct net_device *tdev = NULL; struct ip_tunnel *tunnel; struct iphdr *iph; tunnel = netdev_priv(dev); iph = &tunnel->parms.iph; if (iph->daddr) { struct flowi fl = { .fl4_dst = iph->daddr, .fl4_src = iph->saddr, .fl4_tos = RT_TOS(iph->tos), .oif = tunnel->parms.link, .proto = IPPROTO_IPV6 }; struct rtable *rt; if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { tdev = rt->dst.dev; ip_rt_put(rt); } dev->flags |= IFF_POINTOPOINT; } if (!tdev && tunnel->parms.link) tdev = __dev_get_by_index(dev_net(dev), tunnel->parms.link); if (tdev) { dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr); dev->mtu = tdev->mtu - sizeof(struct iphdr); if (dev->mtu < IPV6_MIN_MTU) dev->mtu = IPV6_MIN_MTU; } dev->iflink = tunnel->parms.link; }
static void ipip6_tunnel_bind_dev(struct net_device *dev) { struct net_device *tdev = NULL; struct ip_tunnel *tunnel; struct iphdr *iph; tunnel = netdev_priv(dev); iph = &tunnel->parms.iph; if (iph->daddr) { struct flowi fl = { .fl4_dst = iph->daddr, .fl4_src = iph->saddr, .fl4_tos = RT_TOS(iph->tos), .oif = tunnel->parms.link, .proto = IPPROTO_IPV6 }; struct rtable *rt; if (!ip_route_output_key(dev_net(dev), &rt, &fl)) { tdev = rt->dst.dev; ip_rt_put(rt); } dev->flags |= IFF_POINTOPOINT; } if (!tdev && tunnel->parms.link) tdev = __dev_get_by_index(dev_net(dev), tunnel->parms.link); if (tdev) { dev->hard_header_len = tdev->hard_header_len + sizeof(struct iphdr); dev->mtu = tdev->mtu - sizeof(struct iphdr); if (dev->mtu < IPV6_MIN_MTU) dev->mtu = IPV6_MIN_MTU; } dev->iflink = tunnel->parms.link; }
C
linux
0
CVE-2019-5792
https://www.cvedetails.com/cve/CVE-2019-5792/
CWE-190
https://github.com/chromium/chromium/commit/227851d714bdc081de4c7e81669420380fa6c000
227851d714bdc081de4c7e81669420380fa6c000
arc: add test for blocking incognito windows in screenshot BUG=778852 TEST=ArcVoiceInteractionFrameworkServiceUnittest. CapturingScreenshotBlocksIncognitoWindows Change-Id: I0bfa5a486759783d7c8926a309c6b5da9b02dcc6 Reviewed-on: https://chromium-review.googlesource.com/914983 Commit-Queue: Muyuan Li <muyuanli@chromium.org> Reviewed-by: Luis Hector Chavez <lhchavez@chromium.org> Cr-Commit-Position: refs/heads/master@{#536438}
void CallHandleEnabledStateChange(bool enabled) { is_enabled_ = enabled; client_->HandleEnabledStateChange(enabled); }
void CallHandleEnabledStateChange(bool enabled) { is_enabled_ = enabled; client_->HandleEnabledStateChange(enabled); }
C
Chrome
0
CVE-2018-18349
https://www.cvedetails.com/cve/CVE-2018-18349/
CWE-732
https://github.com/chromium/chromium/commit/5f8671e7667b8b133bd3664100012a3906e92d65
5f8671e7667b8b133bd3664100012a3906e92d65
Add a check for disallowing remote frame navigations to local resources. Previously, RemoteFrame navigations did not perform any renderer-side checks and relied solely on the browser-side logic to block disallowed navigations via mechanisms like FilterURL. This means that blocked remote frame navigations were silently navigated to about:blank without any console error message. This CL adds a CanDisplay check to the remote navigation path to match an equivalent check done for local frame navigations. This way, the renderer can consistently block disallowed navigations in both cases and output an error message. Bug: 894399 Change-Id: I172f68f77c1676f6ca0172d2a6c78f7edc0e3b7a Reviewed-on: https://chromium-review.googlesource.com/c/1282390 Reviewed-by: Charlie Reis <creis@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Alex Moshchuk <alexmos@chromium.org> Cr-Commit-Position: refs/heads/master@{#601022}
void RemoteFrame::SetInheritedEffectiveTouchAction(TouchAction touch_action) { if (inherited_effective_touch_action_ != touch_action) Client()->SetInheritedEffectiveTouchAction(touch_action); inherited_effective_touch_action_ = touch_action; }
void RemoteFrame::SetInheritedEffectiveTouchAction(TouchAction touch_action) { if (inherited_effective_touch_action_ != touch_action) Client()->SetInheritedEffectiveTouchAction(touch_action); inherited_effective_touch_action_ = touch_action; }
C
Chrome
0
CVE-2015-1335
https://www.cvedetails.com/cve/CVE-2015-1335/
CWE-59
https://github.com/lxc/lxc/commit/592fd47a6245508b79fe6ac819fe6d3b2c1289be
592fd47a6245508b79fe6ac819fe6d3b2c1289be
CVE-2015-1335: Protect container mounts against symlinks When a container starts up, lxc sets up the container's inital fstree by doing a bunch of mounting, guided by the container configuration file. The container config is owned by the admin or user on the host, so we do not try to guard against bad entries. However, since the mount target is in the container, it's possible that the container admin could divert the mount with symbolic links. This could bypass proper container startup (i.e. confinement of a root-owned container by the restrictive apparmor policy, by diverting the required write to /proc/self/attr/current), or bypass the (path-based) apparmor policy by diverting, say, /proc to /mnt in the container. To prevent this, 1. do not allow mounts to paths containing symbolic links 2. do not allow bind mounts from relative paths containing symbolic links. Details: Define safe_mount which ensures that the container has not inserted any symbolic links into any mount targets for mounts to be done during container setup. The host's mount path may contain symbolic links. As it is under the control of the administrator, that's ok. So safe_mount begins the check for symbolic links after the rootfs->mount, by opening that directory. It opens each directory along the path using openat() relative to the parent directory using O_NOFOLLOW. When the target is reached, it mounts onto /proc/self/fd/<targetfd>. Use safe_mount() in mount_entry(), when mounting container proc, and when needed. In particular, safe_mount() need not be used in any case where: 1. the mount is done in the container's namespace 2. the mount is for the container's rootfs 3. the mount is relative to a tmpfs or proc/sysfs which we have just safe_mount()ed ourselves Since we were using proc/net as a temporary placeholder for /proc/sys/net during container startup, and proc/net is a symbolic link, use proc/tty instead. Update the lxc.container.conf manpage with details about the new restrictions. Finally, add a testcase to test some symbolic link possibilities. Reported-by: Roman Fiedler Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
static int cgm_get(const char *filename, char *value, size_t len, const char *name, const char *lxcpath) { pid_t pid; int p[2], ret, newlen, readlen; if (pipe(p) < 0) return -1; if ((pid = fork()) < 0) { close(p[0]); close(p[1]); return -1; } if (!pid) // do_cgm_get exits do_cgm_get(name, lxcpath, filename, p[1], len && value); close(p[1]); ret = read(p[0], &newlen, sizeof(newlen)); if (ret != sizeof(newlen)) { close(p[0]); ret = -1; goto out; } if (!len || !value) { close(p[0]); ret = newlen; goto out; } memset(value, 0, len); if (newlen < 0) { // child is reporting an error close(p[0]); ret = -1; goto out; } if (newlen == 0) { // empty read close(p[0]); ret = 0; goto out; } readlen = newlen > len ? len : newlen; ret = read(p[0], value, readlen); close(p[0]); if (ret != readlen) { ret = -1; goto out; } if (newlen >= len) { value[len-1] = '\0'; newlen = len-1; } else if (newlen+1 < len) { value[newlen++] = '\n'; value[newlen] = '\0'; } ret = newlen; out: if (wait_for_pid(pid)) WARN("do_cgm_get exited with error"); return ret; }
static int cgm_get(const char *filename, char *value, size_t len, const char *name, const char *lxcpath) { pid_t pid; int p[2], ret, newlen, readlen; if (pipe(p) < 0) return -1; if ((pid = fork()) < 0) { close(p[0]); close(p[1]); return -1; } if (!pid) // do_cgm_get exits do_cgm_get(name, lxcpath, filename, p[1], len && value); close(p[1]); ret = read(p[0], &newlen, sizeof(newlen)); if (ret != sizeof(newlen)) { close(p[0]); ret = -1; goto out; } if (!len || !value) { close(p[0]); ret = newlen; goto out; } memset(value, 0, len); if (newlen < 0) { // child is reporting an error close(p[0]); ret = -1; goto out; } if (newlen == 0) { // empty read close(p[0]); ret = 0; goto out; } readlen = newlen > len ? len : newlen; ret = read(p[0], value, readlen); close(p[0]); if (ret != readlen) { ret = -1; goto out; } if (newlen >= len) { value[len-1] = '\0'; newlen = len-1; } else if (newlen+1 < len) { value[newlen++] = '\n'; value[newlen] = '\0'; } ret = newlen; out: if (wait_for_pid(pid)) WARN("do_cgm_get exited with error"); return ret; }
C
lxc
0
CVE-2011-3088
https://www.cvedetails.com/cve/CVE-2011-3088/
CWE-119
https://github.com/chromium/chromium/commit/1dab554a7e795dac34313e2f7dbe4325628d12d4
1dab554a7e795dac34313e2f7dbe4325628d12d4
Lands http://codereview.chromium.org/9316065/ for Marja. I reviewed this, so I'm using TBR to land it. Don't crash if multiple SessionRestoreImpl:s refer to the same Profile. It shouldn't ever happen but it seems to happen anyway. BUG=111238 TEST=NONE TBR=sky@chromium.org R=marja@chromium.org Review URL: https://chromiumcodereview.appspot.com/9343005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120648 0039d316-1c4b-4281-b951-d872f2087c98
void RestoreForeignSession( std::vector<const SessionWindow*>::const_iterator begin, std::vector<const SessionWindow*>::const_iterator end) { StartTabCreation(); for (std::vector<const SessionWindow*>::const_iterator i = begin; i != end; ++i) { Browser* browser = CreateRestoredBrowser( static_cast<Browser::Type>((*i)->type), (*i)->bounds, (*i)->show_state); const int initial_tab_count = browser->tab_count(); int selected_tab_index = (*i)->selected_tab_index; RestoreTabsToBrowser(*(*i), browser, selected_tab_index); ShowBrowser(browser, initial_tab_count, selected_tab_index); tab_loader_->TabIsLoading( &browser->GetSelectedWebContents()->GetController()); NotifySessionServiceOfRestoredTabs(browser, initial_tab_count); } FinishedTabCreation(true, true); }
void RestoreForeignSession( std::vector<const SessionWindow*>::const_iterator begin, std::vector<const SessionWindow*>::const_iterator end) { StartTabCreation(); for (std::vector<const SessionWindow*>::const_iterator i = begin; i != end; ++i) { Browser* browser = CreateRestoredBrowser( static_cast<Browser::Type>((*i)->type), (*i)->bounds, (*i)->show_state); const int initial_tab_count = browser->tab_count(); int selected_tab_index = (*i)->selected_tab_index; RestoreTabsToBrowser(*(*i), browser, selected_tab_index); ShowBrowser(browser, initial_tab_count, selected_tab_index); tab_loader_->TabIsLoading( &browser->GetSelectedWebContents()->GetController()); NotifySessionServiceOfRestoredTabs(browser, initial_tab_count); } FinishedTabCreation(true, true); }
C
Chrome
0
CVE-2013-6626
https://www.cvedetails.com/cve/CVE-2013-6626/
null
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
90fb08ed0146c9beacfd4dde98a20fc45419fff3
Cancel JavaScript dialogs when an interstitial appears. BUG=295695 TEST=See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/24360011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98
void WebContentsImpl::OnOpenDateTimeDialog( const ViewHostMsg_DateTimeDialogValue_Params& value) { date_time_chooser_->ShowDialog(ContentViewCore::FromWebContents(this), GetRenderViewHost(), value.dialog_type, value.year, value.month, value.day, value.hour, value.minute, value.second, value.milli, value.week, value.minimum, value.maximum, value.step); }
void WebContentsImpl::OnOpenDateTimeDialog( const ViewHostMsg_DateTimeDialogValue_Params& value) { date_time_chooser_->ShowDialog(ContentViewCore::FromWebContents(this), GetRenderViewHost(), value.dialog_type, value.year, value.month, value.day, value.hour, value.minute, value.second, value.milli, value.week, value.minimum, value.maximum, value.step); }
C
Chrome
0
CVE-2017-5101
https://www.cvedetails.com/cve/CVE-2017-5101/
CWE-20
https://github.com/chromium/chromium/commit/29734f46c6dc9362783091180c2ee279ad53637f
29734f46c6dc9362783091180c2ee279ad53637f
media: remove base::SharedMemoryHandle usage in v4l2 encoder This replaces a use of the legacy UnalignedSharedMemory ctor taking a SharedMemoryHandle with the current ctor taking a PlatformSharedMemoryRegion. Bug: 849207 Change-Id: Iea24ebdcd941cf2fa97e19cf2aeac1a18f9773d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1697602 Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org> Reviewed-by: Ricky Liang <jcliang@chromium.org> Cr-Commit-Position: refs/heads/master@{#681740}
void V4L2JpegEncodeAccelerator::EncodeTaskLegacy( std::unique_ptr<JobRecord> job_record) { DCHECK(encoder_task_runner_->BelongsToCurrentThread()); if (!job_record->output_shm.MapAt(job_record->output_offset, job_record->output_shm.size())) { VPLOGF(1) << "could not map I420 bitstream_buffer"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (job_record->exif_shm && !job_record->exif_shm->MapAt(job_record->exif_offset, job_record->exif_shm->size())) { VPLOGF(1) << "could not map exif bitstream_buffer"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } gfx::Size coded_size = job_record->input_frame->coded_size(); if (latest_input_buffer_coded_size_legacy_ != coded_size || latest_quality_legacy_ != job_record->quality) { std::unique_ptr<EncodedInstance> encoded_device(new EncodedInstance(this)); VLOGF(1) << "Open Device for quality " << job_record->quality << ", width: " << coded_size.width() << ", height: " << coded_size.height(); if (!encoded_device->Initialize()) { VLOGF(1) << "Failed to initialize device"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (!encoded_device->SetUpJpegParameters(job_record->quality, coded_size)) { VLOGF(1) << "SetUpJpegParameters failed"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (!encoded_device->CreateBuffers(coded_size, job_record->output_shm.size())) { VLOGF(1) << "Create buffers failed."; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } latest_input_buffer_coded_size_legacy_ = coded_size; latest_quality_legacy_ = job_record->quality; encoded_instances_.push(std::move(encoded_device)); } encoded_instances_.back()->input_job_queue_.push(std::move(job_record)); ServiceDeviceTaskLegacy(); }
void V4L2JpegEncodeAccelerator::EncodeTaskLegacy( std::unique_ptr<JobRecord> job_record) { DCHECK(encoder_task_runner_->BelongsToCurrentThread()); if (!job_record->output_shm.MapAt(job_record->output_offset, job_record->output_shm.size())) { VPLOGF(1) << "could not map I420 bitstream_buffer"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (job_record->exif_shm && !job_record->exif_shm->MapAt(job_record->exif_offset, job_record->exif_shm->size())) { VPLOGF(1) << "could not map exif bitstream_buffer"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } gfx::Size coded_size = job_record->input_frame->coded_size(); if (latest_input_buffer_coded_size_legacy_ != coded_size || latest_quality_legacy_ != job_record->quality) { std::unique_ptr<EncodedInstance> encoded_device(new EncodedInstance(this)); VLOGF(1) << "Open Device for quality " << job_record->quality << ", width: " << coded_size.width() << ", height: " << coded_size.height(); if (!encoded_device->Initialize()) { VLOGF(1) << "Failed to initialize device"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (!encoded_device->SetUpJpegParameters(job_record->quality, coded_size)) { VLOGF(1) << "SetUpJpegParameters failed"; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } if (!encoded_device->CreateBuffers(coded_size, job_record->output_shm.size())) { VLOGF(1) << "Create buffers failed."; NotifyError(job_record->task_id, PLATFORM_FAILURE); return; } latest_input_buffer_coded_size_legacy_ = coded_size; latest_quality_legacy_ = job_record->quality; encoded_instances_.push(std::move(encoded_device)); } encoded_instances_.back()->input_job_queue_.push(std::move(job_record)); ServiceDeviceTaskLegacy(); }
C
Chrome
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 R=vollick@chromium.org Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void FrameView::addWidgetToUpdate(RenderEmbeddedObject& object) { ASSERT(isInPerformLayout()); Node* node = object.node(); ASSERT(node); if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); m_widgetUpdateSet.add(&object); }
void FrameView::addWidgetToUpdate(RenderEmbeddedObject& object) { ASSERT(isInPerformLayout()); Node* node = object.node(); ASSERT(node); if (isHTMLObjectElement(*node) || isHTMLEmbedElement(*node)) toHTMLPlugInElement(node)->setNeedsWidgetUpdate(true); m_widgetUpdateSet.add(&object); }
C
Chrome
0
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::PluginDestroyed() { if (window_) WillDestroyWindow(); #if defined(OS_MACOSX) render_view_->UnregisterPluginDelegate(this); #endif if (channel_host_) { Send(new PluginMsg_DestroyInstance(instance_id_)); channel_host_->RemoveRoute(instance_id_); channel_host_ = NULL; } if (window_script_object_) { window_script_object_->OnPluginDestroyed(); } plugin_ = NULL; MessageLoop::current()->DeleteSoon(FROM_HERE, this); }
void WebPluginDelegateProxy::PluginDestroyed() { if (window_) WillDestroyWindow(); #if defined(OS_MACOSX) render_view_->UnregisterPluginDelegate(this); #endif if (channel_host_) { Send(new PluginMsg_DestroyInstance(instance_id_)); channel_host_->RemoveRoute(instance_id_); channel_host_ = NULL; } if (window_script_object_) { window_script_object_->OnPluginDestroyed(); } plugin_ = NULL; MessageLoop::current()->DeleteSoon(FROM_HERE, this); }
C
Chrome
0
CVE-2015-9016
https://www.cvedetails.com/cve/CVE-2015-9016/
CWE-362
https://github.com/torvalds/linux/commit/0048b4837affd153897ed1222283492070027aa9
0048b4837affd153897ed1222283492070027aa9
blk-mq: fix race between timeout and freeing request Inside timeout handler, blk_mq_tag_to_rq() is called to retrieve the request from one tag. This way is obviously wrong because the request can be freed any time and some fiedds of the request can't be trusted, then kernel oops might be triggered[1]. Currently wrt. blk_mq_tag_to_rq(), the only special case is that the flush request can share same tag with the request cloned from, and the two requests can't be active at the same time, so this patch fixes the above issue by updating tags->rqs[tag] with the active request(either flush rq or the request cloned from) of the tag. Also blk_mq_tag_to_rq() gets much simplified with this patch. Given blk_mq_tag_to_rq() is mainly for drivers and the caller must make sure the request can't be freed, so in bt_for_each() this helper is replaced with tags->rqs[tag]. [1] kernel oops log [ 439.696220] BUG: unable to handle kernel NULL pointer dereference at 0000000000000158^M [ 439.697162] IP: [<ffffffff812d89ba>] blk_mq_tag_to_rq+0x21/0x6e^M [ 439.700653] PGD 7ef765067 PUD 7ef764067 PMD 0 ^M [ 439.700653] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC ^M [ 439.700653] Dumping ftrace buffer:^M [ 439.700653] (ftrace buffer empty)^M [ 439.700653] Modules linked in: nbd ipv6 kvm_intel kvm serio_raw^M [ 439.700653] CPU: 6 PID: 2779 Comm: stress-ng-sigfd Not tainted 4.2.0-rc5-next-20150805+ #265^M [ 439.730500] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011^M [ 439.730500] task: ffff880605308000 ti: ffff88060530c000 task.ti: ffff88060530c000^M [ 439.730500] RIP: 0010:[<ffffffff812d89ba>] [<ffffffff812d89ba>] blk_mq_tag_to_rq+0x21/0x6e^M [ 439.730500] RSP: 0018:ffff880819203da0 EFLAGS: 00010283^M [ 439.730500] RAX: ffff880811b0e000 RBX: ffff8800bb465f00 RCX: 0000000000000002^M [ 439.730500] RDX: 0000000000000000 RSI: 0000000000000202 RDI: 0000000000000000^M [ 439.730500] RBP: ffff880819203db0 R08: 0000000000000002 R09: 0000000000000000^M [ 439.730500] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000202^M [ 439.730500] R13: ffff880814104800 R14: 0000000000000002 R15: ffff880811a2ea00^M [ 439.730500] FS: 00007f165b3f5740(0000) GS:ffff880819200000(0000) knlGS:0000000000000000^M [ 439.730500] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b^M [ 439.730500] CR2: 0000000000000158 CR3: 00000007ef766000 CR4: 00000000000006e0^M [ 439.730500] Stack:^M [ 439.730500] 0000000000000008 ffff8808114eed90 ffff880819203e00 ffffffff812dc104^M [ 439.755663] ffff880819203e40 ffffffff812d9f5e 0000020000000000 ffff8808114eed80^M [ 439.755663] Call Trace:^M [ 439.755663] <IRQ> ^M [ 439.755663] [<ffffffff812dc104>] bt_for_each+0x6e/0xc8^M [ 439.755663] [<ffffffff812d9f5e>] ? blk_mq_rq_timed_out+0x6a/0x6a^M [ 439.755663] [<ffffffff812d9f5e>] ? blk_mq_rq_timed_out+0x6a/0x6a^M [ 439.755663] [<ffffffff812dc1b3>] blk_mq_tag_busy_iter+0x55/0x5e^M [ 439.755663] [<ffffffff812d88b4>] ? blk_mq_bio_to_request+0x38/0x38^M [ 439.755663] [<ffffffff812d8911>] blk_mq_rq_timer+0x5d/0xd4^M [ 439.755663] [<ffffffff810a3e10>] call_timer_fn+0xf7/0x284^M [ 439.755663] [<ffffffff810a3d1e>] ? call_timer_fn+0x5/0x284^M [ 439.755663] [<ffffffff812d88b4>] ? blk_mq_bio_to_request+0x38/0x38^M [ 439.755663] [<ffffffff810a46d6>] run_timer_softirq+0x1ce/0x1f8^M [ 439.755663] [<ffffffff8104c367>] __do_softirq+0x181/0x3a4^M [ 439.755663] [<ffffffff8104c76e>] irq_exit+0x40/0x94^M [ 439.755663] [<ffffffff81031482>] smp_apic_timer_interrupt+0x33/0x3e^M [ 439.755663] [<ffffffff815559a4>] apic_timer_interrupt+0x84/0x90^M [ 439.755663] <EOI> ^M [ 439.755663] [<ffffffff81554350>] ? _raw_spin_unlock_irq+0x32/0x4a^M [ 439.755663] [<ffffffff8106a98b>] finish_task_switch+0xe0/0x163^M [ 439.755663] [<ffffffff8106a94d>] ? finish_task_switch+0xa2/0x163^M [ 439.755663] [<ffffffff81550066>] __schedule+0x469/0x6cd^M [ 439.755663] [<ffffffff8155039b>] schedule+0x82/0x9a^M [ 439.789267] [<ffffffff8119b28b>] signalfd_read+0x186/0x49a^M [ 439.790911] [<ffffffff8106d86a>] ? wake_up_q+0x47/0x47^M [ 439.790911] [<ffffffff811618c2>] __vfs_read+0x28/0x9f^M [ 439.790911] [<ffffffff8117a289>] ? __fget_light+0x4d/0x74^M [ 439.790911] [<ffffffff811620a7>] vfs_read+0x7a/0xc6^M [ 439.790911] [<ffffffff8116292b>] SyS_read+0x49/0x7f^M [ 439.790911] [<ffffffff81554c17>] entry_SYSCALL_64_fastpath+0x12/0x6f^M [ 439.790911] Code: 48 89 e5 e8 a9 b8 e7 ff 5d c3 0f 1f 44 00 00 55 89 f2 48 89 e5 41 54 41 89 f4 53 48 8b 47 60 48 8b 1c d0 48 8b 7b 30 48 8b 53 38 <48> 8b 87 58 01 00 00 48 85 c0 75 09 48 8b 97 88 0c 00 00 eb 10 ^M [ 439.790911] RIP [<ffffffff812d89ba>] blk_mq_tag_to_rq+0x21/0x6e^M [ 439.790911] RSP <ffff880819203da0>^M [ 439.790911] CR2: 0000000000000158^M [ 439.790911] ---[ end trace d40af58949325661 ]---^M Cc: <stable@vger.kernel.org> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
static void blk_mq_free_hw_queues(struct request_queue *q, struct blk_mq_tag_set *set) { struct blk_mq_hw_ctx *hctx; unsigned int i; queue_for_each_hw_ctx(q, hctx, i) free_cpumask_var(hctx->cpumask); }
static void blk_mq_free_hw_queues(struct request_queue *q, struct blk_mq_tag_set *set) { struct blk_mq_hw_ctx *hctx; unsigned int i; queue_for_each_hw_ctx(q, hctx, i) free_cpumask_var(hctx->cpumask); }
C
linux
0
CVE-2017-12187
https://www.cvedetails.com/cve/CVE-2017-12187/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit/?id=cad5a1050b7184d828aef9c1dd151c3ab649d37e
cad5a1050b7184d828aef9c1dd151c3ab649d37e
null
AddFragment(struct xorg_list *frags, int bytes) { FragmentList *f = malloc(sizeof(FragmentList) + bytes); if (!f) { return NULL; } else { f->bytes = bytes; xorg_list_add(&f->l, frags->prev); return (char*) f + sizeof(*f); } }
AddFragment(struct xorg_list *frags, int bytes) { FragmentList *f = malloc(sizeof(FragmentList) + bytes); if (!f) { return NULL; } else { f->bytes = bytes; xorg_list_add(&f->l, frags->prev); return (char*) f + sizeof(*f); } }
C
xserver
0
CVE-2013-0892
https://www.cvedetails.com/cve/CVE-2013-0892/
null
https://github.com/chromium/chromium/commit/0ab5fab4939150bd0f30ada8a4bf6eb0f69d66c1
0ab5fab4939150bd0f30ada8a4bf6eb0f69d66c1
Sizes going across an IPC should be uint32. BUG=164946 Review URL: https://chromiumcodereview.appspot.com/11472038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171944 0039d316-1c4b-4281-b951-d872f2087c98
void GpuCommandBufferStub::Destroy() { if (handle_.is_null() && !active_url_.is_empty()) { GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); gpu_channel_manager->Send(new GpuHostMsg_DidDestroyOffscreenContext( active_url_)); } GetMemoryManager()->RemoveClient(this); while (!sync_points_.empty()) OnRetireSyncPoint(sync_points_.front()); scheduler_.reset(); while (!delayed_echos_.empty()) { delete delayed_echos_.front(); delayed_echos_.pop_front(); } bool have_context = false; if (decoder_.get()) have_context = decoder_->MakeCurrent(); FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_, OnWillDestroyStub(this)); scoped_refptr<gfx::GLContext> context; if (decoder_.get()) { context = decoder_->GetGLContext(); decoder_->Destroy(have_context); decoder_.reset(); } command_buffer_.reset(); if (context) context->MakeCurrent(surface_.get()); surface_ = NULL; if (context) context->ReleaseCurrent(NULL); }
void GpuCommandBufferStub::Destroy() { if (handle_.is_null() && !active_url_.is_empty()) { GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); gpu_channel_manager->Send(new GpuHostMsg_DidDestroyOffscreenContext( active_url_)); } GetMemoryManager()->RemoveClient(this); while (!sync_points_.empty()) OnRetireSyncPoint(sync_points_.front()); scheduler_.reset(); while (!delayed_echos_.empty()) { delete delayed_echos_.front(); delayed_echos_.pop_front(); } bool have_context = false; if (decoder_.get()) have_context = decoder_->MakeCurrent(); FOR_EACH_OBSERVER(DestructionObserver, destruction_observers_, OnWillDestroyStub(this)); scoped_refptr<gfx::GLContext> context; if (decoder_.get()) { context = decoder_->GetGLContext(); decoder_->Destroy(have_context); decoder_.reset(); } command_buffer_.reset(); if (context) context->MakeCurrent(surface_.get()); surface_ = NULL; if (context) context->ReleaseCurrent(NULL); }
C
Chrome
0
CVE-2016-1621
https://www.cvedetails.com/cve/CVE-2016-1621/
CWE-119
https://android.googlesource.com/platform/external/libvpx/+/04839626ed859623901ebd3a5fd483982186b59d
04839626ed859623901ebd3a5fd483982186b59d
libwebm: Pull from upstream Rolling mkvparser from upstream. Primarily for fixing a bug on parsing failures with certain Opus WebM files. Upstream commit hash of this pull: 574045edd4ecbeb802ee3f1d214b5510269852ae The diff is so huge because there were some style clean ups upstream. But it was ensured that there were no breaking changes when the style clean ups was done upstream. Change-Id: Ib6e907175484b4b0ae1b55ab39522ea3188ad039
long Tracks::ParseTrackEntry(
long Tracks::ParseTrackEntry( long long track_start, long long track_size, long long element_start, long long element_size, Track*& pResult) const { if (pResult) return -1; IMkvReader* const pReader = m_pSegment->m_pReader; long long pos = track_start; const long long track_stop = track_start + track_size; Track::Info info; info.type = 0; info.number = 0; info.uid = 0; info.defaultDuration = 0; Track::Settings v; v.start = -1; v.size = -1; Track::Settings a; a.start = -1; a.size = -1; Track::Settings e; //content_encodings_settings; e.start = -1; e.size = -1; long long lacing = 1; //default is true while (pos < track_stop) { long long id, size; const long status = ParseElementHeader( pReader, pos, track_stop, id, size); if (status < 0) //error return status; if (size < 0) return E_FILE_FORMAT_INVALID; const long long start = pos; if (id == 0x60) // VideoSettings ID { v.start = start; v.size = size; } else if (id == 0x61) // AudioSettings ID { a.start = start; a.size = size; } else if (id == 0x2D80) // ContentEncodings ID { e.start = start; e.size = size; } else if (id == 0x33C5) //Track UID { if (size > 8) return E_FILE_FORMAT_INVALID; info.uid = 0; long long pos_ = start; const long long pos_end = start + size; while (pos_ != pos_end) { unsigned char b; const int status = pReader->Read(pos_, 1, &b); if (status) return status; info.uid <<= 8; info.uid |= b; ++pos_; } } else if (id == 0x57) //Track Number { const long long num = UnserializeUInt(pReader, pos, size); if ((num <= 0) || (num > 127)) return E_FILE_FORMAT_INVALID; info.number = static_cast<long>(num); } else if (id == 0x03) //Track Type { const long long type = UnserializeUInt(pReader, pos, size); if ((type <= 0) || (type > 254)) return E_FILE_FORMAT_INVALID; info.type = static_cast<long>(type); } else if (id == 0x136E) //Track Name { const long status = UnserializeString( pReader, pos, size, info.nameAsUTF8); if (status) return status; } else if (id == 0x02B59C) //Track Language { const long status = UnserializeString( pReader, pos, size, info.language); if (status) return status; } else if (id == 0x03E383) //Default Duration { const long long duration = UnserializeUInt(pReader, pos, size); if (duration < 0) return E_FILE_FORMAT_INVALID; info.defaultDuration = static_cast<unsigned long long>(duration); } else if (id == 0x06) //CodecID { const long status = UnserializeString( pReader, pos, size, info.codecId); if (status) return status; } else if (id == 0x1C) //lacing { lacing = UnserializeUInt(pReader, pos, size); if ((lacing < 0) || (lacing > 1)) return E_FILE_FORMAT_INVALID; } else if (id == 0x23A2) //Codec Private { delete[] info.codecPrivate; info.codecPrivate = NULL; info.codecPrivateSize = 0; const size_t buflen = static_cast<size_t>(size); if (buflen) { typedef unsigned char* buf_t; const buf_t buf = new (std::nothrow) unsigned char[buflen]; if (buf == NULL) return -1; const int status = pReader->Read(pos, buflen, buf); if (status) { delete[] buf; return status; } info.codecPrivate = buf; info.codecPrivateSize = buflen; } } else if (id == 0x058688) //Codec Name { const long status = UnserializeString( pReader, pos, size, info.codecNameAsUTF8); if (status) return status; } else if (id == 0x16AA) //Codec Delay { info.codecDelay = UnserializeUInt(pReader, pos, size); } else if (id == 0x16BB) //Seek Pre Roll { info.seekPreRoll = UnserializeUInt(pReader, pos, size); } pos += size; //consume payload assert(pos <= track_stop); } assert(pos == track_stop); if (info.number <= 0) //not specified return E_FILE_FORMAT_INVALID; if (GetTrackByNumber(info.number)) return E_FILE_FORMAT_INVALID; if (info.type <= 0) //not specified return E_FILE_FORMAT_INVALID; info.lacing = (lacing > 0) ? true : false; if (info.type == Track::kVideo) { if (v.start < 0) return E_FILE_FORMAT_INVALID; if (a.start >= 0) return E_FILE_FORMAT_INVALID; info.settings = v; VideoTrack* pTrack = NULL; const long status = VideoTrack::Parse(m_pSegment, info, element_start, element_size, pTrack); if (status) return status; pResult = pTrack; assert(pResult); if (e.start >= 0) pResult->ParseContentEncodingsEntry(e.start, e.size); } else if (info.type == Track::kAudio) { if (a.start < 0) return E_FILE_FORMAT_INVALID; if (v.start >= 0) return E_FILE_FORMAT_INVALID; info.settings = a; AudioTrack* pTrack = NULL; const long status = AudioTrack::Parse(m_pSegment, info, element_start, element_size, pTrack); if (status) return status; pResult = pTrack; assert(pResult); if (e.start >= 0) pResult->ParseContentEncodingsEntry(e.start, e.size); } else { if (a.start >= 0) return E_FILE_FORMAT_INVALID; if (v.start >= 0) return E_FILE_FORMAT_INVALID; if (e.start >= 0) return E_FILE_FORMAT_INVALID; info.settings.start = -1; info.settings.size = 0; Track* pTrack = NULL; const long status = Track::Create(m_pSegment, info, element_start, element_size, pTrack); if (status) return status; pResult = pTrack; assert(pResult); } return 0; //success }
C
Android
1
CVE-2016-10267
https://www.cvedetails.com/cve/CVE-2016-10267/
CWE-369
https://github.com/vadz/libtiff/commit/43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec
43bc256d8ae44b92d2734a3c5bc73957a4d7c1ec
* libtiff/tif_ojpeg.c: make OJPEGDecode() early exit in case of failure in OJPEGPreDecode(). This will avoid a divide by zero, and potential other issues. Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2611
OJPEGLibjpegJpegSourceMgrInitSource(jpeg_decompress_struct* cinfo) { (void)cinfo; }
OJPEGLibjpegJpegSourceMgrInitSource(jpeg_decompress_struct* cinfo) { (void)cinfo; }
C
libtiff
0
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
double AudioMixerAlsa::GetVolumeDb() { base::AutoLock lock(lock_); return volume_db_; }
double AudioMixerAlsa::GetVolumeDb() { base::AutoLock lock(lock_); return volume_db_; }
C
Chrome
0
CVE-2017-8072
https://www.cvedetails.com/cve/CVE-2017-8072/
CWE-388
https://github.com/torvalds/linux/commit/8e9faa15469ed7c7467423db4c62aeed3ff4cae3
8e9faa15469ed7c7467423db4c62aeed3ff4cae3
HID: cp2112: fix gpio-callback error handling In case of a zero-length report, the gpio direction_input callback would currently return success instead of an errno. Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable") Cc: stable <stable@vger.kernel.org> # 4.9 Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
static int cp2112_get_usb_config(struct hid_device *hdev, struct cp2112_usb_config_report *cfg) { int ret; ret = cp2112_hid_get(hdev, CP2112_USB_CONFIG, (u8 *)cfg, sizeof(*cfg), HID_FEATURE_REPORT); if (ret != sizeof(*cfg)) { hid_err(hdev, "error reading usb config: %d\n", ret); if (ret < 0) return ret; return -EIO; } return 0; }
static int cp2112_get_usb_config(struct hid_device *hdev, struct cp2112_usb_config_report *cfg) { int ret; ret = cp2112_hid_get(hdev, CP2112_USB_CONFIG, (u8 *)cfg, sizeof(*cfg), HID_FEATURE_REPORT); if (ret != sizeof(*cfg)) { hid_err(hdev, "error reading usb config: %d\n", ret); if (ret < 0) return ret; return -EIO; } return 0; }
C
linux
0
CVE-2016-3839
https://www.cvedetails.com/cve/CVE-2016-3839/
CWE-284
https://android.googlesource.com/platform/system/bt/+/472271b153c5dc53c28beac55480a8d8434b2d5c
472271b153c5dc53c28beac55480a8d8434b2d5c
DO NOT MERGE Fix potential DoS caused by delivering signal to BT process Bug: 28885210 Change-Id: I63866d894bfca47464d6e42e3fb0357c4f94d360 Conflicts: btif/co/bta_hh_co.c btif/src/btif_core.c Merge conflict resolution of ag/1161415 (referencing ag/1164670) - Directly into mnc-mr2-release
static inline void uipc_wakeup_locked(void) { char sig_on = 1; BTIF_TRACE_EVENT("UIPC SEND WAKE UP"); TEMP_FAILURE_RETRY(send(uipc_main.signal_fds[1], &sig_on, sizeof(sig_on), 0)); }
static inline void uipc_wakeup_locked(void) { char sig_on = 1; BTIF_TRACE_EVENT("UIPC SEND WAKE UP"); send(uipc_main.signal_fds[1], &sig_on, sizeof(sig_on), 0); }
C
Android
1
CVE-2016-7912
https://www.cvedetails.com/cve/CVE-2016-7912/
CWE-416
https://github.com/torvalds/linux/commit/38740a5b87d53ceb89eb2c970150f6e94e00373a
38740a5b87d53ceb89eb2c970150f6e94e00373a
usb: gadget: f_fs: Fix use-after-free When using asynchronous read or write operations on the USB endpoints the issuer of the IO request is notified by calling the ki_complete() callback of the submitted kiocb when the URB has been completed. Calling this ki_complete() callback will free kiocb. Make sure that the structure is no longer accessed beyond that point, otherwise undefined behaviour might occur. Fixes: 2e4c7553cd6f ("usb: gadget: f_fs: add aio support") Cc: <stable@vger.kernel.org> # v3.15+ Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) { struct ffs_io_data io_data, *p = &io_data; ssize_t res; ENTER(); if (!is_sync_kiocb(kiocb)) { p = kmalloc(sizeof(io_data), GFP_KERNEL); if (unlikely(!p)) return -ENOMEM; p->aio = true; } else { p->aio = false; } p->read = true; p->kiocb = kiocb; if (p->aio) { p->to_free = dup_iter(&p->data, to, GFP_KERNEL); if (!p->to_free) { kfree(p); return -ENOMEM; } } else { p->data = *to; p->to_free = NULL; } p->mm = current->mm; kiocb->private = p; if (p->aio) kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED) return res; if (p->aio) { kfree(p->to_free); kfree(p); } else { *to = p->data; } return res; }
static ssize_t ffs_epfile_read_iter(struct kiocb *kiocb, struct iov_iter *to) { struct ffs_io_data io_data, *p = &io_data; ssize_t res; ENTER(); if (!is_sync_kiocb(kiocb)) { p = kmalloc(sizeof(io_data), GFP_KERNEL); if (unlikely(!p)) return -ENOMEM; p->aio = true; } else { p->aio = false; } p->read = true; p->kiocb = kiocb; if (p->aio) { p->to_free = dup_iter(&p->data, to, GFP_KERNEL); if (!p->to_free) { kfree(p); return -ENOMEM; } } else { p->data = *to; p->to_free = NULL; } p->mm = current->mm; kiocb->private = p; if (p->aio) kiocb_set_cancel_fn(kiocb, ffs_aio_cancel); res = ffs_epfile_io(kiocb->ki_filp, p); if (res == -EIOCBQUEUED) return res; if (p->aio) { kfree(p->to_free); kfree(p); } else { *to = p->data; } return res; }
C
linux
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::FileSystemAdded( const DevToolsFileHelper::FileSystem& file_system) { std::unique_ptr<base::DictionaryValue> file_system_value( CreateFileSystemValue(file_system)); CallClientFunction("DevToolsAPI.fileSystemAdded", file_system_value.get(), NULL, NULL); }
void DevToolsUIBindings::FileSystemAdded( const DevToolsFileHelper::FileSystem& file_system) { std::unique_ptr<base::DictionaryValue> file_system_value( CreateFileSystemValue(file_system)); CallClientFunction("DevToolsAPI.fileSystemAdded", file_system_value.get(), NULL, NULL); }
C
Chrome
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}
int WorkerFetchContext::ApplicationCacheHostID() const { return web_context_->ApplicationCacheHostID(); }
int WorkerFetchContext::ApplicationCacheHostID() const { return web_context_->ApplicationCacheHostID(); }
C
Chrome
0
CVE-2017-9203
https://www.cvedetails.com/cve/CVE-2017-9203/
CWE-787
https://github.com/jsummers/imageworsener/commit/a4f247707f08e322f0b41e82c3e06e224240a654
a4f247707f08e322f0b41e82c3e06e224240a654
Fixed a bug that could cause invalid memory to be accessed The bug could happen when transparency is removed from an image. Also fixed a semi-related BMP error handling logic bug. Fixes issue #21
static void decide_how_to_apply_bkgd(struct iw_context *ctx) { if(!IW_IMGTYPE_HAS_ALPHA(ctx->img1_imgtype_logical)) { ctx->apply_bkgd=0; return; } if(ctx->img1_bkgd_label_set && (ctx->req.use_bkgd_label_from_file || !ctx->req.bkgd_valid)) { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_FILE; } else if(ctx->req.bkgd_valid) { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_REQ; ctx->bkgd_checkerboard = ctx->req.bkgd_checkerboard; } else { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_NONE; } if(ctx->bkgd_checkerboard) { if(ctx->bkgd_check_size<1) ctx->bkgd_check_size=1; } if(ctx->req.bkgd_valid) { ctx->apply_bkgd=1; } if(!(ctx->output_profile&IW_PROFILE_TRANSPARENCY)) { if(!ctx->req.bkgd_valid && !ctx->apply_bkgd) { iw_warning(ctx,"This image may have transparency, which is incompatible with the output format. A background color will be applied."); } ctx->apply_bkgd=1; } if(ctx->resize_settings[IW_DIMENSION_H].use_offset || ctx->resize_settings[IW_DIMENSION_V].use_offset) { if(!ctx->req.bkgd_valid && !ctx->apply_bkgd) { iw_warning(ctx,"This image may have transparency, which is incompatible with a channel offset. A background color will be applied."); } ctx->apply_bkgd=1; if(ctx->bkgd_checkerboard && ctx->req.bkgd_checkerboard) { iw_warning(ctx,"Checkerboard backgrounds are not supported when using a channel offset."); ctx->bkgd_checkerboard=0; } ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_EARLY; return; } if(!ctx->apply_bkgd) { return; } if(ctx->bkgd_checkerboard) { ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_LATE; return; } ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_LATE; }
static void decide_how_to_apply_bkgd(struct iw_context *ctx) { if(!IW_IMGTYPE_HAS_ALPHA(ctx->img1_imgtype_logical)) { ctx->apply_bkgd=0; return; } if(ctx->img1_bkgd_label_set && (ctx->req.use_bkgd_label_from_file || !ctx->req.bkgd_valid)) { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_FILE; } else if(ctx->req.bkgd_valid) { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_REQ; ctx->bkgd_checkerboard = ctx->req.bkgd_checkerboard; } else { ctx->bkgd_color_source = IW_BKGD_COLOR_SOURCE_NONE; } if(ctx->bkgd_checkerboard) { if(ctx->bkgd_check_size<1) ctx->bkgd_check_size=1; } if(ctx->req.bkgd_valid) { ctx->apply_bkgd=1; } if(!(ctx->output_profile&IW_PROFILE_TRANSPARENCY)) { if(!ctx->req.bkgd_valid && !ctx->apply_bkgd) { iw_warning(ctx,"This image may have transparency, which is incompatible with the output format. A background color will be applied."); } ctx->apply_bkgd=1; } if(ctx->resize_settings[IW_DIMENSION_H].use_offset || ctx->resize_settings[IW_DIMENSION_V].use_offset) { if(!ctx->req.bkgd_valid && !ctx->apply_bkgd) { iw_warning(ctx,"This image may have transparency, which is incompatible with a channel offset. A background color will be applied."); } ctx->apply_bkgd=1; if(ctx->bkgd_checkerboard && ctx->req.bkgd_checkerboard) { iw_warning(ctx,"Checkerboard backgrounds are not supported when using a channel offset."); ctx->bkgd_checkerboard=0; } ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_EARLY; return; } if(!ctx->apply_bkgd) { return; } if(ctx->bkgd_checkerboard) { ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_LATE; return; } ctx->apply_bkgd_strategy=IW_BKGD_STRATEGY_LATE; }
C
imageworsener
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 __exit void hardware_unsetup(void) { free_kvm_area(); }
static __exit void hardware_unsetup(void) { free_kvm_area(); }
C
linux
0
CVE-2012-3552
https://www.cvedetails.com/cve/CVE-2012-3552/
CWE-362
https://github.com/torvalds/linux/commit/f6d8bd051c391c1c0458a30b2a7abcd939329259
f6d8bd051c391c1c0458a30b2a7abcd939329259
inet: add RCU protection to inet->opt We lack proper synchronization to manipulate inet->opt ip_options Problem is ip_make_skb() calls ip_setup_cork() and ip_setup_cork() possibly makes a copy of ipc->opt (struct ip_options), without any protection against another thread manipulating inet->opt. Another thread can change inet->opt pointer and free old one under us. Use RCU to protect inet->opt (changed to inet->inet_opt). Instead of handling atomic refcounts, just copy ip_options when necessary, to avoid cache line dirtying. We cant insert an rcu_head in struct ip_options since its included in skb->cb[], so this patch is large because I had to introduce a new ip_options_rcu structure. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
int compat_ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { int err; if (level != SOL_IP) return -ENOPROTOOPT; if (optname >= MCAST_JOIN_GROUP && optname <= MCAST_MSFILTER) return compat_mc_setsockopt(sk, level, optname, optval, optlen, ip_setsockopt); err = do_ip_setsockopt(sk, level, optname, optval, optlen); #ifdef CONFIG_NETFILTER /* we need to exclude all possible ENOPROTOOPTs except default case */ if (err == -ENOPROTOOPT && optname != IP_HDRINCL && optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY && !ip_mroute_opt(optname)) { lock_sock(sk); err = compat_nf_setsockopt(sk, PF_INET, optname, optval, optlen); release_sock(sk); } #endif return err; }
int compat_ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, unsigned int optlen) { int err; if (level != SOL_IP) return -ENOPROTOOPT; if (optname >= MCAST_JOIN_GROUP && optname <= MCAST_MSFILTER) return compat_mc_setsockopt(sk, level, optname, optval, optlen, ip_setsockopt); err = do_ip_setsockopt(sk, level, optname, optval, optlen); #ifdef CONFIG_NETFILTER /* we need to exclude all possible ENOPROTOOPTs except default case */ if (err == -ENOPROTOOPT && optname != IP_HDRINCL && optname != IP_IPSEC_POLICY && optname != IP_XFRM_POLICY && !ip_mroute_opt(optname)) { lock_sock(sk); err = compat_nf_setsockopt(sk, PF_INET, optname, optval, optlen); release_sock(sk); } #endif return err; }
C
linux
0
CVE-2015-8816
https://www.cvedetails.com/cve/CVE-2015-8816/
null
https://github.com/torvalds/linux/commit/e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
e50293ef9775c5f1cf3fcc093037dd6a8c5684ea
USB: fix invalid memory access in hub_activate() Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit failed to take a reference to the usb_hub structure or to lock the hub interface while doing so. As a result, if a hub is plugged in and quickly unplugged before the work routine can run, the routine will try to access memory that has been deallocated. Or, if the hub is unplugged while the routine is running, the memory may be deallocated while it is in active use. This patch fixes the problem by taking a reference to the usb_hub at the start of hub_activate() and releasing it at the end (when the work is finished), and by locking the hub interface while the work routine is running. It also adds a check at the start of the routine to see if the hub has already been disconnected, in which nothing should be done. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Alexandru Cornea <alexandru.cornea@intel.com> Tested-by: Alexandru Cornea <alexandru.cornea@intel.com> Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void usb_set_lpm_mel(struct usb_device *udev, struct usb3_lpm_parameters *udev_lpm_params, unsigned int udev_exit_latency, struct usb_hub *hub, struct usb3_lpm_parameters *hub_lpm_params, unsigned int hub_exit_latency) { unsigned int total_mel; unsigned int device_mel; unsigned int hub_mel; /* * Calculate the time it takes to transition all links from the roothub * to the parent hub into U0. The parent hub must then decode the * packet (hub header decode latency) to figure out which port it was * bound for. * * The Hub Header decode latency is expressed in 0.1us intervals (0x1 * means 0.1us). Multiply that by 100 to get nanoseconds. */ total_mel = hub_lpm_params->mel + (hub->descriptor->u.ss.bHubHdrDecLat * 100); /* * How long will it take to transition the downstream hub's port into * U0? The greater of either the hub exit latency or the device exit * latency. * * The BOS U1/U2 exit latencies are expressed in 1us intervals. * Multiply that by 1000 to get nanoseconds. */ device_mel = udev_exit_latency * 1000; hub_mel = hub_exit_latency * 1000; if (device_mel > hub_mel) total_mel += device_mel; else total_mel += hub_mel; udev_lpm_params->mel = total_mel; }
static void usb_set_lpm_mel(struct usb_device *udev, struct usb3_lpm_parameters *udev_lpm_params, unsigned int udev_exit_latency, struct usb_hub *hub, struct usb3_lpm_parameters *hub_lpm_params, unsigned int hub_exit_latency) { unsigned int total_mel; unsigned int device_mel; unsigned int hub_mel; /* * Calculate the time it takes to transition all links from the roothub * to the parent hub into U0. The parent hub must then decode the * packet (hub header decode latency) to figure out which port it was * bound for. * * The Hub Header decode latency is expressed in 0.1us intervals (0x1 * means 0.1us). Multiply that by 100 to get nanoseconds. */ total_mel = hub_lpm_params->mel + (hub->descriptor->u.ss.bHubHdrDecLat * 100); /* * How long will it take to transition the downstream hub's port into * U0? The greater of either the hub exit latency or the device exit * latency. * * The BOS U1/U2 exit latencies are expressed in 1us intervals. * Multiply that by 1000 to get nanoseconds. */ device_mel = udev_exit_latency * 1000; hub_mel = hub_exit_latency * 1000; if (device_mel > hub_mel) total_mel += device_mel; else total_mel += hub_mel; udev_lpm_params->mel = total_mel; }
C
linux
0
CVE-2011-3108
https://www.cvedetails.com/cve/CVE-2011-3108/
CWE-399
https://github.com/chromium/chromium/commit/9f4633c617ef393ba4709cba7d8fa23101b64025
9f4633c617ef393ba4709cba7d8fa23101b64025
Http cache: Test deleting an entry with a pending_entry when adding the truncated flag. BUG=125159 TEST=net_unittests Review URL: https://chromiumcodereview.appspot.com/10356113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139331 0039d316-1c4b-4281-b951-d872f2087c98
void RunTransactionTestWithResponse(net::HttpCache* cache, const MockTransaction& trans_info, std::string* response_headers) { net::HttpResponseInfo response; RunTransactionTestWithResponseInfo(cache, trans_info, &response); response.headers->GetNormalizedHeaders(response_headers); }
void RunTransactionTestWithResponse(net::HttpCache* cache, const MockTransaction& trans_info, std::string* response_headers) { net::HttpResponseInfo response; RunTransactionTestWithResponseInfo(cache, trans_info, &response); response.headers->GetNormalizedHeaders(response_headers); }
C
Chrome
0
CVE-2014-3122
https://www.cvedetails.com/cve/CVE-2014-3122/
CWE-264
https://github.com/torvalds/linux/commit/57e68e9cd65b4b8eb4045a1e0d0746458502554c
57e68e9cd65b4b8eb4045a1e0d0746458502554c
mm: try_to_unmap_cluster() should lock_page() before mlocking A BUG_ON(!PageLocked) was triggered in mlock_vma_page() by Sasha Levin fuzzing with trinity. The call site try_to_unmap_cluster() does not lock the pages other than its check_page parameter (which is already locked). The BUG_ON in mlock_vma_page() is not documented and its purpose is somewhat unclear, but apparently it serializes against page migration, which could otherwise fail to transfer the PG_mlocked flag. This would not be fatal, as the page would be eventually encountered again, but NR_MLOCK accounting would become distorted nevertheless. This patch adds a comment to the BUG_ON in mlock_vma_page() and munlock_vma_page() to that effect. The call site try_to_unmap_cluster() is fixed so that for page != check_page, trylock_page() is attempted (to avoid possible deadlocks as we already have check_page locked) and mlock_vma_page() is performed only upon success. If the page lock cannot be obtained, the page is left without PG_mlocked, which is again not a problem in the whole unevictable memory design. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Bob Liu <bob.liu@oracle.com> Reported-by: Sasha Levin <sasha.levin@oracle.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Michel Lespinasse <walken@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Acked-by: Rik van Riel <riel@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) { struct anon_vma_chain *avc; struct anon_vma *anon_vma; /* Don't bother if the parent process has no anon_vma here. */ if (!pvma->anon_vma) return 0; /* * First, attach the new VMA to the parent VMA's anon_vmas, * so rmap can find non-COWed pages in child processes. */ if (anon_vma_clone(vma, pvma)) return -ENOMEM; /* Then add our own anon_vma. */ anon_vma = anon_vma_alloc(); if (!anon_vma) goto out_error; avc = anon_vma_chain_alloc(GFP_KERNEL); if (!avc) goto out_error_free_anon_vma; /* * The root anon_vma's spinlock is the lock actually used when we * lock any of the anon_vmas in this anon_vma tree. */ anon_vma->root = pvma->anon_vma->root; /* * With refcounts, an anon_vma can stay around longer than the * process it belongs to. The root anon_vma needs to be pinned until * this anon_vma is freed, because the lock lives in the root. */ get_anon_vma(anon_vma->root); /* Mark this anon_vma as the one where our new (COWed) pages go. */ vma->anon_vma = anon_vma; anon_vma_lock_write(anon_vma); anon_vma_chain_link(vma, avc, anon_vma); anon_vma_unlock_write(anon_vma); return 0; out_error_free_anon_vma: put_anon_vma(anon_vma); out_error: unlink_anon_vmas(vma); return -ENOMEM; }
int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) { struct anon_vma_chain *avc; struct anon_vma *anon_vma; /* Don't bother if the parent process has no anon_vma here. */ if (!pvma->anon_vma) return 0; /* * First, attach the new VMA to the parent VMA's anon_vmas, * so rmap can find non-COWed pages in child processes. */ if (anon_vma_clone(vma, pvma)) return -ENOMEM; /* Then add our own anon_vma. */ anon_vma = anon_vma_alloc(); if (!anon_vma) goto out_error; avc = anon_vma_chain_alloc(GFP_KERNEL); if (!avc) goto out_error_free_anon_vma; /* * The root anon_vma's spinlock is the lock actually used when we * lock any of the anon_vmas in this anon_vma tree. */ anon_vma->root = pvma->anon_vma->root; /* * With refcounts, an anon_vma can stay around longer than the * process it belongs to. The root anon_vma needs to be pinned until * this anon_vma is freed, because the lock lives in the root. */ get_anon_vma(anon_vma->root); /* Mark this anon_vma as the one where our new (COWed) pages go. */ vma->anon_vma = anon_vma; anon_vma_lock_write(anon_vma); anon_vma_chain_link(vma, avc, anon_vma); anon_vma_unlock_write(anon_vma); return 0; out_error_free_anon_vma: put_anon_vma(anon_vma); out_error: unlink_anon_vmas(vma); return -ENOMEM; }
C
linux
0
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
void SetupForTesting() { need_paint_update_ = false; }
void SetupForTesting() { need_paint_update_ = false; }
C
Chrome
0
CVE-2016-6787
https://www.cvedetails.com/cve/CVE-2016-6787/
CWE-264
https://github.com/torvalds/linux/commit/f63a8daa5812afef4f06c962351687e1ff9ccb2b
f63a8daa5812afef4f06c962351687e1ff9ccb2b
perf: Fix event->ctx locking There have been a few reported issues wrt. the lack of locking around changing event->ctx. This patch tries to address those. It avoids the whole rwsem thing; and while it appears to work, please give it some thought in review. What I did fail at is sensible runtime checks on the use of event->ctx, the RCU use makes it very hard. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20150123125834.209535886@infradead.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) { int ctxn; for_each_task_context_nr(ctxn) perf_event_context_sched_out(task, ctxn, next); /* * if cgroup events exist on this CPU, then we need * to check if we have to switch out PMU state. * cgroup event are system-wide mode only */ if (atomic_read(this_cpu_ptr(&perf_cgroup_events))) perf_cgroup_sched_out(task, next); }
void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) { int ctxn; for_each_task_context_nr(ctxn) perf_event_context_sched_out(task, ctxn, next); /* * if cgroup events exist on this CPU, then we need * to check if we have to switch out PMU state. * cgroup event are system-wide mode only */ if (atomic_read(this_cpu_ptr(&perf_cgroup_events))) perf_cgroup_sched_out(task, next); }
C
linux
0
CVE-2016-9685
https://www.cvedetails.com/cve/CVE-2016-9685/
CWE-400
https://github.com/torvalds/linux/commit/2e83b79b2d6c78bf1b4aa227938a214dcbddc83f
2e83b79b2d6c78bf1b4aa227938a214dcbddc83f
xfs: fix two memory leaks in xfs_attr_list.c error paths This plugs 2 trivial leaks in xfs_attr_shortform_list and xfs_attr3_leaf_list_int. Signed-off-by: Mateusz Guzik <mguzik@redhat.com> Cc: <stable@vger.kernel.org> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
xfs_attr_node_list(xfs_attr_list_context_t *context) { attrlist_cursor_kern_t *cursor; xfs_attr_leafblock_t *leaf; xfs_da_intnode_t *node; struct xfs_attr3_icleaf_hdr leafhdr; struct xfs_da3_icnode_hdr nodehdr; struct xfs_da_node_entry *btree; int error, i; struct xfs_buf *bp; struct xfs_inode *dp = context->dp; struct xfs_mount *mp = dp->i_mount; trace_xfs_attr_node_list(context); cursor = context->cursor; cursor->initted = 1; /* * Do all sorts of validation on the passed-in cursor structure. * If anything is amiss, ignore the cursor and look up the hashval * starting from the btree root. */ bp = NULL; if (cursor->blkno > 0) { error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1, &bp, XFS_ATTR_FORK); if ((error != 0) && (error != -EFSCORRUPTED)) return error; if (bp) { struct xfs_attr_leaf_entry *entries; node = bp->b_addr; switch (be16_to_cpu(node->hdr.info.magic)) { case XFS_DA_NODE_MAGIC: case XFS_DA3_NODE_MAGIC: trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; break; case XFS_ATTR_LEAF_MAGIC: case XFS_ATTR3_LEAF_MAGIC: leaf = bp->b_addr; xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); entries = xfs_attr3_leaf_entryp(leaf); if (cursor->hashval > be32_to_cpu( entries[leafhdr.count - 1].hashval)) { trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } else if (cursor->hashval <= be32_to_cpu( entries[0].hashval)) { trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } break; default: trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } } } /* * We did not find what we expected given the cursor's contents, * so we start from the top and work down based on the hash value. * Note that start of node block is same as start of leaf block. */ if (bp == NULL) { cursor->blkno = 0; for (;;) { __uint16_t magic; error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1, &bp, XFS_ATTR_FORK); if (error) return error; node = bp->b_addr; magic = be16_to_cpu(node->hdr.info.magic); if (magic == XFS_ATTR_LEAF_MAGIC || magic == XFS_ATTR3_LEAF_MAGIC) break; if (magic != XFS_DA_NODE_MAGIC && magic != XFS_DA3_NODE_MAGIC) { XFS_CORRUPTION_ERROR("xfs_attr_node_list(3)", XFS_ERRLEVEL_LOW, context->dp->i_mount, node); xfs_trans_brelse(NULL, bp); return -EFSCORRUPTED; } dp->d_ops->node_hdr_from_disk(&nodehdr, node); btree = dp->d_ops->node_tree_p(node); for (i = 0; i < nodehdr.count; btree++, i++) { if (cursor->hashval <= be32_to_cpu(btree->hashval)) { cursor->blkno = be32_to_cpu(btree->before); trace_xfs_attr_list_node_descend(context, btree); break; } } if (i == nodehdr.count) { xfs_trans_brelse(NULL, bp); return 0; } xfs_trans_brelse(NULL, bp); } } ASSERT(bp != NULL); /* * Roll upward through the blocks, processing each leaf block in * order. As long as there is space in the result buffer, keep * adding the information. */ for (;;) { leaf = bp->b_addr; error = xfs_attr3_leaf_list_int(bp, context); if (error) { xfs_trans_brelse(NULL, bp); return error; } xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); if (context->seen_enough || leafhdr.forw == 0) break; cursor->blkno = leafhdr.forw; xfs_trans_brelse(NULL, bp); error = xfs_attr3_leaf_read(NULL, dp, cursor->blkno, -1, &bp); if (error) return error; } xfs_trans_brelse(NULL, bp); return 0; }
xfs_attr_node_list(xfs_attr_list_context_t *context) { attrlist_cursor_kern_t *cursor; xfs_attr_leafblock_t *leaf; xfs_da_intnode_t *node; struct xfs_attr3_icleaf_hdr leafhdr; struct xfs_da3_icnode_hdr nodehdr; struct xfs_da_node_entry *btree; int error, i; struct xfs_buf *bp; struct xfs_inode *dp = context->dp; struct xfs_mount *mp = dp->i_mount; trace_xfs_attr_node_list(context); cursor = context->cursor; cursor->initted = 1; /* * Do all sorts of validation on the passed-in cursor structure. * If anything is amiss, ignore the cursor and look up the hashval * starting from the btree root. */ bp = NULL; if (cursor->blkno > 0) { error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1, &bp, XFS_ATTR_FORK); if ((error != 0) && (error != -EFSCORRUPTED)) return error; if (bp) { struct xfs_attr_leaf_entry *entries; node = bp->b_addr; switch (be16_to_cpu(node->hdr.info.magic)) { case XFS_DA_NODE_MAGIC: case XFS_DA3_NODE_MAGIC: trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; break; case XFS_ATTR_LEAF_MAGIC: case XFS_ATTR3_LEAF_MAGIC: leaf = bp->b_addr; xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); entries = xfs_attr3_leaf_entryp(leaf); if (cursor->hashval > be32_to_cpu( entries[leafhdr.count - 1].hashval)) { trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } else if (cursor->hashval <= be32_to_cpu( entries[0].hashval)) { trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } break; default: trace_xfs_attr_list_wrong_blk(context); xfs_trans_brelse(NULL, bp); bp = NULL; } } } /* * We did not find what we expected given the cursor's contents, * so we start from the top and work down based on the hash value. * Note that start of node block is same as start of leaf block. */ if (bp == NULL) { cursor->blkno = 0; for (;;) { __uint16_t magic; error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1, &bp, XFS_ATTR_FORK); if (error) return error; node = bp->b_addr; magic = be16_to_cpu(node->hdr.info.magic); if (magic == XFS_ATTR_LEAF_MAGIC || magic == XFS_ATTR3_LEAF_MAGIC) break; if (magic != XFS_DA_NODE_MAGIC && magic != XFS_DA3_NODE_MAGIC) { XFS_CORRUPTION_ERROR("xfs_attr_node_list(3)", XFS_ERRLEVEL_LOW, context->dp->i_mount, node); xfs_trans_brelse(NULL, bp); return -EFSCORRUPTED; } dp->d_ops->node_hdr_from_disk(&nodehdr, node); btree = dp->d_ops->node_tree_p(node); for (i = 0; i < nodehdr.count; btree++, i++) { if (cursor->hashval <= be32_to_cpu(btree->hashval)) { cursor->blkno = be32_to_cpu(btree->before); trace_xfs_attr_list_node_descend(context, btree); break; } } if (i == nodehdr.count) { xfs_trans_brelse(NULL, bp); return 0; } xfs_trans_brelse(NULL, bp); } } ASSERT(bp != NULL); /* * Roll upward through the blocks, processing each leaf block in * order. As long as there is space in the result buffer, keep * adding the information. */ for (;;) { leaf = bp->b_addr; error = xfs_attr3_leaf_list_int(bp, context); if (error) { xfs_trans_brelse(NULL, bp); return error; } xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); if (context->seen_enough || leafhdr.forw == 0) break; cursor->blkno = leafhdr.forw; xfs_trans_brelse(NULL, bp); error = xfs_attr3_leaf_read(NULL, dp, cursor->blkno, -1, &bp); if (error) return error; } xfs_trans_brelse(NULL, bp); return 0; }
C
linux
0
CVE-2017-5056
https://www.cvedetails.com/cve/CVE-2017-5056/
CWE-125
https://github.com/chromium/chromium/commit/2ad6b02cbf13d8f9dce50340e966ba413cb66b1c
2ad6b02cbf13d8f9dce50340e966ba413cb66b1c
ime-service: Delete InputEngine.ProcessText. It is deprecated and no longer used. Bug: 1009903 Change-Id: I6774a4506bd0bb41a5d1a5909a40a2a781564b16 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1833029 Auto-Submit: Darren Shen <shend@chromium.org> Reviewed-by: Chris Palmer <palmer@chromium.org> Reviewed-by: Keith Lee <keithlee@chromium.org> Reviewed-by: Shu Chen <shuchen@chromium.org> Commit-Queue: Darren Shen <shend@chromium.org> Cr-Commit-Position: refs/heads/master@{#705445}
InputEngine::InputEngine() {}
InputEngine::InputEngine() {}
C
Chrome
0
CVE-2014-1700
https://www.cvedetails.com/cve/CVE-2014-1700/
CWE-399
https://github.com/chromium/chromium/commit/d926098e2e2be270c80a5ba25ab8a611b80b8556
d926098e2e2be270c80a5ba25ab8a611b80b8556
Connect WebUSB client interface to the devices app This provides a basic WebUSB client interface in content/renderer. Most of the interface is unimplemented, but this CL hooks up navigator.usb.getDevices() to the browser's Mojo devices app to enumerate available USB devices. BUG=492204 Review URL: https://codereview.chromium.org/1293253002 Cr-Commit-Position: refs/heads/master@{#344881}
void RenderFrameImpl::didDisownOpener(blink::WebLocalFrame* frame) { DCHECK(!frame_ || frame_ == frame); if (is_swapped_out_ || frame->parent()) return; Send(new FrameHostMsg_DidDisownOpener(routing_id_)); }
void RenderFrameImpl::didDisownOpener(blink::WebLocalFrame* frame) { DCHECK(!frame_ || frame_ == frame); if (is_swapped_out_ || frame->parent()) return; Send(new FrameHostMsg_DidDisownOpener(routing_id_)); }
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 ...
static void grace_ender(struct work_struct *grace) { struct delayed_work *dwork = to_delayed_work(grace); struct lockd_net *ln = container_of(dwork, struct lockd_net, grace_period_end); locks_end_grace(&ln->lockd_manager); }
static void grace_ender(struct work_struct *grace) { struct delayed_work *dwork = to_delayed_work(grace); struct lockd_net *ln = container_of(dwork, struct lockd_net, grace_period_end); locks_end_grace(&ln->lockd_manager); }
C
linux
0
CVE-2016-2550
https://www.cvedetails.com/cve/CVE-2016-2550/
CWE-399
https://github.com/torvalds/linux/commit/415e3d3e90ce9e18727e8843ae343eda5a58fad6
415e3d3e90ce9e18727e8843ae343eda5a58fad6
unix: correctly track in-flight fds in sending process user_struct The commit referenced in the Fixes tag incorrectly accounted the number of in-flight fds over a unix domain socket to the original opener of the file-descriptor. This allows another process to arbitrary deplete the original file-openers resource limit for the maximum of open files. Instead the sending processes and its struct cred should be credited. To do so, we add a reference counted struct user_struct pointer to the scm_fp_list and use it to account for the number of inflight unix fds. Fixes: 712f4aad406bb1 ("unix: properly account for FDs passed over unix sockets") Reported-by: David Herrmann <dh.herrmann@gmail.com> Cc: David Herrmann <dh.herrmann@gmail.com> Cc: Willy Tarreau <w@1wt.eu> Cc: Linus Torvalds <torvalds@linux-foundation.org> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
static unsigned int unix_dgram_poll(struct file *file, struct socket *sock, poll_table *wait) { struct sock *sk = sock->sk, *other; unsigned int mask, writable; sock_poll_wait(file, sk_sleep(sk), wait); mask = 0; /* exceptional events? */ if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) mask |= POLLERR | (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); if (sk->sk_shutdown & RCV_SHUTDOWN) mask |= POLLRDHUP | POLLIN | POLLRDNORM; if (sk->sk_shutdown == SHUTDOWN_MASK) mask |= POLLHUP; /* readable? */ if (!skb_queue_empty(&sk->sk_receive_queue)) mask |= POLLIN | POLLRDNORM; /* Connection-based need to check for termination and startup */ if (sk->sk_type == SOCK_SEQPACKET) { if (sk->sk_state == TCP_CLOSE) mask |= POLLHUP; /* connection hasn't started yet? */ if (sk->sk_state == TCP_SYN_SENT) return mask; } /* No write status requested, avoid expensive OUT tests. */ if (!(poll_requested_events(wait) & (POLLWRBAND|POLLWRNORM|POLLOUT))) return mask; writable = unix_writable(sk); if (writable) { unix_state_lock(sk); other = unix_peer(sk); if (other && unix_peer(other) != sk && unix_recvq_full(other) && unix_dgram_peer_wake_me(sk, other)) writable = 0; unix_state_unlock(sk); } if (writable) mask |= POLLOUT | POLLWRNORM | POLLWRBAND; else sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); return mask; }
static unsigned int unix_dgram_poll(struct file *file, struct socket *sock, poll_table *wait) { struct sock *sk = sock->sk, *other; unsigned int mask, writable; sock_poll_wait(file, sk_sleep(sk), wait); mask = 0; /* exceptional events? */ if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) mask |= POLLERR | (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); if (sk->sk_shutdown & RCV_SHUTDOWN) mask |= POLLRDHUP | POLLIN | POLLRDNORM; if (sk->sk_shutdown == SHUTDOWN_MASK) mask |= POLLHUP; /* readable? */ if (!skb_queue_empty(&sk->sk_receive_queue)) mask |= POLLIN | POLLRDNORM; /* Connection-based need to check for termination and startup */ if (sk->sk_type == SOCK_SEQPACKET) { if (sk->sk_state == TCP_CLOSE) mask |= POLLHUP; /* connection hasn't started yet? */ if (sk->sk_state == TCP_SYN_SENT) return mask; } /* No write status requested, avoid expensive OUT tests. */ if (!(poll_requested_events(wait) & (POLLWRBAND|POLLWRNORM|POLLOUT))) return mask; writable = unix_writable(sk); if (writable) { unix_state_lock(sk); other = unix_peer(sk); if (other && unix_peer(other) != sk && unix_recvq_full(other) && unix_dgram_peer_wake_me(sk, other)) writable = 0; unix_state_unlock(sk); } if (writable) mask |= POLLOUT | POLLWRNORM | POLLWRBAND; else sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); return mask; }
C
linux
0
CVE-2018-9507
https://www.cvedetails.com/cve/CVE-2018-9507/
CWE-125
https://android.googlesource.com/platform/system/bt/+/30cec963095366536ca0b1306089154e09bfe1a9
30cec963095366536ca0b1306089154e09bfe1a9
Check packet length in bta_av_proc_meta_cmd Bug: 111893951 Test: manual - connect A2DP Change-Id: Ibbf347863dfd29ea3385312e9dde1082bc90d2f3 (cherry picked from commit ed51887f921263219bcd2fbf6650ead5ec8d334e)
void bta_av_rc_browse_opened(tBTA_AV_DATA* p_data) { tBTA_AV_CB* p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG* p_msg = (tBTA_AV_RC_CONN_CHG*)p_data; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; LOG_INFO(LOG_TAG, "%s: peer_addr: %s rc_handle:%d", __func__, p_msg->peer_addr.ToString().c_str(), p_msg->handle); rc_browse_open.status = BTA_AV_SUCCESS; rc_browse_open.rc_handle = p_msg->handle; rc_browse_open.peer_addr = p_msg->peer_addr; tBTA_AV bta_av_data; bta_av_data.rc_browse_open = rc_browse_open; (*p_cb->p_cback)(BTA_AV_RC_BROWSE_OPEN_EVT, &bta_av_data); }
void bta_av_rc_browse_opened(tBTA_AV_DATA* p_data) { tBTA_AV_CB* p_cb = &bta_av_cb; tBTA_AV_RC_CONN_CHG* p_msg = (tBTA_AV_RC_CONN_CHG*)p_data; tBTA_AV_RC_BROWSE_OPEN rc_browse_open; LOG_INFO(LOG_TAG, "%s: peer_addr: %s rc_handle:%d", __func__, p_msg->peer_addr.ToString().c_str(), p_msg->handle); rc_browse_open.status = BTA_AV_SUCCESS; rc_browse_open.rc_handle = p_msg->handle; rc_browse_open.peer_addr = p_msg->peer_addr; tBTA_AV bta_av_data; bta_av_data.rc_browse_open = rc_browse_open; (*p_cb->p_cback)(BTA_AV_RC_BROWSE_OPEN_EVT, &bta_av_data); }
C
Android
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
void stri_del(GF_Box *s) { GF_SubTrackInformationBox *ptr = (GF_SubTrackInformationBox *)s; if (ptr == NULL) return; if (ptr->attribute_list) gf_free(ptr->attribute_list); gf_free(ptr); }
void stri_del(GF_Box *s) { GF_SubTrackInformationBox *ptr = (GF_SubTrackInformationBox *)s; if (ptr == NULL) return; if (ptr->attribute_list) gf_free(ptr->attribute_list); gf_free(ptr); }
C
gpac
0
CVE-2016-2108
https://www.cvedetails.com/cve/CVE-2016-2108/
CWE-119
https://git.openssl.org/?p=openssl.git;a=commit;h=f5da52e308a6aeea6d5f3df98c4da295d7e9cc27
f5da52e308a6aeea6d5f3df98c4da295d7e9cc27
null
int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) { return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF); }
int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) { return asn1_item_flags_i2d(val, out, it, ASN1_TFLG_NDEF); }
C
openssl
0
CVE-2018-16435
https://www.cvedetails.com/cve/CVE-2018-16435/
CWE-190
https://github.com/mm2/Little-CMS/commit/768f70ca405cd3159d990e962d54456773bb8cf8
768f70ca405cd3159d990e962d54456773bb8cf8
Upgrade Visual studio 2017 15.8 - Upgrade to 15.8 - Add check on CGATS memory allocation (thanks to Quang Nguyen for pointing out this)
cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsHANDLE hIT8, int row, int col) { const char* Buffer; Buffer = cmsIT8GetDataRowCol(hIT8, row, col); if (Buffer == NULL) return 0.0; return ParseFloatNumber(Buffer); }
cmsFloat64Number CMSEXPORT cmsIT8GetDataRowColDbl(cmsHANDLE hIT8, int row, int col) { const char* Buffer; Buffer = cmsIT8GetDataRowCol(hIT8, row, col); if (Buffer == NULL) return 0.0; return ParseFloatNumber(Buffer); }
C
Little-CMS
0
CVE-2016-5170
https://www.cvedetails.com/cve/CVE-2016-5170/
CWE-416
https://github.com/chromium/chromium/commit/c3957448cfc6e299165196a33cd954b790875fdb
c3957448cfc6e299165196a33cd954b790875fdb
Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this issue. This got cleaned up in: https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 so that focus is no longer applied after layout. +Cleanup: Goto considered harmful Bug: 795381 Change-Id: Ifeb4d2e03e872fd48cca6720b1d4de36ad1ecbb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524417 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#641101}
DocumentParser* Document::ImplicitOpen( ParserSynchronizationPolicy parser_sync_policy) { RemoveChildren(); DCHECK(!focused_element_); SetCompatibilityMode(kNoQuirksMode); if (!ThreadedParsingEnabledForTesting()) { parser_sync_policy = kForceSynchronousParsing; } else if (parser_sync_policy == kAllowAsynchronousParsing && IsPrefetchOnly()) { parser_sync_policy = kForceSynchronousParsing; } DetachParser(); parser_sync_policy_ = parser_sync_policy; parser_ = CreateParser(); DocumentParserTiming::From(*this).MarkParserStart(); SetParsingState(kParsing); SetReadyState(kLoading); if (load_event_progress_ != kLoadEventInProgress && PageDismissalEventBeingDispatched() == kNoDismissal) { load_event_progress_ = kLoadEventNotRun; } return parser_; }
DocumentParser* Document::ImplicitOpen( ParserSynchronizationPolicy parser_sync_policy) { RemoveChildren(); DCHECK(!focused_element_); SetCompatibilityMode(kNoQuirksMode); if (!ThreadedParsingEnabledForTesting()) { parser_sync_policy = kForceSynchronousParsing; } else if (parser_sync_policy == kAllowAsynchronousParsing && IsPrefetchOnly()) { parser_sync_policy = kForceSynchronousParsing; } DetachParser(); parser_sync_policy_ = parser_sync_policy; parser_ = CreateParser(); DocumentParserTiming::From(*this).MarkParserStart(); SetParsingState(kParsing); SetReadyState(kLoading); if (load_event_progress_ != kLoadEventInProgress && PageDismissalEventBeingDispatched() == kNoDismissal) { load_event_progress_ = kLoadEventNotRun; } return parser_; }
C
Chrome
0
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.
static int jp2_ftyp_putdata(jp2_box_t *box, jas_stream_t *out) { jp2_ftyp_t *ftyp = &box->data.ftyp; unsigned int i; if (jp2_putuint32(out, ftyp->majver) || jp2_putuint32(out, ftyp->minver)) { return -1; } for (i = 0; i < ftyp->numcompatcodes; ++i) { if (jp2_putuint32(out, ftyp->compatcodes[i])) { return -1; } } return 0; }
static int jp2_ftyp_putdata(jp2_box_t *box, jas_stream_t *out) { jp2_ftyp_t *ftyp = &box->data.ftyp; unsigned int i; if (jp2_putuint32(out, ftyp->majver) || jp2_putuint32(out, ftyp->minver)) { return -1; } for (i = 0; i < ftyp->numcompatcodes; ++i) { if (jp2_putuint32(out, ftyp->compatcodes[i])) { return -1; } } return 0; }
C
jasper
0
CVE-2018-16080
https://www.cvedetails.com/cve/CVE-2018-16080/
CWE-20
https://github.com/chromium/chromium/commit/c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
c552cd7b8a0862f6b3c8c6a07f98bda3721101eb
Mac: turn popups into new tabs while in fullscreen. It's platform convention to show popups as new tabs while in non-HTML5 fullscreen. (Popups cause tabs to lose HTML5 fullscreen.) This was implemented for Cocoa in a BrowserWindow override, but it makes sense to just stick it into Browser and remove a ton of override code put in just to support this. BUG=858929, 868416 TEST=as in bugs Change-Id: I43471f242813ec1159d9c690bab73dab3e610b7d Reviewed-on: https://chromium-review.googlesource.com/1153455 Reviewed-by: Sidney San Martín <sdy@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#578755}
bool BrowserView::IsToolbarVisible() const { if (immersive_mode_controller_->ShouldHideTopViews()) return false; return (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) && toolbar_; }
bool BrowserView::IsToolbarVisible() const { if (immersive_mode_controller_->ShouldHideTopViews()) return false; return (browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) && toolbar_; }
C
Chrome
0
CVE-2013-7023
https://www.cvedetails.com/cve/CVE-2013-7023/
CWE-119
https://github.com/FFmpeg/FFmpeg/commit/f31011e9abfb2ae75bb32bc44e2c34194c8dc40a
f31011e9abfb2ae75bb32bc44e2c34194c8dc40a
avcodec/parser: reset indexes on realloc failure Fixes Ticket2982 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
void av_parser_close(AVCodecParserContext *s) { if(s){ if (s->parser->parser_close) s->parser->parser_close(s); av_free(s->priv_data); av_free(s); } }
void av_parser_close(AVCodecParserContext *s) { if(s){ if (s->parser->parser_close) s->parser->parser_close(s); av_free(s->priv_data); av_free(s); } }
C
FFmpeg
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.
void jpc_ms_dump(jpc_ms_t *ms, FILE *out) { jpc_mstabent_t *mstabent; mstabent = jpc_mstab_lookup(ms->id); fprintf(out, "type = 0x%04"PRIxFAST16" (%s);", ms->id, mstabent->name); if (JPC_MS_HASPARMS(ms->id)) { fprintf(out, " len = %"PRIuFAST16";", ms->len + 2); if (ms->ops->dumpparms) { (*ms->ops->dumpparms)(ms, out); } else { fprintf(out, "\n"); } } else { fprintf(out, "\n"); } }
void jpc_ms_dump(jpc_ms_t *ms, FILE *out) { jpc_mstabent_t *mstabent; mstabent = jpc_mstab_lookup(ms->id); fprintf(out, "type = 0x%04"PRIxFAST16" (%s);", ms->id, mstabent->name); if (JPC_MS_HASPARMS(ms->id)) { fprintf(out, " len = %"PRIuFAST16";", ms->len + 2); if (ms->ops->dumpparms) { (*ms->ops->dumpparms)(ms, out); } else { fprintf(out, "\n"); } } else { fprintf(out, "\n"); } }
C
jasper
0
CVE-2015-3886
https://www.cvedetails.com/cve/CVE-2015-3886/
CWE-295
https://github.com/gobby/libinfinity/commit/c97f870f5ae13112988d9f8ad464b4f679903706
c97f870f5ae13112988d9f8ad464b4f679903706
Fix expired certificate validation (gobby #61)
inf_gtk_certificate_manager_finalize(GObject* object) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); inf_gtk_certificate_manager_set_known_hosts(manager, NULL); g_assert(priv->known_hosts_file == NULL); G_OBJECT_CLASS(inf_gtk_certificate_manager_parent_class)->finalize(object); }
inf_gtk_certificate_manager_finalize(GObject* object) { InfGtkCertificateManager* manager; InfGtkCertificateManagerPrivate* priv; manager = INF_GTK_CERTIFICATE_MANAGER(object); priv = INF_GTK_CERTIFICATE_MANAGER_PRIVATE(manager); inf_gtk_certificate_manager_set_known_hosts(manager, NULL); g_assert(priv->known_hosts_file == NULL); G_OBJECT_CLASS(inf_gtk_certificate_manager_parent_class)->finalize(object); }
C
libinfinity
0
CVE-2013-6663
https://www.cvedetails.com/cve/CVE-2013-6663/
CWE-399
https://github.com/chromium/chromium/commit/fb5dce12f0462056fc9f66967b0f7b2b7bcd88f5
fb5dce12f0462056fc9f66967b0f7b2b7bcd88f5
One polymer_config.js to rule them all. R=michaelpg@chromium.org,fukino@chromium.org,mfoltz@chromium.org BUG=425626 Review URL: https://codereview.chromium.org/1224783005 Cr-Commit-Position: refs/heads/master@{#337882}
EnrollmentScreenActor* OobeUI::GetEnrollmentScreenActor() { return enrollment_screen_actor_; }
EnrollmentScreenActor* OobeUI::GetEnrollmentScreenActor() { return enrollment_screen_actor_; }
C
Chrome
0
CVE-2016-9294
https://www.cvedetails.com/cve/CVE-2016-9294/
CWE-476
http://git.ghostscript.com/?p=mujs.git;a=commit;h=5008105780c0b0182ea6eda83ad5598f225be3ee
5008105780c0b0182ea6eda83ad5598f225be3ee
null
static void cassignop2(JF, js_Ast *lhs, int postfix) { switch (lhs->type) { case EXP_IDENTIFIER: if (postfix) emit(J, F, OP_ROT2); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: if (postfix) emit(J, F, OP_ROT4); emit(J, F, OP_SETPROP); break; case EXP_MEMBER: if (postfix) emit(J, F, OP_ROT3); emitstring(J, F, OP_SETPROP_S, lhs->b->string); break; default: jsC_error(J, lhs, "invalid l-value in assignment"); } }
static void cassignop2(JF, js_Ast *lhs, int postfix) { switch (lhs->type) { case EXP_IDENTIFIER: if (postfix) emit(J, F, OP_ROT2); emitlocal(J, F, OP_SETLOCAL, OP_SETVAR, lhs); break; case EXP_INDEX: if (postfix) emit(J, F, OP_ROT4); emit(J, F, OP_SETPROP); break; case EXP_MEMBER: if (postfix) emit(J, F, OP_ROT3); emitstring(J, F, OP_SETPROP_S, lhs->b->string); break; default: jsC_error(J, lhs, "invalid l-value in assignment"); } }
C
ghostscript
0
CVE-2016-7423
https://www.cvedetails.com/cve/CVE-2016-7423/
CWE-787
https://git.qemu.org/?p=qemu.git;a=commit;h=670e56d3ed2918b3861d9216f2c0540d9e9ae0d5
670e56d3ed2918b3861d9216f2c0540d9e9ae0d5
null
static void mptsas_diag_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { MPTSASState *s = opaque; trace_mptsas_diag_write(s, addr, val); }
static void mptsas_diag_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { MPTSASState *s = opaque; trace_mptsas_diag_write(s, addr, val); }
C
qemu
0
CVE-2015-8935
https://www.cvedetails.com/cve/CVE-2015-8935/
CWE-79
https://github.com/php/php-src/commit/996faf964bba1aec06b153b370a7f20d3dd2bb8b?w=1
996faf964bba1aec06b153b370a7f20d3dd2bb8b?w=1
Update header handling to RFC 7230
SAPI_API void sapi_deactivate(TSRMLS_D) { zend_llist_destroy(&SG(sapi_headers).headers); if (SG(request_info).post_data) { efree(SG(request_info).post_data); } else if (SG(server_context)) { if(sapi_module.read_post) { /* make sure we've consumed all request input data */ char dummy[SAPI_POST_BLOCK_SIZE]; int read_bytes; while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { SG(read_post_bytes) += read_bytes; } } } if (SG(request_info).raw_post_data) { efree(SG(request_info).raw_post_data); } if (SG(request_info).auth_user) { efree(SG(request_info).auth_user); } if (SG(request_info).auth_password) { efree(SG(request_info).auth_password); } if (SG(request_info).auth_digest) { efree(SG(request_info).auth_digest); } if (SG(request_info).content_type_dup) { efree(SG(request_info).content_type_dup); } if (SG(request_info).current_user) { efree(SG(request_info).current_user); } if (sapi_module.deactivate) { sapi_module.deactivate(TSRMLS_C); } if (SG(rfc1867_uploaded_files)) { destroy_uploaded_files_hash(TSRMLS_C); } if (SG(sapi_headers).mimetype) { efree(SG(sapi_headers).mimetype); SG(sapi_headers).mimetype = NULL; } sapi_send_headers_free(TSRMLS_C); SG(sapi_started) = 0; SG(headers_sent) = 0; SG(callback_run) = 0; if (SG(callback_func)) { zval_ptr_dtor(&SG(callback_func)); } SG(request_info).headers_read = 0; SG(global_request_time) = 0; }
SAPI_API void sapi_deactivate(TSRMLS_D) { zend_llist_destroy(&SG(sapi_headers).headers); if (SG(request_info).post_data) { efree(SG(request_info).post_data); } else if (SG(server_context)) { if(sapi_module.read_post) { /* make sure we've consumed all request input data */ char dummy[SAPI_POST_BLOCK_SIZE]; int read_bytes; while((read_bytes = sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC)) > 0) { SG(read_post_bytes) += read_bytes; } } } if (SG(request_info).raw_post_data) { efree(SG(request_info).raw_post_data); } if (SG(request_info).auth_user) { efree(SG(request_info).auth_user); } if (SG(request_info).auth_password) { efree(SG(request_info).auth_password); } if (SG(request_info).auth_digest) { efree(SG(request_info).auth_digest); } if (SG(request_info).content_type_dup) { efree(SG(request_info).content_type_dup); } if (SG(request_info).current_user) { efree(SG(request_info).current_user); } if (sapi_module.deactivate) { sapi_module.deactivate(TSRMLS_C); } if (SG(rfc1867_uploaded_files)) { destroy_uploaded_files_hash(TSRMLS_C); } if (SG(sapi_headers).mimetype) { efree(SG(sapi_headers).mimetype); SG(sapi_headers).mimetype = NULL; } sapi_send_headers_free(TSRMLS_C); SG(sapi_started) = 0; SG(headers_sent) = 0; SG(callback_run) = 0; if (SG(callback_func)) { zval_ptr_dtor(&SG(callback_func)); } SG(request_info).headers_read = 0; SG(global_request_time) = 0; }
C
php-src
0
CVE-2018-7253
https://www.cvedetails.com/cve/CVE-2018-7253/
CWE-125
https://github.com/dbry/WavPack/commit/36a24c7881427d2e1e4dc1cef58f19eee0d13aec
36a24c7881427d2e1e4dc1cef58f19eee0d13aec
issue #28, do not overwrite heap on corrupt DSDIFF file
int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t infilesize, total_samples; DFFFileHeader dff_file_header; DFFChunkHeader dff_chunk_header; uint32_t bcount; infilesize = DoGetFileSize (infile); memcpy (&dff_file_header, fourcc, 4); if ((!DoReadFile (infile, ((char *) &dff_file_header) + 4, sizeof (DFFFileHeader) - 4, &bcount) || bcount != sizeof (DFFFileHeader) - 4) || strncmp (dff_file_header.formType, "DSD ", 4)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &dff_file_header, sizeof (DFFFileHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } #if 1 // this might be a little too picky... WavpackBigEndianToNative (&dff_file_header, DFFFileHeaderFormat); if (infilesize && !(config->qmode & QMODE_IGNORE_LENGTH) && dff_file_header.ckDataSize && dff_file_header.ckDataSize + 1 && dff_file_header.ckDataSize + 12 != infilesize) { error_line ("%s is not a valid .DFF file (by total size)!", infilename); return WAVPACK_SOFT_ERROR; } if (debug_logging_mode) error_line ("file header indicated length = %lld", dff_file_header.ckDataSize); #endif while (1) { if (!DoReadFile (infile, &dff_chunk_header, sizeof (DFFChunkHeader), &bcount) || bcount != sizeof (DFFChunkHeader)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &dff_chunk_header, sizeof (DFFChunkHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackBigEndianToNative (&dff_chunk_header, DFFChunkHeaderFormat); if (debug_logging_mode) error_line ("chunk header indicated length = %lld", dff_chunk_header.ckDataSize); if (!strncmp (dff_chunk_header.ckID, "FVER", 4)) { uint32_t version; if (dff_chunk_header.ckDataSize != sizeof (version) || !DoReadFile (infile, &version, sizeof (version), &bcount) || bcount != sizeof (version)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &version, sizeof (version))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackBigEndianToNative (&version, "L"); if (debug_logging_mode) error_line ("dsdiff file version = 0x%08x", version); } else if (!strncmp (dff_chunk_header.ckID, "PROP", 4)) { char *prop_chunk; if (dff_chunk_header.ckDataSize < 4 || dff_chunk_header.ckDataSize > 1024) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } if (debug_logging_mode) error_line ("got PROP chunk of %d bytes total", (int) dff_chunk_header.ckDataSize); prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); if (!DoReadFile (infile, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize, &bcount) || bcount != dff_chunk_header.ckDataSize) { error_line ("%s is not a valid .DFF file!", infilename); free (prop_chunk); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize)) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (prop_chunk); return WAVPACK_SOFT_ERROR; } if (!strncmp (prop_chunk, "SND ", 4)) { char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize; uint16_t numChannels, chansSpecified, chanMask = 0; uint32_t sampleRate; while (eptr - cptr >= sizeof (dff_chunk_header)) { memcpy (&dff_chunk_header, cptr, sizeof (dff_chunk_header)); cptr += sizeof (dff_chunk_header); WavpackBigEndianToNative (&dff_chunk_header, DFFChunkHeaderFormat); if (eptr - cptr >= dff_chunk_header.ckDataSize) { if (!strncmp (dff_chunk_header.ckID, "FS ", 4) && dff_chunk_header.ckDataSize == 4) { memcpy (&sampleRate, cptr, sizeof (sampleRate)); WavpackBigEndianToNative (&sampleRate, "L"); cptr += dff_chunk_header.ckDataSize; if (debug_logging_mode) error_line ("got sample rate of %u Hz", sampleRate); } else if (!strncmp (dff_chunk_header.ckID, "CHNL", 4) && dff_chunk_header.ckDataSize >= 2) { memcpy (&numChannels, cptr, sizeof (numChannels)); WavpackBigEndianToNative (&numChannels, "S"); cptr += sizeof (numChannels); chansSpecified = (int)(dff_chunk_header.ckDataSize - sizeof (numChannels)) / 4; while (chansSpecified--) { if (!strncmp (cptr, "SLFT", 4) || !strncmp (cptr, "MLFT", 4)) chanMask |= 0x1; else if (!strncmp (cptr, "SRGT", 4) || !strncmp (cptr, "MRGT", 4)) chanMask |= 0x2; else if (!strncmp (cptr, "LS ", 4)) chanMask |= 0x10; else if (!strncmp (cptr, "RS ", 4)) chanMask |= 0x20; else if (!strncmp (cptr, "C ", 4)) chanMask |= 0x4; else if (!strncmp (cptr, "LFE ", 4)) chanMask |= 0x8; else if (debug_logging_mode) error_line ("undefined channel ID %c%c%c%c", cptr [0], cptr [1], cptr [2], cptr [3]); cptr += 4; } if (debug_logging_mode) error_line ("%d channels, mask = 0x%08x", numChannels, chanMask); } else if (!strncmp (dff_chunk_header.ckID, "CMPR", 4) && dff_chunk_header.ckDataSize >= 4) { if (strncmp (cptr, "DSD ", 4)) { error_line ("DSDIFF files must be uncompressed, not \"%c%c%c%c\"!", cptr [0], cptr [1], cptr [2], cptr [3]); free (prop_chunk); return WAVPACK_SOFT_ERROR; } cptr += dff_chunk_header.ckDataSize; } else { if (debug_logging_mode) error_line ("got PROP/SND chunk type \"%c%c%c%c\" of %d bytes", dff_chunk_header.ckID [0], dff_chunk_header.ckID [1], dff_chunk_header.ckID [2], dff_chunk_header.ckID [3], dff_chunk_header.ckDataSize); cptr += dff_chunk_header.ckDataSize; } } else { error_line ("%s is not a valid .DFF file!", infilename); free (prop_chunk); return WAVPACK_SOFT_ERROR; } } if (chanMask && (config->channel_mask || (config->qmode & QMODE_CHANS_UNASSIGNED))) { error_line ("this DSDIFF file already has channel order information!"); free (prop_chunk); return WAVPACK_SOFT_ERROR; } else if (chanMask) config->channel_mask = chanMask; config->bits_per_sample = 8; config->bytes_per_sample = 1; config->num_channels = numChannels; config->sample_rate = sampleRate / 8; config->qmode |= QMODE_DSD_MSB_FIRST; } else if (debug_logging_mode) error_line ("got unknown PROP chunk type \"%c%c%c%c\" of %d bytes", prop_chunk [0], prop_chunk [1], prop_chunk [2], prop_chunk [3], dff_chunk_header.ckDataSize); free (prop_chunk); } else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) { total_samples = dff_chunk_header.ckDataSize / config->num_channels; break; } else { // just copy unknown chunks to output file int bytes_to_copy = (int)(((dff_chunk_header.ckDataSize) + 1) & ~(int64_t)1); char *buff = malloc (bytes_to_copy); if (debug_logging_mode) error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", dff_chunk_header.ckID [0], dff_chunk_header.ckID [1], dff_chunk_header.ckID [2], dff_chunk_header.ckID [3], dff_chunk_header.ckDataSize); if (!DoReadFile (infile, buff, bytes_to_copy, &bcount) || bcount != bytes_to_copy || (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, buff, bytes_to_copy))) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (buff); return WAVPACK_SOFT_ERROR; } free (buff); } } if (debug_logging_mode) error_line ("setting configuration with %lld samples", total_samples); if (!WavpackSetConfiguration64 (wpc, config, total_samples, NULL)) { error_line ("%s: %s", infilename, WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } return WAVPACK_NO_ERROR; }
int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) { int64_t infilesize, total_samples; DFFFileHeader dff_file_header; DFFChunkHeader dff_chunk_header; uint32_t bcount; infilesize = DoGetFileSize (infile); memcpy (&dff_file_header, fourcc, 4); if ((!DoReadFile (infile, ((char *) &dff_file_header) + 4, sizeof (DFFFileHeader) - 4, &bcount) || bcount != sizeof (DFFFileHeader) - 4) || strncmp (dff_file_header.formType, "DSD ", 4)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &dff_file_header, sizeof (DFFFileHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } #if 1 // this might be a little too picky... WavpackBigEndianToNative (&dff_file_header, DFFFileHeaderFormat); if (infilesize && !(config->qmode & QMODE_IGNORE_LENGTH) && dff_file_header.ckDataSize && dff_file_header.ckDataSize + 1 && dff_file_header.ckDataSize + 12 != infilesize) { error_line ("%s is not a valid .DFF file (by total size)!", infilename); return WAVPACK_SOFT_ERROR; } if (debug_logging_mode) error_line ("file header indicated length = %lld", dff_file_header.ckDataSize); #endif while (1) { if (!DoReadFile (infile, &dff_chunk_header, sizeof (DFFChunkHeader), &bcount) || bcount != sizeof (DFFChunkHeader)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &dff_chunk_header, sizeof (DFFChunkHeader))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackBigEndianToNative (&dff_chunk_header, DFFChunkHeaderFormat); if (debug_logging_mode) error_line ("chunk header indicated length = %lld", dff_chunk_header.ckDataSize); if (!strncmp (dff_chunk_header.ckID, "FVER", 4)) { uint32_t version; if (dff_chunk_header.ckDataSize != sizeof (version) || !DoReadFile (infile, &version, sizeof (version), &bcount) || bcount != sizeof (version)) { error_line ("%s is not a valid .DFF file!", infilename); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, &version, sizeof (version))) { error_line ("%s", WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } WavpackBigEndianToNative (&version, "L"); if (debug_logging_mode) error_line ("dsdiff file version = 0x%08x", version); } else if (!strncmp (dff_chunk_header.ckID, "PROP", 4)) { char *prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); if (!DoReadFile (infile, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize, &bcount) || bcount != dff_chunk_header.ckDataSize) { error_line ("%s is not a valid .DFF file!", infilename); free (prop_chunk); return WAVPACK_SOFT_ERROR; } else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize)) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (prop_chunk); return WAVPACK_SOFT_ERROR; } if (!strncmp (prop_chunk, "SND ", 4)) { char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize; uint16_t numChannels, chansSpecified, chanMask = 0; uint32_t sampleRate; while (eptr - cptr >= sizeof (dff_chunk_header)) { memcpy (&dff_chunk_header, cptr, sizeof (dff_chunk_header)); cptr += sizeof (dff_chunk_header); WavpackBigEndianToNative (&dff_chunk_header, DFFChunkHeaderFormat); if (eptr - cptr >= dff_chunk_header.ckDataSize) { if (!strncmp (dff_chunk_header.ckID, "FS ", 4) && dff_chunk_header.ckDataSize == 4) { memcpy (&sampleRate, cptr, sizeof (sampleRate)); WavpackBigEndianToNative (&sampleRate, "L"); cptr += dff_chunk_header.ckDataSize; if (debug_logging_mode) error_line ("got sample rate of %u Hz", sampleRate); } else if (!strncmp (dff_chunk_header.ckID, "CHNL", 4) && dff_chunk_header.ckDataSize >= 2) { memcpy (&numChannels, cptr, sizeof (numChannels)); WavpackBigEndianToNative (&numChannels, "S"); cptr += sizeof (numChannels); chansSpecified = (int)(dff_chunk_header.ckDataSize - sizeof (numChannels)) / 4; while (chansSpecified--) { if (!strncmp (cptr, "SLFT", 4) || !strncmp (cptr, "MLFT", 4)) chanMask |= 0x1; else if (!strncmp (cptr, "SRGT", 4) || !strncmp (cptr, "MRGT", 4)) chanMask |= 0x2; else if (!strncmp (cptr, "LS ", 4)) chanMask |= 0x10; else if (!strncmp (cptr, "RS ", 4)) chanMask |= 0x20; else if (!strncmp (cptr, "C ", 4)) chanMask |= 0x4; else if (!strncmp (cptr, "LFE ", 4)) chanMask |= 0x8; else if (debug_logging_mode) error_line ("undefined channel ID %c%c%c%c", cptr [0], cptr [1], cptr [2], cptr [3]); cptr += 4; } if (debug_logging_mode) error_line ("%d channels, mask = 0x%08x", numChannels, chanMask); } else if (!strncmp (dff_chunk_header.ckID, "CMPR", 4) && dff_chunk_header.ckDataSize >= 4) { if (strncmp (cptr, "DSD ", 4)) { error_line ("DSDIFF files must be uncompressed, not \"%c%c%c%c\"!", cptr [0], cptr [1], cptr [2], cptr [3]); free (prop_chunk); return WAVPACK_SOFT_ERROR; } cptr += dff_chunk_header.ckDataSize; } else { if (debug_logging_mode) error_line ("got PROP/SND chunk type \"%c%c%c%c\" of %d bytes", dff_chunk_header.ckID [0], dff_chunk_header.ckID [1], dff_chunk_header.ckID [2], dff_chunk_header.ckID [3], dff_chunk_header.ckDataSize); cptr += dff_chunk_header.ckDataSize; } } else { error_line ("%s is not a valid .DFF file!", infilename); free (prop_chunk); return WAVPACK_SOFT_ERROR; } } if (chanMask && (config->channel_mask || (config->qmode & QMODE_CHANS_UNASSIGNED))) { error_line ("this DSDIFF file already has channel order information!"); free (prop_chunk); return WAVPACK_SOFT_ERROR; } else if (chanMask) config->channel_mask = chanMask; config->bits_per_sample = 8; config->bytes_per_sample = 1; config->num_channels = numChannels; config->sample_rate = sampleRate / 8; config->qmode |= QMODE_DSD_MSB_FIRST; } else if (debug_logging_mode) error_line ("got unknown PROP chunk type \"%c%c%c%c\" of %d bytes", prop_chunk [0], prop_chunk [1], prop_chunk [2], prop_chunk [3], dff_chunk_header.ckDataSize); free (prop_chunk); } else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) { total_samples = dff_chunk_header.ckDataSize / config->num_channels; break; } else { // just copy unknown chunks to output file int bytes_to_copy = (int)(((dff_chunk_header.ckDataSize) + 1) & ~(int64_t)1); char *buff = malloc (bytes_to_copy); if (debug_logging_mode) error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", dff_chunk_header.ckID [0], dff_chunk_header.ckID [1], dff_chunk_header.ckID [2], dff_chunk_header.ckID [3], dff_chunk_header.ckDataSize); if (!DoReadFile (infile, buff, bytes_to_copy, &bcount) || bcount != bytes_to_copy || (!(config->qmode & QMODE_NO_STORE_WRAPPER) && !WavpackAddWrapper (wpc, buff, bytes_to_copy))) { error_line ("%s", WavpackGetErrorMessage (wpc)); free (buff); return WAVPACK_SOFT_ERROR; } free (buff); } } if (debug_logging_mode) error_line ("setting configuration with %lld samples", total_samples); if (!WavpackSetConfiguration64 (wpc, config, total_samples, NULL)) { error_line ("%s: %s", infilename, WavpackGetErrorMessage (wpc)); return WAVPACK_SOFT_ERROR; } return WAVPACK_NO_ERROR; }
C
WavPack
1
CVE-2015-8215
https://www.cvedetails.com/cve/CVE-2015-8215/
CWE-20
https://github.com/torvalds/linux/commit/77751427a1ff25b27d47a4c36b12c3c8667855ac
77751427a1ff25b27d47a4c36b12c3c8667855ac
ipv6: addrconf: validate new MTU before applying it Currently we don't check if the new MTU is valid or not and this allows one to configure a smaller than minimum allowed by RFCs or even bigger than interface own MTU, which is a problem as it may lead to packet drops. If you have a daemon like NetworkManager running, this may be exploited by remote attackers by forging RA packets with an invalid MTU, possibly leading to a DoS. (NetworkManager currently only validates for values too small, but not for too big ones.) The fix is just to make sure the new value is valid. That is, between IPV6_MIN_MTU and interface's MTU. Note that similar check is already performed at ndisc_router_discovery(), for when kernel itself parses the RA. Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
static void addrconf_dad_completed(struct inet6_ifaddr *ifp) { struct net_device *dev = ifp->idev->dev; struct in6_addr lladdr; bool send_rs, send_mld; addrconf_del_dad_work(ifp); /* * Configure the address for reception. Now it is valid. */ ipv6_ifa_notify(RTM_NEWADDR, ifp); /* If added prefix is link local and we are prepared to process router advertisements, start sending router solicitations. */ read_lock_bh(&ifp->idev->lock); send_mld = ifp->scope == IFA_LINK && ipv6_lonely_lladdr(ifp); send_rs = send_mld && ipv6_accept_ra(ifp->idev) && ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0; read_unlock_bh(&ifp->idev->lock); /* While dad is in progress mld report's source address is in6_addrany. * Resend with proper ll now. */ if (send_mld) ipv6_mc_dad_complete(ifp->idev); if (send_rs) { /* * If a host as already performed a random delay * [...] as part of DAD [...] there is no need * to delay again before sending the first RS */ if (ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE)) return; ndisc_send_rs(dev, &lladdr, &in6addr_linklocal_allrouters); write_lock_bh(&ifp->idev->lock); spin_lock(&ifp->lock); ifp->idev->rs_probes = 1; ifp->idev->if_flags |= IF_RS_SENT; addrconf_mod_rs_timer(ifp->idev, ifp->idev->cnf.rtr_solicit_interval); spin_unlock(&ifp->lock); write_unlock_bh(&ifp->idev->lock); } }
static void addrconf_dad_completed(struct inet6_ifaddr *ifp) { struct net_device *dev = ifp->idev->dev; struct in6_addr lladdr; bool send_rs, send_mld; addrconf_del_dad_work(ifp); /* * Configure the address for reception. Now it is valid. */ ipv6_ifa_notify(RTM_NEWADDR, ifp); /* If added prefix is link local and we are prepared to process router advertisements, start sending router solicitations. */ read_lock_bh(&ifp->idev->lock); send_mld = ifp->scope == IFA_LINK && ipv6_lonely_lladdr(ifp); send_rs = send_mld && ipv6_accept_ra(ifp->idev) && ifp->idev->cnf.rtr_solicits > 0 && (dev->flags&IFF_LOOPBACK) == 0; read_unlock_bh(&ifp->idev->lock); /* While dad is in progress mld report's source address is in6_addrany. * Resend with proper ll now. */ if (send_mld) ipv6_mc_dad_complete(ifp->idev); if (send_rs) { /* * If a host as already performed a random delay * [...] as part of DAD [...] there is no need * to delay again before sending the first RS */ if (ipv6_get_lladdr(dev, &lladdr, IFA_F_TENTATIVE)) return; ndisc_send_rs(dev, &lladdr, &in6addr_linklocal_allrouters); write_lock_bh(&ifp->idev->lock); spin_lock(&ifp->lock); ifp->idev->rs_probes = 1; ifp->idev->if_flags |= IF_RS_SENT; addrconf_mod_rs_timer(ifp->idev, ifp->idev->cnf.rtr_solicit_interval); spin_unlock(&ifp->lock); write_unlock_bh(&ifp->idev->lock); } }
C
linux
0
CVE-2018-16073
https://www.cvedetails.com/cve/CVE-2018-16073/
CWE-285
https://github.com/chromium/chromium/commit/0bb3f5c715eb66bb5c1fb05fd81d902ca57f33ca
0bb3f5c715eb66bb5c1fb05fd81d902ca57f33ca
Use unique processes for data URLs on restore. Data URLs are usually put into the process that created them, but this info is not tracked after a tab restore. Ensure that they do not end up in the parent frame's process (or each other's process), in case they are malicious. BUG=863069 Change-Id: Ib391f90c7bdf28a0a9c057c5cc7918c10aed968b Reviewed-on: https://chromium-review.googlesource.com/1150767 Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#581023}
void WaitForLauncherThread() { base::RunLoop run_loop; content::GetProcessLauncherTaskRunner()->PostTaskAndReply( FROM_HERE, base::DoNothing(), run_loop.QuitWhenIdleClosure()); run_loop.Run(); }
void WaitForLauncherThread() { base::RunLoop run_loop; content::GetProcessLauncherTaskRunner()->PostTaskAndReply( FROM_HERE, base::DoNothing(), run_loop.QuitWhenIdleClosure()); run_loop.Run(); }
C
Chrome
0
CVE-2011-3055
https://www.cvedetails.com/cve/CVE-2011-3055/
null
https://github.com/chromium/chromium/commit/e9372a1bfd3588a80fcf49aa07321f0971dd6091
e9372a1bfd3588a80fcf49aa07321f0971dd6091
[V8] Pass Isolate to throwNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=86983 Reviewed by Adam Barth. The objective is to pass Isolate around in V8 bindings. This patch passes Isolate to throwNotEnoughArgumentsError(). No tests. No change in behavior. * bindings/scripts/CodeGeneratorV8.pm: (GenerateArgumentsCountCheck): (GenerateEventConstructorCallback): * bindings/scripts/test/V8/V8Float64Array.cpp: (WebCore::Float64ArrayV8Internal::fooCallback): * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionCallback): (WebCore::TestActiveDOMObjectV8Internal::postMessageCallback): * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: (WebCore::TestCustomNamedGetterV8Internal::anotherFunctionCallback): * bindings/scripts/test/V8/V8TestEventConstructor.cpp: (WebCore::V8TestEventConstructor::constructorCallback): * bindings/scripts/test/V8/V8TestEventTarget.cpp: (WebCore::TestEventTargetV8Internal::itemCallback): (WebCore::TestEventTargetV8Internal::dispatchEventCallback): * bindings/scripts/test/V8/V8TestInterface.cpp: (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback): (WebCore::V8TestInterface::constructorCallback): * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: (WebCore::TestMediaQueryListListenerV8Internal::methodCallback): * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: (WebCore::V8TestNamedConstructorConstructorCallback): * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore::TestObjV8Internal::voidMethodWithArgsCallback): (WebCore::TestObjV8Internal::intMethodWithArgsCallback): (WebCore::TestObjV8Internal::objMethodWithArgsCallback): (WebCore::TestObjV8Internal::methodWithSequenceArgCallback): (WebCore::TestObjV8Internal::methodReturningSequenceCallback): (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback): (WebCore::TestObjV8Internal::serializedValueCallback): (WebCore::TestObjV8Internal::idbKeyCallback): (WebCore::TestObjV8Internal::optionsObjectCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgCallback): (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsCallback): (WebCore::TestObjV8Internal::methodWithCallbackArgCallback): (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback): (WebCore::TestObjV8Internal::overloadedMethod1Callback): (WebCore::TestObjV8Internal::overloadedMethod2Callback): (WebCore::TestObjV8Internal::overloadedMethod3Callback): (WebCore::TestObjV8Internal::overloadedMethod4Callback): (WebCore::TestObjV8Internal::overloadedMethod5Callback): (WebCore::TestObjV8Internal::overloadedMethod6Callback): (WebCore::TestObjV8Internal::overloadedMethod7Callback): (WebCore::TestObjV8Internal::overloadedMethod11Callback): (WebCore::TestObjV8Internal::overloadedMethod12Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback): (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback): (WebCore::TestObjV8Internal::convert1Callback): (WebCore::TestObjV8Internal::convert2Callback): (WebCore::TestObjV8Internal::convert3Callback): (WebCore::TestObjV8Internal::convert4Callback): (WebCore::TestObjV8Internal::convert5Callback): (WebCore::TestObjV8Internal::strictFunctionCallback): (WebCore::V8TestObj::constructorCallback): * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: (WebCore::TestSerializedScriptValueInterfaceV8Internal::acceptTransferListCallback): (WebCore::V8TestSerializedScriptValueInterface::constructorCallback): * bindings/v8/ScriptController.cpp: (WebCore::setValueAndClosePopupCallback): * bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::throwNotEnoughArgumentsError): * bindings/v8/V8Proxy.h: (V8Proxy): * bindings/v8/custom/V8AudioContextCustom.cpp: (WebCore::V8AudioContext::constructorCallback): * bindings/v8/custom/V8DataViewCustom.cpp: (WebCore::V8DataView::getInt8Callback): (WebCore::V8DataView::getUint8Callback): (WebCore::V8DataView::setInt8Callback): (WebCore::V8DataView::setUint8Callback): * bindings/v8/custom/V8DirectoryEntryCustom.cpp: (WebCore::V8DirectoryEntry::getDirectoryCallback): (WebCore::V8DirectoryEntry::getFileCallback): * bindings/v8/custom/V8IntentConstructor.cpp: (WebCore::V8Intent::constructorCallback): * bindings/v8/custom/V8SVGLengthCustom.cpp: (WebCore::V8SVGLength::convertToSpecifiedUnitsCallback): * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: (WebCore::getObjectParameter): (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback): (WebCore::V8WebGLRenderingContext::getExtensionCallback): (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallback): (WebCore::V8WebGLRenderingContext::getParameterCallback): (WebCore::V8WebGLRenderingContext::getProgramParameterCallback): (WebCore::V8WebGLRenderingContext::getShaderParameterCallback): (WebCore::V8WebGLRenderingContext::getUniformCallback): (WebCore::vertexAttribAndUniformHelperf): (WebCore::uniformHelperi): (WebCore::uniformMatrixHelper): * bindings/v8/custom/V8WebKitMutationObserverCustom.cpp: (WebCore::V8WebKitMutationObserver::constructorCallback): (WebCore::V8WebKitMutationObserver::observeCallback): * bindings/v8/custom/V8WebSocketCustom.cpp: (WebCore::V8WebSocket::constructorCallback): (WebCore::V8WebSocket::sendCallback): * bindings/v8/custom/V8XMLHttpRequestCustom.cpp: (WebCore::V8XMLHttpRequest::openCallback): git-svn-id: svn://svn.chromium.org/blink/trunk@117736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args) { INC_STATS("DOM.TestObj.convert3"); if (args.Length() < 1) return V8Proxy::throwNotEnoughArgumentsError(args.GetIsolate()); TestObj* imp = V8TestObj::toNative(args.Holder()); EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0); imp->convert3(); return v8::Handle<v8::Value>(); }
static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args) { INC_STATS("DOM.TestObj.convert3"); if (args.Length() < 1) return V8Proxy::throwNotEnoughArgumentsError(); TestObj* imp = V8TestObj::toNative(args.Holder()); EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0); imp->convert3(); return v8::Handle<v8::Value>(); }
C
Chrome
1
CVE-2013-7026
https://www.cvedetails.com/cve/CVE-2013-7026/
CWE-362
https://github.com/torvalds/linux/commit/a399b29dfbaaaf91162b2dc5a5875dd51bbfa2a1
a399b29dfbaaaf91162b2dc5a5875dd51bbfa2a1
ipc,shm: fix shm_file deletion races When IPC_RMID races with other shm operations there's potential for use-after-free of the shm object's associated file (shm_file). Here's the race before this patch: TASK 1 TASK 2 ------ ------ shm_rmid() ipc_lock_object() shmctl() shp = shm_obtain_object_check() shm_destroy() shum_unlock() fput(shp->shm_file) ipc_lock_object() shmem_lock(shp->shm_file) <OOPS> The oops is caused because shm_destroy() calls fput() after dropping the ipc_lock. fput() clears the file's f_inode, f_path.dentry, and f_path.mnt, which causes various NULL pointer references in task 2. I reliably see the oops in task 2 if with shmlock, shmu This patch fixes the races by: 1) set shm_file=NULL in shm_destroy() while holding ipc_object_lock(). 2) modify at risk operations to check shm_file while holding ipc_object_lock(). Example workloads, which each trigger oops... Workload 1: while true; do id=$(shmget 1 4096) shm_rmid $id & shmlock $id & wait done The oops stack shows accessing NULL f_inode due to racing fput: _raw_spin_lock shmem_lock SyS_shmctl Workload 2: while true; do id=$(shmget 1 4096) shmat $id 4096 & shm_rmid $id & wait done The oops stack is similar to workload 1 due to NULL f_inode: touch_atime shmem_mmap shm_mmap mmap_region do_mmap_pgoff do_shmat SyS_shmat Workload 3: while true; do id=$(shmget 1 4096) shmlock $id shm_rmid $id & shmunlock $id & wait done The oops stack shows second fput tripping on an NULL f_inode. The first fput() completed via from shm_destroy(), but a racing thread did a get_file() and queued this fput(): locks_remove_flock __fput ____fput task_work_run do_notify_resume int_signal Fixes: c2c737a0461e ("ipc,shm: shorten critical region for shmat") Fixes: 2caacaa82a51 ("ipc,shm: shorten critical region for shmctl") Signed-off-by: Greg Thelen <gthelen@google.com> Cc: Davidlohr Bueso <davidlohr@hp.com> Cc: Rik van Riel <riel@redhat.com> Cc: Manfred Spraul <manfred@colorfullife.com> Cc: <stable@vger.kernel.org> # 3.10.17+ 3.11.6+ Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static void shm_add_rss_swap(struct shmid_kernel *shp, unsigned long *rss_add, unsigned long *swp_add) { struct inode *inode; inode = file_inode(shp->shm_file); if (is_file_hugepages(shp->shm_file)) { struct address_space *mapping = inode->i_mapping; struct hstate *h = hstate_file(shp->shm_file); *rss_add += pages_per_huge_page(h) * mapping->nrpages; } else { #ifdef CONFIG_SHMEM struct shmem_inode_info *info = SHMEM_I(inode); spin_lock(&info->lock); *rss_add += inode->i_mapping->nrpages; *swp_add += info->swapped; spin_unlock(&info->lock); #else *rss_add += inode->i_mapping->nrpages; #endif } }
static void shm_add_rss_swap(struct shmid_kernel *shp, unsigned long *rss_add, unsigned long *swp_add) { struct inode *inode; inode = file_inode(shp->shm_file); if (is_file_hugepages(shp->shm_file)) { struct address_space *mapping = inode->i_mapping; struct hstate *h = hstate_file(shp->shm_file); *rss_add += pages_per_huge_page(h) * mapping->nrpages; } else { #ifdef CONFIG_SHMEM struct shmem_inode_info *info = SHMEM_I(inode); spin_lock(&info->lock); *rss_add += inode->i_mapping->nrpages; *swp_add += info->swapped; spin_unlock(&info->lock); #else *rss_add += inode->i_mapping->nrpages; #endif } }
C
linux
0
CVE-2017-10929
https://www.cvedetails.com/cve/CVE-2017-10929/
CWE-119
https://github.com/radare/radare2/commit/c57997e76ec70862174a1b3b3aeb62a6f8570e85
c57997e76ec70862174a1b3b3aeb62a6f8570e85
Fix r2_hbo_grub_memmove ext2 crash
grub_disk_read_ex (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, void *buf, int flags) { unsigned real_offset; if (! flags) return grub_disk_read (disk, sector, offset, size, buf); if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE) return grub_errno; real_offset = offset; while (size) { char tmp_buf[GRUB_DISK_SECTOR_SIZE]; grub_size_t len; if ((real_offset != 0) || (size < GRUB_DISK_SECTOR_SIZE)) { len = GRUB_DISK_SECTOR_SIZE - real_offset; if (len > size) len = size; if (buf) { if ((disk->dev->read) (disk, sector, 1, tmp_buf) != GRUB_ERR_NONE) break; grub_memcpy (buf, tmp_buf + real_offset, len); } if (disk->read_hook) (disk->read_hook) (sector, real_offset, len, disk->closure); sector++; real_offset = 0; } else { grub_size_t n; len = size & ~(GRUB_DISK_SECTOR_SIZE - 1); n = size >> GRUB_DISK_SECTOR_BITS; if ((buf) && ((disk->dev->read) (disk, sector, n, buf) != GRUB_ERR_NONE)) break; if (disk->read_hook) { while (n) { (disk->read_hook) (sector++, 0, GRUB_DISK_SECTOR_SIZE, disk->closure); n--; } } else sector += n; } if (buf) buf = (char *) buf + len; size -= len; } return grub_errno; }
grub_disk_read_ex (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, void *buf, int flags) { unsigned real_offset; if (! flags) return grub_disk_read (disk, sector, offset, size, buf); if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE) return grub_errno; real_offset = offset; while (size) { char tmp_buf[GRUB_DISK_SECTOR_SIZE]; grub_size_t len; if ((real_offset != 0) || (size < GRUB_DISK_SECTOR_SIZE)) { len = GRUB_DISK_SECTOR_SIZE - real_offset; if (len > size) len = size; if (buf) { if ((disk->dev->read) (disk, sector, 1, tmp_buf) != GRUB_ERR_NONE) break; grub_memcpy (buf, tmp_buf + real_offset, len); } if (disk->read_hook) (disk->read_hook) (sector, real_offset, len, disk->closure); sector++; real_offset = 0; } else { grub_size_t n; len = size & ~(GRUB_DISK_SECTOR_SIZE - 1); n = size >> GRUB_DISK_SECTOR_BITS; if ((buf) && ((disk->dev->read) (disk, sector, n, buf) != GRUB_ERR_NONE)) break; if (disk->read_hook) { while (n) { (disk->read_hook) (sector++, 0, GRUB_DISK_SECTOR_SIZE, disk->closure); n--; } } else sector += n; } if (buf) buf = (char *) buf + len; size -= len; } return grub_errno; }
C
radare2
0
CVE-2016-9317
https://www.cvedetails.com/cve/CVE-2016-9317/
CWE-20
https://github.com/libgd/libgd/commit/1846f48e5fcdde996e7c27a4bbac5d0aef183e4b
1846f48e5fcdde996e7c27a4bbac5d0aef183e4b
Fix #340: System frozen gdImageCreate() doesn't check for oversized images and as such is prone to DoS vulnerabilities. We fix that by applying the same overflow check that is already in place for gdImageCreateTrueColor(). CVE-2016-9317
BGD_DECLARE(void) gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) { im->alphaBlendingFlag = alphaBlendingArg; }
BGD_DECLARE(void) gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) { im->alphaBlendingFlag = alphaBlendingArg; }
C
libgd
0
CVE-2018-19044
https://www.cvedetails.com/cve/CVE-2018-19044/
CWE-59
https://github.com/acassen/keepalived/commit/04f2d32871bb3b11d7dc024039952f2fe2750306
04f2d32871bb3b11d7dc024039952f2fe2750306
When opening files for write, ensure they aren't symbolic links Issue #1048 identified that if, for example, a non privileged user created a symbolic link from /etc/keepalvied.data to /etc/passwd, writing to /etc/keepalived.data (which could be invoked via DBus) would cause /etc/passwd to be overwritten. This commit stops keepalived writing to pathnames where the ultimate component is a symbolic link, by setting O_NOFOLLOW whenever opening a file for writing. This might break some setups, where, for example, /etc/keepalived.data was a symbolic link to /home/fred/keepalived.data. If this was the case, instead create a symbolic link from /home/fred/keepalived.data to /tmp/keepalived.data, so that the file is still accessible via /home/fred/keepalived.data. There doesn't appear to be a way around this backward incompatibility, since even checking if the pathname is a symbolic link prior to opening for writing would create a race condition. Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
fifo_open(notify_fifo_t* fifo, int (*script_exit)(thread_t *), const char *type) { int ret; int sav_errno; if (fifo->name) { sav_errno = 0; if (!(ret = mkfifo(fifo->name, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) fifo->created_fifo = true; else { sav_errno = errno; if (sav_errno != EEXIST) log_message(LOG_INFO, "Unable to create %snotify fifo %s", type, fifo->name); } if (!sav_errno || sav_errno == EEXIST) { /* Run the notify script if there is one */ if (fifo->script) notify_fifo_exec(master, script_exit, fifo, fifo->script); /* Now open the fifo */ if ((fifo->fd = open(fifo->name, O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOFOLLOW)) == -1) { log_message(LOG_INFO, "Unable to open %snotify fifo %s - errno %d", type, fifo->name, errno); if (fifo->created_fifo) { unlink(fifo->name); fifo->created_fifo = false; } } } if (fifo->fd == -1) { FREE(fifo->name); fifo->name = NULL; } } }
fifo_open(notify_fifo_t* fifo, int (*script_exit)(thread_t *), const char *type) { int ret; int sav_errno; if (fifo->name) { sav_errno = 0; if (!(ret = mkfifo(fifo->name, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) fifo->created_fifo = true; else { sav_errno = errno; if (sav_errno != EEXIST) log_message(LOG_INFO, "Unable to create %snotify fifo %s", type, fifo->name); } if (!sav_errno || sav_errno == EEXIST) { /* Run the notify script if there is one */ if (fifo->script) notify_fifo_exec(master, script_exit, fifo, fifo->script); /* Now open the fifo */ if ((fifo->fd = open(fifo->name, O_RDWR | O_CLOEXEC | O_NONBLOCK)) == -1) { log_message(LOG_INFO, "Unable to open %snotify fifo %s - errno %d", type, fifo->name, errno); if (fifo->created_fifo) { unlink(fifo->name); fifo->created_fifo = false; } } } if (fifo->fd == -1) { FREE(fifo->name); fifo->name = NULL; } } }
C
keepalived
1
CVE-2017-12843
https://www.cvedetails.com/cve/CVE-2017-12843/
CWE-20
https://github.com/cyrusimap/cyrus-imapd/commit/53c4137bd924b954432c6c59da7572c4c5ffa901
53c4137bd924b954432c6c59da7572c4c5ffa901
imapd: check for isadmin BEFORE parsing sync lines
static void cmd_id(char *tag) { int c = EOF, npair = 0; static struct buf arg, field; /* check if we've already had an ID in non-authenticated state */ if (!imapd_userid && imapd_id.did_id) { prot_printf(imapd_out, "%s OK NIL\r\n", tag); eatline(imapd_in, c); return; } clear_id(); /* ok, accept parameter list */ c = getword(imapd_in, &arg); /* check for "NIL" or start of parameter list */ if (strcasecmp(arg.s, "NIL") && c != '(') { prot_printf(imapd_out, "%s BAD Invalid parameter list in Id\r\n", tag); eatline(imapd_in, c); return; } /* parse parameter list */ if (c == '(') { for (;;) { if (c == ')') { /* end of string/value pairs */ break; } /* get field name */ c = getstring(imapd_in, imapd_out, &field); if (c != ' ') { prot_printf(imapd_out, "%s BAD Invalid/missing field name in Id\r\n", tag); eatline(imapd_in, c); return; } /* get field value */ c = getnstring(imapd_in, imapd_out, &arg); if (c != ' ' && c != ')') { prot_printf(imapd_out, "%s BAD Invalid/missing value in Id\r\n", tag); eatline(imapd_in, c); return; } /* ok, we're anal, but we'll still process the ID command */ if (strlen(field.s) > MAXIDFIELDLEN) { prot_printf(imapd_out, "%s BAD field longer than %u octets in Id\r\n", tag, MAXIDFIELDLEN); eatline(imapd_in, c); return; } if (arg.len > MAXIDVALUELEN) { prot_printf(imapd_out, "%s BAD value longer than %u octets in Id\r\n", tag, MAXIDVALUELEN); eatline(imapd_in, c); return; } if (++npair > MAXIDPAIRS) { prot_printf(imapd_out, "%s BAD too many (%u) field-value pairs in ID\r\n", tag, MAXIDPAIRS); eatline(imapd_in, c); return; } if (!strcmp(field.s, "os") && !strcmp(arg.s, "iOS")) { imapd_id.quirks |= QUIRK_SEARCHFUZZY; } /* ok, we're happy enough */ appendattvalue(&imapd_id.params, field.s, &arg); } if (c != ')') { /* erp! */ prot_printf(imapd_out, "%s BAD trailing junk\r\n", tag); eatline(imapd_in, c); return; } c = prot_getc(imapd_in); } /* check for CRLF */ if (c == '\r') c = prot_getc(imapd_in); if (c != '\n') { prot_printf(imapd_out, "%s BAD Unexpected extra arguments to Id\r\n", tag); eatline(imapd_in, c); return; } /* log the client's ID string. eventually this should be a callback or something. */ if (npair) { struct buf logbuf = BUF_INITIALIZER; struct attvaluelist *pptr; for (pptr = imapd_id.params; pptr; pptr = pptr->next) { const char *val = buf_cstring(&pptr->value); /* should we check for and format literals here ??? */ buf_printf(&logbuf, " \"%s\" ", pptr->attrib); if (!val || !strcmp(val, "NIL")) buf_printf(&logbuf, "NIL"); else buf_printf(&logbuf, "\"%s\"", val); } syslog(LOG_INFO, "client id sessionid=<%s>:%s", session_id(), buf_cstring(&logbuf)); buf_free(&logbuf); } /* spit out our ID string. eventually this might be configurable. */ if (config_getswitch(IMAPOPT_IMAPIDRESPONSE) && (imapd_authstate || (config_serverinfo == IMAP_ENUM_SERVERINFO_ON))) { id_response(imapd_out); prot_printf(imapd_out, ")\r\n"); } else prot_printf(imapd_out, "* ID NIL\r\n"); imapd_check(NULL, 0); prot_printf(imapd_out, "%s OK %s\r\n", tag, error_message(IMAP_OK_COMPLETED)); imapd_id.did_id = 1; }
static void cmd_id(char *tag) { int c = EOF, npair = 0; static struct buf arg, field; /* check if we've already had an ID in non-authenticated state */ if (!imapd_userid && imapd_id.did_id) { prot_printf(imapd_out, "%s OK NIL\r\n", tag); eatline(imapd_in, c); return; } clear_id(); /* ok, accept parameter list */ c = getword(imapd_in, &arg); /* check for "NIL" or start of parameter list */ if (strcasecmp(arg.s, "NIL") && c != '(') { prot_printf(imapd_out, "%s BAD Invalid parameter list in Id\r\n", tag); eatline(imapd_in, c); return; } /* parse parameter list */ if (c == '(') { for (;;) { if (c == ')') { /* end of string/value pairs */ break; } /* get field name */ c = getstring(imapd_in, imapd_out, &field); if (c != ' ') { prot_printf(imapd_out, "%s BAD Invalid/missing field name in Id\r\n", tag); eatline(imapd_in, c); return; } /* get field value */ c = getnstring(imapd_in, imapd_out, &arg); if (c != ' ' && c != ')') { prot_printf(imapd_out, "%s BAD Invalid/missing value in Id\r\n", tag); eatline(imapd_in, c); return; } /* ok, we're anal, but we'll still process the ID command */ if (strlen(field.s) > MAXIDFIELDLEN) { prot_printf(imapd_out, "%s BAD field longer than %u octets in Id\r\n", tag, MAXIDFIELDLEN); eatline(imapd_in, c); return; } if (arg.len > MAXIDVALUELEN) { prot_printf(imapd_out, "%s BAD value longer than %u octets in Id\r\n", tag, MAXIDVALUELEN); eatline(imapd_in, c); return; } if (++npair > MAXIDPAIRS) { prot_printf(imapd_out, "%s BAD too many (%u) field-value pairs in ID\r\n", tag, MAXIDPAIRS); eatline(imapd_in, c); return; } if (!strcmp(field.s, "os") && !strcmp(arg.s, "iOS")) { imapd_id.quirks |= QUIRK_SEARCHFUZZY; } /* ok, we're happy enough */ appendattvalue(&imapd_id.params, field.s, &arg); } if (c != ')') { /* erp! */ prot_printf(imapd_out, "%s BAD trailing junk\r\n", tag); eatline(imapd_in, c); return; } c = prot_getc(imapd_in); } /* check for CRLF */ if (c == '\r') c = prot_getc(imapd_in); if (c != '\n') { prot_printf(imapd_out, "%s BAD Unexpected extra arguments to Id\r\n", tag); eatline(imapd_in, c); return; } /* log the client's ID string. eventually this should be a callback or something. */ if (npair) { struct buf logbuf = BUF_INITIALIZER; struct attvaluelist *pptr; for (pptr = imapd_id.params; pptr; pptr = pptr->next) { const char *val = buf_cstring(&pptr->value); /* should we check for and format literals here ??? */ buf_printf(&logbuf, " \"%s\" ", pptr->attrib); if (!val || !strcmp(val, "NIL")) buf_printf(&logbuf, "NIL"); else buf_printf(&logbuf, "\"%s\"", val); } syslog(LOG_INFO, "client id sessionid=<%s>:%s", session_id(), buf_cstring(&logbuf)); buf_free(&logbuf); } /* spit out our ID string. eventually this might be configurable. */ if (config_getswitch(IMAPOPT_IMAPIDRESPONSE) && (imapd_authstate || (config_serverinfo == IMAP_ENUM_SERVERINFO_ON))) { id_response(imapd_out); prot_printf(imapd_out, ")\r\n"); } else prot_printf(imapd_out, "* ID NIL\r\n"); imapd_check(NULL, 0); prot_printf(imapd_out, "%s OK %s\r\n", tag, error_message(IMAP_OK_COMPLETED)); imapd_id.did_id = 1; }
C
cyrus-imapd
0
CVE-2017-12190
https://www.cvedetails.com/cve/CVE-2017-12190/
CWE-772
https://github.com/torvalds/linux/commit/95d78c28b5a85bacbc29b8dba7c04babb9b0d467
95d78c28b5a85bacbc29b8dba7c04babb9b0d467
fix unbalanced page refcounting in bio_map_user_iov bio_map_user_iov and bio_unmap_user do unbalanced pages refcounting if IO vector has small consecutive buffers belonging to the same page. bio_add_pc_page merges them into one, but the page reference is never dropped. Cc: stable@vger.kernel.org Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
static struct bio *__bio_chain_endio(struct bio *bio) { struct bio *parent = bio->bi_private; if (!parent->bi_status) parent->bi_status = bio->bi_status; bio_put(bio); return parent; }
static struct bio *__bio_chain_endio(struct bio *bio) { struct bio *parent = bio->bi_private; if (!parent->bi_status) parent->bi_status = bio->bi_status; bio_put(bio); return parent; }
C
linux
0
CVE-2012-2896
https://www.cvedetails.com/cve/CVE-2012-2896/
CWE-189
https://github.com/chromium/chromium/commit/3aad1a37affb1ab70d1897f2b03eb8c077264984
3aad1a37affb1ab70d1897f2b03eb8c077264984
Fix SafeAdd and SafeMultiply BUG=145648,145544 Review URL: https://chromiumcodereview.appspot.com/10916165 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155478 0039d316-1c4b-4281-b951-d872f2087c98
error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( uint32 immediate_data_size, const gles2::PostSubBufferCHROMIUM& c) { TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); if (!surface_->HasExtension("GL_CHROMIUM_post_sub_buffer")) { SetGLError(GL_INVALID_OPERATION, "glPostSubBufferCHROMIUM", "command not supported by surface"); return error::kNoError; } if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { return error::kNoError; } else { LOG(ERROR) << "Context lost because PostSubBuffer failed."; return error::kLostContext; } }
error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( uint32 immediate_data_size, const gles2::PostSubBufferCHROMIUM& c) { TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); if (!surface_->HasExtension("GL_CHROMIUM_post_sub_buffer")) { SetGLError(GL_INVALID_OPERATION, "glPostSubBufferCHROMIUM", "command not supported by surface"); return error::kNoError; } if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) { return error::kNoError; } else { LOG(ERROR) << "Context lost because PostSubBuffer failed."; return error::kLostContext; } }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/9d02cda7a634fbd6e53d98091f618057f0174387
9d02cda7a634fbd6e53d98091f618057f0174387
Coverity: Fixing pass by value. CID=101462, 101458, 101437, 101471, 101467 BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/9006023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115257 0039d316-1c4b-4281-b951-d872f2087c98
bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) { return ReadExtensionPrefBoolean(extension_id, kPrefAllowFileAccess); }
bool ExtensionPrefs::AllowFileAccess(const std::string& extension_id) { return ReadExtensionPrefBoolean(extension_id, kPrefAllowFileAccess); }
C
Chrome
0
CVE-2016-9756
https://www.cvedetails.com/cve/CVE-2016-9756/
CWE-200
https://github.com/torvalds/linux/commit/2117d5398c81554fbf803f5fd1dc55eb78216c0c
2117d5398c81554fbf803f5fd1dc55eb78216c0c
KVM: x86: drop error recovery in em_jmp_far and em_ret_far em_jmp_far and em_ret_far assumed that setting IP can only fail in 64 bit mode, but syzkaller proved otherwise (and SDM agrees). Code segment was restored upon failure, but it was left uninitialized outside of long mode, which could lead to a leak of host kernel stack. We could have fixed that by always saving and restoring the CS, but we take a simpler approach and just break any guest that manages to fail as the error recovery is error-prone and modern CPUs don't need emulator for this. Found by syzkaller: WARNING: CPU: 2 PID: 3668 at arch/x86/kvm/emulate.c:2217 em_ret_far+0x428/0x480 Kernel panic - not syncing: panic_on_warn set ... CPU: 2 PID: 3668 Comm: syz-executor Not tainted 4.9.0-rc4+ #49 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 [...] Call Trace: [...] __dump_stack lib/dump_stack.c:15 [...] dump_stack+0xb3/0x118 lib/dump_stack.c:51 [...] panic+0x1b7/0x3a3 kernel/panic.c:179 [...] __warn+0x1c4/0x1e0 kernel/panic.c:542 [...] warn_slowpath_null+0x2c/0x40 kernel/panic.c:585 [...] em_ret_far+0x428/0x480 arch/x86/kvm/emulate.c:2217 [...] em_ret_far_imm+0x17/0x70 arch/x86/kvm/emulate.c:2227 [...] x86_emulate_insn+0x87a/0x3730 arch/x86/kvm/emulate.c:5294 [...] x86_emulate_instruction+0x520/0x1ba0 arch/x86/kvm/x86.c:5545 [...] emulate_instruction arch/x86/include/asm/kvm_host.h:1116 [...] complete_emulated_io arch/x86/kvm/x86.c:6870 [...] complete_emulated_mmio+0x4e9/0x710 arch/x86/kvm/x86.c:6934 [...] kvm_arch_vcpu_ioctl_run+0x3b7a/0x5a90 arch/x86/kvm/x86.c:6978 [...] kvm_vcpu_ioctl+0x61e/0xdd0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:2557 [...] vfs_ioctl fs/ioctl.c:43 [...] do_vfs_ioctl+0x18c/0x1040 fs/ioctl.c:679 [...] SYSC_ioctl fs/ioctl.c:694 [...] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 [...] entry_SYSCALL_64_fastpath+0x1f/0xc2 Reported-by: Dmitry Vyukov <dvyukov@google.com> Cc: stable@vger.kernel.org Fixes: d1442d85cc30 ("KVM: x86: Handle errors when RIP is set during far jumps") Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
static int em_jmp_far(struct x86_emulate_ctxt *ctxt) { int rc; unsigned short sel; struct desc_struct new_desc; u8 cpl = ctxt->ops->cpl(ctxt); memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, X86_TRANSFER_CALL_JMP, &new_desc); if (rc != X86EMUL_CONTINUE) return rc; rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc); /* Error handling is not implemented. */ if (rc != X86EMUL_CONTINUE) return X86EMUL_UNHANDLEABLE; return rc; }
static int em_jmp_far(struct x86_emulate_ctxt *ctxt) { int rc; unsigned short sel, old_sel; struct desc_struct old_desc, new_desc; const struct x86_emulate_ops *ops = ctxt->ops; u8 cpl = ctxt->ops->cpl(ctxt); /* Assignment of RIP may only fail in 64-bit mode */ if (ctxt->mode == X86EMUL_MODE_PROT64) ops->get_segment(ctxt, &old_sel, &old_desc, NULL, VCPU_SREG_CS); memcpy(&sel, ctxt->src.valptr + ctxt->op_bytes, 2); rc = __load_segment_descriptor(ctxt, sel, VCPU_SREG_CS, cpl, X86_TRANSFER_CALL_JMP, &new_desc); if (rc != X86EMUL_CONTINUE) return rc; rc = assign_eip_far(ctxt, ctxt->src.val, &new_desc); if (rc != X86EMUL_CONTINUE) { WARN_ON(ctxt->mode != X86EMUL_MODE_PROT64); /* assigning eip failed; restore the old cs */ ops->set_segment(ctxt, old_sel, &old_desc, 0, VCPU_SREG_CS); return rc; } return rc; }
C
linux
1
CVE-2016-6136
https://www.cvedetails.com/cve/CVE-2016-6136/
CWE-362
https://github.com/torvalds/linux/commit/43761473c254b45883a64441dd0bc85a42f3645c
43761473c254b45883a64441dd0bc85a42f3645c
audit: fix a double fetch in audit_log_single_execve_arg() There is a double fetch problem in audit_log_single_execve_arg() where we first check the execve(2) argumnets for any "bad" characters which would require hex encoding and then re-fetch the arguments for logging in the audit record[1]. Of course this leaves a window of opportunity for an unsavory application to munge with the data. This patch reworks things by only fetching the argument data once[2] into a buffer where it is scanned and logged into the audit records(s). In addition to fixing the double fetch, this patch improves on the original code in a few other ways: better handling of large arguments which require encoding, stricter record length checking, and some performance improvements (completely unverified, but we got rid of some strlen() calls, that's got to be a good thing). As part of the development of this patch, I've also created a basic regression test for the audit-testsuite, the test can be tracked on GitHub at the following link: * https://github.com/linux-audit/audit-testsuite/issues/25 [1] If you pay careful attention, there is actually a triple fetch problem due to a strnlen_user() call at the top of the function. [2] This is a tiny white lie, we do make a call to strnlen_user() prior to fetching the argument data. I don't like it, but due to the way the audit record is structured we really have no choice unless we copy the entire argument at once (which would require a rather wasteful allocation). The good news is that with this patch the kernel no longer relies on this strnlen_user() value for anything beyond recording it in the log, we also update it with a trustworthy value whenever possible. Reported-by: Pengfei Wang <wpengfeinudt@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Paul Moore <paul@paul-moore.com>
static int match_tree_refs(struct audit_context *ctx, struct audit_tree *tree) { #ifdef CONFIG_AUDIT_TREE struct audit_tree_refs *p; int n; if (!tree) return 0; /* full ones */ for (p = ctx->first_trees; p != ctx->trees; p = p->next) { for (n = 0; n < 31; n++) if (audit_tree_match(p->c[n], tree)) return 1; } /* partial */ if (p) { for (n = ctx->tree_count; n < 31; n++) if (audit_tree_match(p->c[n], tree)) return 1; } #endif return 0; }
static int match_tree_refs(struct audit_context *ctx, struct audit_tree *tree) { #ifdef CONFIG_AUDIT_TREE struct audit_tree_refs *p; int n; if (!tree) return 0; /* full ones */ for (p = ctx->first_trees; p != ctx->trees; p = p->next) { for (n = 0; n < 31; n++) if (audit_tree_match(p->c[n], tree)) return 1; } /* partial */ if (p) { for (n = ctx->tree_count; n < 31; n++) if (audit_tree_match(p->c[n], tree)) return 1; } #endif return 0; }
C
linux
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
Document* DocumentLoader::document() const { if (m_frame && m_frame->loader()->documentLoader() == this) return m_frame->document(); return 0; }
Document* DocumentLoader::document() const { if (m_frame && m_frame->loader()->documentLoader() == this) return m_frame->document(); return 0; }
C
Chrome
0
CVE-2015-1221
https://www.cvedetails.com/cve/CVE-2015-1221/
null
https://github.com/chromium/chromium/commit/a69c7b5d863dacbb08bfaa04359e3bc0bb4470dc
a69c7b5d863dacbb08bfaa04359e3bc0bb4470dc
Make TypingCommand::insertText() to take SelectionInDOMTree instead of VisibleSelection This patch makes |TypingCommand::insertText()| to take |SelectionInDOMTree| instead of |VisibleSelection| to reduce usage of |VisibleSelection| for improving code health. BUG=657237 TEST=n/a Review-Url: https://codereview.chromium.org/2733183002 Cr-Commit-Position: refs/heads/master@{#455368}
void Editor::applyParagraphStyleToSelection(StylePropertySet* style, InputEvent::InputType inputType) { if (!style || style->isEmpty() || !canEditRichly()) return; applyParagraphStyle(style, inputType); }
void Editor::applyParagraphStyleToSelection(StylePropertySet* style, InputEvent::InputType inputType) { if (!style || style->isEmpty() || !canEditRichly()) return; applyParagraphStyle(style, inputType); }
C
Chrome
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 void __net_exit netlink_net_exit(struct net *net) { #ifdef CONFIG_PROC_FS proc_net_remove(net, "netlink"); #endif }
static void __net_exit netlink_net_exit(struct net *net) { #ifdef CONFIG_PROC_FS proc_net_remove(net, "netlink"); #endif }
C
linux
0
CVE-2016-7166
https://www.cvedetails.com/cve/CVE-2016-7166/
CWE-399
https://github.com/libarchive/libarchive/commit/6e06b1c89dd0d16f74894eac4cfc1327a06ee4a0
6e06b1c89dd0d16f74894eac4cfc1327a06ee4a0
Fix a potential crash issue discovered by Alexander Cherepanov: It seems bsdtar automatically handles stacked compression. This is a nice feature but it could be problematic when it's completely unlimited. Most clearly it's illustrated with quines: $ curl -sRO http://www.maximumcompression.com/selfgz.gz $ (ulimit -v 10000000 && bsdtar -tvf selfgz.gz) bsdtar: Error opening archive: Can't allocate data for gzip decompression Without ulimit, bsdtar will eat all available memory. This could also be a problem for other applications using libarchive.
archive_read_vtable(void) { static struct archive_vtable av; static int inited = 0; if (!inited) { av.archive_filter_bytes = _archive_filter_bytes; av.archive_filter_code = _archive_filter_code; av.archive_filter_name = _archive_filter_name; av.archive_filter_count = _archive_filter_count; av.archive_read_data_block = _archive_read_data_block; av.archive_read_next_header = _archive_read_next_header; av.archive_read_next_header2 = _archive_read_next_header2; av.archive_free = _archive_read_free; av.archive_close = _archive_read_close; inited = 1; } return (&av); }
archive_read_vtable(void) { static struct archive_vtable av; static int inited = 0; if (!inited) { av.archive_filter_bytes = _archive_filter_bytes; av.archive_filter_code = _archive_filter_code; av.archive_filter_name = _archive_filter_name; av.archive_filter_count = _archive_filter_count; av.archive_read_data_block = _archive_read_data_block; av.archive_read_next_header = _archive_read_next_header; av.archive_read_next_header2 = _archive_read_next_header2; av.archive_free = _archive_read_free; av.archive_close = _archive_read_close; inited = 1; } return (&av); }
C
libarchive
0
null
null
null
https://github.com/chromium/chromium/commit/a44b00c88bc5ea35b5b150217c5fd6e4ce168e58
a44b00c88bc5ea35b5b150217c5fd6e4ce168e58
Apply behaviour change fix from upstream for previous XPath change. BUG=58731 TEST=NONE Review URL: http://codereview.chromium.org/4027006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63572 0039d316-1c4b-4281-b951-d872f2087c98
xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); if (cur == NULL) { if (ctxt->context->node == NULL) return(NULL); switch (ctxt->context->node->type) { case XML_ELEMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_NOTATION_NODE: case XML_DTD_NODE: return(ctxt->context->node->children); case XML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_HTML_DOCUMENT_NODE: #ifdef LIBXML_DOCB_ENABLED case XML_DOCB_DOCUMENT_NODE: #endif return(((xmlDocPtr) ctxt->context->node)->children); case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: case XML_ENTITY_DECL: case XML_ATTRIBUTE_NODE: case XML_NAMESPACE_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: return(NULL); } return(NULL); } if ((cur->type == XML_DOCUMENT_NODE) || (cur->type == XML_HTML_DOCUMENT_NODE)) return(NULL); return(cur->next); }
xmlXPathNextChild(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); if (cur == NULL) { if (ctxt->context->node == NULL) return(NULL); switch (ctxt->context->node->type) { case XML_ELEMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_ENTITY_REF_NODE: case XML_ENTITY_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_NOTATION_NODE: case XML_DTD_NODE: return(ctxt->context->node->children); case XML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_HTML_DOCUMENT_NODE: #ifdef LIBXML_DOCB_ENABLED case XML_DOCB_DOCUMENT_NODE: #endif return(((xmlDocPtr) ctxt->context->node)->children); case XML_ELEMENT_DECL: case XML_ATTRIBUTE_DECL: case XML_ENTITY_DECL: case XML_ATTRIBUTE_NODE: case XML_NAMESPACE_DECL: case XML_XINCLUDE_START: case XML_XINCLUDE_END: return(NULL); } return(NULL); } if ((cur->type == XML_DOCUMENT_NODE) || (cur->type == XML_HTML_DOCUMENT_NODE)) return(NULL); return(cur->next); }
C
Chrome
0
CVE-2018-1091
https://www.cvedetails.com/cve/CVE-2018-1091/
CWE-119
https://github.com/torvalds/linux/commit/c1fa0768a8713b135848f78fd43ffc208d8ded70
c1fa0768a8713b135848f78fd43ffc208d8ded70
powerpc/tm: Flush TM only if CPU has TM feature Commit cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") added code to access TM SPRs in flush_tmregs_to_thread(). However flush_tmregs_to_thread() does not check if TM feature is available on CPU before trying to access TM SPRs in order to copy live state to thread structures. flush_tmregs_to_thread() is indeed guarded by CONFIG_PPC_TRANSACTIONAL_MEM but it might be the case that kernel was compiled with CONFIG_PPC_TRANSACTIONAL_MEM enabled and ran on a CPU without TM feature available, thus rendering the execution of TM instructions that are treated by the CPU as illegal instructions. The fix is just to add proper checking in flush_tmregs_to_thread() if CPU has the TM feature before accessing any TM-specific resource, returning immediately if TM is no available on the CPU. Adding that checking in flush_tmregs_to_thread() instead of in places where it is called, like in vsr_get() and vsr_set(), is better because avoids the same problem cropping up elsewhere. Cc: stable@vger.kernel.org # v4.13+ Fixes: cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump") Signed-off-by: Gustavo Romero <gromero@linux.vnet.ibm.com> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
static int fpr_get(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf) { #ifdef CONFIG_VSX u64 buf[33]; int i; flush_fp_to_thread(target); /* copy to local buffer then write that out */ for (i = 0; i < 32 ; i++) buf[i] = target->thread.TS_FPR(i); buf[32] = target->thread.fp_state.fpscr; return user_regset_copyout(&pos, &count, &kbuf, &ubuf, buf, 0, -1); #else BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != offsetof(struct thread_fp_state, fpr[32])); flush_fp_to_thread(target); return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.fp_state, 0, -1); #endif }
static int fpr_get(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf) { #ifdef CONFIG_VSX u64 buf[33]; int i; flush_fp_to_thread(target); /* copy to local buffer then write that out */ for (i = 0; i < 32 ; i++) buf[i] = target->thread.TS_FPR(i); buf[32] = target->thread.fp_state.fpscr; return user_regset_copyout(&pos, &count, &kbuf, &ubuf, buf, 0, -1); #else BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != offsetof(struct thread_fp_state, fpr[32])); flush_fp_to_thread(target); return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.fp_state, 0, -1); #endif }
C
linux
0
CVE-2018-16066
https://www.cvedetails.com/cve/CVE-2018-16066/
CWE-416
https://github.com/chromium/chromium/commit/2bf635c28effa427a270f4fc45df84ed344f411c
2bf635c28effa427a270f4fc45df84ed344f411c
Do not crash while reentrantly appending to style element. When a node is inserted into a container, it is notified via ::InsertedInto. However, a node may request a second notification via DidNotifySubtreeInsertionsToDocument, which occurs after all the children have been notified as well. *StyleElement is currently using this second notification. This causes a problem, because *ScriptElement is using the same mechanism, which in turn means that scripts can execute before the state of *StyleElements are properly updated. This patch avoids ::DidNotifySubtreeInsertionsToDocument, and instead processes the stylesheet in ::InsertedInto. The original reason for using ::DidNotifySubtreeInsertionsToDocument in the first place appears to be invalid now, as the test case is still passing. R=futhark@chromium.org, hayato@chromium.org Bug: 853709, 847570 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Ic0b5fa611044c78c5745cf26870a747f88920a14 Reviewed-on: https://chromium-review.googlesource.com/1104347 Commit-Queue: Anders Ruud <andruud@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#568368}
inline HTMLStyleElement::HTMLStyleElement(Document& document, const CreateElementFlags flags) : HTMLElement(styleTag, document), StyleElement(&document, flags.IsCreatedByParser()), fired_load_(false), loaded_sheet_(false) {}
inline HTMLStyleElement::HTMLStyleElement(Document& document, const CreateElementFlags flags) : HTMLElement(styleTag, document), StyleElement(&document, flags.IsCreatedByParser()), fired_load_(false), loaded_sheet_(false) {}
C
Chrome
0
CVE-2019-5778
https://www.cvedetails.com/cve/CVE-2019-5778/
CWE-79
https://github.com/chromium/chromium/commit/e13eb21898c7eba584f680e3d17ca1b9e28bc505
e13eb21898c7eba584f680e3d17ca1b9e28bc505
[Extensions] Have URLPattern::Contains() properly check schemes Have URLPattern::Contains() properly check the schemes of the patterns when evaluating if one pattern contains another. This is important in order to prevent extensions from requesting chrome:-scheme permissions via the permissions API when <all_urls> is specified as an optional permission. Bug: 859600,918470 Change-Id: If04d945ad0c939e84a80d83502c0f84b6ef0923d Reviewed-on: https://chromium-review.googlesource.com/c/1396561 Commit-Queue: Devlin <rdevlin.cronin@chromium.org> Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Cr-Commit-Position: refs/heads/master@{#621410}
scoped_refptr<const Extension> CreateExtensionWithOptionalPermissions( std::unique_ptr<base::Value> optional_permissions, std::unique_ptr<base::Value> permissions, const std::string& name) { return ExtensionBuilder() .SetLocation(Manifest::INTERNAL) .SetManifest( DictionaryBuilder() .Set("name", name) .Set("description", "foo") .Set("manifest_version", 2) .Set("version", "0.1.2.3") .Set("permissions", std::move(permissions)) .Set("optional_permissions", std::move(optional_permissions)) .Build()) .SetID(crx_file::id_util::GenerateId(name)) .Build(); }
scoped_refptr<const Extension> CreateExtensionWithOptionalPermissions( std::unique_ptr<base::Value> optional_permissions, std::unique_ptr<base::Value> permissions, const std::string& name) { return ExtensionBuilder() .SetLocation(Manifest::INTERNAL) .SetManifest( DictionaryBuilder() .Set("name", name) .Set("description", "foo") .Set("manifest_version", 2) .Set("version", "0.1.2.3") .Set("permissions", std::move(permissions)) .Set("optional_permissions", std::move(optional_permissions)) .Build()) .SetID(crx_file::id_util::GenerateId(name)) .Build(); }
C
Chrome
0
CVE-2016-5218
https://www.cvedetails.com/cve/CVE-2016-5218/
CWE-20
https://github.com/chromium/chromium/commit/45d901b56f578a74b19ba0d10fa5c4c467f19303
45d901b56f578a74b19ba0d10fa5c4c467f19303
Paint tab groups with the group color. * The background of TabGroupHeader now uses the group color. * The backgrounds of tabs in the group are tinted with the group color. This treatment, along with the colors chosen, are intended to be a placeholder. Bug: 905491 Change-Id: Ic808548f8eba23064606e7fb8c9bba281d0d117f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610504 Commit-Queue: Bret Sepulveda <bsep@chromium.org> Reviewed-by: Taylor Bergquist <tbergquist@chromium.org> Cr-Commit-Position: refs/heads/master@{#660498}
void TabStrip::OnMouseEventInTab(views::View* source, const ui::MouseEvent& event) { UpdateStackedLayoutFromMouseEvent(source, event); }
void TabStrip::OnMouseEventInTab(views::View* source, const ui::MouseEvent& event) { UpdateStackedLayoutFromMouseEvent(source, event); }
C
Chrome
0
CVE-2015-8935
https://www.cvedetails.com/cve/CVE-2015-8935/
CWE-79
https://github.com/php/php-src/commit/996faf964bba1aec06b153b370a7f20d3dd2bb8b?w=1
996faf964bba1aec06b153b370a7f20d3dd2bb8b?w=1
Update header handling to RFC 7230
PHP_FUNCTION(header_register_callback) { zval *callback_func; char *callback_name; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callback_func) == FAILURE) { return; } if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) { efree(callback_name); RETURN_FALSE; } efree(callback_name); if (SG(callback_func)) { zval_ptr_dtor(&SG(callback_func)); SG(fci_cache) = empty_fcall_info_cache; } SG(callback_func) = callback_func; Z_ADDREF_P(SG(callback_func)); RETURN_TRUE; }
PHP_FUNCTION(header_register_callback) { zval *callback_func; char *callback_name; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callback_func) == FAILURE) { return; } if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) { efree(callback_name); RETURN_FALSE; } efree(callback_name); if (SG(callback_func)) { zval_ptr_dtor(&SG(callback_func)); SG(fci_cache) = empty_fcall_info_cache; } SG(callback_func) = callback_func; Z_ADDREF_P(SG(callback_func)); RETURN_TRUE; }
C
php-src
0
CVE-2019-14980
https://www.cvedetails.com/cve/CVE-2019-14980/
CWE-416
https://github.com/ImageMagick/ImageMagick6/commit/614a257295bdcdeda347086761062ac7658b6830
614a257295bdcdeda347086761062ac7658b6830
https://github.com/ImageMagick/ImageMagick6/issues/43
MagickExport unsigned short ReadBlobShort(Image *image) { register const unsigned char *p; register unsigned short value; ssize_t count; unsigned char buffer[2]; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); *buffer='\0'; p=(const unsigned char *) ReadBlobStream(image,2,buffer,&count); if (count != 2) return((unsigned short) 0U); if (image->endian == LSBEndian) { value=(unsigned short) (*p++); value|=(unsigned short) (*p++) << 8; return(value); } value=(unsigned short) ((unsigned short) (*p++) << 8); value|=(unsigned short) (*p++); return(value); }
MagickExport unsigned short ReadBlobShort(Image *image) { register const unsigned char *p; register unsigned short value; ssize_t count; unsigned char buffer[2]; assert(image != (Image *) NULL); assert(image->signature == MagickCoreSignature); *buffer='\0'; p=(const unsigned char *) ReadBlobStream(image,2,buffer,&count); if (count != 2) return((unsigned short) 0U); if (image->endian == LSBEndian) { value=(unsigned short) (*p++); value|=(unsigned short) (*p++) << 8; return(value); } value=(unsigned short) ((unsigned short) (*p++) << 8); value|=(unsigned short) (*p++); return(value); }
C
ImageMagick6
0
CVE-2017-16359
https://www.cvedetails.com/cve/CVE-2017-16359/
CWE-476
https://github.com/radare/radare2/commit/62e39f34b2705131a2d08aff0c2e542c6a52cf0e
62e39f34b2705131a2d08aff0c2e542c6a52cf0e
Fix #8764 - huge vd_aux caused pointer wraparound
ut64 Elf_(r_bin_elf_get_section_addr_end)(ELFOBJ *bin, const char *section_name) { RBinElfSection *section = get_section_by_name (bin, section_name); return section? section->rva + section->size: UT64_MAX; }
ut64 Elf_(r_bin_elf_get_section_addr_end)(ELFOBJ *bin, const char *section_name) { RBinElfSection *section = get_section_by_name (bin, section_name); return section? section->rva + section->size: UT64_MAX; }
C
radare2
0
CVE-2009-3605
https://www.cvedetails.com/cve/CVE-2009-3605/
CWE-189
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
7b2d314a61fd0e12f47c62996cb49ec0d1ba747a
null
GfxGouraudTriangleShading::GfxGouraudTriangleShading( int typeA, GfxGouraudVertex *verticesA, int nVerticesA, int (*trianglesA)[3], int nTrianglesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; vertices = verticesA; nVertices = nVerticesA; triangles = trianglesA; nTriangles = nTrianglesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
GfxGouraudTriangleShading::GfxGouraudTriangleShading( int typeA, GfxGouraudVertex *verticesA, int nVerticesA, int (*trianglesA)[3], int nTrianglesA, Function **funcsA, int nFuncsA): GfxShading(typeA) { int i; vertices = verticesA; nVertices = nVerticesA; triangles = trianglesA; nTriangles = nTrianglesA; nFuncs = nFuncsA; for (i = 0; i < nFuncs; ++i) { funcs[i] = funcsA[i]; } }
CPP
poppler
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <efault@gmx.de> Reported-by: Bjoern B. Brandenburg <bbb.lst@gmail.com> Tested-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: stable@kernel.org LKML-Reference: <1291802742.1417.9.camel@marge.simson.net> Signed-off-by: Ingo Molnar <mingo@elte.hu>
SYSCALL_DEFINE1(sched_get_priority_min, int, policy) { int ret = -EINVAL; switch (policy) { case SCHED_FIFO: case SCHED_RR: ret = 1; break; case SCHED_NORMAL: case SCHED_BATCH: case SCHED_IDLE: ret = 0; } return ret; }
SYSCALL_DEFINE1(sched_get_priority_min, int, policy) { int ret = -EINVAL; switch (policy) { case SCHED_FIFO: case SCHED_RR: ret = 1; break; case SCHED_NORMAL: case SCHED_BATCH: case SCHED_IDLE: ret = 0; } return ret; }
C
linux
0
CVE-2013-0921
https://www.cvedetails.com/cve/CVE-2013-0921/
CWE-264
https://github.com/chromium/chromium/commit/e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
e9841fbdaf41b4a2baaa413f94d5c0197f9261f4
Ensure extensions and the Chrome Web Store are loaded in new BrowsingInstances. BUG=174943 TEST=Can't post message to CWS. See bug for repro steps. Review URL: https://chromiumcodereview.appspot.com/12301013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184208 0039d316-1c4b-4281-b951-d872f2087c98
void ChromeContentBrowserClient::DidCreatePpapiPlugin( content::BrowserPpapiHost* browser_host) { #if defined(ENABLE_PLUGINS) browser_host->GetPpapiHost()->AddHostFactoryFilter( scoped_ptr<ppapi::host::HostFactory>( new ChromeBrowserPepperHostFactory(browser_host))); #endif }
void ChromeContentBrowserClient::DidCreatePpapiPlugin( content::BrowserPpapiHost* browser_host) { #if defined(ENABLE_PLUGINS) browser_host->GetPpapiHost()->AddHostFactoryFilter( scoped_ptr<ppapi::host::HostFactory>( new ChromeBrowserPepperHostFactory(browser_host))); #endif }
C
Chrome
0
CVE-2016-8860
https://www.cvedetails.com/cve/CVE-2016-8860/
CWE-119
https://github.com/torproject/tor/commit/3cea86eb2fbb65949673eb4ba8ebb695c87a57ce
3cea86eb2fbb65949673eb4ba8ebb695c87a57ce
Add a one-word sentinel value of 0x0 at the end of each buf_t chunk This helps protect against bugs where any part of a buf_t's memory is passed to a function that expects a NUL-terminated input. It also closes TROVE-2016-10-001 (aka bug 20384).
buf_add_chunk_with_capacity(buf_t *buf, size_t capacity, int capped) { chunk_t *chunk; struct timeval now; if (CHUNK_ALLOC_SIZE(capacity) < buf->default_chunk_size) { chunk = chunk_new_with_alloc_size(buf->default_chunk_size); } else if (capped && CHUNK_ALLOC_SIZE(capacity) > MAX_CHUNK_ALLOC) { chunk = chunk_new_with_alloc_size(MAX_CHUNK_ALLOC); } else { chunk = chunk_new_with_alloc_size(preferred_chunk_size(capacity)); } tor_gettimeofday_cached_monotonic(&now); chunk->inserted_time = (uint32_t)tv_to_msec(&now); if (buf->tail) { tor_assert(buf->head); buf->tail->next = chunk; buf->tail = chunk; } else { tor_assert(!buf->head); buf->head = buf->tail = chunk; } check(); return chunk; }
buf_add_chunk_with_capacity(buf_t *buf, size_t capacity, int capped) { chunk_t *chunk; struct timeval now; if (CHUNK_ALLOC_SIZE(capacity) < buf->default_chunk_size) { chunk = chunk_new_with_alloc_size(buf->default_chunk_size); } else if (capped && CHUNK_ALLOC_SIZE(capacity) > MAX_CHUNK_ALLOC) { chunk = chunk_new_with_alloc_size(MAX_CHUNK_ALLOC); } else { chunk = chunk_new_with_alloc_size(preferred_chunk_size(capacity)); } tor_gettimeofday_cached_monotonic(&now); chunk->inserted_time = (uint32_t)tv_to_msec(&now); if (buf->tail) { tor_assert(buf->head); buf->tail->next = chunk; buf->tail = chunk; } else { tor_assert(!buf->head); buf->head = buf->tail = chunk; } check(); return chunk; }
C
tor
0
CVE-2011-2840
https://www.cvedetails.com/cve/CVE-2011-2840/
CWE-20
https://github.com/chromium/chromium/commit/2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
2db5a2048dfcacfe5ad4311c2b1e435c4c67febc
chromeos: fix bug where "aw snap" page replaces first tab if it was a NTP when closing window with > 1 tab. BUG=chromium-os:12088 TEST=verify bug per bug report. Review URL: http://codereview.chromium.org/6882058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83031 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripModel::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { switch (type.value) { case NotificationType::TAB_CONTENTS_DESTROYED: { int index = GetWrapperIndex(Source<TabContents>(source).ptr()); if (index != TabStripModel::kNoTab) { DetachTabContentsAt(index); } break; } case NotificationType::EXTENSION_UNLOADED: { const Extension* extension = Details<UnloadedExtensionInfo>(details)->extension; for (int i = count() - 1; i >= 0; i--) { TabContentsWrapper* contents = GetTabContentsAt(i); if (contents->extension_tab_helper()->extension_app() == extension) { InternalCloseTab(contents, i, false); } } break; } default: NOTREACHED(); } }
void TabStripModel::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { switch (type.value) { case NotificationType::TAB_CONTENTS_DESTROYED: { int index = GetWrapperIndex(Source<TabContents>(source).ptr()); if (index != TabStripModel::kNoTab) { DetachTabContentsAt(index); } break; } case NotificationType::EXTENSION_UNLOADED: { const Extension* extension = Details<UnloadedExtensionInfo>(details)->extension; for (int i = count() - 1; i >= 0; i--) { TabContentsWrapper* contents = GetTabContentsAt(i); if (contents->extension_tab_helper()->extension_app() == extension) { InternalCloseTab(contents, i, false); } } break; } default: NOTREACHED(); } }
C
Chrome
0
CVE-2018-20839
https://www.cvedetails.com/cve/CVE-2018-20839/
CWE-255
https://github.com/systemd/systemd/commit/9725f1a10f80f5e0ae7d9b60547458622aeb322f
9725f1a10f80f5e0ae7d9b60547458622aeb322f
Merge pull request #12378 from rbalint/vt-kbd-reset-check VT kbd reset check
int make_console_stdio(void) { int fd, r; /* Make /dev/console the controlling terminal and stdin/stdout/stderr */ fd = acquire_terminal("/dev/console", ACQUIRE_TERMINAL_FORCE|ACQUIRE_TERMINAL_PERMISSIVE, USEC_INFINITY); if (fd < 0) return log_error_errno(fd, "Failed to acquire terminal: %m"); r = reset_terminal_fd(fd, true); if (r < 0) log_warning_errno(r, "Failed to reset terminal, ignoring: %m"); r = rearrange_stdio(fd, fd, fd); /* This invalidates 'fd' both on success and on failure. */ if (r < 0) return log_error_errno(r, "Failed to make terminal stdin/stdout/stderr: %m"); reset_terminal_feature_caches(); return 0; }
int make_console_stdio(void) { int fd, r; /* Make /dev/console the controlling terminal and stdin/stdout/stderr */ fd = acquire_terminal("/dev/console", ACQUIRE_TERMINAL_FORCE|ACQUIRE_TERMINAL_PERMISSIVE, USEC_INFINITY); if (fd < 0) return log_error_errno(fd, "Failed to acquire terminal: %m"); r = reset_terminal_fd(fd, true); if (r < 0) log_warning_errno(r, "Failed to reset terminal, ignoring: %m"); r = rearrange_stdio(fd, fd, fd); /* This invalidates 'fd' both on success and on failure. */ if (r < 0) return log_error_errno(r, "Failed to make terminal stdin/stdout/stderr: %m"); reset_terminal_feature_caches(); return 0; }
C
systemd
0
CVE-2014-1738
https://www.cvedetails.com/cve/CVE-2014-1738/
CWE-264
https://github.com/torvalds/linux/commit/2145e15e0557a01b9195d1c7199a1b92cb9be81f
2145e15e0557a01b9195d1c7199a1b92cb9be81f
floppy: don't write kernel-only members to FDRAWCMD ioctl output Do not leak kernel-only floppy_raw_cmd structure members to userspace. This includes the linked-list pointer and the pointer to the allocated DMA space. Signed-off-by: Matthew Daley <mattd@bugfuzz.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static void generic_failure(void) { cont->done(0); }
static void generic_failure(void) { cont->done(0); }
C
linux
0
CVE-2016-5212
https://www.cvedetails.com/cve/CVE-2016-5212/
CWE-200
https://github.com/chromium/chromium/commit/f865c2dfddb1d95af3a2467587c62566e3f7dfe4
f865c2dfddb1d95af3a2467587c62566e3f7dfe4
[DevTools] Move sanitize url to devtools_ui.cc. Compatibility script is not reliable enough. BUG=653134 Review-Url: https://codereview.chromium.org/2403633002 Cr-Commit-Position: refs/heads/master@{#425814}
DevToolsWindow::DevToolsWindow(Profile* profile, WebContents* main_web_contents, DevToolsUIBindings* bindings, WebContents* inspected_web_contents, bool can_dock) : profile_(profile), main_web_contents_(main_web_contents), toolbox_web_contents_(nullptr), bindings_(bindings), browser_(nullptr), is_docked_(true), can_dock_(can_dock), life_stage_(can_dock ? kNotLoaded : kIsDockedSet), action_on_load_(DevToolsToggleAction::NoOp()), intercepted_page_beforeunload_(false), ready_for_test_(false) { main_web_contents_->SetDelegate(this); bindings_->SetDelegate(this); data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( main_web_contents_); zoom::ZoomController::CreateForWebContents(main_web_contents_); zoom::ZoomController::FromWebContents(main_web_contents_) ->SetShowsNotificationBubble(false); g_instances.Get().push_back(this); if (inspected_web_contents) inspected_contents_observer_.reset( new ObserverWithAccessor(inspected_web_contents)); if (can_dock_ && inspected_web_contents) { content::RenderWidgetHostView* inspected_view = inspected_web_contents->GetRenderWidgetHostView(); if (inspected_view && main_web_contents_->GetRenderWidgetHostView()) { gfx::Size size = inspected_view->GetViewBounds().size(); main_web_contents_->GetRenderWidgetHostView()->SetSize(size); } } event_forwarder_.reset(new DevToolsEventForwarder(this)); task_manager::WebContentsTags::CreateForDevToolsContents(main_web_contents_); std::vector<base::Callback<void(DevToolsWindow*)>> copy( g_creation_callbacks.Get()); for (const auto& callback : copy) callback.Run(this); }
DevToolsWindow::DevToolsWindow(Profile* profile, WebContents* main_web_contents, DevToolsUIBindings* bindings, WebContents* inspected_web_contents, bool can_dock) : profile_(profile), main_web_contents_(main_web_contents), toolbox_web_contents_(nullptr), bindings_(bindings), browser_(nullptr), is_docked_(true), can_dock_(can_dock), life_stage_(can_dock ? kNotLoaded : kIsDockedSet), action_on_load_(DevToolsToggleAction::NoOp()), intercepted_page_beforeunload_(false), ready_for_test_(false) { main_web_contents_->SetDelegate(this); bindings_->SetDelegate(this); data_use_measurement::DataUseWebContentsObserver::CreateForWebContents( main_web_contents_); zoom::ZoomController::CreateForWebContents(main_web_contents_); zoom::ZoomController::FromWebContents(main_web_contents_) ->SetShowsNotificationBubble(false); g_instances.Get().push_back(this); if (inspected_web_contents) inspected_contents_observer_.reset( new ObserverWithAccessor(inspected_web_contents)); if (can_dock_ && inspected_web_contents) { content::RenderWidgetHostView* inspected_view = inspected_web_contents->GetRenderWidgetHostView(); if (inspected_view && main_web_contents_->GetRenderWidgetHostView()) { gfx::Size size = inspected_view->GetViewBounds().size(); main_web_contents_->GetRenderWidgetHostView()->SetSize(size); } } event_forwarder_.reset(new DevToolsEventForwarder(this)); task_manager::WebContentsTags::CreateForDevToolsContents(main_web_contents_); std::vector<base::Callback<void(DevToolsWindow*)>> copy( g_creation_callbacks.Get()); for (const auto& callback : copy) callback.Run(this); }
C
Chrome
0
CVE-2017-11144
https://www.cvedetails.com/cve/CVE-2017-11144/
CWE-754
https://git.php.net/?p=php-src.git;a=commit;h=91826a311dd37f4c4e5d605fa7af331e80ddd4c3
91826a311dd37f4c4e5d605fa7af331e80ddd4c3
null
PHP_FUNCTION(openssl_pkcs7_decrypt) { zval * recipcert, * recipkey = NULL; X509 * cert = NULL; EVP_PKEY * key = NULL; zend_resource *certresval, *keyresval; BIO * in = NULL, * out = NULL, * datain = NULL; PKCS7 * p7 = NULL; char * infilename; size_t infilename_len; char * outfilename; size_t outfilename_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppz|z", &infilename, &infilename_len, &outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) { return; } RETVAL_FALSE; cert = php_openssl_x509_from_zval(recipcert, 0, &certresval); if (cert == NULL) { php_error_docref(NULL, E_WARNING, "unable to coerce parameter 3 to x509 cert"); goto clean_exit; } key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, 0, &keyresval); if (key == NULL) { php_error_docref(NULL, E_WARNING, "unable to get private key"); goto clean_exit; } if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) { goto clean_exit; } in = BIO_new_file(infilename, "r"); if (in == NULL) { php_openssl_store_errors(); goto clean_exit; } out = BIO_new_file(outfilename, "w"); if (out == NULL) { php_openssl_store_errors(); goto clean_exit; } p7 = SMIME_read_PKCS7(in, &datain); if (p7 == NULL) { php_openssl_store_errors(); goto clean_exit; } if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { RETVAL_TRUE; } else { php_openssl_store_errors(); } clean_exit: PKCS7_free(p7); BIO_free(datain); BIO_free(in); BIO_free(out); if (cert && certresval == NULL) { X509_free(cert); } if (key && keyresval == NULL) { EVP_PKEY_free(key); } }
PHP_FUNCTION(openssl_pkcs7_decrypt) { zval * recipcert, * recipkey = NULL; X509 * cert = NULL; EVP_PKEY * key = NULL; zend_resource *certresval, *keyresval; BIO * in = NULL, * out = NULL, * datain = NULL; PKCS7 * p7 = NULL; char * infilename; size_t infilename_len; char * outfilename; size_t outfilename_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "ppz|z", &infilename, &infilename_len, &outfilename, &outfilename_len, &recipcert, &recipkey) == FAILURE) { return; } RETVAL_FALSE; cert = php_openssl_x509_from_zval(recipcert, 0, &certresval); if (cert == NULL) { php_error_docref(NULL, E_WARNING, "unable to coerce parameter 3 to x509 cert"); goto clean_exit; } key = php_openssl_evp_from_zval(recipkey ? recipkey : recipcert, 0, "", 0, 0, &keyresval); if (key == NULL) { php_error_docref(NULL, E_WARNING, "unable to get private key"); goto clean_exit; } if (php_openssl_open_base_dir_chk(infilename) || php_openssl_open_base_dir_chk(outfilename)) { goto clean_exit; } in = BIO_new_file(infilename, "r"); if (in == NULL) { php_openssl_store_errors(); goto clean_exit; } out = BIO_new_file(outfilename, "w"); if (out == NULL) { php_openssl_store_errors(); goto clean_exit; } p7 = SMIME_read_PKCS7(in, &datain); if (p7 == NULL) { php_openssl_store_errors(); goto clean_exit; } if (PKCS7_decrypt(p7, key, cert, out, PKCS7_DETACHED)) { RETVAL_TRUE; } else { php_openssl_store_errors(); } clean_exit: PKCS7_free(p7); BIO_free(datain); BIO_free(in); BIO_free(out); if (cert && certresval == NULL) { X509_free(cert); } if (key && keyresval == NULL) { EVP_PKEY_free(key); } }
C
php
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 deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); imp->deprecatedMethod(); }
static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { TestObject* imp = V8TestObject::toNative(info.Holder()); imp->deprecatedMethod(); }
C
Chrome
0
CVE-2016-0850
https://www.cvedetails.com/cve/CVE-2016-0850/
CWE-264
https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/c677ee92595335233eb0e7b59809a1a94e7a678a
c677ee92595335233eb0e7b59809a1a94e7a678a
DO NOT MERGE Remove Porsche car-kit pairing workaround Bug: 26551752 Change-Id: I14c5e3fcda0849874c8a94e48aeb7d09585617e1
BOOLEAN BTM_SecRegisterLinkKeyNotificationCallback (tBTM_LINK_KEY_CALLBACK *p_callback) { btm_cb.api.p_link_key_callback = p_callback; return(TRUE); }
BOOLEAN BTM_SecRegisterLinkKeyNotificationCallback (tBTM_LINK_KEY_CALLBACK *p_callback) { btm_cb.api.p_link_key_callback = p_callback; return(TRUE); }
C
Android
0
CVE-2017-11472
https://www.cvedetails.com/cve/CVE-2017-11472/
CWE-755
https://github.com/torvalds/linux/commit/3b2d69114fefa474fca542e51119036dceb4aa6f
3b2d69114fefa474fca542e51119036dceb4aa6f
ACPICA: Namespace: fix operand cache leak ACPICA commit a23325b2e583556eae88ed3f764e457786bf4df6 I found some ACPI operand cache leaks in ACPI early abort cases. Boot log of ACPI operand cache leak is as follows: >[ 0.174332] ACPI: Added _OSI(Module Device) >[ 0.175504] ACPI: Added _OSI(Processor Device) >[ 0.176010] ACPI: Added _OSI(3.0 _SCP Extensions) >[ 0.177032] ACPI: Added _OSI(Processor Aggregator Device) >[ 0.178284] ACPI: SCI (IRQ16705) allocation failed >[ 0.179352] ACPI Exception: AE_NOT_ACQUIRED, Unable to install System Control Interrupt handler (20160930/evevent-131) >[ 0.180008] ACPI: Unable to start the ACPI Interpreter >[ 0.181125] ACPI Error: Could not remove SCI handler (20160930/evmisc-281) >[ 0.184068] kmem_cache_destroy Acpi-Operand: Slab cache still has objects >[ 0.185358] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.0-rc3 #2 >[ 0.186820] Hardware name: innotek gmb_h virtual_box/virtual_box, BIOS virtual_box 12/01/2006 >[ 0.188000] Call Trace: >[ 0.188000] ? dump_stack+0x5c/0x7d >[ 0.188000] ? kmem_cache_destroy+0x224/0x230 >[ 0.188000] ? acpi_sleep_proc_init+0x22/0x22 >[ 0.188000] ? acpi_os_delete_cache+0xa/0xd >[ 0.188000] ? acpi_ut_delete_caches+0x3f/0x7b >[ 0.188000] ? acpi_terminate+0x5/0xf >[ 0.188000] ? acpi_init+0x288/0x32e >[ 0.188000] ? __class_create+0x4c/0x80 >[ 0.188000] ? video_setup+0x7a/0x7a >[ 0.188000] ? do_one_initcall+0x4e/0x1b0 >[ 0.188000] ? kernel_init_freeable+0x194/0x21a >[ 0.188000] ? rest_init+0x80/0x80 >[ 0.188000] ? kernel_init+0xa/0x100 >[ 0.188000] ? ret_from_fork+0x25/0x30 When early abort is occurred due to invalid ACPI information, Linux kernel terminates ACPI by calling acpi_terminate() function. The function calls acpi_ns_terminate() function to delete namespace data and ACPI operand cache (acpi_gbl_module_code_list). But the deletion code in acpi_ns_terminate() function is wrapped in ACPI_EXEC_APP definition, therefore the code is only executed when the definition exists. If the define doesn't exist, ACPI operand cache (acpi_gbl_module_code_list) is leaked, and stack dump is shown in kernel log. This causes a security threat because the old kernel (<= 4.9) shows memory locations of kernel functions in stack dump, therefore kernel ASLR can be neutralized. To fix ACPI operand leak for enhancing security, I made a patch which removes the ACPI_EXEC_APP define in acpi_ns_terminate() function for executing the deletion code unconditionally. Link: https://github.com/acpica/acpica/commit/a23325b2 Signed-off-by: Seunghun Han <kkamagui@gmail.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle) { ACPI_FUNCTION_ENTRY(); /* Parameter validation */ if ((!handle) || (handle == ACPI_ROOT_OBJECT)) { return (acpi_gbl_root_node); } /* We can at least attempt to verify the handle */ if (ACPI_GET_DESCRIPTOR_TYPE(handle) != ACPI_DESC_TYPE_NAMED) { return (NULL); } return (ACPI_CAST_PTR(struct acpi_namespace_node, handle)); }
struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle) { ACPI_FUNCTION_ENTRY(); /* Parameter validation */ if ((!handle) || (handle == ACPI_ROOT_OBJECT)) { return (acpi_gbl_root_node); } /* We can at least attempt to verify the handle */ if (ACPI_GET_DESCRIPTOR_TYPE(handle) != ACPI_DESC_TYPE_NAMED) { return (NULL); } return (ACPI_CAST_PTR(struct acpi_namespace_node, handle)); }
C
linux
0
CVE-2018-6083
https://www.cvedetails.com/cve/CVE-2018-6083/
null
https://github.com/chromium/chromium/commit/ffac0ee4b8b00944e2ddf23f7f4f55daff3c117e
ffac0ee4b8b00944e2ddf23f7f4f55daff3c117e
Fail the web app manifest fetch if the document is sandboxed. This ensures that sandboxed pages are regarded as non-PWAs, and that other features in the browser process which trust the web manifest do not receive the manifest at all if the document itself cannot access the manifest. BUG=771709 Change-Id: Ifd4d00c2fccff8cc0e5e8d2457bd55b992b0a8f4 Reviewed-on: https://chromium-review.googlesource.com/866529 Commit-Queue: Dominick Ng <dominickn@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Cr-Commit-Position: refs/heads/master@{#531121}
ManifestChangeNotifier::GetManifestChangeObserver() { if (!manifest_change_observer_) { render_frame()->GetRemoteAssociatedInterfaces()->GetInterface( &manifest_change_observer_); } return *manifest_change_observer_; }
ManifestChangeNotifier::GetManifestChangeObserver() { if (!manifest_change_observer_) { render_frame()->GetRemoteAssociatedInterfaces()->GetInterface( &manifest_change_observer_); } return *manifest_change_observer_; }
C
Chrome
0
CVE-2011-3084
https://www.cvedetails.com/cve/CVE-2011-3084/
CWE-264
https://github.com/chromium/chromium/commit/744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
744c2a2d90c3c9a33c818e1ea4b7ccb5010663a0
Allow browser to handle all WebUI navigations. BUG=113496 TEST="Google Dashboard" link in Sync settings loads in new process. Review URL: http://codereview.chromium.org/9663045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126949 0039d316-1c4b-4281-b951-d872f2087c98
void RenderViewImpl::OnImeConfirmComposition( const string16& text, const ui::Range& replacement_range) { if (pepper_delegate_.IsPluginFocused()) { pepper_delegate_.OnImeConfirmComposition(text); } else { #if defined(OS_WIN) if (focused_plugin_id_ >= 0) { std::set<WebPluginDelegateProxy*>::iterator it; for (it = plugin_delegates_.begin(); it != plugin_delegates_.end(); ++it) { (*it)->ImeCompositionCompleted(text, focused_plugin_id_); } return; } #endif if (replacement_range.IsValid() && webview()) { if (WebFrame* frame = webview()->focusedFrame()) { WebRange webrange = WebRange::fromDocumentRange( frame, replacement_range.start(), replacement_range.length()); if (!webrange.isNull()) frame->setSelectionToRange(webrange); } } RenderWidget::OnImeConfirmComposition(text, replacement_range); } }
void RenderViewImpl::OnImeConfirmComposition( const string16& text, const ui::Range& replacement_range) { if (pepper_delegate_.IsPluginFocused()) { pepper_delegate_.OnImeConfirmComposition(text); } else { #if defined(OS_WIN) if (focused_plugin_id_ >= 0) { std::set<WebPluginDelegateProxy*>::iterator it; for (it = plugin_delegates_.begin(); it != plugin_delegates_.end(); ++it) { (*it)->ImeCompositionCompleted(text, focused_plugin_id_); } return; } #endif if (replacement_range.IsValid() && webview()) { if (WebFrame* frame = webview()->focusedFrame()) { WebRange webrange = WebRange::fromDocumentRange( frame, replacement_range.start(), replacement_range.length()); if (!webrange.isNull()) frame->setSelectionToRange(webrange); } } RenderWidget::OnImeConfirmComposition(text, replacement_range); } }
C
Chrome
0
CVE-2014-9710
https://www.cvedetails.com/cve/CVE-2014-9710/
CWE-362
https://github.com/torvalds/linux/commit/5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339
5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339
Btrfs: make xattr replace operations atomic Replacing a xattr consists of doing a lookup for its existing value, delete the current value from the respective leaf, release the search path and then finally insert the new value. This leaves a time window where readers (getxattr, listxattrs) won't see any value for the xattr. Xattrs are used to store ACLs, so this has security implications. This change also fixes 2 other existing issues which were: *) Deleting the old xattr value without verifying first if the new xattr will fit in the existing leaf item (in case multiple xattrs are packed in the same item due to name hash collision); *) Returning -EEXIST when the flag XATTR_CREATE is given and the xattr doesn't exist but we have have an existing item that packs muliple xattrs with the same name hash as the input xattr. In this case we should return ENOSPC. A test case for xfstests follows soon. Thanks to Alexandre Oliva for reporting the non-atomicity of the xattr replace implementation. Reported-by: Alexandre Oliva <oliva@gnu.org> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
tree_mod_log_search(struct btrfs_fs_info *fs_info, u64 start, u64 min_seq) { return __tree_mod_log_search(fs_info, start, min_seq, 0); }
tree_mod_log_search(struct btrfs_fs_info *fs_info, u64 start, u64 min_seq) { return __tree_mod_log_search(fs_info, start, min_seq, 0); }
C
linux
0
CVE-2018-20067
https://www.cvedetails.com/cve/CVE-2018-20067/
CWE-254
https://github.com/chromium/chromium/commit/a7d715ae5b654d1f98669fd979a00282a7229044
a7d715ae5b654d1f98669fd979a00282a7229044
Prevent renderer initiated back navigation to cancel a browser one. Renderer initiated back/forward navigations must not be able to cancel ongoing browser initiated navigation if they are not user initiated. Note: 'normal' renderer initiated navigation uses the FrameHost::BeginNavigation() path. A code similar to this patch is done in NavigatorImpl::OnBeginNavigation(). Test: ----- Added: NavigationBrowserTest. * HistoryBackInBeforeUnload * HistoryBackInBeforeUnloadAfterSetTimeout * HistoryBackCancelPendingNavigationNoUserGesture * HistoryBackCancelPendingNavigationUserGesture Fixed: * (WPT) .../the-history-interface/traverse_the_history_2.html * (WPT) .../the-history-interface/traverse_the_history_3.html * (WPT) .../the-history-interface/traverse_the_history_4.html * (WPT) .../the-history-interface/traverse_the_history_5.html Bug: 879965 Change-Id: I1a9bfaaea1ffc219e6c32f6e676b660e746c578c Reviewed-on: https://chromium-review.googlesource.com/1209744 Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Charlie Reis <creis@chromium.org> Cr-Commit-Position: refs/heads/master@{#592823}
void WebContentsImpl::MoveCaret(const gfx::Point& extent) { RenderFrameHostImpl* focused_frame = GetFocusedFrame(); if (!focused_frame) return; focused_frame->GetFrameInputHandler()->MoveCaret(extent); }
void WebContentsImpl::MoveCaret(const gfx::Point& extent) { RenderFrameHostImpl* focused_frame = GetFocusedFrame(); if (!focused_frame) return; focused_frame->GetFrameInputHandler()->MoveCaret(extent); }
C
Chrome
0
CVE-2013-0912
https://www.cvedetails.com/cve/CVE-2013-0912/
CWE-94
https://github.com/chromium/chromium/commit/faceb51d5058e1159835a4b0cd65081bb0a9de1e
faceb51d5058e1159835a4b0cd65081bb0a9de1e
Remove SpeechSynthesis runtime flag (status=stable) BUG=402536 Review URL: https://codereview.chromium.org/482273005 git-svn-id: svn://svn.chromium.org/blink/trunk@180763 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void WebRuntimeFeatures::enableNavigatorContentUtils(bool enable) { RuntimeEnabledFeatures::setNavigatorContentUtilsEnabled(enable); }
void WebRuntimeFeatures::enableNavigatorContentUtils(bool enable) { RuntimeEnabledFeatures::setNavigatorContentUtilsEnabled(enable); }
C
Chrome
0
CVE-2016-1658
https://www.cvedetails.com/cve/CVE-2016-1658/
CWE-284
https://github.com/chromium/chromium/commit/5c437bcc7a51edbef45242c5173cf7871fde2866
5c437bcc7a51edbef45242c5173cf7871fde2866
Make extensions use a correct same-origin check. GURL::GetOrigin does not do the right thing for all types of URLs. BUG=573317 Review URL: https://codereview.chromium.org/1658913002 Cr-Commit-Position: refs/heads/master@{#373381}
void ExtensionViewGuest::DidInitialize( const base::DictionaryValue& create_params) { ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); ApplyAttributes(create_params); }
void ExtensionViewGuest::DidInitialize( const base::DictionaryValue& create_params) { ExtensionsAPIClient::Get()->AttachWebContentsHelpers(web_contents()); ApplyAttributes(create_params); }
C
Chrome
0
CVE-2017-9150
https://www.cvedetails.com/cve/CVE-2017-9150/
CWE-200
https://github.com/torvalds/linux/commit/0d0e57697f162da4aa218b5feafe614fb666db07
0d0e57697f162da4aa218b5feafe614fb666db07
bpf: don't let ldimm64 leak map addresses on unprivileged The patch fixes two things at once: 1) It checks the env->allow_ptr_leaks and only prints the map address to the log if we have the privileges to do so, otherwise it just dumps 0 as we would when kptr_restrict is enabled on %pK. Given the latter is off by default and not every distro sets it, I don't want to rely on this, hence the 0 by default for unprivileged. 2) Printing of ldimm64 in the verifier log is currently broken in that we don't print the full immediate, but only the 32 bit part of the first insn part for ldimm64. Thus, fix this up as well; it's okay to access, since we verified all ldimm64 earlier already (including just constants) through replace_map_fd_with_map_ptr(). Fixes: 1be7f75d1668 ("bpf: enable non-root eBPF programs") Fixes: cbd357008604 ("bpf: verifier (add ability to receive verification log)") Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
static int check_val_ptr_alignment(const struct bpf_reg_state *reg, int size) { if (size != 1) { verbose("Unknown alignment. Only byte-sized access allowed in value access.\n"); return -EACCES; } return 0; }
static int check_val_ptr_alignment(const struct bpf_reg_state *reg, int size) { if (size != 1) { verbose("Unknown alignment. Only byte-sized access allowed in value access.\n"); return -EACCES; } return 0; }
C
linux
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void TabStripGtk::TabChangedAt(TabContents* contents, int index, TabChangeType change_type) { TabGtk* tab = GetTabAtAdjustForAnimation(index); if (change_type == TITLE_NOT_LOADING) { if (tab->mini() && !tab->IsActive()) tab->StartMiniTabTitleAnimation(); return; } tab->UpdateData(contents->web_contents(), model_->IsAppTab(index), change_type == LOADING_ONLY); tab->UpdateFromModel(); }
void TabStripGtk::TabChangedAt(TabContents* contents, int index, TabChangeType change_type) { TabGtk* tab = GetTabAtAdjustForAnimation(index); if (change_type == TITLE_NOT_LOADING) { if (tab->mini() && !tab->IsActive()) tab->StartMiniTabTitleAnimation(); return; } tab->UpdateData(contents->web_contents(), model_->IsAppTab(index), change_type == LOADING_ONLY); tab->UpdateFromModel(); }
C
Chrome
0
CVE-2012-3375
https://www.cvedetails.com/cve/CVE-2012-3375/
null
https://github.com/torvalds/linux/commit/13d518074a952d33d47c428419693f63389547e9
13d518074a952d33d47c428419693f63389547e9
epoll: clear the tfile_check_list on -ELOOP An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent circular epoll dependencies from being created. However, in that case we do not properly clear the 'tfile_check_list'. Thus, add a call to clear_tfile_check_list() for the -ELOOP case. Signed-off-by: Jason Baron <jbaron@redhat.com> Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru> Cc: Nelson Elhage <nelhage@nelhage.com> Cc: Davide Libenzi <davidel@xmailserver.org> Tested-by: Alexandra N. Kossovsky <Alexandra.Kossovsky@oktetlabs.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static inline struct timespec ep_set_mstimeout(long ms) { struct timespec now, ts = { .tv_sec = ms / MSEC_PER_SEC, .tv_nsec = NSEC_PER_MSEC * (ms % MSEC_PER_SEC), }; ktime_get_ts(&now); return timespec_add_safe(now, ts); }
static inline struct timespec ep_set_mstimeout(long ms) { struct timespec now, ts = { .tv_sec = ms / MSEC_PER_SEC, .tv_nsec = NSEC_PER_MSEC * (ms % MSEC_PER_SEC), }; ktime_get_ts(&now); return timespec_add_safe(now, ts); }
C
linux
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
GahpClient::cream_job_status_all(const char *service, GahpClient::CreamJobStatusMap & results) { static const char* command = "CREAM_JOB_STATUS"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } std::string reqline; char *esc1 = strdup( escapeGahpString(service) ); int job_number = 0; // "all" int x = sprintf(reqline, "%s %d", esc1, job_number); ASSERT( x > 0 ); free( esc1 ); const char *buf = reqline.c_str(); if ( !is_pending(command,buf) ) { if ( m_mode == results_only ) { return GAHPCLIENT_COMMAND_NOT_SUBMITTED; } now_pending(command,buf,normal_proxy,high_prio); } const int FIRST_RESULT = 3; // Field 3 (0 indexed) is the first const int RECORD_FIELDS = 4; // How many fields in a record? Gahp_Args* result = get_pending_result(command,buf); if ( result ) { int num_results = 0; if (result->argc > 2) { num_results = atoi(result->argv[2]); if( result->argc != FIRST_RESULT + num_results * RECORD_FIELDS) { EXCEPT("Bad %s Result",command); } } else if (result->argc != 2) { EXCEPT("Bad %s Result",command); } int rc; if (strcmp(result->argv[1], NULLSTRING) == 0) { rc = 0; } else { rc = 1; error_string = result->argv[1]; } if ( rc == 0 ) { for(int i = 0; i < num_results; i++) { CreamJobStatus status; int offset = FIRST_RESULT + i * RECORD_FIELDS; status.job_id = result->argv[offset + 0]; status.job_status = result->argv[offset + 1]; status.exit_code = atoi(result->argv[offset + 2]); if ( strcasecmp(result->argv[offset + 3], NULLSTRING) ) { status.failure_reason = result->argv[offset + 3]; } results[status.job_id] = status; } } delete result; return rc; } if ( check_pending_timeout(command,buf) ) { sprintf( error_string, "%s timed out", command ); return GAHPCLIENT_COMMAND_TIMED_OUT; } return GAHPCLIENT_COMMAND_PENDING; }
GahpClient::cream_job_status_all(const char *service, GahpClient::CreamJobStatusMap & results) { static const char* command = "CREAM_JOB_STATUS"; if (server->m_commands_supported->contains_anycase(command)==FALSE) { return GAHPCLIENT_COMMAND_NOT_SUPPORTED; } std::string reqline; char *esc1 = strdup( escapeGahpString(service) ); int job_number = 0; // "all" int x = sprintf(reqline, "%s %d", esc1, job_number); ASSERT( x > 0 ); free( esc1 ); const char *buf = reqline.c_str(); if ( !is_pending(command,buf) ) { if ( m_mode == results_only ) { return GAHPCLIENT_COMMAND_NOT_SUBMITTED; } now_pending(command,buf,normal_proxy,high_prio); } const int FIRST_RESULT = 3; // Field 3 (0 indexed) is the first const int RECORD_FIELDS = 4; // How many fields in a record? Gahp_Args* result = get_pending_result(command,buf); if ( result ) { int num_results = 0; if (result->argc > 2) { num_results = atoi(result->argv[2]); if( result->argc != FIRST_RESULT + num_results * RECORD_FIELDS) { EXCEPT("Bad %s Result",command); } } else if (result->argc != 2) { EXCEPT("Bad %s Result",command); } int rc; if (strcmp(result->argv[1], NULLSTRING) == 0) { rc = 0; } else { rc = 1; error_string = result->argv[1]; } if ( rc == 0 ) { for(int i = 0; i < num_results; i++) { CreamJobStatus status; int offset = FIRST_RESULT + i * RECORD_FIELDS; status.job_id = result->argv[offset + 0]; status.job_status = result->argv[offset + 1]; status.exit_code = atoi(result->argv[offset + 2]); if ( strcasecmp(result->argv[offset + 3], NULLSTRING) ) { status.failure_reason = result->argv[offset + 3]; } results[status.job_id] = status; } } delete result; return rc; } if ( check_pending_timeout(command,buf) ) { sprintf( error_string, "%s timed out", command ); return GAHPCLIENT_COMMAND_TIMED_OUT; } return GAHPCLIENT_COMMAND_PENDING; }
CPP
htcondor
0
CVE-2019-5754
https://www.cvedetails.com/cve/CVE-2019-5754/
CWE-310
https://github.com/chromium/chromium/commit/fd2335678e96c34d14f4b20f0d9613dfbd1ccdb4
fd2335678e96c34d14f4b20f0d9613dfbd1ccdb4
Fix a bug in network_session_configurator.cc in which support for HTTPS URLS in QUIC proxies was always set to false. BUG=914497 Change-Id: I56ad16088168302598bb448553ba32795eee3756 Reviewed-on: https://chromium-review.googlesource.com/c/1417356 Auto-Submit: Ryan Hamilton <rch@chromium.org> Commit-Queue: Zhongyi Shi <zhongyi@chromium.org> Reviewed-by: Zhongyi Shi <zhongyi@chromium.org> Cr-Commit-Position: refs/heads/master@{#623763}
void ParseFieldTrials() { ParseCommandLineAndFieldTrials( base::CommandLine(base::CommandLine::NO_PROGRAM)); }
void ParseFieldTrials() { ParseCommandLineAndFieldTrials( base::CommandLine(base::CommandLine::NO_PROGRAM)); }
C
Chrome
0
CVE-2017-12168
https://www.cvedetails.com/cve/CVE-2017-12168/
CWE-617
https://github.com/torvalds/linux/commit/9e3f7a29694049edd728e2400ab57ad7553e5aa9
9e3f7a29694049edd728e2400ab57ad7553e5aa9
arm64: KVM: pmu: Fix AArch32 cycle counter access We're missing the handling code for the cycle counter accessed from a 32bit guest, leading to unexpected results. Cc: stable@vger.kernel.org # 4.6+ Signed-off-by: Wei Huang <wei@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
int kvm_handle_sys_reg(struct kvm_vcpu *vcpu, struct kvm_run *run) { struct sys_reg_params params; unsigned long esr = kvm_vcpu_get_hsr(vcpu); int Rt = (esr >> 5) & 0x1f; int ret; trace_kvm_handle_sys_reg(esr); params.is_aarch32 = false; params.is_32bit = false; params.Op0 = (esr >> 20) & 3; params.Op1 = (esr >> 14) & 0x7; params.CRn = (esr >> 10) & 0xf; params.CRm = (esr >> 1) & 0xf; params.Op2 = (esr >> 17) & 0x7; params.regval = vcpu_get_reg(vcpu, Rt); params.is_write = !(esr & 1); ret = emulate_sys_reg(vcpu, &params); if (!params.is_write) vcpu_set_reg(vcpu, Rt, params.regval); return ret; }
int kvm_handle_sys_reg(struct kvm_vcpu *vcpu, struct kvm_run *run) { struct sys_reg_params params; unsigned long esr = kvm_vcpu_get_hsr(vcpu); int Rt = (esr >> 5) & 0x1f; int ret; trace_kvm_handle_sys_reg(esr); params.is_aarch32 = false; params.is_32bit = false; params.Op0 = (esr >> 20) & 3; params.Op1 = (esr >> 14) & 0x7; params.CRn = (esr >> 10) & 0xf; params.CRm = (esr >> 1) & 0xf; params.Op2 = (esr >> 17) & 0x7; params.regval = vcpu_get_reg(vcpu, Rt); params.is_write = !(esr & 1); ret = emulate_sys_reg(vcpu, &params); if (!params.is_write) vcpu_set_reg(vcpu, Rt, params.regval); return ret; }
C
linux
0
CVE-2013-0881
https://www.cvedetails.com/cve/CVE-2013-0881/
CWE-20
https://github.com/chromium/chromium/commit/634c5943f46abe8c6280079f6d394dfee08c3c8f
634c5943f46abe8c6280079f6d394dfee08c3c8f
Disable some more query compositingState asserts. This gets the tests passing again on Mac. See the bug for the stacktrace. A future patch will need to actually fix the incorrect reading of compositingState. BUG=343179 Review URL: https://codereview.chromium.org/162153002 git-svn-id: svn://svn.chromium.org/blink/trunk@167069 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void RenderLayerCompositor::frameViewDidChangeSize() { if (m_containerLayer) { FrameView* frameView = m_renderView->frameView(); m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); frameViewDidScroll(); updateOverflowControlsLayers(); } }
void RenderLayerCompositor::frameViewDidChangeSize() { if (m_containerLayer) { FrameView* frameView = m_renderView->frameView(); m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); frameViewDidScroll(); updateOverflowControlsLayers(); } }
C
Chrome
0
CVE-2012-2817
https://www.cvedetails.com/cve/CVE-2012-2817/
CWE-399
https://github.com/chromium/chromium/commit/9b9a9f33f0a26f40d083be85a539dd7963adfc9b
9b9a9f33f0a26f40d083be85a539dd7963adfc9b
Explicitly stopping thread in MediaStreamImpl dtor to avoid any racing issues. This may solve the below bugs. BUG=112408,111202 TEST=content_unittests Review URL: https://chromiumcodereview.appspot.com/9307058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120222 0039d316-1c4b-4281-b951-d872f2087c98
void MediaStreamImpl::ClosePeerConnection() { DCHECK(CalledOnValidThread()); video_renderer_ = NULL; peer_connection_handler_ = NULL; MediaStreamTrackPtrMap::const_iterator it = local_tracks_.begin(); for (; it != local_tracks_.end(); ++it) it->second->set_state(webrtc::MediaStreamTrackInterface::kEnded); }
void MediaStreamImpl::ClosePeerConnection() { DCHECK(CalledOnValidThread()); video_renderer_ = NULL; peer_connection_handler_ = NULL; MediaStreamTrackPtrMap::const_iterator it = local_tracks_.begin(); for (; it != local_tracks_.end(); ++it) it->second->set_state(webrtc::MediaStreamTrackInterface::kEnded); }
C
Chrome
0
CVE-2014-3564
https://www.cvedetails.com/cve/CVE-2014-3564/
CWE-119
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=commit;h=2cbd76f7911fc215845e89b50d6af5ff4a83dd77
2cbd76f7911fc215845e89b50d6af5ff4a83dd77
null
gpgsm_io_event (void *engine, gpgme_event_io_t type, void *type_data) { engine_gpgsm_t gpgsm = engine; TRACE3 (DEBUG_ENGINE, "gpgme:gpgsm_io_event", gpgsm, "event %p, type %d, type_data %p", gpgsm->io_cbs.event, type, type_data); if (gpgsm->io_cbs.event) (*gpgsm->io_cbs.event) (gpgsm->io_cbs.event_priv, type, type_data); }
gpgsm_io_event (void *engine, gpgme_event_io_t type, void *type_data) { engine_gpgsm_t gpgsm = engine; TRACE3 (DEBUG_ENGINE, "gpgme:gpgsm_io_event", gpgsm, "event %p, type %d, type_data %p", gpgsm->io_cbs.event, type, type_data); if (gpgsm->io_cbs.event) (*gpgsm->io_cbs.event) (gpgsm->io_cbs.event_priv, type, type_data); }
C
gnupg
0