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-2018-16863 | https://www.cvedetails.com/cve/CVE-2018-16863/ | CWE-78 | http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=79cccf641486 | 79cccf641486a6595c43f1de1cd7ade696020a31 | null | bool gs_is_null_device(gx_device *dev)
{
/* Assuming null_fill_path isn't used elswhere. */
return dev->procs.fill_path == gs_null_device.procs.fill_path;
}
| bool gs_is_null_device(gx_device *dev)
{
/* Assuming null_fill_path isn't used elswhere. */
return dev->procs.fill_path == gs_null_device.procs.fill_path;
}
| C | ghostscript | 0 |
CVE-2013-0904 | https://www.cvedetails.com/cve/CVE-2013-0904/ | CWE-119 | https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a | b2b21468c1f7f08b30a7c1755316f6026c50eb2a | Separate repaint and layout requirements of StyleDifference (Step 1)
Previously StyleDifference was an enum that proximately bigger values
imply smaller values (e.g. StyleDifferenceLayout implies
StyleDifferenceRepaint). This causes unnecessary repaints in some cases
on layout change.
Convert StyleDifference to a structure containing relatively independent
flags.
This change doesn't directly improve the result, but can make further
repaint optimizations possible.
Step 1 doesn't change any functionality. RenderStyle still generate the
legacy StyleDifference enum when comparing styles and convert the result
to the new StyleDifference. Implicit requirements are not handled during
the conversion.
Converted call sites to use the new StyleDifference according to the
following conversion rules:
- diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange()
- diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly()
- diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer()
- diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer()
- diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout()
- diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout()
- diff > StyleDifferenceRepaintLayer => diff.needsLayout()
- diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly()
- diff == StyleDifferenceLayout => diff.needsFullLayout()
BUG=358460
TEST=All existing layout tests.
[email protected], [email protected], [email protected]
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983
Review URL: https://codereview.chromium.org/236203020
git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer)
{
if (!m_floatingObjects || hasColumns() || !parent())
return false;
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
FloatingObjectSetIterator it = floatingObjectSet.find<FloatingObjectHashTranslator>(renderer);
if (it == floatingObjectSet.end())
return false;
return logicalBottomForFloat(*it) > logicalHeight();
}
| bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer)
{
if (!m_floatingObjects || hasColumns() || !parent())
return false;
const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
FloatingObjectSetIterator it = floatingObjectSet.find<FloatingObjectHashTranslator>(renderer);
if (it == floatingObjectSet.end())
return false;
return logicalBottomForFloat(*it) > logicalHeight();
}
| C | Chrome | 0 |
CVE-2014-4652 | https://www.cvedetails.com/cve/CVE-2014-4652/ | CWE-362 | https://github.com/torvalds/linux/commit/07f4d9d74a04aa7c72c5dae0ef97565f28f17b92 | 07f4d9d74a04aa7c72c5dae0ef97565f28f17b92 | ALSA: control: Protect user controls against concurrent access
The user-control put and get handlers as well as the tlv do not protect against
concurrent access from multiple threads. Since the state of the control is not
updated atomically it is possible that either two write operations or a write
and a read operation race against each other. Both can lead to arbitrary memory
disclosure. This patch introduces a new lock that protects user-controls from
concurrent access. Since applications typically access controls sequentially
than in parallel a single lock per card should be fine.
Signed-off-by: Lars-Peter Clausen <[email protected]>
Acked-by: Jaroslav Kysela <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]> | int snd_card_free(struct snd_card *card)
{
struct completion released;
int ret;
init_completion(&released);
card->release_completion = &released;
ret = snd_card_free_when_closed(card);
if (ret)
return ret;
/* wait, until all devices are ready for the free operation */
wait_for_completion(&released);
return 0;
}
| int snd_card_free(struct snd_card *card)
{
struct completion released;
int ret;
init_completion(&released);
card->release_completion = &released;
ret = snd_card_free_when_closed(card);
if (ret)
return ret;
/* wait, until all devices are ready for the free operation */
wait_for_completion(&released);
return 0;
}
| C | linux | 0 |
CVE-2017-5094 | https://www.cvedetails.com/cve/CVE-2017-5094/ | CWE-704 | https://github.com/chromium/chromium/commit/41f5b55ab27da6890af96f2f8f0f6dd5bc6cc93c | 41f5b55ab27da6890af96f2f8f0f6dd5bc6cc93c | SkiaRenderer: Support changing color space
SkiaOutputSurfaceImpl did not handle the color space changing after it
was created previously. The SkSurfaceCharacterization color space was
only set during the first time Reshape() ran when the charactization is
returned from the GPU thread. If the color space was changed later the
SkSurface and SkDDL color spaces no longer matched and draw failed.
Bug: 1009452
Change-Id: Ib6d2083efc7e7eb6f94782342e92a809b69d6fdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841811
Reviewed-by: Peng Huang <[email protected]>
Commit-Queue: kylechar <[email protected]>
Cr-Commit-Position: refs/heads/master@{#702946} | void SkiaOutputSurfaceImpl::RemoveRenderPassResource(
std::vector<RenderPassId> ids) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!ids.empty());
std::vector<std::unique_ptr<ImageContextImpl>> image_contexts;
image_contexts.reserve(ids.size());
for (const auto id : ids) {
auto it = render_pass_image_cache_.find(id);
if (it != render_pass_image_cache_.end()) {
it->second->clear_image();
image_contexts.push_back(std::move(it->second));
render_pass_image_cache_.erase(it);
}
}
if (!image_contexts.empty()) {
auto callback = base::BindOnce(
&SkiaOutputSurfaceImplOnGpu::RemoveRenderPassResource,
base::Unretained(impl_on_gpu_.get()), std::move(image_contexts));
ScheduleGpuTask(std::move(callback), std::vector<gpu::SyncToken>());
}
}
| void SkiaOutputSurfaceImpl::RemoveRenderPassResource(
std::vector<RenderPassId> ids) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(!ids.empty());
std::vector<std::unique_ptr<ImageContextImpl>> image_contexts;
image_contexts.reserve(ids.size());
for (const auto id : ids) {
auto it = render_pass_image_cache_.find(id);
if (it != render_pass_image_cache_.end()) {
it->second->clear_image();
image_contexts.push_back(std::move(it->second));
render_pass_image_cache_.erase(it);
}
}
if (!image_contexts.empty()) {
auto callback = base::BindOnce(
&SkiaOutputSurfaceImplOnGpu::RemoveRenderPassResource,
base::Unretained(impl_on_gpu_.get()), std::move(image_contexts));
ScheduleGpuTask(std::move(callback), std::vector<gpu::SyncToken>());
}
}
| C | Chrome | 0 |
CVE-2014-1713 | https://www.cvedetails.com/cve/CVE-2014-1713/ | CWE-399 | https://github.com/chromium/chromium/commit/f85a87ec670ad0fce9d98d90c9a705b72a288154 | f85a87ec670ad0fce9d98d90c9a705b72a288154 | document.location bindings fix
BUG=352374
[email protected]
Review URL: https://codereview.chromium.org/196343011
git-svn-id: svn://svn.chromium.org/blink/trunk@169176 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
TestObjectV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
| 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 <[email protected]>
Acked-by: Stéphane Graber <[email protected]> | extern struct lxc_popen_FILE *lxc_popen(const char *command)
{
struct lxc_popen_FILE *fp = NULL;
int parent_end = -1, child_end = -1;
int pipe_fds[2];
pid_t child_pid;
int r = pipe2(pipe_fds, O_CLOEXEC);
if (r < 0) {
ERROR("pipe2 failure");
return NULL;
}
parent_end = pipe_fds[0];
child_end = pipe_fds[1];
child_pid = fork();
if (child_pid == 0) {
/* child */
int child_std_end = STDOUT_FILENO;
if (child_end != child_std_end) {
/* dup2() doesn't dup close-on-exec flag */
dup2(child_end, child_std_end);
/* it's safe not to close child_end here
* as it's marked close-on-exec anyway
*/
} else {
/*
* The descriptor is already the one we will use.
* But it must not be marked close-on-exec.
* Undo the effects.
*/
if (fcntl(child_end, F_SETFD, 0) != 0) {
SYSERROR("Failed to remove FD_CLOEXEC from fd.");
exit(127);
}
}
/*
* Unblock signals.
* This is the main/only reason
* why we do our lousy popen() emulation.
*/
{
sigset_t mask;
sigfillset(&mask);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
}
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
exit(127);
}
/* parent */
close(child_end);
child_end = -1;
if (child_pid < 0) {
ERROR("fork failure");
goto error;
}
fp = calloc(1, sizeof(*fp));
if (!fp) {
ERROR("failed to allocate memory");
goto error;
}
fp->f = fdopen(parent_end, "r");
if (!fp->f) {
ERROR("fdopen failure");
goto error;
}
fp->child_pid = child_pid;
return fp;
error:
if (fp) {
if (fp->f) {
fclose(fp->f);
parent_end = -1; /* so we do not close it second time */
}
free(fp);
}
if (parent_end != -1)
close(parent_end);
return NULL;
}
| extern struct lxc_popen_FILE *lxc_popen(const char *command)
{
struct lxc_popen_FILE *fp = NULL;
int parent_end = -1, child_end = -1;
int pipe_fds[2];
pid_t child_pid;
int r = pipe2(pipe_fds, O_CLOEXEC);
if (r < 0) {
ERROR("pipe2 failure");
return NULL;
}
parent_end = pipe_fds[0];
child_end = pipe_fds[1];
child_pid = fork();
if (child_pid == 0) {
/* child */
int child_std_end = STDOUT_FILENO;
if (child_end != child_std_end) {
/* dup2() doesn't dup close-on-exec flag */
dup2(child_end, child_std_end);
/* it's safe not to close child_end here
* as it's marked close-on-exec anyway
*/
} else {
/*
* The descriptor is already the one we will use.
* But it must not be marked close-on-exec.
* Undo the effects.
*/
if (fcntl(child_end, F_SETFD, 0) != 0) {
SYSERROR("Failed to remove FD_CLOEXEC from fd.");
exit(127);
}
}
/*
* Unblock signals.
* This is the main/only reason
* why we do our lousy popen() emulation.
*/
{
sigset_t mask;
sigfillset(&mask);
sigprocmask(SIG_UNBLOCK, &mask, NULL);
}
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
exit(127);
}
/* parent */
close(child_end);
child_end = -1;
if (child_pid < 0) {
ERROR("fork failure");
goto error;
}
fp = calloc(1, sizeof(*fp));
if (!fp) {
ERROR("failed to allocate memory");
goto error;
}
fp->f = fdopen(parent_end, "r");
if (!fp->f) {
ERROR("fdopen failure");
goto error;
}
fp->child_pid = child_pid;
return fp;
error:
if (fp) {
if (fp->f) {
fclose(fp->f);
parent_end = -1; /* so we do not close it second time */
}
free(fp);
}
if (parent_end != -1)
close(parent_end);
return NULL;
}
| C | lxc | 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) | GF_Err fecr_dump(GF_Box *a, FILE * trace)
{
u32 i;
char *box_name;
FECReservoirBox *ptr = (FECReservoirBox *) a;
if (a->type==GF_ISOM_BOX_TYPE_FIRE) {
box_name = "FILEReservoirBox";
} else {
box_name = "FECReservoirBox";
}
gf_isom_box_dump_start(a, box_name, trace);
fprintf(trace, ">\n");
for (i=0; i<ptr->nb_entries; i++) {
fprintf(trace, "<%sEntry itemID=\"%d\" symbol_count=\"%d\"/>\n", box_name, ptr->entries[i].item_id, ptr->entries[i].symbol_count);
}
if (!ptr->size) {
fprintf(trace, "<%sEntry itemID=\"\" symbol_count=\"\"/>\n", box_name);
}
gf_isom_box_dump_done(box_name, a, trace);
return GF_OK;
}
| GF_Err fecr_dump(GF_Box *a, FILE * trace)
{
u32 i;
char *box_name;
FECReservoirBox *ptr = (FECReservoirBox *) a;
if (a->type==GF_ISOM_BOX_TYPE_FIRE) {
box_name = "FILEReservoirBox";
} else {
box_name = "FECReservoirBox";
}
gf_isom_box_dump_start(a, box_name, trace);
fprintf(trace, ">\n");
for (i=0; i<ptr->nb_entries; i++) {
fprintf(trace, "<%sEntry itemID=\"%d\" symbol_count=\"%d\"/>\n", box_name, ptr->entries[i].item_id, ptr->entries[i].symbol_count);
}
if (!ptr->size) {
fprintf(trace, "<%sEntry itemID=\"\" symbol_count=\"\"/>\n", box_name);
}
gf_isom_box_dump_done(box_name, a, trace);
return GF_OK;
}
| C | gpac | 0 |
null | null | null | https://github.com/chromium/chromium/commit/8a50f99c25fb70ff43aaa82b6f9569db383f0ca8 | 8a50f99c25fb70ff43aaa82b6f9569db383f0ca8 | [Sync] Rework unit tests for ChromeInvalidationClient
In particular, add unit tests that would have caught bug 139424.
Dep-inject InvalidationClient into ChromeInvalidationClient.
Use the function name 'UpdateRegisteredIds' consistently.
Replace some mocks with fakes.
BUG=139424
Review URL: https://chromiumcodereview.appspot.com/10827133
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150665 0039d316-1c4b-4281-b951-d872f2087c98 | ObjectIdSet RegistrationManager::GetRegisteredIds() const {
DCHECK(CalledOnValidThread());
ObjectIdSet ids;
for (RegistrationStatusMap::const_iterator it =
registration_statuses_.begin();
it != registration_statuses_.end(); ++it) {
if (IsIdRegistered(it->first)) {
ids.insert(it->first);
}
}
return ids;
}
| ObjectIdSet RegistrationManager::GetRegisteredIds() const {
DCHECK(CalledOnValidThread());
ObjectIdSet ids;
for (RegistrationStatusMap::const_iterator it =
registration_statuses_.begin();
it != registration_statuses_.end(); ++it) {
if (IsIdRegistered(it->first)) {
ids.insert(it->first);
}
}
return ids;
}
| C | Chrome | 0 |
CVE-2019-5838 | https://www.cvedetails.com/cve/CVE-2019-5838/ | CWE-20 | https://github.com/chromium/chromium/commit/0660e08731fd42076d7242068e9eaed1482b14d5 | 0660e08731fd42076d7242068e9eaed1482b14d5 | Call CanCaptureVisiblePage in page capture API.
Currently the pageCapture permission allows access
to arbitrary local files and chrome:// pages which
can be a security concern. In order to address this,
the page capture API needs to be changed similar to
the captureVisibleTab API. The API will now only allow
extensions to capture otherwise-restricted URLs if the
user has granted activeTab. In addition, file:// URLs are
only capturable with the "Allow on file URLs" option enabled.
Bug: 893087
Change-Id: I6d6225a3efb70fc033e2e1c031c633869afac624
Reviewed-on: https://chromium-review.googlesource.com/c/1330689
Commit-Queue: Bettina Dea <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Varun Khaneja <[email protected]>
Cr-Commit-Position: refs/heads/master@{#615248} | void TabsCaptureVisibleTabFunction::OnCaptureSuccess(const SkBitmap& bitmap) {
std::string base64_result;
if (!EncodeBitmap(bitmap, &base64_result)) {
OnCaptureFailure(FAILURE_REASON_ENCODING_FAILED);
return;
}
Respond(OneArgument(std::make_unique<base::Value>(base64_result)));
}
| void TabsCaptureVisibleTabFunction::OnCaptureSuccess(const SkBitmap& bitmap) {
std::string base64_result;
if (!EncodeBitmap(bitmap, &base64_result)) {
OnCaptureFailure(FAILURE_REASON_ENCODING_FAILED);
return;
}
Respond(OneArgument(std::make_unique<base::Value>(base64_result)));
}
| C | Chrome | 0 |
CVE-2016-2384 | https://www.cvedetails.com/cve/CVE-2016-2384/ | null | https://github.com/torvalds/linux/commit/07d86ca93db7e5cdf4743564d98292042ec21af7 | 07d86ca93db7e5cdf4743564d98292042ec21af7 | ALSA: usb-audio: avoid freeing umidi object twice
The 'umidi' object will be free'd on the error path by snd_usbmidi_free()
when tearing down the rawmidi interface. So we shouldn't try to free it
in snd_usbmidi_create() after having registered the rawmidi interface.
Found by KASAN.
Signed-off-by: Andrey Konovalov <[email protected]>
Acked-by: Clemens Ladisch <[email protected]>
Cc: <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]> | static void snd_usbmidi_rawmidi_free(struct snd_rawmidi *rmidi)
{
struct snd_usb_midi *umidi = rmidi->private_data;
snd_usbmidi_free(umidi);
}
| static void snd_usbmidi_rawmidi_free(struct snd_rawmidi *rmidi)
{
struct snd_usb_midi *umidi = rmidi->private_data;
snd_usbmidi_free(umidi);
}
| C | linux | 0 |
CVE-2017-5019 | https://www.cvedetails.com/cve/CVE-2017-5019/ | CWE-416 | https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93 | f03ea5a5c2ff26e239dfd23e263b15da2d9cee93 | Convert FrameHostMsg_DidAddMessageToConsole to Mojo.
Note: Since this required changing the test
RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually
re-introduced https://crbug.com/666714 locally (the bug the test was
added for), and reran the test to confirm that it still covers the bug.
Bug: 786836
Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270
Commit-Queue: Lowell Manners <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Camille Lamy <[email protected]>
Cr-Commit-Position: refs/heads/master@{#653137} | service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
return &remote_interfaces_;
}
| service_manager::InterfaceProvider* RenderFrameImpl::GetRemoteInterfaces() {
return &remote_interfaces_;
}
| C | Chrome | 0 |
CVE-2016-5337 | https://www.cvedetails.com/cve/CVE-2016-5337/ | CWE-200 | https://git.qemu.org/?p=qemu.git;a=commit;h=844864fbae66935951529408831c2f22367a57b6 | 844864fbae66935951529408831c2f22367a57b6 | null | static void megasas_port_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
megasas_mmio_write(opaque, addr & 0xff, val, size);
}
| static void megasas_port_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
megasas_mmio_write(opaque, addr & 0xff, val, size);
}
| C | qemu | 0 |
CVE-2017-6001 | https://www.cvedetails.com/cve/CVE-2017-6001/ | CWE-362 | https://github.com/torvalds/linux/commit/321027c1fe77f892f4ea07846aeae08cefbbb290 | 321027c1fe77f892f4ea07846aeae08cefbbb290 | perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
Di Shen reported a race between two concurrent sys_perf_event_open()
calls where both try and move the same pre-existing software group
into a hardware context.
The problem is exactly that described in commit:
f63a8daa5812 ("perf: Fix event->ctx locking")
... where, while we wait for a ctx->mutex acquisition, the event->ctx
relation can have changed under us.
That very same commit failed to recognise sys_perf_event_context() as an
external access vector to the events and thereby didn't apply the
established locking rules correctly.
So while one sys_perf_event_open() call is stuck waiting on
mutex_lock_double(), the other (which owns said locks) moves the group
about. So by the time the former sys_perf_event_open() acquires the
locks, the context we've acquired is stale (and possibly dead).
Apply the established locking rules as per perf_event_ctx_lock_nested()
to the mutex_lock_double() for the 'move_group' case. This obviously means
we need to validate state after we acquire the locks.
Reported-by: Di Shen (Keen Lab)
Tested-by: John Dias <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Min Chong <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Fixes: f63a8daa5812 ("perf: Fix event->ctx locking")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]> | static ssize_t nr_addr_filters_show(struct device *dev,
struct device_attribute *attr,
char *page)
{
struct pmu *pmu = dev_get_drvdata(dev);
return snprintf(page, PAGE_SIZE - 1, "%d\n", pmu->nr_addr_filters);
}
| static ssize_t nr_addr_filters_show(struct device *dev,
struct device_attribute *attr,
char *page)
{
struct pmu *pmu = dev_get_drvdata(dev);
return snprintf(page, PAGE_SIZE - 1, "%d\n", pmu->nr_addr_filters);
}
| C | linux | 0 |
CVE-2016-1665 | https://www.cvedetails.com/cve/CVE-2016-1665/ | CWE-20 | https://github.com/chromium/chromium/commit/282f53ffdc3b1902da86f6a0791af736837efbf8 | 282f53ffdc3b1902da86f6a0791af736837efbf8 | [signin] Add metrics to track the source for refresh token updated events
This CL add a source for update and revoke credentials operations. It then
surfaces the source in the chrome://signin-internals page.
This CL also records the following histograms that track refresh token events:
* Signin.RefreshTokenUpdated.ToValidToken.Source
* Signin.RefreshTokenUpdated.ToInvalidToken.Source
* Signin.RefreshTokenRevoked.Source
These histograms are needed to validate the assumptions of how often tokens
are revoked by the browser and the sources for the token revocations.
Bug: 896182
Change-Id: I2fcab80ee8e5699708e695bc3289fa6d34859a90
Reviewed-on: https://chromium-review.googlesource.com/c/1286464
Reviewed-by: Jochen Eisinger <[email protected]>
Reviewed-by: David Roger <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Commit-Queue: Mihai Sardarescu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#606181} | base::Value GetAccountValue(const AccountInfo& account,
AccountTrackerService* account_tracker) {
DCHECK(!account.IsEmpty());
base::Value dictionary(base::Value::Type::DICTIONARY);
dictionary.SetKey("email", base::Value(account.email));
dictionary.SetKey("fullName", base::Value(account.full_name));
dictionary.SetKey("givenName", base::Value(account.given_name));
const gfx::Image& account_image =
account_tracker->GetAccountImage(account.account_id);
if (!account_image.IsEmpty()) {
dictionary.SetKey(
"avatarImage",
base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap())));
}
return dictionary;
}
| base::Value GetAccountValue(const AccountInfo& account,
AccountTrackerService* account_tracker) {
DCHECK(!account.IsEmpty());
base::Value dictionary(base::Value::Type::DICTIONARY);
dictionary.SetKey("email", base::Value(account.email));
dictionary.SetKey("fullName", base::Value(account.full_name));
dictionary.SetKey("givenName", base::Value(account.given_name));
const gfx::Image& account_image =
account_tracker->GetAccountImage(account.account_id);
if (!account_image.IsEmpty()) {
dictionary.SetKey(
"avatarImage",
base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap())));
}
return dictionary;
}
| C | Chrome | 0 |
CVE-2018-11596 | https://www.cvedetails.com/cve/CVE-2018-11596/ | CWE-119 | https://github.com/espruino/Espruino/commit/ce1924193862d58cb43d3d4d9dada710a8361b89 | ce1924193862d58cb43d3d4d9dada710a8361b89 | fix jsvGetString regression | bool jsvIsFunctionReturn(const JsVar *v) { return v && ((v->flags&JSV_VARTYPEMASK)==JSV_FUNCTION_RETURN); } ///< Is this a function with an implicit 'return' at the start?
| bool jsvIsFunctionReturn(const JsVar *v) { return v && ((v->flags&JSV_VARTYPEMASK)==JSV_FUNCTION_RETURN); } ///< Is this a function with an implicit 'return' at the start?
| C | Espruino | 0 |
CVE-2015-3331 | https://www.cvedetails.com/cve/CVE-2015-3331/ | CWE-119 | https://github.com/torvalds/linux/commit/ccfe8c3f7e52ae83155cb038753f4c75b774ca8a | ccfe8c3f7e52ae83155cb038753f4c75b774ca8a | crypto: aesni - fix memory usage in GCM decryption
The kernel crypto API logic requires the caller to provide the
length of (ciphertext || authentication tag) as cryptlen for the
AEAD decryption operation. Thus, the cipher implementation must
calculate the size of the plaintext output itself and cannot simply use
cryptlen.
The RFC4106 GCM decryption operation tries to overwrite cryptlen memory
in req->dst. As the destination buffer for decryption only needs to hold
the plaintext memory but cryptlen references the input buffer holding
(ciphertext || authentication tag), the assumption of the destination
buffer length in RFC4106 GCM operation leads to a too large size. This
patch simply uses the already calculated plaintext size.
In addition, this patch fixes the offset calculation of the AAD buffer
pointer: as mentioned before, cryptlen already includes the size of the
tag. Thus, the tag does not need to be added. With the addition, the AAD
will be written beyond the already allocated buffer.
Note, this fixes a kernel crash that can be triggered from user space
via AF_ALG(aead) -- simply use the libkcapi test application
from [1] and update it to use rfc4106-gcm-aes.
Using [1], the changes were tested using CAVS vectors to demonstrate
that the crypto operation still delivers the right results.
[1] http://www.chronox.de/libkcapi.html
CC: Tadeusz Struk <[email protected]>
Cc: [email protected]
Signed-off-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]> | static void aesni_gcm_enc_avx(void *ctx, u8 *out,
const u8 *in, unsigned long plaintext_len, u8 *iv,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((plaintext_len < AVX_GEN2_OPTSIZE) || (aes_ctx-> key_length != AES_KEYSIZE_128)){
aesni_gcm_enc(ctx, out, in, plaintext_len, iv, hash_subkey, aad,
aad_len, auth_tag, auth_tag_len);
} else {
aesni_gcm_precomp_avx_gen2(ctx, hash_subkey);
aesni_gcm_enc_avx_gen2(ctx, out, in, plaintext_len, iv, aad,
aad_len, auth_tag, auth_tag_len);
}
}
| static void aesni_gcm_enc_avx(void *ctx, u8 *out,
const u8 *in, unsigned long plaintext_len, u8 *iv,
u8 *hash_subkey, const u8 *aad, unsigned long aad_len,
u8 *auth_tag, unsigned long auth_tag_len)
{
struct crypto_aes_ctx *aes_ctx = (struct crypto_aes_ctx*)ctx;
if ((plaintext_len < AVX_GEN2_OPTSIZE) || (aes_ctx-> key_length != AES_KEYSIZE_128)){
aesni_gcm_enc(ctx, out, in, plaintext_len, iv, hash_subkey, aad,
aad_len, auth_tag, auth_tag_len);
} else {
aesni_gcm_precomp_avx_gen2(ctx, hash_subkey);
aesni_gcm_enc_avx_gen2(ctx, out, in, plaintext_len, iv, aad,
aad_len, auth_tag, auth_tag_len);
}
}
| C | linux | 0 |
CVE-2015-3412 | https://www.cvedetails.com/cve/CVE-2015-3412/ | CWE-254 | https://git.php.net/?p=php-src.git;a=commit;h=4435b9142ff9813845d5c97ab29a5d637bedb257 | 4435b9142ff9813845d5c97ab29a5d637bedb257 | null | PHP_FUNCTION(imagecolorat)
{
zval *IM;
long x, y;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &IM, &x, &y) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
if (gdImageTrueColor(im)) {
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y);
RETURN_FALSE;
}
}
}
| PHP_FUNCTION(imagecolorat)
{
zval *IM;
long x, y;
gdImagePtr im;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &IM, &x, &y) == FAILURE) {
return;
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
if (gdImageTrueColor(im)) {
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", x, y);
RETURN_FALSE;
}
}
}
| C | php | 0 |
CVE-2012-2828 | https://www.cvedetails.com/cve/CVE-2012-2828/ | CWE-189 | https://github.com/chromium/chromium/commit/d560c6f5a89c582c9e12000adcebb4d4538a665d | d560c6f5a89c582c9e12000adcebb4d4538a665d | Disable OutOfProcessPPAPITest.VarDeprecated on Mac due to timeouts.
BUG=121107
[email protected],[email protected]
Review URL: https://chromiumcodereview.appspot.com/9950017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129857 0039d316-1c4b-4281-b951-d872f2087c98 | void Reset() {
finished_ = false;
waiting_ = false;
result_.clear();
}
| void Reset() {
finished_ = false;
waiting_ = false;
result_.clear();
}
| C | Chrome | 0 |
CVE-2013-0292 | https://www.cvedetails.com/cve/CVE-2013-0292/ | CWE-20 | https://cgit.freedesktop.org/dbus/dbus-glib/commit/?id=166978a09cf5edff4028e670b6074215a4c75eca | 166978a09cf5edff4028e670b6074215a4c75eca | null | tristring_from_message (DBusMessage *message)
{
const char *path;
const char *interface;
path = dbus_message_get_path (message);
interface = dbus_message_get_interface (message);
g_assert (path);
g_assert (interface);
return tristring_alloc_from_strings (0,
dbus_message_get_sender (message),
path, interface);
}
| tristring_from_message (DBusMessage *message)
{
const char *path;
const char *interface;
path = dbus_message_get_path (message);
interface = dbus_message_get_interface (message);
g_assert (path);
g_assert (interface);
return tristring_alloc_from_strings (0,
dbus_message_get_sender (message),
path, interface);
}
| C | dbus | 0 |
CVE-2014-3570 | https://www.cvedetails.com/cve/CVE-2014-3570/ | CWE-310 | https://github.com/openssl/openssl/commit/a7a44ba55cb4f884c6bc9ceac90072dea38e66d0 | a7a44ba55cb4f884c6bc9ceac90072dea38e66d0 | Fix for CVE-2014-3570 (with minor bn_asm.c revamp).
Reviewed-by: Emilia Kasper <[email protected]> | BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
{
BN_ULONG t1,t2;
int c=0;
if (n <= 0) return((BN_ULONG)0);
for (;;)
{
t1=a[0]; t2=b[0];
r[0]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[1]; t2=b[1];
r[1]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[2]; t2=b[2];
r[2]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[3]; t2=b[3];
r[3]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
a+=4;
b+=4;
r+=4;
}
return(c);
}
| BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
{
BN_ULONG t1,t2;
int c=0;
if (n <= 0) return((BN_ULONG)0);
for (;;)
{
t1=a[0]; t2=b[0];
r[0]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[1]; t2=b[1];
r[1]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[2]; t2=b[2];
r[2]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
t1=a[3]; t2=b[3];
r[3]=(t1-t2-c)&BN_MASK2;
if (t1 != t2) c=(t1 < t2);
if (--n <= 0) break;
a+=4;
b+=4;
r+=4;
}
return(c);
}
| C | openssl | 0 |
CVE-2012-2890 | https://www.cvedetails.com/cve/CVE-2012-2890/ | CWE-399 | https://github.com/chromium/chromium/commit/a6f7726de20450074a01493e4e85409ce3f2595a | a6f7726de20450074a01493e4e85409ce3f2595a | Unreviewed, rolling out r147402.
http://trac.webkit.org/changeset/147402
https://bugs.webkit.org/show_bug.cgi?id=112903
Source/WebCore:
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
LayoutTests:
* http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html:
* http/tests/security/XFrameOptions/x-frame-options-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny.html:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny.html:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-multiple-headers-sameorigin-deny-expected.txt:
* platform/chromium/http/tests/security/XFrameOptions/x-frame-options-parent-same-origin-deny-expected.txt:
git-svn-id: svn://svn.chromium.org/blink/trunk@147450 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void Document::setDecoder(PassRefPtr<TextResourceDecoder> decoder)
{
m_decoder = decoder;
}
| void Document::setDecoder(PassRefPtr<TextResourceDecoder> decoder)
{
m_decoder = decoder;
}
| C | Chrome | 0 |
CVE-2018-10717 | https://www.cvedetails.com/cve/CVE-2018-10717/ | CWE-119 | https://github.com/miniupnp/ngiflib/commit/cf429e0a2fe26b5f01ce0c8e9b79432e94509b6e | cf429e0a2fe26b5f01ce0c8e9b79432e94509b6e | fix "pixel overrun"
fixes #3 | void fprintf_ngiflib_img(FILE * f, struct ngiflib_img * i) {
fprintf(f, " * ngiflib_img @ %p\n", i);
fprintf(f, " next = %p\n", i->next);
fprintf(f, " parent = %p\n", i->parent);
fprintf(f, " palette = %p\n", i->palette);
fprintf(f, " %3d couleurs", i->ncolors);
if(i->interlaced) fprintf(f, " interlaced");
fprintf(f, "\n taille : %dx%d, pos (%d,%d)\n", i->width, i->height, i->posX, i->posY);
fprintf(f, " sort_flag=%x localpalbits=%d\n", i->sort_flag, i->localpalbits);
}
| void fprintf_ngiflib_img(FILE * f, struct ngiflib_img * i) {
fprintf(f, " * ngiflib_img @ %p\n", i);
fprintf(f, " next = %p\n", i->next);
fprintf(f, " parent = %p\n", i->parent);
fprintf(f, " palette = %p\n", i->palette);
fprintf(f, " %3d couleurs", i->ncolors);
if(i->interlaced) fprintf(f, " interlaced");
fprintf(f, "\n taille : %dx%d, pos (%d,%d)\n", i->width, i->height, i->posX, i->posY);
fprintf(f, " sort_flag=%x localpalbits=%d\n", i->sort_flag, i->localpalbits);
}
| C | ngiflib | 0 |
CVE-2014-2523 | https://www.cvedetails.com/cve/CVE-2014-2523/ | CWE-20 | https://github.com/torvalds/linux/commit/b22f5126a24b3b2f15448c3f2a254fc10cbc2b92 | b22f5126a24b3b2f15448c3f2a254fc10cbc2b92 | netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
Some occurences in the netfilter tree use skb_header_pointer() in
the following way ...
struct dccp_hdr _dh, *dh;
...
skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
... where dh itself is a pointer that is being passed as the copy
buffer. Instead, we need to use &_dh as the forth argument so that
we're copying the data into an actual buffer that sits on the stack.
Currently, we probably could overwrite memory on the stack (e.g.
with a possibly mal-formed DCCP packet), but unintentionally, as
we only want the buffer to be placed into _dh variable.
Fixes: 2bc780499aa3 ("[NETFILTER]: nf_conntrack: add DCCP protocol support")
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]> | static int dccp_error(struct net *net, struct nf_conn *tmpl,
struct sk_buff *skb, unsigned int dataoff,
enum ip_conntrack_info *ctinfo,
u_int8_t pf, unsigned int hooknum)
{
struct dccp_hdr _dh, *dh;
unsigned int dccp_len = skb->len - dataoff;
unsigned int cscov;
const char *msg;
dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
if (dh == NULL) {
msg = "nf_ct_dccp: short packet ";
goto out_invalid;
}
if (dh->dccph_doff * 4 < sizeof(struct dccp_hdr) ||
dh->dccph_doff * 4 > dccp_len) {
msg = "nf_ct_dccp: truncated/malformed packet ";
goto out_invalid;
}
cscov = dccp_len;
if (dh->dccph_cscov) {
cscov = (dh->dccph_cscov - 1) * 4;
if (cscov > dccp_len) {
msg = "nf_ct_dccp: bad checksum coverage ";
goto out_invalid;
}
}
if (net->ct.sysctl_checksum && hooknum == NF_INET_PRE_ROUTING &&
nf_checksum_partial(skb, hooknum, dataoff, cscov, IPPROTO_DCCP,
pf)) {
msg = "nf_ct_dccp: bad checksum ";
goto out_invalid;
}
if (dh->dccph_type >= DCCP_PKT_INVALID) {
msg = "nf_ct_dccp: reserved packet type ";
goto out_invalid;
}
return NF_ACCEPT;
out_invalid:
if (LOG_INVALID(net, IPPROTO_DCCP))
nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL, "%s", msg);
return -NF_ACCEPT;
}
| static int dccp_error(struct net *net, struct nf_conn *tmpl,
struct sk_buff *skb, unsigned int dataoff,
enum ip_conntrack_info *ctinfo,
u_int8_t pf, unsigned int hooknum)
{
struct dccp_hdr _dh, *dh;
unsigned int dccp_len = skb->len - dataoff;
unsigned int cscov;
const char *msg;
dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);
if (dh == NULL) {
msg = "nf_ct_dccp: short packet ";
goto out_invalid;
}
if (dh->dccph_doff * 4 < sizeof(struct dccp_hdr) ||
dh->dccph_doff * 4 > dccp_len) {
msg = "nf_ct_dccp: truncated/malformed packet ";
goto out_invalid;
}
cscov = dccp_len;
if (dh->dccph_cscov) {
cscov = (dh->dccph_cscov - 1) * 4;
if (cscov > dccp_len) {
msg = "nf_ct_dccp: bad checksum coverage ";
goto out_invalid;
}
}
if (net->ct.sysctl_checksum && hooknum == NF_INET_PRE_ROUTING &&
nf_checksum_partial(skb, hooknum, dataoff, cscov, IPPROTO_DCCP,
pf)) {
msg = "nf_ct_dccp: bad checksum ";
goto out_invalid;
}
if (dh->dccph_type >= DCCP_PKT_INVALID) {
msg = "nf_ct_dccp: reserved packet type ";
goto out_invalid;
}
return NF_ACCEPT;
out_invalid:
if (LOG_INVALID(net, IPPROTO_DCCP))
nf_log_packet(net, pf, 0, skb, NULL, NULL, NULL, "%s", msg);
return -NF_ACCEPT;
}
| C | linux | 1 |
CVE-2019-17178 | https://www.cvedetails.com/cve/CVE-2019-17178/ | CWE-772 | https://github.com/akallabeth/FreeRDP/commit/fc80ab45621bd966f70594c0b7393ec005a94007 | fc80ab45621bd966f70594c0b7393ec005a94007 | Fixed #5645: realloc return handling | BOOL rectangle_is_empty(const RECTANGLE_16* rect)
{
/* A rectangle with width = 0 or height = 0 should be regarded
* as empty.
*/
return ((rect->left == rect->right) || (rect->top == rect->bottom)) ? TRUE : FALSE;
}
| BOOL rectangle_is_empty(const RECTANGLE_16* rect)
{
/* A rectangle with width = 0 or height = 0 should be regarded
* as empty.
*/
return ((rect->left == rect->right) || (rect->top == rect->bottom)) ? TRUE : FALSE;
}
| C | FreeRDP | 0 |
CVE-2017-5069 | https://www.cvedetails.com/cve/CVE-2017-5069/ | CWE-79 | https://github.com/chromium/chromium/commit/7a0dee9d17d0ee7fd1b40b017442f4952384a7c2 | 7a0dee9d17d0ee7fd1b40b017442f4952384a7c2 | Prevent regular mode session startup pref type turning to default.
When user loses past session tabs of regular mode after
invoking a new window from the incognito mode.
This was happening because the SessionStartUpPref type was being set
to default, from last, for regular user mode. This was happening in
the RestoreIfNecessary method where the restoration was taking place
for users whose SessionStartUpPref type was set to last.
The fix was to make the protocol of changing the pref type to
default more explicit to incognito users and not regular users
of pref type last.
Bug: 481373
Change-Id: I96efb4cf196949312181c83c6dcd45986ddded13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774441
Reviewed-by: Tommy Martino <[email protected]>
Reviewed-by: Ramin Halavati <[email protected]>
Commit-Queue: Rohit Agarwal <[email protected]>
Cr-Commit-Position: refs/heads/master@{#691726} | void StartupBrowserCreator::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
#if !defined(OS_CHROMEOS)
registry->RegisterBooleanPref(prefs::kPromotionalTabsEnabled, true);
registry->RegisterBooleanPref(prefs::kCommandLineFlagSecurityWarningsEnabled,
true);
#endif
registry->RegisterBooleanPref(prefs::kSuppressUnsupportedOSWarning, false);
registry->RegisterBooleanPref(prefs::kWasRestarted, false);
}
| void StartupBrowserCreator::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) {
#if !defined(OS_CHROMEOS)
registry->RegisterBooleanPref(prefs::kPromotionalTabsEnabled, true);
registry->RegisterBooleanPref(prefs::kCommandLineFlagSecurityWarningsEnabled,
true);
#endif
registry->RegisterBooleanPref(prefs::kSuppressUnsupportedOSWarning, false);
registry->RegisterBooleanPref(prefs::kWasRestarted, false);
}
| C | Chrome | 0 |
CVE-2011-4127 | https://www.cvedetails.com/cve/CVE-2011-4127/ | CWE-264 | https://github.com/torvalds/linux/commit/0bfc96cb77224736dfa35c3c555d37b3646ef35e | 0bfc96cb77224736dfa35c3c555d37b3646ef35e | block: fail SCSI passthrough ioctls on partition devices
Linux allows executing the SG_IO ioctl on a partition or LVM volume, and
will pass the command to the underlying block device. This is
well-known, but it is also a large security problem when (via Unix
permissions, ACLs, SELinux or a combination thereof) a program or user
needs to be granted access only to part of the disk.
This patch lets partitions forward a small set of harmless ioctls;
others are logged with printk so that we can see which ioctls are
actually sent. In my tests only CDROM_GET_CAPABILITY actually occurred.
Of course it was being sent to a (partition on a) hard disk, so it would
have failed with ENOTTY and the patch isn't changing anything in
practice. Still, I'm treating it specially to avoid spamming the logs.
In principle, this restriction should include programs running with
CAP_SYS_RAWIO. If for example I let a program access /dev/sda2 and
/dev/sdb, it still should not be able to read/write outside the
boundaries of /dev/sda2 independent of the capabilities. However, for
now programs with CAP_SYS_RAWIO will still be allowed to send the
ioctls. Their actions will still be logged.
This patch does not affect the non-libata IDE driver. That driver
however already tests for bd != bd->bd_contains before issuing some
ioctl; it could be restricted further to forbid these ioctls even for
programs running with CAP_SYS_ADMIN/CAP_SYS_RAWIO.
Cc: [email protected]
Cc: Jens Axboe <[email protected]>
Cc: James Bottomley <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
[ Make it also print the command name when warning - Linus ]
Signed-off-by: Linus Torvalds <[email protected]> | sd_show_protection_type(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct scsi_disk *sdkp = to_scsi_disk(dev);
return snprintf(buf, 20, "%u\n", sdkp->protection_type);
}
| sd_show_protection_type(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct scsi_disk *sdkp = to_scsi_disk(dev);
return snprintf(buf, 20, "%u\n", sdkp->protection_type);
}
| C | linux | 0 |
CVE-2013-7421 | https://www.cvedetails.com/cve/CVE-2013-7421/ | CWE-264 | https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b | 5d26a105b5a73e5635eae0629b42fa0a90e07b7b | crypto: prefix module autoloading with "crypto-"
This prefixes all crypto module loading with "crypto-" so we never run
the risk of exposing module auto-loading to userspace via a crypto API,
as demonstrated by Mathias Krause:
https://lkml.org/lkml/2013/3/4/70
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Herbert Xu <[email protected]> | int __camellia_setkey(struct camellia_ctx *cctx, const unsigned char *key,
unsigned int key_len, u32 *flags)
{
if (key_len != 16 && key_len != 24 && key_len != 32) {
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
cctx->key_length = key_len;
switch (key_len) {
case 16:
camellia_setup128(key, cctx->key_table);
break;
case 24:
camellia_setup192(key, cctx->key_table);
break;
case 32:
camellia_setup256(key, cctx->key_table);
break;
}
return 0;
}
| int __camellia_setkey(struct camellia_ctx *cctx, const unsigned char *key,
unsigned int key_len, u32 *flags)
{
if (key_len != 16 && key_len != 24 && key_len != 32) {
*flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
return -EINVAL;
}
cctx->key_length = key_len;
switch (key_len) {
case 16:
camellia_setup128(key, cctx->key_table);
break;
case 24:
camellia_setup192(key, cctx->key_table);
break;
case 32:
camellia_setup256(key, cctx->key_table);
break;
}
return 0;
}
| C | linux | 0 |
CVE-2016-3751 | https://www.cvedetails.com/cve/CVE-2016-3751/ | null | https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca | 9d4853418ab2f754c2b63e091c29c5529b8b86ca | DO NOT MERGE Update libpng to 1.6.20
BUG:23265085
Change-Id: I85199805636d771f3597b691b63bc0bf46084833
(cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
| store_read_buffer_next(png_store *ps)
{
png_store_buffer *pbOld = ps->next;
png_store_buffer *pbNew = &ps->current->data;
if (pbOld != pbNew)
{
while (pbNew != NULL && pbNew->prev != pbOld)
pbNew = pbNew->prev;
if (pbNew != NULL)
{
ps->next = pbNew;
ps->readpos = 0;
return 1;
}
png_error(ps->pread, "buffer lost");
}
return 0; /* EOF or error */
}
| store_read_buffer_next(png_store *ps)
{
png_store_buffer *pbOld = ps->next;
png_store_buffer *pbNew = &ps->current->data;
if (pbOld != pbNew)
{
while (pbNew != NULL && pbNew->prev != pbOld)
pbNew = pbNew->prev;
if (pbNew != NULL)
{
ps->next = pbNew;
ps->readpos = 0;
return 1;
}
png_error(ps->pread, "buffer lost");
}
return 0; /* EOF or error */
}
| C | Android | 0 |
CVE-2017-5013 | https://www.cvedetails.com/cve/CVE-2017-5013/ | null | https://github.com/chromium/chromium/commit/8f3a9a68b2dcdd2c54cf49a41ad34729ab576702 | 8f3a9a68b2dcdd2c54cf49a41ad34729ab576702 | Don't focus the location bar for NTP navigations in non-selected tabs.
BUG=677716
TEST=See bug for repro steps.
Review-Url: https://codereview.chromium.org/2624373002
Cr-Commit-Position: refs/heads/master@{#443338} | void Browser::LostMouseLock() {
exclusive_access_manager_->mouse_lock_controller()->LostMouseLock();
}
| void Browser::LostMouseLock() {
exclusive_access_manager_->mouse_lock_controller()->LostMouseLock();
}
| C | Chrome | 0 |
CVE-2017-9250 | https://www.cvedetails.com/cve/CVE-2017-9250/ | CWE-476 | https://github.com/zherczeg/jerryscript/commit/03a8c630f015f63268639d3ed3bf82cff6fa77d8 | 03a8c630f015f63268639d3ed3bf82cff6fa77d8 | Do not allocate memory for zero length strings.
Fixes #1821.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected] | lexer_scan_identifier (parser_context_t *context_p, /**< context */
bool propety_name) /**< property name */
{
skip_spaces (context_p);
context_p->token.line = context_p->line;
context_p->token.column = context_p->column;
if (context_p->source_p < context_p->source_end_p
&& (lit_char_is_identifier_start (context_p->source_p) || context_p->source_p[0] == LIT_CHAR_BACKSLASH))
{
lexer_parse_identifier (context_p, false);
if (propety_name && context_p->token.lit_location.length == 3)
{
skip_spaces (context_p);
if (context_p->source_p < context_p->source_end_p
&& context_p->source_p[0] != LIT_CHAR_COLON)
{
if (lexer_compare_identifier_to_current (context_p, &lexer_get_literal))
{
context_p->token.type = LEXER_PROPERTY_GETTER;
}
else if (lexer_compare_identifier_to_current (context_p, &lexer_set_literal))
{
context_p->token.type = LEXER_PROPERTY_SETTER;
}
}
}
return;
}
if (propety_name)
{
lexer_next_token (context_p);
if (context_p->token.type == LEXER_LITERAL
|| context_p->token.type == LEXER_RIGHT_BRACE)
{
return;
}
}
parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
} /* lexer_scan_identifier */
| lexer_scan_identifier (parser_context_t *context_p, /**< context */
bool propety_name) /**< property name */
{
skip_spaces (context_p);
context_p->token.line = context_p->line;
context_p->token.column = context_p->column;
if (context_p->source_p < context_p->source_end_p
&& (lit_char_is_identifier_start (context_p->source_p) || context_p->source_p[0] == LIT_CHAR_BACKSLASH))
{
lexer_parse_identifier (context_p, false);
if (propety_name && context_p->token.lit_location.length == 3)
{
skip_spaces (context_p);
if (context_p->source_p < context_p->source_end_p
&& context_p->source_p[0] != LIT_CHAR_COLON)
{
if (lexer_compare_identifier_to_current (context_p, &lexer_get_literal))
{
context_p->token.type = LEXER_PROPERTY_GETTER;
}
else if (lexer_compare_identifier_to_current (context_p, &lexer_set_literal))
{
context_p->token.type = LEXER_PROPERTY_SETTER;
}
}
}
return;
}
if (propety_name)
{
lexer_next_token (context_p);
if (context_p->token.type == LEXER_LITERAL
|| context_p->token.type == LEXER_RIGHT_BRACE)
{
return;
}
}
parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
} /* lexer_scan_identifier */
| C | jerryscript | 0 |
CVE-2018-10021 | https://www.cvedetails.com/cve/CVE-2018-10021/ | null | https://github.com/torvalds/linux/commit/318aaf34f1179b39fa9c30fa0f3288b645beee39 | 318aaf34f1179b39fa9c30fa0f3288b645beee39 | scsi: libsas: defer ata device eh commands to libata
When ata device doing EH, some commands still attached with tasks are
not passed to libata when abort failed or recover failed, so libata did
not handle these commands. After these commands done, sas task is freed,
but ata qc is not freed. This will cause ata qc leak and trigger a
warning like below:
WARNING: CPU: 0 PID: 28512 at drivers/ata/libata-eh.c:4037
ata_eh_finish+0xb4/0xcc
CPU: 0 PID: 28512 Comm: kworker/u32:2 Tainted: G W OE 4.14.0#1
......
Call trace:
[<ffff0000088b7bd0>] ata_eh_finish+0xb4/0xcc
[<ffff0000088b8420>] ata_do_eh+0xc4/0xd8
[<ffff0000088b8478>] ata_std_error_handler+0x44/0x8c
[<ffff0000088b8068>] ata_scsi_port_error_handler+0x480/0x694
[<ffff000008875fc4>] async_sas_ata_eh+0x4c/0x80
[<ffff0000080f6be8>] async_run_entry_fn+0x4c/0x170
[<ffff0000080ebd70>] process_one_work+0x144/0x390
[<ffff0000080ec100>] worker_thread+0x144/0x418
[<ffff0000080f2c98>] kthread+0x10c/0x138
[<ffff0000080855dc>] ret_from_fork+0x10/0x18
If ata qc leaked too many, ata tag allocation will fail and io blocked
for ever.
As suggested by Dan Williams, defer ata device commands to libata and
merge sas_eh_finish_cmd() with sas_eh_defer_cmd(). libata will handle
ata qcs correctly after this.
Signed-off-by: Jason Yan <[email protected]>
CC: Xiaofei Tan <[email protected]>
CC: John Garry <[email protected]>
CC: Dan Williams <[email protected]>
Reviewed-by: Dan Williams <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]> | static int sas_queue_reset(struct domain_device *dev, int reset_type,
u64 lun, int wait)
{
struct sas_ha_struct *ha = dev->port->ha;
int scheduled = 0, tries = 100;
/* ata: promote lun reset to bus reset */
if (dev_is_sata(dev)) {
sas_ata_schedule_reset(dev);
if (wait)
sas_ata_wait_eh(dev);
return SUCCESS;
}
while (!scheduled && tries--) {
spin_lock_irq(&ha->lock);
if (!test_bit(SAS_DEV_EH_PENDING, &dev->state) &&
!test_bit(reset_type, &dev->state)) {
scheduled = 1;
ha->eh_active++;
list_add_tail(&dev->ssp_dev.eh_list_node, &ha->eh_dev_q);
set_bit(SAS_DEV_EH_PENDING, &dev->state);
set_bit(reset_type, &dev->state);
int_to_scsilun(lun, &dev->ssp_dev.reset_lun);
scsi_schedule_eh(ha->core.shost);
}
spin_unlock_irq(&ha->lock);
if (wait)
sas_wait_eh(dev);
if (scheduled)
return SUCCESS;
}
SAS_DPRINTK("%s reset of %s failed\n",
reset_type == SAS_DEV_LU_RESET ? "LUN" : "Bus",
dev_name(&dev->rphy->dev));
return FAILED;
}
| static int sas_queue_reset(struct domain_device *dev, int reset_type,
u64 lun, int wait)
{
struct sas_ha_struct *ha = dev->port->ha;
int scheduled = 0, tries = 100;
/* ata: promote lun reset to bus reset */
if (dev_is_sata(dev)) {
sas_ata_schedule_reset(dev);
if (wait)
sas_ata_wait_eh(dev);
return SUCCESS;
}
while (!scheduled && tries--) {
spin_lock_irq(&ha->lock);
if (!test_bit(SAS_DEV_EH_PENDING, &dev->state) &&
!test_bit(reset_type, &dev->state)) {
scheduled = 1;
ha->eh_active++;
list_add_tail(&dev->ssp_dev.eh_list_node, &ha->eh_dev_q);
set_bit(SAS_DEV_EH_PENDING, &dev->state);
set_bit(reset_type, &dev->state);
int_to_scsilun(lun, &dev->ssp_dev.reset_lun);
scsi_schedule_eh(ha->core.shost);
}
spin_unlock_irq(&ha->lock);
if (wait)
sas_wait_eh(dev);
if (scheduled)
return SUCCESS;
}
SAS_DPRINTK("%s reset of %s failed\n",
reset_type == SAS_DEV_LU_RESET ? "LUN" : "Bus",
dev_name(&dev->rphy->dev));
return FAILED;
}
| C | linux | 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 label(JF, int inst)
{
labelto(J, F, inst, F->codelen);
}
| static void label(JF, int inst)
{
labelto(J, F, inst, F->codelen);
}
| C | ghostscript | 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::LayoutNewTabButton(double last_tab_right,
double unselected_width) {
GtkWidget* toplevel = gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW);
bool is_maximized = false;
if (toplevel) {
GdkWindow* gdk_window = gtk_widget_get_window(toplevel);
is_maximized = (gdk_window_get_state(gdk_window) &
GDK_WINDOW_STATE_MAXIMIZED) != 0;
}
int y = is_maximized ? 0 : kNewTabButtonVOffset;
int height = newtab_surface_bounds_.height() + kNewTabButtonVOffset - y;
gfx::Rect bounds(0, y, newtab_surface_bounds_.width(), height);
int delta = abs(Round(unselected_width) - TabGtk::GetStandardSize().width());
if (delta > 1 && !needs_resize_layout_) {
bounds.set_x(bounds_.width() - newtab_button_->WidgetAllocation().width);
} else {
bounds.set_x(Round(last_tab_right - kTabHOffset) + kNewTabButtonHOffset);
}
bounds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds));
gtk_fixed_move(GTK_FIXED(tabstrip_.get()), newtab_button_->widget(),
bounds.x(), bounds.y());
gtk_widget_set_size_request(newtab_button_->widget(), bounds.width(),
bounds.height());
}
| void TabStripGtk::LayoutNewTabButton(double last_tab_right,
double unselected_width) {
GtkWidget* toplevel = gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW);
bool is_maximized = false;
if (toplevel) {
GdkWindow* gdk_window = gtk_widget_get_window(toplevel);
is_maximized = (gdk_window_get_state(gdk_window) &
GDK_WINDOW_STATE_MAXIMIZED) != 0;
}
int y = is_maximized ? 0 : kNewTabButtonVOffset;
int height = newtab_surface_bounds_.height() + kNewTabButtonVOffset - y;
gfx::Rect bounds(0, y, newtab_surface_bounds_.width(), height);
int delta = abs(Round(unselected_width) - TabGtk::GetStandardSize().width());
if (delta > 1 && !needs_resize_layout_) {
bounds.set_x(bounds_.width() - newtab_button_->WidgetAllocation().width);
} else {
bounds.set_x(Round(last_tab_right - kTabHOffset) + kNewTabButtonHOffset);
}
bounds.set_x(gtk_util::MirroredLeftPointForRect(tabstrip_.get(), bounds));
gtk_fixed_move(GTK_FIXED(tabstrip_.get()), newtab_button_->widget(),
bounds.x(), bounds.y());
gtk_widget_set_size_request(newtab_button_->widget(), bounds.width(),
bounds.height());
}
| C | Chrome | 0 |
CVE-2016-4544 | https://www.cvedetails.com/cve/CVE-2016-4544/ | CWE-119 | https://git.php.net/?p=php-src.git;a=commit;h=082aecfc3a753ad03be82cf14f03ac065723ec92 | 082aecfc3a753ad03be82cf14f03ac065723ec92 | null | static char *exif_get_sectionname(int section)
{
switch(section) {
case SECTION_FILE: return "FILE";
case SECTION_COMPUTED: return "COMPUTED";
case SECTION_ANY_TAG: return "ANY_TAG";
case SECTION_IFD0: return "IFD0";
case SECTION_THUMBNAIL: return "THUMBNAIL";
case SECTION_COMMENT: return "COMMENT";
case SECTION_APP0: return "APP0";
case SECTION_EXIF: return "EXIF";
case SECTION_FPIX: return "FPIX";
case SECTION_GPS: return "GPS";
case SECTION_INTEROP: return "INTEROP";
case SECTION_APP12: return "APP12";
case SECTION_WINXP: return "WINXP";
case SECTION_MAKERNOTE: return "MAKERNOTE";
}
return "";
}
| static char *exif_get_sectionname(int section)
{
switch(section) {
case SECTION_FILE: return "FILE";
case SECTION_COMPUTED: return "COMPUTED";
case SECTION_ANY_TAG: return "ANY_TAG";
case SECTION_IFD0: return "IFD0";
case SECTION_THUMBNAIL: return "THUMBNAIL";
case SECTION_COMMENT: return "COMMENT";
case SECTION_APP0: return "APP0";
case SECTION_EXIF: return "EXIF";
case SECTION_FPIX: return "FPIX";
case SECTION_GPS: return "GPS";
case SECTION_INTEROP: return "INTEROP";
case SECTION_APP12: return "APP12";
case SECTION_WINXP: return "WINXP";
case SECTION_MAKERNOTE: return "MAKERNOTE";
}
return "";
}
| C | php | 0 |
CVE-2010-1166 | https://www.cvedetails.com/cve/CVE-2010-1166/ | CWE-189 | https://cgit.freedesktop.org/xorg/xserver/commit/?id=d2f813f7db | d2f813f7db157fc83abc4b3726821c36ee7e40b1 | null | fbFetch_c4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
{
int i;
for (i = 0; i < width; ++i) {
CARD32 p = Fetch4(bits, i + x);
WRITE(buffer++, indexed->rgba[p]);
}
}
| fbFetch_c4 (const FbBits *bits, int x, int width, CARD32 *buffer, miIndexedPtr indexed)
{
int i;
for (i = 0; i < width; ++i) {
CARD32 p = Fetch4(bits, i + x);
WRITE(buffer++, indexed->rgba[p]);
}
}
| C | xserver | 0 |
null | null | null | https://github.com/chromium/chromium/commit/8f883f2b12f68fed993671dce7fb5fb91f2229aa | 8f883f2b12f68fed993671dce7fb5fb91f2229aa | Add more non client Windows messages to the list of messages not being sent to the renderer.
Turns out we get WM_NCLBUTTONDOWN/UP messages at times which go to the renderer and are not acked causing the
unresponsive renderer dialog to show up in Desktop Chrome Aura.
BUG=335248
[email protected]
TBR=jam
Review URL: https://codereview.chromium.org/141103004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245949 0039d316-1c4b-4281-b951-d872f2087c98 | void RenderWidgetHostViewAura::RemovingFromRootWindow() {
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(window_->GetRootWindow());
if (cursor_client)
cursor_client->RemoveObserver(this);
DetachFromInputMethod();
event_filter_for_popup_exit_.reset();
window_->GetDispatcher()->RemoveRootWindowObserver(this);
host_->ParentChanged(0);
ui::Compositor* compositor = GetCompositor();
if (current_surface_.get()) {
window_->layer()->SetShowPaintedContent();
}
RunOnCommitCallbacks();
resize_lock_.reset();
host_->WasResized();
if (compositor && compositor->HasObserver(this))
compositor->RemoveObserver(this);
}
| void RenderWidgetHostViewAura::RemovingFromRootWindow() {
aura::client::CursorClient* cursor_client =
aura::client::GetCursorClient(window_->GetRootWindow());
if (cursor_client)
cursor_client->RemoveObserver(this);
DetachFromInputMethod();
event_filter_for_popup_exit_.reset();
window_->GetDispatcher()->RemoveRootWindowObserver(this);
host_->ParentChanged(0);
ui::Compositor* compositor = GetCompositor();
if (current_surface_.get()) {
window_->layer()->SetShowPaintedContent();
}
RunOnCommitCallbacks();
resize_lock_.reset();
host_->WasResized();
if (compositor && compositor->HasObserver(this))
compositor->RemoveObserver(this);
}
| C | Chrome | 0 |
null | null | null | https://github.com/chromium/chromium/commit/610f904d8215075c4681be4eb413f4348860bf9f | 610f904d8215075c4681be4eb413f4348860bf9f | Retrieve per host storage usage from QuotaManager.
[email protected]
BUG=none
TEST=QuotaManagerTest.GetUsage
Review URL: http://codereview.chromium.org/8079004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103921 0039d316-1c4b-4281-b951-d872f2087c98 | void GetAvailableSpace() {
quota_status_ = kQuotaStatusUnknown;
available_space_ = -1;
quota_manager_->GetAvailableSpace(
callback_factory_.NewCallback(
&QuotaManagerTest::DidGetAvailableSpace));
}
| void GetAvailableSpace() {
quota_status_ = kQuotaStatusUnknown;
available_space_ = -1;
quota_manager_->GetAvailableSpace(
callback_factory_.NewCallback(
&QuotaManagerTest::DidGetAvailableSpace));
}
| C | Chrome | 0 |
CVE-2018-16427 | https://www.cvedetails.com/cve/CVE-2018-16427/ | CWE-125 | https://github.com/OpenSC/OpenSC/pull/1447/commits/8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | 8fe377e93b4b56060e5bbfb6f3142ceaeca744fa | fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes. | static int asepcos_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *pdata,
int *tries_left)
{
sc_apdu_t apdu;
int r = SC_SUCCESS;
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
if (tries_left)
*tries_left = -1;
/* only PIN verification is supported at the moment */
/* check PIN length */
if (pdata->pin1.len < 4 || pdata->pin1.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN1 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
switch (pdata->cmd) {
case SC_PIN_CMD_VERIFY:
if (pdata->pin_type != SC_AC_CHV && pdata->pin_type != SC_AC_AUT)
return SC_ERROR_INVALID_ARGUMENTS;
/* 'AUT' key is the transport PIN and should have reference '0' */
if (pdata->pin_type == SC_AC_AUT && pdata->pin_reference)
return SC_ERROR_INVALID_ARGUMENTS;
/* build verify APDU and send it to the card */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS)
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
case SC_PIN_CMD_CHANGE:
if (pdata->pin_type != SC_AC_CHV)
return SC_ERROR_INVALID_ARGUMENTS;
if (pdata->pin2.len < 4 || pdata->pin2.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN2 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
/* 1. step: verify the old pin */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
if (apdu.sw1 != 0x90 || apdu.sw2 != 0x00) {
/* unable to verify the old PIN */
break;
}
/* 2, step: use CHANGE KEY to update the PIN */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_CHANGE, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS)
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
case SC_PIN_CMD_UNBLOCK:
if (pdata->pin_type != SC_AC_CHV)
return SC_ERROR_INVALID_ARGUMENTS;
if (pdata->pin2.len < 4 || pdata->pin2.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN2 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
/* 1. step: verify the puk */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 1);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
/* 2, step: unblock and change the pin */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_UNBLOCK, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
break;
default:
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "error: unknown cmd type");
return SC_ERROR_INTERNAL;
}
/* Clear the buffer - it may contain pins */
sc_mem_clear(sbuf, sizeof(sbuf));
/* check for remaining tries if verification failed */
if (r == SC_SUCCESS) {
if (apdu.sw1 == 0x63) {
if ((apdu.sw2 & 0xF0) == 0xC0 && tries_left != NULL)
*tries_left = apdu.sw2 & 0x0F;
r = SC_ERROR_PIN_CODE_INCORRECT;
return r;
}
r = sc_check_sw(card, apdu.sw1, apdu.sw2);
}
return r;
}
| static int asepcos_pin_cmd(sc_card_t *card, struct sc_pin_cmd_data *pdata,
int *tries_left)
{
sc_apdu_t apdu;
int r = SC_SUCCESS;
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
if (tries_left)
*tries_left = -1;
/* only PIN verification is supported at the moment */
/* check PIN length */
if (pdata->pin1.len < 4 || pdata->pin1.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN1 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
switch (pdata->cmd) {
case SC_PIN_CMD_VERIFY:
if (pdata->pin_type != SC_AC_CHV && pdata->pin_type != SC_AC_AUT)
return SC_ERROR_INVALID_ARGUMENTS;
/* 'AUT' key is the transport PIN and should have reference '0' */
if (pdata->pin_type == SC_AC_AUT && pdata->pin_reference)
return SC_ERROR_INVALID_ARGUMENTS;
/* build verify APDU and send it to the card */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS)
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
case SC_PIN_CMD_CHANGE:
if (pdata->pin_type != SC_AC_CHV)
return SC_ERROR_INVALID_ARGUMENTS;
if (pdata->pin2.len < 4 || pdata->pin2.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN2 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
/* 1. step: verify the old pin */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
if (apdu.sw1 != 0x90 || apdu.sw2 != 0x00) {
/* unable to verify the old PIN */
break;
}
/* 2, step: use CHANGE KEY to update the PIN */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_CHANGE, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS)
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
case SC_PIN_CMD_UNBLOCK:
if (pdata->pin_type != SC_AC_CHV)
return SC_ERROR_INVALID_ARGUMENTS;
if (pdata->pin2.len < 4 || pdata->pin2.len > 16) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid PIN2 length");
return SC_ERROR_INVALID_PIN_LENGTH;
}
/* 1. step: verify the puk */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_VERIFY, 1);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
/* 2, step: unblock and change the pin */
r = asepcos_build_pin_apdu(card, &apdu, pdata, sbuf, sizeof(sbuf), SC_PIN_CMD_UNBLOCK, 0);
if (r != SC_SUCCESS)
break;
r = sc_transmit_apdu(card, &apdu);
if (r != SC_SUCCESS) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "APDU transmit failed");
break;
}
break;
default:
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "error: unknown cmd type");
return SC_ERROR_INTERNAL;
}
/* Clear the buffer - it may contain pins */
sc_mem_clear(sbuf, sizeof(sbuf));
/* check for remaining tries if verification failed */
if (r == SC_SUCCESS) {
if (apdu.sw1 == 0x63) {
if ((apdu.sw2 & 0xF0) == 0xC0 && tries_left != NULL)
*tries_left = apdu.sw2 & 0x0F;
r = SC_ERROR_PIN_CODE_INCORRECT;
return r;
}
r = sc_check_sw(card, apdu.sw1, apdu.sw2);
}
return r;
}
| C | OpenSC | 0 |
CVE-2009-3736 | https://www.cvedetails.com/cve/CVE-2009-3736/ | null | https://git.savannah.gnu.org/cgit/libtool.git/commit/?h=branch-1-5&id=29b48580df75f0c5baa2962548a4c101ec7ed7ec | 29b48580df75f0c5baa2962548a4c101ec7ed7ec | null | lt_dlinit ()
{
int errors = 0;
LT_DLMUTEX_LOCK ();
/* Initialize only at first call. */
if (++initialized == 1)
{
handles = 0;
user_search_path = 0; /* empty search path */
#if HAVE_LIBDL
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
#endif
#if HAVE_SHL_LOAD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
#endif
#ifdef __WINDOWS__
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
#endif
#ifdef __BEOS__
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
#endif
#if HAVE_DLD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
#endif
#if HAVE_DYLD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
errors += sys_dyld_init();
#endif
errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
if (presym_init (presym.dlloader_data))
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER));
++errors;
}
else if (errors != 0)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED));
++errors;
}
}
LT_DLMUTEX_UNLOCK ();
return errors;
}
| lt_dlinit ()
{
int errors = 0;
LT_DLMUTEX_LOCK ();
/* Initialize only at first call. */
if (++initialized == 1)
{
handles = 0;
user_search_path = 0; /* empty search path */
#if HAVE_LIBDL
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
#endif
#if HAVE_SHL_LOAD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
#endif
#ifdef __WINDOWS__
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
#endif
#ifdef __BEOS__
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
#endif
#if HAVE_DLD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
#endif
#if HAVE_DYLD
errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
errors += sys_dyld_init();
#endif
errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
if (presym_init (presym.dlloader_data))
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER));
++errors;
}
else if (errors != 0)
{
LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED));
++errors;
}
}
LT_DLMUTEX_UNLOCK ();
return errors;
}
| C | savannah | 0 |
CVE-2016-9794 | https://www.cvedetails.com/cve/CVE-2016-9794/ | CWE-416 | https://github.com/torvalds/linux/commit/3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4 | 3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4 | ALSA: pcm : Call kill_fasync() in stream lock
Currently kill_fasync() is called outside the stream lock in
snd_pcm_period_elapsed(). This is potentially racy, since the stream
may get released even during the irq handler is running. Although
snd_pcm_release_substream() calls snd_pcm_drop(), this doesn't
guarantee that the irq handler finishes, thus the kill_fasync() call
outside the stream spin lock may be invoked after the substream is
detached, as recently reported by KASAN.
As a quick workaround, move kill_fasync() call inside the stream
lock. The fasync is rarely used interface, so this shouldn't have a
big impact from the performance POV.
Ideally, we should implement some sync mechanism for the proper finish
of stream and irq handler. But this oneliner should suffice for most
cases, so far.
Reported-by: Baozeng Ding <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]> | static int _snd_pcm_hw_param_last(struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var)
{
int changed;
if (hw_is_mask(var))
changed = snd_mask_refine_last(hw_param_mask(params, var));
else if (hw_is_interval(var))
changed = snd_interval_refine_last(hw_param_interval(params, var));
else
return -EINVAL;
if (changed) {
params->cmask |= 1 << var;
params->rmask |= 1 << var;
}
return changed;
}
| static int _snd_pcm_hw_param_last(struct snd_pcm_hw_params *params,
snd_pcm_hw_param_t var)
{
int changed;
if (hw_is_mask(var))
changed = snd_mask_refine_last(hw_param_mask(params, var));
else if (hw_is_interval(var))
changed = snd_interval_refine_last(hw_param_interval(params, var));
else
return -EINVAL;
if (changed) {
params->cmask |= 1 << var;
params->rmask |= 1 << var;
}
return changed;
}
| C | linux | 0 |
CVE-2017-7946 | https://www.cvedetails.com/cve/CVE-2017-7946/ | CWE-416 | https://github.com/radare/radare2/commit/d1e8ac62c6d978d4662f69116e30230d43033c92 | d1e8ac62c6d978d4662f69116e30230d43033c92 | Fix null deref and uaf in mach0 parser | static int parse_thread(struct MACH0_(obj_t)* bin, struct load_command *lc, ut64 off, bool is_first_thread) {
ut64 ptr_thread, pc = UT64_MAX, pc_offset = UT64_MAX;
ut32 flavor, count;
ut8 *arw_ptr = NULL;
int arw_sz, len = 0;
ut8 thc[sizeof (struct thread_command)] = {0};
if (off > bin->size || off + sizeof (struct thread_command) > bin->size)
return false;
len = r_buf_read_at (bin->b, off, thc, 8);
if (len < 1)
goto wrong_read;
bin->thread.cmd = r_read_ble32 (&thc[0], bin->big_endian);
bin->thread.cmdsize = r_read_ble32 (&thc[4], bin->big_endian);
flavor = r_read_ble32 (bin->b->buf + off + sizeof(struct thread_command), bin->big_endian);
if (len == -1)
goto wrong_read;
if (off + sizeof (struct thread_command) + sizeof (flavor) > bin->size || \
off + sizeof (struct thread_command) + sizeof (flavor) + sizeof (ut32) > bin->size)
return false;
count = r_read_ble32 (bin->b->buf + off + sizeof (struct thread_command) + sizeof(flavor),
bin->big_endian);
ptr_thread = off + sizeof (struct thread_command) + sizeof (flavor) + sizeof (count);
if (ptr_thread > bin->size)
return false;
switch (bin->hdr.cputype) {
case CPU_TYPE_I386:
case CPU_TYPE_X86_64:
switch (flavor) {
case X86_THREAD_STATE32:
if (ptr_thread + sizeof (struct x86_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.x86_32, "16i", 1)) == -1) {
bprintf ("Error: read (thread state x86_32)\n");
return false;
}
pc = bin->thread_state.x86_32.eip;
pc_offset = ptr_thread + r_offsetof(struct x86_thread_state32, eip);
arw_ptr = (ut8 *)&bin->thread_state.x86_32;
arw_sz = sizeof (struct x86_thread_state32);
break;
case X86_THREAD_STATE64:
if (ptr_thread + sizeof (struct x86_thread_state64) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.x86_64, "32l", 1)) == -1) {
bprintf ("Error: read (thread state x86_64)\n");
return false;
}
pc = bin->thread_state.x86_64.rip;
pc_offset = ptr_thread + r_offsetof(struct x86_thread_state64, rip);
arw_ptr = (ut8 *)&bin->thread_state.x86_64;
arw_sz = sizeof (struct x86_thread_state64);
break;
}
break;
case CPU_TYPE_POWERPC:
case CPU_TYPE_POWERPC64:
if (flavor == X86_THREAD_STATE32) {
if (ptr_thread + sizeof (struct ppc_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.ppc_32, bin->big_endian?"40I":"40i", 1)) == -1) {
bprintf ("Error: read (thread state ppc_32)\n");
return false;
}
pc = bin->thread_state.ppc_32.srr0;
pc_offset = ptr_thread + r_offsetof(struct ppc_thread_state32, srr0);
arw_ptr = (ut8 *)&bin->thread_state.ppc_32;
arw_sz = sizeof (struct ppc_thread_state32);
} else if (flavor == X86_THREAD_STATE64) {
if (ptr_thread + sizeof (struct ppc_thread_state64) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.ppc_64, bin->big_endian?"34LI3LI":"34li3li", 1)) == -1) {
bprintf ("Error: read (thread state ppc_64)\n");
return false;
}
pc = bin->thread_state.ppc_64.srr0;
pc_offset = ptr_thread + r_offsetof(struct ppc_thread_state64, srr0);
arw_ptr = (ut8 *)&bin->thread_state.ppc_64;
arw_sz = sizeof (struct ppc_thread_state64);
}
break;
case CPU_TYPE_ARM:
if (ptr_thread + sizeof (struct arm_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.arm_32, bin->big_endian?"17I":"17i", 1)) == -1) {
bprintf ("Error: read (thread state arm)\n");
return false;
}
pc = bin->thread_state.arm_32.r15;
pc_offset = ptr_thread + r_offsetof (struct arm_thread_state32, r15);
arw_ptr = (ut8 *)&bin->thread_state.arm_32;
arw_sz = sizeof (struct arm_thread_state32);
break;
case CPU_TYPE_ARM64:
if (ptr_thread + sizeof (struct arm_thread_state64) > bin->size) {
return false;
}
if ((len = r_buf_fread_at(bin->b, ptr_thread,
(ut8*)&bin->thread_state.arm_64, bin->big_endian?"34LI1I":"34Li1i", 1)) == -1) {
bprintf ("Error: read (thread state arm)\n");
return false;
}
pc = r_read_be64 (&bin->thread_state.arm_64.pc);
pc_offset = ptr_thread + r_offsetof (struct arm_thread_state64, pc);
arw_ptr = (ut8*)&bin->thread_state.arm_64;
arw_sz = sizeof (struct arm_thread_state64);
break;
default:
bprintf ("Error: read (unknown thread state structure)\n");
return false;
}
if (arw_ptr && arw_sz > 0) {
int i;
ut8 *p = arw_ptr;
bprintf ("arw ");
for (i = 0; i < arw_sz; i++) {
bprintf ("%02x", 0xff & p[i]);
}
bprintf ("\n");
}
if (is_first_thread) {
bin->main_cmd = *lc;
if (pc != UT64_MAX) {
bin->entry = pc;
}
if (pc_offset != UT64_MAX) {
sdb_num_set (bin->kv, "mach0.entry.offset", pc_offset, 0);
}
}
return true;
wrong_read:
bprintf ("Error: read (thread)\n");
return false;
}
| static int parse_thread(struct MACH0_(obj_t)* bin, struct load_command *lc, ut64 off, bool is_first_thread) {
ut64 ptr_thread, pc = UT64_MAX, pc_offset = UT64_MAX;
ut32 flavor, count;
ut8 *arw_ptr = NULL;
int arw_sz, len = 0;
ut8 thc[sizeof (struct thread_command)] = {0};
if (off > bin->size || off + sizeof (struct thread_command) > bin->size)
return false;
len = r_buf_read_at (bin->b, off, thc, 8);
if (len < 1)
goto wrong_read;
bin->thread.cmd = r_read_ble32 (&thc[0], bin->big_endian);
bin->thread.cmdsize = r_read_ble32 (&thc[4], bin->big_endian);
flavor = r_read_ble32 (bin->b->buf + off + sizeof(struct thread_command), bin->big_endian);
if (len == -1)
goto wrong_read;
if (off + sizeof (struct thread_command) + sizeof (flavor) > bin->size || \
off + sizeof (struct thread_command) + sizeof (flavor) + sizeof (ut32) > bin->size)
return false;
count = r_read_ble32 (bin->b->buf + off + sizeof (struct thread_command) + sizeof(flavor),
bin->big_endian);
ptr_thread = off + sizeof (struct thread_command) + sizeof (flavor) + sizeof (count);
if (ptr_thread > bin->size)
return false;
switch (bin->hdr.cputype) {
case CPU_TYPE_I386:
case CPU_TYPE_X86_64:
switch (flavor) {
case X86_THREAD_STATE32:
if (ptr_thread + sizeof (struct x86_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.x86_32, "16i", 1)) == -1) {
bprintf ("Error: read (thread state x86_32)\n");
return false;
}
pc = bin->thread_state.x86_32.eip;
pc_offset = ptr_thread + r_offsetof(struct x86_thread_state32, eip);
arw_ptr = (ut8 *)&bin->thread_state.x86_32;
arw_sz = sizeof (struct x86_thread_state32);
break;
case X86_THREAD_STATE64:
if (ptr_thread + sizeof (struct x86_thread_state64) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.x86_64, "32l", 1)) == -1) {
bprintf ("Error: read (thread state x86_64)\n");
return false;
}
pc = bin->thread_state.x86_64.rip;
pc_offset = ptr_thread + r_offsetof(struct x86_thread_state64, rip);
arw_ptr = (ut8 *)&bin->thread_state.x86_64;
arw_sz = sizeof (struct x86_thread_state64);
break;
}
break;
case CPU_TYPE_POWERPC:
case CPU_TYPE_POWERPC64:
if (flavor == X86_THREAD_STATE32) {
if (ptr_thread + sizeof (struct ppc_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.ppc_32, bin->big_endian?"40I":"40i", 1)) == -1) {
bprintf ("Error: read (thread state ppc_32)\n");
return false;
}
pc = bin->thread_state.ppc_32.srr0;
pc_offset = ptr_thread + r_offsetof(struct ppc_thread_state32, srr0);
arw_ptr = (ut8 *)&bin->thread_state.ppc_32;
arw_sz = sizeof (struct ppc_thread_state32);
} else if (flavor == X86_THREAD_STATE64) {
if (ptr_thread + sizeof (struct ppc_thread_state64) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.ppc_64, bin->big_endian?"34LI3LI":"34li3li", 1)) == -1) {
bprintf ("Error: read (thread state ppc_64)\n");
return false;
}
pc = bin->thread_state.ppc_64.srr0;
pc_offset = ptr_thread + r_offsetof(struct ppc_thread_state64, srr0);
arw_ptr = (ut8 *)&bin->thread_state.ppc_64;
arw_sz = sizeof (struct ppc_thread_state64);
}
break;
case CPU_TYPE_ARM:
if (ptr_thread + sizeof (struct arm_thread_state32) > bin->size)
return false;
if ((len = r_buf_fread_at (bin->b, ptr_thread,
(ut8*)&bin->thread_state.arm_32, bin->big_endian?"17I":"17i", 1)) == -1) {
bprintf ("Error: read (thread state arm)\n");
return false;
}
pc = bin->thread_state.arm_32.r15;
pc_offset = ptr_thread + r_offsetof (struct arm_thread_state32, r15);
arw_ptr = (ut8 *)&bin->thread_state.arm_32;
arw_sz = sizeof (struct arm_thread_state32);
break;
case CPU_TYPE_ARM64:
if (ptr_thread + sizeof (struct arm_thread_state64) > bin->size) {
return false;
}
if ((len = r_buf_fread_at(bin->b, ptr_thread,
(ut8*)&bin->thread_state.arm_64, bin->big_endian?"34LI1I":"34Li1i", 1)) == -1) {
bprintf ("Error: read (thread state arm)\n");
return false;
}
pc = r_read_be64 (&bin->thread_state.arm_64.pc);
pc_offset = ptr_thread + r_offsetof (struct arm_thread_state64, pc);
arw_ptr = (ut8*)&bin->thread_state.arm_64;
arw_sz = sizeof (struct arm_thread_state64);
break;
default:
bprintf ("Error: read (unknown thread state structure)\n");
return false;
}
if (arw_ptr && arw_sz > 0) {
int i;
ut8 *p = arw_ptr;
bprintf ("arw ");
for (i = 0; i < arw_sz; i++) {
bprintf ("%02x", 0xff & p[i]);
}
bprintf ("\n");
}
if (is_first_thread) {
bin->main_cmd = *lc;
if (pc != UT64_MAX) {
bin->entry = pc;
}
if (pc_offset != UT64_MAX) {
sdb_num_set (bin->kv, "mach0.entry.offset", pc_offset, 0);
}
}
return true;
wrong_read:
bprintf ("Error: read (thread)\n");
return false;
}
| C | radare2 | 0 |
CVE-2018-1999011 | https://www.cvedetails.com/cve/CVE-2018-1999011/ | CWE-119 | https://github.com/FFmpeg/FFmpeg/commit/2b46ebdbff1d8dec7a3d8ea280a612b91a582869 | 2b46ebdbff1d8dec7a3d8ea280a612b91a582869 | avformat/asfdec_o: Check size_bmp more fully
Fixes: integer overflow and out of array access
Fixes: asfo-crash-46080c4341572a7137a162331af77f6ded45cbd7
Found-by: Paul Ch <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]> | static int get_asf_string(AVIOContext *pb, int maxlen, char *buf, int buflen)
{
char *q = buf;
int ret = 0;
if (buflen <= 0)
return AVERROR(EINVAL);
while (ret + 1 < maxlen) {
uint8_t tmp;
uint32_t ch;
GET_UTF16(ch, (ret += 2) <= maxlen ? avio_rl16(pb) : 0, break;);
PUT_UTF8(ch, tmp, if (q - buf < buflen - 1) *q++ = tmp;)
}
*q = 0;
return ret;
}
| static int get_asf_string(AVIOContext *pb, int maxlen, char *buf, int buflen)
{
char *q = buf;
int ret = 0;
if (buflen <= 0)
return AVERROR(EINVAL);
while (ret + 1 < maxlen) {
uint8_t tmp;
uint32_t ch;
GET_UTF16(ch, (ret += 2) <= maxlen ? avio_rl16(pb) : 0, break;);
PUT_UTF8(ch, tmp, if (q - buf < buflen - 1) *q++ = tmp;)
}
*q = 0;
return ret;
}
| C | FFmpeg | 0 |
CVE-2018-6127 | https://www.cvedetails.com/cve/CVE-2018-6127/ | null | https://github.com/chromium/chromium/commit/28044cb7ef4488e7278c2b80f0e3a2c3707d03b6 | 28044cb7ef4488e7278c2b80f0e3a2c3707d03b6 | [IndexedDB] Fixing early destruction of connection during forceclose
Patch is as small as possible for merging.
Bug: 842990
Change-Id: I9968ffee1bf3279e61e1ec13e4d541f713caf12f
Reviewed-on: https://chromium-review.googlesource.com/1062935
Commit-Queue: Daniel Murphy <[email protected]>
Commit-Queue: Victor Costan <[email protected]>
Reviewed-by: Victor Costan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#559383} | void IndexedDBDatabase::TransactionFinished(IndexedDBTransaction* transaction,
bool committed) {
IDB_TRACE1("IndexedDBTransaction::TransactionFinished", "txn.id",
transaction->id());
--transaction_count_;
DCHECK_GE(transaction_count_, 0);
if (active_request_ &&
transaction->mode() == blink::kWebIDBTransactionModeVersionChange) {
active_request_->UpgradeTransactionFinished(committed);
}
}
| void IndexedDBDatabase::TransactionFinished(IndexedDBTransaction* transaction,
bool committed) {
IDB_TRACE1("IndexedDBTransaction::TransactionFinished", "txn.id",
transaction->id());
--transaction_count_;
DCHECK_GE(transaction_count_, 0);
if (active_request_ &&
transaction->mode() == blink::kWebIDBTransactionModeVersionChange) {
active_request_->UpgradeTransactionFinished(committed);
}
}
| C | Chrome | 0 |
CVE-2019-15140 | https://www.cvedetails.com/cve/CVE-2019-15140/ | CWE-416 | https://github.com/ImageMagick/ImageMagick/commit/f7206618d27c2e69d977abf40e3035a33e5f6be0 | f7206618d27c2e69d977abf40e3035a33e5f6be0 | https://github.com/ImageMagick/ImageMagick/issues/1554 | static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal,
double MaxVal,ExceptionInfo *exception)
{
double f;
int x;
register Quantum *q;
if (MinVal >= 0)
MinVal = -1;
if (MaxVal <= 0)
MaxVal = 1;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
return;
for (x = 0; x < (ssize_t) image->columns; x++)
{
if (*p > 0)
{
f=(*p/MaxVal)*(Quantum) (QuantumRange-GetPixelRed(image,q));
if ((f+GetPixelRed(image,q)) >= QuantumRange)
SetPixelRed(image,QuantumRange,q);
else
SetPixelRed(image,GetPixelRed(image,q)+ClampToQuantum(f),q);
f=GetPixelGreen(image,q)-f/2.0;
if (f <= 0.0)
{
SetPixelGreen(image,0,q);
SetPixelBlue(image,0,q);
}
else
{
SetPixelBlue(image,ClampToQuantum(f),q);
SetPixelGreen(image,ClampToQuantum(f),q);
}
}
if (*p < 0)
{
f=(*p/MinVal)*(Quantum) (QuantumRange-GetPixelBlue(image,q));
if ((f+GetPixelBlue(image,q)) >= QuantumRange)
SetPixelBlue(image,QuantumRange,q);
else
SetPixelBlue(image,GetPixelBlue(image,q)+ClampToQuantum(f),q);
f=GetPixelGreen(image,q)-f/2.0;
if (f <= 0.0)
{
SetPixelRed(image,0,q);
SetPixelGreen(image,0,q);
}
else
{
SetPixelRed(image,ClampToQuantum(f),q);
SetPixelGreen(image,ClampToQuantum(f),q);
}
}
p++;
q++;
}
if (!SyncAuthenticPixels(image,exception))
return;
return;
}
| static void InsertComplexDoubleRow(Image *image,double *p,int y,double MinVal,
double MaxVal,ExceptionInfo *exception)
{
double f;
int x;
register Quantum *q;
if (MinVal >= 0)
MinVal = -1;
if (MaxVal <= 0)
MaxVal = 1;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
return;
for (x = 0; x < (ssize_t) image->columns; x++)
{
if (*p > 0)
{
f=(*p/MaxVal)*(Quantum) (QuantumRange-GetPixelRed(image,q));
if ((f+GetPixelRed(image,q)) >= QuantumRange)
SetPixelRed(image,QuantumRange,q);
else
SetPixelRed(image,GetPixelRed(image,q)+ClampToQuantum(f),q);
f=GetPixelGreen(image,q)-f/2.0;
if (f <= 0.0)
{
SetPixelGreen(image,0,q);
SetPixelBlue(image,0,q);
}
else
{
SetPixelBlue(image,ClampToQuantum(f),q);
SetPixelGreen(image,ClampToQuantum(f),q);
}
}
if (*p < 0)
{
f=(*p/MinVal)*(Quantum) (QuantumRange-GetPixelBlue(image,q));
if ((f+GetPixelBlue(image,q)) >= QuantumRange)
SetPixelBlue(image,QuantumRange,q);
else
SetPixelBlue(image,GetPixelBlue(image,q)+ClampToQuantum(f),q);
f=GetPixelGreen(image,q)-f/2.0;
if (f <= 0.0)
{
SetPixelRed(image,0,q);
SetPixelGreen(image,0,q);
}
else
{
SetPixelRed(image,ClampToQuantum(f),q);
SetPixelGreen(image,ClampToQuantum(f),q);
}
}
p++;
q++;
}
if (!SyncAuthenticPixels(image,exception))
return;
return;
}
| C | ImageMagick | 0 |
CVE-2011-2859 | https://www.cvedetails.com/cve/CVE-2011-2859/ | CWE-264 | https://github.com/chromium/chromium/commit/454434f6100cb6a529652a25b5fc181caa7c7f32 | 454434f6100cb6a529652a25b5fc181caa7c7f32 | Limit extent of webstore app to just chrome.google.com/webstore.
BUG=93497
TEST=Try installing extensions and apps from the webstore, starting both being
initially logged in, and not.
Review URL: http://codereview.chromium.org/7719003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97986 0039d316-1c4b-4281-b951-d872f2087c98 | void ExtensionService::LoadExtension(const FilePath& extension_path,
bool prompt_for_plugins) {
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(backend_.get(),
&ExtensionServiceBackend::LoadSingleExtension,
extension_path, prompt_for_plugins));
}
| void ExtensionService::LoadExtension(const FilePath& extension_path,
bool prompt_for_plugins) {
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(backend_.get(),
&ExtensionServiceBackend::LoadSingleExtension,
extension_path, prompt_for_plugins));
}
| C | Chrome | 0 |
CVE-2018-16513 | https://www.cvedetails.com/cve/CVE-2018-16513/ | CWE-704 | http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=b326a71659b7837d3acde954b18bda1a6f5e9498 | b326a71659b7837d3acde954b18bda1a6f5e9498 | null | static int devicencompareproc(i_ctx_t *i_ctx_p, ref *space, ref *testspace)
{
ref sname1, sname2;
int code;
code = array_get(imemory, space, 1, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 1, &sname2);
if (code < 0)
return 0;
if (!r_is_array(&sname1))
return 0;
if (!r_is_array(&sname2))
return 0;
if (!comparearrays(i_ctx_p, &sname1, &sname2))
return 0;
code = array_get(imemory, testspace, 2, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 2, &sname2);
if (code < 0)
return 0;
if (r_type(&sname1) != r_type(&sname2))
return 0;
if (r_is_array(&sname1)) {
if (!comparearrays(i_ctx_p, &sname1, &sname2))
return 0;
} else {
if (!r_has_type(&sname1, t_name))
return 0;
if (!name_eq(&sname1, &sname2))
return 0;
}
code = array_get(imemory, space, 3, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 3, &sname2);
if (code < 0)
return 0;
return(comparearrays(i_ctx_p, &sname1, &sname2));
}
| static int devicencompareproc(i_ctx_t *i_ctx_p, ref *space, ref *testspace)
{
ref sname1, sname2;
int code;
code = array_get(imemory, space, 1, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 1, &sname2);
if (code < 0)
return 0;
if (!r_is_array(&sname1))
return 0;
if (!r_is_array(&sname2))
return 0;
if (!comparearrays(i_ctx_p, &sname1, &sname2))
return 0;
code = array_get(imemory, testspace, 2, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 2, &sname2);
if (code < 0)
return 0;
if (r_type(&sname1) != r_type(&sname2))
return 0;
if (r_is_array(&sname1)) {
if (!comparearrays(i_ctx_p, &sname1, &sname2))
return 0;
} else {
if (!r_has_type(&sname1, t_name))
return 0;
if (!name_eq(&sname1, &sname2))
return 0;
}
code = array_get(imemory, space, 3, &sname1);
if (code < 0)
return 0;
code = array_get(imemory, testspace, 3, &sname2);
if (code < 0)
return 0;
return(comparearrays(i_ctx_p, &sname1, &sname2));
}
| C | ghostscript | 0 |
CVE-2013-2884 | https://www.cvedetails.com/cve/CVE-2013-2884/ | CWE-399 | https://github.com/chromium/chromium/commit/4ac8bc08e3306f38a5ab3e551aef6ad43753579c | 4ac8bc08e3306f38a5ab3e551aef6ad43753579c | Set Attr.ownerDocument in Element#setAttributeNode()
Attr objects can move across documents by setAttributeNode().
So It needs to reset ownerDocument through TreeScopeAdoptr::adoptIfNeeded().
BUG=248950
TEST=set-attribute-node-from-iframe.html
Review URL: https://chromiumcodereview.appspot.com/17583003
git-svn-id: svn://svn.chromium.org/blink/trunk@152938 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | PassRefPtr<Element> Element::cloneElementWithChildren()
{
RefPtr<Element> clone = cloneElementWithoutChildren();
cloneChildNodes(clone.get());
return clone.release();
}
| PassRefPtr<Element> Element::cloneElementWithChildren()
{
RefPtr<Element> clone = cloneElementWithoutChildren();
cloneChildNodes(clone.get());
return clone.release();
}
| C | Chrome | 0 |
null | null | null | https://github.com/chromium/chromium/commit/76f36a8362a3e817cc3ec721d591f2f8878dc0c7 | 76f36a8362a3e817cc3ec721d591f2f8878dc0c7 | Scheduler/child/TimeSource could be replaced with base/time/DefaultTickClock.
They both are totally same and TimeSource is removed.
BUG=494892
[email protected], [email protected]
Review URL: https://codereview.chromium.org/1163143002
Cr-Commit-Position: refs/heads/master@{#333035} | TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() {
CheckOnValidThread();
return task_queue_manager_.get();
}
| TaskQueueManager* SchedulerHelper::GetTaskQueueManagerForTesting() {
CheckOnValidThread();
return task_queue_manager_.get();
}
| C | Chrome | 0 |
CVE-2013-0885 | https://www.cvedetails.com/cve/CVE-2013-0885/ | CWE-264 | https://github.com/chromium/chromium/commit/f335421145bb7f82c60fb9d61babcd6ce2e4b21e | f335421145bb7f82c60fb9d61babcd6ce2e4b21e | Tighten restrictions on hosted apps calling extension APIs
Only allow component apps to make any API calls, and for them only allow the namespaces they explicitly have permission for (plus chrome.test - I need to see if I can rework some WebStore tests to remove even this).
BUG=172369
Review URL: https://chromiumcodereview.appspot.com/12095095
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180426 0039d316-1c4b-4281-b951-d872f2087c98 | Static()
: api(extensions::ExtensionAPI::CreateWithDefaultConfiguration()) {
}
| Static()
: api(extensions::ExtensionAPI::CreateWithDefaultConfiguration()) {
}
| C | Chrome | 0 |
CVE-2015-5697 | https://www.cvedetails.com/cve/CVE-2015-5697/ | CWE-200 | https://github.com/torvalds/linux/commit/b6878d9e03043695dbf3fa1caa6dfc09db225b16 | b6878d9e03043695dbf3fa1caa6dfc09db225b16 | md: use kzalloc() when bitmap is disabled
In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a
mdu_bitmap_file_t called "file".
5769 file = kmalloc(sizeof(*file), GFP_NOIO);
5770 if (!file)
5771 return -ENOMEM;
This structure is copied to user space at the end of the function.
5786 if (err == 0 &&
5787 copy_to_user(arg, file, sizeof(*file)))
5788 err = -EFAULT
But if bitmap is disabled only the first byte of "file" is initialized
with zero, so it's possible to read some bytes (up to 4095) of kernel
space memory from user space. This is an information leak.
5775 /* bitmap disabled, zero the first byte and copy out */
5776 if (!mddev->bitmap_info.file)
5777 file->pathname[0] = '\0';
Signed-off-by: Benjamin Randazzo <[email protected]>
Signed-off-by: NeilBrown <[email protected]> | static void md_new_event_inintr(struct mddev *mddev)
{
atomic_inc(&md_event_count);
wake_up(&md_event_waiters);
}
| static void md_new_event_inintr(struct mddev *mddev)
{
atomic_inc(&md_event_count);
wake_up(&md_event_waiters);
}
| C | linux | 0 |
CVE-2013-3231 | https://www.cvedetails.com/cve/CVE-2013-3231/ | CWE-200 | https://github.com/torvalds/linux/commit/c77a4b9cffb6215a15196ec499490d116dfad181 | c77a4b9cffb6215a15196ec499490d116dfad181 | llc: Fix missing msg_namelen update in llc_ui_recvmsg()
For stream sockets the code misses to update the msg_namelen member
to 0 and therefore makes net/socket.c leak the local, uninitialized
sockaddr_storage variable to userland -- 128 bytes of kernel stack
memory. The msg_namelen update is also missing for datagram sockets
in case the socket is shutting down during receive.
Fix both issues by setting msg_namelen to 0 early. It will be
updated later if we're going to fill the msg_name member.
Cc: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | static int llc_ui_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
int rc = -ESOCKTNOSUPPORT;
if (!ns_capable(net->user_ns, CAP_NET_RAW))
return -EPERM;
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) {
rc = -ENOMEM;
sk = llc_sk_alloc(net, PF_LLC, GFP_KERNEL, &llc_proto);
if (sk) {
rc = 0;
llc_ui_sk_init(sock, sk);
}
}
return rc;
}
| static int llc_ui_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
int rc = -ESOCKTNOSUPPORT;
if (!ns_capable(net->user_ns, CAP_NET_RAW))
return -EPERM;
if (!net_eq(net, &init_net))
return -EAFNOSUPPORT;
if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) {
rc = -ENOMEM;
sk = llc_sk_alloc(net, PF_LLC, GFP_KERNEL, &llc_proto);
if (sk) {
rc = 0;
llc_ui_sk_init(sock, sk);
}
}
return rc;
}
| C | linux | 0 |
CVE-2015-1265 | https://www.cvedetails.com/cve/CVE-2015-1265/ | null | https://github.com/chromium/chromium/commit/8ea5693d5cf304e56174bb6b65412f04209904db | 8ea5693d5cf304e56174bb6b65412f04209904db | Move Editor::Transpose() out of Editor class
This patch moves |Editor::Transpose()| out of |Editor| class as preparation of
expanding it into |ExecutTranspose()| in "EditorCommand.cpp" to make |Editor|
class simpler for improving code health.
Following patch will expand |Transpose()| into |ExecutTranspose()|.
Bug: 672405
Change-Id: Icde253623f31813d2b4517c4da7d4798bd5fadf6
Reviewed-on: https://chromium-review.googlesource.com/583880
Reviewed-by: Xiaocheng Hu <[email protected]>
Commit-Queue: Yoshifumi Inoue <[email protected]>
Cr-Commit-Position: refs/heads/master@{#489518} | static bool ExecuteFontSize(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String& value) {
CSSValueID size;
if (!HTMLFontElement::CssValueFromFontSizeNumber(value, size))
return false;
return ExecuteApplyStyle(frame, source, InputEvent::InputType::kNone,
CSSPropertyFontSize, size);
}
| static bool ExecuteFontSize(LocalFrame& frame,
Event*,
EditorCommandSource source,
const String& value) {
CSSValueID size;
if (!HTMLFontElement::CssValueFromFontSizeNumber(value, size))
return false;
return ExecuteApplyStyle(frame, source, InputEvent::InputType::kNone,
CSSPropertyFontSize, size);
}
| C | Chrome | 0 |
CVE-2019-13307 | https://www.cvedetails.com/cve/CVE-2019-13307/ | CWE-119 | https://github.com/ImageMagick/ImageMagick/commit/025e77fcb2f45b21689931ba3bf74eac153afa48 | 025e77fcb2f45b21689931ba3bf74eac153afa48 | https://github.com/ImageMagick/ImageMagick/issues/1615 | MagickExport MagickBooleanType FunctionImage(Image *image,
const MagickFunction function,const size_t number_parameters,
const double *parameters,ExceptionInfo *exception)
{
#define FunctionImageTag "Function/Image "
CacheView
*image_view;
MagickBooleanType
status;
MagickOffsetType
progress;
ssize_t
y;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
#if defined(MAGICKCORE_OPENCL_SUPPORT)
if (AccelerateFunctionImage(image,function,number_parameters,parameters,
exception) != MagickFalse)
return(MagickTrue);
#endif
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
progress=0;
image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static) shared(progress,status) \
magick_number_threads(image,image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
*magick_restrict q;
register ssize_t
x;
if (status == MagickFalse)
continue;
q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
status=MagickFalse;
continue;
}
for (x=0; x < (ssize_t) image->columns; x++)
{
register ssize_t
i;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel channel = GetPixelChannelChannel(image,i);
PixelTrait traits = GetPixelChannelTraits(image,channel);
if (traits == UndefinedPixelTrait)
continue;
if ((traits & UpdatePixelTrait) == 0)
continue;
q[i]=ApplyFunction(q[i],function,number_parameters,parameters,
exception);
}
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
MagickBooleanType
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp atomic
#endif
progress++;
proceed=SetImageProgress(image,FunctionImageTag,progress,image->rows);
if (proceed == MagickFalse)
status=MagickFalse;
}
}
image_view=DestroyCacheView(image_view);
return(status);
}
| MagickExport MagickBooleanType FunctionImage(Image *image,
const MagickFunction function,const size_t number_parameters,
const double *parameters,ExceptionInfo *exception)
{
#define FunctionImageTag "Function/Image "
CacheView
*image_view;
MagickBooleanType
status;
MagickOffsetType
progress;
ssize_t
y;
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
#if defined(MAGICKCORE_OPENCL_SUPPORT)
if (AccelerateFunctionImage(image,function,number_parameters,parameters,
exception) != MagickFalse)
return(MagickTrue);
#endif
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
status=MagickTrue;
progress=0;
image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static) shared(progress,status) \
magick_number_threads(image,image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
*magick_restrict q;
register ssize_t
x;
if (status == MagickFalse)
continue;
q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
if (q == (Quantum *) NULL)
{
status=MagickFalse;
continue;
}
for (x=0; x < (ssize_t) image->columns; x++)
{
register ssize_t
i;
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel channel = GetPixelChannelChannel(image,i);
PixelTrait traits = GetPixelChannelTraits(image,channel);
if (traits == UndefinedPixelTrait)
continue;
if ((traits & UpdatePixelTrait) == 0)
continue;
q[i]=ApplyFunction(q[i],function,number_parameters,parameters,
exception);
}
q+=GetPixelChannels(image);
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
MagickBooleanType
proceed;
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp atomic
#endif
progress++;
proceed=SetImageProgress(image,FunctionImageTag,progress,image->rows);
if (proceed == MagickFalse)
status=MagickFalse;
}
}
image_view=DestroyCacheView(image_view);
return(status);
}
| C | ImageMagick6 | 0 |
CVE-2015-5307 | https://www.cvedetails.com/cve/CVE-2015-5307/ | CWE-399 | https://github.com/torvalds/linux/commit/54a20552e1eae07aa240fa370a0293e006b5faed | 54a20552e1eae07aa240fa370a0293e006b5faed | KVM: x86: work around infinite loop in microcode when #AC is delivered
It was found that a guest can DoS a host by triggering an infinite
stream of "alignment check" (#AC) exceptions. This causes the
microcode to enter an infinite loop where the core never receives
another interrupt. The host kernel panics pretty quickly due to the
effects (CVE-2015-5307).
Signed-off-by: Eric Northup <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]> | static inline bool cpu_has_vmx_pml(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_ENABLE_PML;
}
| static inline bool cpu_has_vmx_pml(void)
{
return vmcs_config.cpu_based_2nd_exec_ctrl & SECONDARY_EXEC_ENABLE_PML;
}
| C | linux | 0 |
CVE-2019-14980 | https://www.cvedetails.com/cve/CVE-2019-14980/ | CWE-416 | https://github.com/ImageMagick/ImageMagick/commit/c5d012a46ae22be9444326aa37969a3f75daa3ba | c5d012a46ae22be9444326aa37969a3f75daa3ba | https://github.com/ImageMagick/ImageMagick6/issues/43 | MagickExport MagickBooleanType IsBlobSeekable(const Image *image)
{
BlobInfo
*magick_restrict blob_info;
assert(image != (const Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
blob_info=image->blob;
switch (blob_info->type)
{
case BlobStream:
return(MagickTrue);
case FileStream:
{
int
status;
if (blob_info->file_info.file == (FILE *) NULL)
return(MagickFalse);
status=fseek(blob_info->file_info.file,0,SEEK_CUR);
return(status == -1 ? MagickFalse : MagickTrue);
}
case ZipStream:
{
#if defined(MAGICKCORE_ZLIB_DELEGATE)
MagickOffsetType
offset;
if (blob_info->file_info.gzfile == (gzFile) NULL)
return(MagickFalse);
offset=gzseek(blob_info->file_info.gzfile,0,SEEK_CUR);
return(offset < 0 ? MagickFalse : MagickTrue);
#else
break;
#endif
}
case UndefinedStream:
case BZipStream:
case FifoStream:
case PipeStream:
case StandardStream:
break;
case CustomStream:
{
if ((blob_info->custom_stream->seeker != (CustomStreamSeeker) NULL) &&
(blob_info->custom_stream->teller != (CustomStreamTeller) NULL))
return(MagickTrue);
break;
}
default:
break;
}
return(MagickFalse);
}
| MagickExport MagickBooleanType IsBlobSeekable(const Image *image)
{
BlobInfo
*magick_restrict blob_info;
assert(image != (const Image *) NULL);
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
blob_info=image->blob;
switch (blob_info->type)
{
case BlobStream:
return(MagickTrue);
case FileStream:
{
int
status;
if (blob_info->file_info.file == (FILE *) NULL)
return(MagickFalse);
status=fseek(blob_info->file_info.file,0,SEEK_CUR);
return(status == -1 ? MagickFalse : MagickTrue);
}
case ZipStream:
{
#if defined(MAGICKCORE_ZLIB_DELEGATE)
MagickOffsetType
offset;
if (blob_info->file_info.gzfile == (gzFile) NULL)
return(MagickFalse);
offset=gzseek(blob_info->file_info.gzfile,0,SEEK_CUR);
return(offset < 0 ? MagickFalse : MagickTrue);
#else
break;
#endif
}
case UndefinedStream:
case BZipStream:
case FifoStream:
case PipeStream:
case StandardStream:
break;
case CustomStream:
{
if ((blob_info->custom_stream->seeker != (CustomStreamSeeker) NULL) &&
(blob_info->custom_stream->teller != (CustomStreamTeller) NULL))
return(MagickTrue);
break;
}
default:
break;
}
return(MagickFalse);
}
| C | ImageMagick6 | 0 |
CVE-2014-9644 | https://www.cvedetails.com/cve/CVE-2014-9644/ | CWE-264 | https://github.com/torvalds/linux/commit/4943ba16bbc2db05115707b3ff7b4874e9e3c560 | 4943ba16bbc2db05115707b3ff7b4874e9e3c560 | crypto: include crypto- module prefix in template
This adds the module loading prefix "crypto-" to the template lookup
as well.
For example, attempting to load 'vfat(blowfish)' via AF_ALG now correctly
includes the "crypto-" prefix at every level, correctly rejecting "vfat":
net-pf-38
algif-hash
crypto-vfat(blowfish)
crypto-vfat(blowfish)-all
crypto-vfat
Reported-by: Mathias Krause <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Acked-by: Mathias Krause <[email protected]>
Signed-off-by: Herbert Xu <[email protected]> | static int seqiv_aead_init(struct crypto_tfm *tfm)
{
struct crypto_aead *geniv = __crypto_aead_cast(tfm);
struct seqiv_ctx *ctx = crypto_aead_ctx(geniv);
spin_lock_init(&ctx->lock);
tfm->crt_aead.reqsize = sizeof(struct aead_request);
return aead_geniv_init(tfm);
}
| static int seqiv_aead_init(struct crypto_tfm *tfm)
{
struct crypto_aead *geniv = __crypto_aead_cast(tfm);
struct seqiv_ctx *ctx = crypto_aead_ctx(geniv);
spin_lock_init(&ctx->lock);
tfm->crt_aead.reqsize = sizeof(struct aead_request);
return aead_geniv_init(tfm);
}
| C | linux | 0 |
CVE-2009-3607 | https://www.cvedetails.com/cve/CVE-2009-3607/ | CWE-189 | https://cgit.freedesktop.org/poppler/poppler/commit/?id=c839b706 | c839b706092583f6b12ed3cc634bf5af34b7a2bb | null | poppler_color_new (void)
{
return (PopplerColor *) g_new0 (PopplerColor, 1);
}
| poppler_color_new (void)
{
return (PopplerColor *) g_new0 (PopplerColor, 1);
}
| CPP | poppler | 0 |
CVE-2011-2350 | https://www.cvedetails.com/cve/CVE-2011-2350/ | CWE-20 | https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201 | b944f670bb7a8a919daac497a4ea0536c954c201 | [JSC] Implement a helper method createNotEnoughArgumentsError()
https://bugs.webkit.org/show_bug.cgi?id=85102
Reviewed by Geoffrey Garen.
In bug 84787, kbr@ requested to avoid hard-coding
createTypeError(exec, "Not enough arguments") here and there.
This patch implements createNotEnoughArgumentsError(exec)
and uses it in JSC bindings.
c.f. a corresponding bug for V8 bindings is bug 85097.
Source/JavaScriptCore:
* runtime/Error.cpp:
(JSC::createNotEnoughArgumentsError):
(JSC):
* runtime/Error.h:
(JSC):
Source/WebCore:
Test: bindings/scripts/test/TestObj.idl
* bindings/scripts/CodeGeneratorJS.pm: Modified as described above.
(GenerateArgumentsCountCheck):
* bindings/js/JSDataViewCustom.cpp: Ditto.
(WebCore::getDataViewMember):
(WebCore::setDataViewMember):
* bindings/js/JSDeprecatedPeerConnectionCustom.cpp:
(WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection):
* bindings/js/JSDirectoryEntryCustom.cpp:
(WebCore::JSDirectoryEntry::getFile):
(WebCore::JSDirectoryEntry::getDirectory):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
* bindings/js/JSWebKitMutationObserverCustom.cpp:
(WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
(WebCore::JSWebKitMutationObserver::observe):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorkerConstructor::constructJSWorker):
* bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests.
(WebCore::jsFloat64ArrayPrototypeFunctionFoo):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
(WebCore::jsTestEventTargetPrototypeFunctionAddEventListener):
(WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener):
(WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::constructJSTestObj):
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
(WebCore::jsTestObjPrototypeFunctionIdbKey):
(WebCore::jsTestObjPrototypeFunctionOptionsObject):
(WebCore::jsTestObjPrototypeFunctionAddEventListener):
(WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjConstructorFunctionClassMethod2):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray):
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionConvert2):
(WebCore::jsTestObjPrototypeFunctionConvert3):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionConvert5):
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList):
git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void setJSTestObjSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value));
}
| void setJSTestObjSequenceAttr(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = jsCast<JSTestObj*>(thisObject);
TestObj* impl = static_cast<TestObj*>(castedThis->impl());
impl->setSequenceAttr(toNativeArray<ScriptProfile>(exec, value));
}
| C | Chrome | 0 |
CVE-2018-20784 | https://www.cvedetails.com/cve/CVE-2018-20784/ | CWE-400 | https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0 | c40f7d74c741a907cfaeb73a7697081881c497d0 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) revert of:
a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path")
It turns out that the list_del_leaf_cfs_rq() introduced by this commit
is a surprising property that was not considered in followup commits
such as:
9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list")
As Vincent Guittot explains:
"I think that there is a bigger problem with commit a9e7f6544b9c and
cfs_rq throttling:
Let take the example of the following topology TG2 --> TG1 --> root:
1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1
cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in
one path because it has never been used and can't be throttled so
tmp_alone_branch will point to leaf_cfs_rq_list at the end.
2) Then TG1 is throttled
3) and we add TG3 as a new child of TG1.
4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1
cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list.
With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list.
So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1
cfs_rq is removed from the list.
Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list
but tmp_alone_branch still points to TG3 cfs_rq because its throttled
parent can't be enqueued when the lock is released.
tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should.
So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch
points on another TG cfs_rq, the next TG cfs_rq that will be added,
will be linked outside rq->leaf_cfs_rq_list - which is bad.
In addition, we can break the ordering of the cfs_rq in
rq->leaf_cfs_rq_list but this ordering is used to update and
propagate the update from leaf down to root."
Instead of trying to work through all these cases and trying to reproduce
the very high loads that produced the lockup to begin with, simplify
the code temporarily by reverting a9e7f6544b9c - which change was clearly
not thought through completely.
This (hopefully) gives us a kernel that doesn't lock up so people
can continue to enjoy their holidays without worrying about regressions. ;-)
[ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ]
Analyzed-by: Xie XiuQi <[email protected]>
Analyzed-by: Vincent Guittot <[email protected]>
Reported-by: Zhipeng Xie <[email protected]>
Reported-by: Sargun Dhillon <[email protected]>
Reported-by: Xie XiuQi <[email protected]>
Tested-by: Zhipeng Xie <[email protected]>
Tested-by: Sargun Dhillon <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Acked-by: Vincent Guittot <[email protected]>
Cc: <[email protected]> # v4.13+
Cc: Bin Li <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]> | static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)
{
return &tg->cfs_bandwidth;
}
| static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)
{
return &tg->cfs_bandwidth;
}
| C | linux | 0 |
CVE-2012-2894 | https://www.cvedetails.com/cve/CVE-2012-2894/ | CWE-399 | https://github.com/chromium/chromium/commit/9dc6161824d61e899c282cfe9aa40a4d3031974d | 9dc6161824d61e899c282cfe9aa40a4d3031974d | [cros] Allow media streaming for OOBE WebUI.
BUG=122764
TEST=Manual with --enable-html5-camera
Review URL: https://chromiumcodereview.appspot.com/10693027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144899 0039d316-1c4b-4281-b951-d872f2087c98 | bool WebUILoginView::AcceleratorPressed(
const ui::Accelerator& accelerator) {
AccelMap::const_iterator entry = accel_map_.find(accelerator);
if (entry == accel_map_.end())
return false;
if (!webui_login_)
return true;
content::WebUI* web_ui = GetWebUI();
if (web_ui) {
base::StringValue accel_name(entry->second);
web_ui->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator",
accel_name);
}
return true;
}
| bool WebUILoginView::AcceleratorPressed(
const ui::Accelerator& accelerator) {
AccelMap::const_iterator entry = accel_map_.find(accelerator);
if (entry == accel_map_.end())
return false;
if (!webui_login_)
return true;
content::WebUI* web_ui = GetWebUI();
if (web_ui) {
base::StringValue accel_name(entry->second);
web_ui->CallJavascriptFunction("cr.ui.Oobe.handleAccelerator",
accel_name);
}
return true;
}
| C | Chrome | 0 |
CVE-2017-5112 | https://www.cvedetails.com/cve/CVE-2017-5112/ | CWE-119 | https://github.com/chromium/chromium/commit/f6ac1dba5e36f338a490752a2cbef3339096d9fe | f6ac1dba5e36f338a490752a2cbef3339096d9fe | Reset ES3 pixel pack parameters and PIXEL_PACK_BUFFER binding in DrawingBuffer before ReadPixels() and recover them later.
BUG=740603
TEST=new conformance test
[email protected],[email protected]
Change-Id: I3ea54c6cc34f34e249f7c8b9f792d93c5e1958f4
Reviewed-on: https://chromium-review.googlesource.com/570840
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Zhenyao Mo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#486518} | void WebGLRenderingContextBase::RestoreUnpackParameters() {
if (unpack_alignment_ != 1)
ContextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment_);
}
| void WebGLRenderingContextBase::RestoreUnpackParameters() {
if (unpack_alignment_ != 1)
ContextGL()->PixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment_);
}
| C | Chrome | 0 |
CVE-2011-4131 | https://www.cvedetails.com/cve/CVE-2011-4131/ | CWE-189 | https://github.com/torvalds/linux/commit/bf118a342f10dafe44b14451a1392c3254629a1f | bf118a342f10dafe44b14451a1392c3254629a1f | NFSv4: include bitmap in nfsv4 get acl data
The NFSv4 bitmap size is unbounded: a server can return an arbitrary
sized bitmap in an FATTR4_WORD0_ACL request. Replace using the
nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data
xdr length to the (cached) acl page data.
This is a general solution to commit e5012d1f "NFSv4.1: update
nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead
when getting ACLs.
Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr
was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved.
Cc: [email protected]
Signed-off-by: Andy Adamson <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]> | int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
{
struct nfs_server *server = NFS_SERVER(lgp->args.inode);
struct rpc_task *task;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
.rpc_argp = &lgp->args,
.rpc_resp = &lgp->res,
};
struct rpc_task_setup task_setup_data = {
.rpc_client = server->client,
.rpc_message = &msg,
.callback_ops = &nfs4_layoutget_call_ops,
.callback_data = lgp,
.flags = RPC_TASK_ASYNC,
};
int status = 0;
dprintk("--> %s\n", __func__);
lgp->res.layoutp = &lgp->args.layout;
lgp->res.seq_res.sr_slot = NULL;
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);
status = nfs4_wait_for_completion_rpc_task(task);
if (status == 0)
status = task->tk_status;
if (status == 0)
status = pnfs_layout_process(lgp);
rpc_put_task(task);
dprintk("<-- %s status=%d\n", __func__, status);
return status;
}
| int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
{
struct nfs_server *server = NFS_SERVER(lgp->args.inode);
struct rpc_task *task;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_LAYOUTGET],
.rpc_argp = &lgp->args,
.rpc_resp = &lgp->res,
};
struct rpc_task_setup task_setup_data = {
.rpc_client = server->client,
.rpc_message = &msg,
.callback_ops = &nfs4_layoutget_call_ops,
.callback_data = lgp,
.flags = RPC_TASK_ASYNC,
};
int status = 0;
dprintk("--> %s\n", __func__);
lgp->res.layoutp = &lgp->args.layout;
lgp->res.seq_res.sr_slot = NULL;
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);
status = nfs4_wait_for_completion_rpc_task(task);
if (status == 0)
status = task->tk_status;
if (status == 0)
status = pnfs_layout_process(lgp);
rpc_put_task(task);
dprintk("<-- %s status=%d\n", __func__, status);
return status;
}
| C | linux | 0 |
CVE-2018-20784 | https://www.cvedetails.com/cve/CVE-2018-20784/ | CWE-400 | https://github.com/torvalds/linux/commit/c40f7d74c741a907cfaeb73a7697081881c497d0 | c40f7d74c741a907cfaeb73a7697081881c497d0 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) revert of:
a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path")
It turns out that the list_del_leaf_cfs_rq() introduced by this commit
is a surprising property that was not considered in followup commits
such as:
9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list")
As Vincent Guittot explains:
"I think that there is a bigger problem with commit a9e7f6544b9c and
cfs_rq throttling:
Let take the example of the following topology TG2 --> TG1 --> root:
1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1
cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in
one path because it has never been used and can't be throttled so
tmp_alone_branch will point to leaf_cfs_rq_list at the end.
2) Then TG1 is throttled
3) and we add TG3 as a new child of TG1.
4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1
cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list.
With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list.
So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1
cfs_rq is removed from the list.
Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list
but tmp_alone_branch still points to TG3 cfs_rq because its throttled
parent can't be enqueued when the lock is released.
tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should.
So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch
points on another TG cfs_rq, the next TG cfs_rq that will be added,
will be linked outside rq->leaf_cfs_rq_list - which is bad.
In addition, we can break the ordering of the cfs_rq in
rq->leaf_cfs_rq_list but this ordering is used to update and
propagate the update from leaf down to root."
Instead of trying to work through all these cases and trying to reproduce
the very high loads that produced the lockup to begin with, simplify
the code temporarily by reverting a9e7f6544b9c - which change was clearly
not thought through completely.
This (hopefully) gives us a kernel that doesn't lock up so people
can continue to enjoy their holidays without worrying about regressions. ;-)
[ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ]
Analyzed-by: Xie XiuQi <[email protected]>
Analyzed-by: Vincent Guittot <[email protected]>
Reported-by: Zhipeng Xie <[email protected]>
Reported-by: Sargun Dhillon <[email protected]>
Reported-by: Xie XiuQi <[email protected]>
Tested-by: Zhipeng Xie <[email protected]>
Tested-by: Sargun Dhillon <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Acked-by: Vincent Guittot <[email protected]>
Cc: <[email protected]> # v4.13+
Cc: Bin Li <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]> | void init_entity_runnable_average(struct sched_entity *se)
{
struct sched_avg *sa = &se->avg;
memset(sa, 0, sizeof(*sa));
/*
* Tasks are initialized with full load to be seen as heavy tasks until
* they get a chance to stabilize to their real load level.
* Group entities are initialized with zero load to reflect the fact that
* nothing has been attached to the task group yet.
*/
if (entity_is_task(se))
sa->runnable_load_avg = sa->load_avg = scale_load_down(se->load.weight);
se->runnable_weight = se->load.weight;
/* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */
}
| void init_entity_runnable_average(struct sched_entity *se)
{
struct sched_avg *sa = &se->avg;
memset(sa, 0, sizeof(*sa));
/*
* Tasks are initialized with full load to be seen as heavy tasks until
* they get a chance to stabilize to their real load level.
* Group entities are initialized with zero load to reflect the fact that
* nothing has been attached to the task group yet.
*/
if (entity_is_task(se))
sa->runnable_load_avg = sa->load_avg = scale_load_down(se->load.weight);
se->runnable_weight = se->load.weight;
/* when this task enqueue'ed, it will contribute to its cfs_rq's load_avg */
}
| C | linux | 0 |
CVE-2013-6644 | https://www.cvedetails.com/cve/CVE-2013-6644/ | null | https://github.com/chromium/chromium/commit/db93178bcaaf7e99ebb18bd51fa99b2feaf47e1f | db93178bcaaf7e99ebb18bd51fa99b2feaf47e1f | [Extensions] Add GetInstalledExtension() method to ExtensionRegistry
This CL adds GetInstalledExtension() method to ExtensionRegistry and
uses it instead of deprecated ExtensionService::GetInstalledExtension()
in chrome/browser/ui/app_list/.
Part of removing the deprecated GetInstalledExtension() call
from the ExtensionService.
BUG=489687
Review URL: https://codereview.chromium.org/1130353010
Cr-Commit-Position: refs/heads/master@{#333036} | void ExtensionAppItem::Move(const ExtensionAppItem* prev,
const ExtensionAppItem* next) {
if (!prev && !next)
return; // No reordering necessary
extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_);
extensions::AppSorting* sorting = GetAppSorting(profile_);
syncer::StringOrdinal page;
std::string prev_id, next_id;
if (!prev) {
next_id = next->extension_id();
page = sorting->GetPageOrdinal(next_id);
} else if (!next) {
prev_id = prev->extension_id();
page = sorting->GetPageOrdinal(prev_id);
} else {
prev_id = prev->extension_id();
page = sorting->GetPageOrdinal(prev_id);
if (page.Equals(sorting->GetPageOrdinal(next->extension_id())))
next_id = next->extension_id();
}
prefs->SetAppDraggedByUser(extension_id_);
sorting->SetPageOrdinal(extension_id_, page);
sorting->OnExtensionMoved(extension_id_, prev_id, next_id);
UpdatePositionFromExtensionOrdering();
}
| void ExtensionAppItem::Move(const ExtensionAppItem* prev,
const ExtensionAppItem* next) {
if (!prev && !next)
return; // No reordering necessary
extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_);
extensions::AppSorting* sorting = GetAppSorting(profile_);
syncer::StringOrdinal page;
std::string prev_id, next_id;
if (!prev) {
next_id = next->extension_id();
page = sorting->GetPageOrdinal(next_id);
} else if (!next) {
prev_id = prev->extension_id();
page = sorting->GetPageOrdinal(prev_id);
} else {
prev_id = prev->extension_id();
page = sorting->GetPageOrdinal(prev_id);
if (page.Equals(sorting->GetPageOrdinal(next->extension_id())))
next_id = next->extension_id();
}
prefs->SetAppDraggedByUser(extension_id_);
sorting->SetPageOrdinal(extension_id_, page);
sorting->OnExtensionMoved(extension_id_, prev_id, next_id);
UpdatePositionFromExtensionOrdering();
}
| C | Chrome | 0 |
CVE-2016-3746 | https://www.cvedetails.com/cve/CVE-2016-3746/ | null | https://android.googlesource.com/platform/hardware/qcom/media/+/5b82f4f90c3d531313714df4b936f92fb0ff15cf | 5b82f4f90c3d531313714df4b936f92fb0ff15cf | DO NOT MERGE mm-video-v4l2: vdec: Avoid processing ETBs/FTBs in invalid states
(per the spec) ETB/FTB should not be handled in states other than
Executing, Paused and Idle. This avoids accessing invalid buffers.
Also add a lock to protect the private-buffers from being deleted
while accessing from another thread.
Bug: 27890802
Security Vulnerability - Heap Use-After-Free and Possible LPE in
MediaServer (libOmxVdec problem #6)
CRs-Fixed: 1008882
Change-Id: Iaac2e383cd53cf9cf8042c9ed93ddc76dba3907e
| void omx_vdec::set_frame_rate(OMX_S64 act_timestamp)
{
OMX_U32 new_frame_interval = 0;
if (VALID_TS(act_timestamp) && VALID_TS(prev_ts) && act_timestamp != prev_ts
&& llabs(act_timestamp - prev_ts) > 2000) {
new_frame_interval = client_set_fps ? frm_int :
llabs(act_timestamp - prev_ts);
if (new_frame_interval != frm_int || frm_int == 0) {
frm_int = new_frame_interval;
if (frm_int) {
drv_ctx.frame_rate.fps_numerator = 1e6;
drv_ctx.frame_rate.fps_denominator = frm_int;
DEBUG_PRINT_LOW("set_frame_rate: frm_int(%u) fps(%f)",
(unsigned int)frm_int, drv_ctx.frame_rate.fps_numerator /
(float)drv_ctx.frame_rate.fps_denominator);
/* We need to report the difference between this FBD and the previous FBD
* back to the driver for clock scaling purposes. */
struct v4l2_outputparm oparm;
/*XXX: we're providing timing info as seconds per frame rather than frames
* per second.*/
oparm.timeperframe.numerator = drv_ctx.frame_rate.fps_denominator;
oparm.timeperframe.denominator = drv_ctx.frame_rate.fps_numerator;
struct v4l2_streamparm sparm;
sparm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
sparm.parm.output = oparm;
if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_PARM, &sparm)) {
DEBUG_PRINT_ERROR("Unable to convey fps info to driver, \
performance might be affected");
}
}
}
}
prev_ts = act_timestamp;
}
| void omx_vdec::set_frame_rate(OMX_S64 act_timestamp)
{
OMX_U32 new_frame_interval = 0;
if (VALID_TS(act_timestamp) && VALID_TS(prev_ts) && act_timestamp != prev_ts
&& llabs(act_timestamp - prev_ts) > 2000) {
new_frame_interval = client_set_fps ? frm_int :
llabs(act_timestamp - prev_ts);
if (new_frame_interval != frm_int || frm_int == 0) {
frm_int = new_frame_interval;
if (frm_int) {
drv_ctx.frame_rate.fps_numerator = 1e6;
drv_ctx.frame_rate.fps_denominator = frm_int;
DEBUG_PRINT_LOW("set_frame_rate: frm_int(%u) fps(%f)",
(unsigned int)frm_int, drv_ctx.frame_rate.fps_numerator /
(float)drv_ctx.frame_rate.fps_denominator);
/* We need to report the difference between this FBD and the previous FBD
* back to the driver for clock scaling purposes. */
struct v4l2_outputparm oparm;
/*XXX: we're providing timing info as seconds per frame rather than frames
* per second.*/
oparm.timeperframe.numerator = drv_ctx.frame_rate.fps_denominator;
oparm.timeperframe.denominator = drv_ctx.frame_rate.fps_numerator;
struct v4l2_streamparm sparm;
sparm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
sparm.parm.output = oparm;
if (ioctl(drv_ctx.video_driver_fd, VIDIOC_S_PARM, &sparm)) {
DEBUG_PRINT_ERROR("Unable to convey fps info to driver, \
performance might be affected");
}
}
}
}
prev_ts = act_timestamp;
}
| C | Android | 0 |
CVE-2013-1929 | https://www.cvedetails.com/cve/CVE-2013-1929/ | CWE-119 | https://github.com/torvalds/linux/commit/715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string length (32 bytes). On overflow,
truncate the formatted firmware string instead of potentially overwriting
portions of the tg3 struct.
http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf
Signed-off-by: Kees Cook <[email protected]>
Reported-by: Oded Horovitz <[email protected]>
Reported-by: Brad Spengler <[email protected]>
Cc: [email protected]
Cc: Matt Carlson <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | static u32 tg3_read_otp_phycfg(struct tg3 *tp)
{
u32 bhalf_otp, thalf_otp;
tw32(OTP_MODE, OTP_MODE_OTP_THRU_GRC);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_INIT))
return 0;
tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC1);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
return 0;
thalf_otp = tr32(OTP_READ_DATA);
tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC2);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
return 0;
bhalf_otp = tr32(OTP_READ_DATA);
return ((thalf_otp & 0x0000ffff) << 16) | (bhalf_otp >> 16);
}
| static u32 tg3_read_otp_phycfg(struct tg3 *tp)
{
u32 bhalf_otp, thalf_otp;
tw32(OTP_MODE, OTP_MODE_OTP_THRU_GRC);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_INIT))
return 0;
tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC1);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
return 0;
thalf_otp = tr32(OTP_READ_DATA);
tw32(OTP_ADDRESS, OTP_ADDRESS_MAGIC2);
if (tg3_issue_otp_command(tp, OTP_CTRL_OTP_CMD_READ))
return 0;
bhalf_otp = tr32(OTP_READ_DATA);
return ((thalf_otp & 0x0000ffff) << 16) | (bhalf_otp >> 16);
}
| C | linux | 0 |
CVE-2011-3107 | https://www.cvedetails.com/cve/CVE-2011-3107/ | null | https://github.com/chromium/chromium/commit/89e4098439f73cb5c16996511cbfdb171a26e173 | 89e4098439f73cb5c16996511cbfdb171a26e173 | [Qt][WK2] There's no way to test the gesture tap on WTR
https://bugs.webkit.org/show_bug.cgi?id=92895
Reviewed by Kenneth Rohde Christiansen.
Source/WebKit2:
Add an instance of QtViewportHandler to QQuickWebViewPrivate, so it's
now available on mobile and desktop modes, as a side effect gesture tap
events can now be created and sent to WebCore.
This is needed to test tap gestures and to get tap gestures working
when you have a WebView (in desktop mode) on notebooks equipped with
touch screens.
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::onComponentComplete):
(QQuickWebViewFlickablePrivate::onComponentComplete): Implementation
moved to QQuickWebViewPrivate::onComponentComplete.
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
(QQuickWebViewFlickablePrivate):
Tools:
WTR doesn't create the QQuickItem from C++, not from QML, so a call
to componentComplete() was added to mimic the QML behaviour.
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):
git-svn-id: svn://svn.chromium.org/blink/trunk@124625 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | void QQuickWebViewPrivate::runJavaScriptAlert(const QString& alertText)
{
Q_Q(QQuickWebView);
QtDialogRunner dialogRunner(q);
if (!dialogRunner.initForAlert(alertText))
return;
dialogRunner.run();
}
| void QQuickWebViewPrivate::runJavaScriptAlert(const QString& alertText)
{
Q_Q(QQuickWebView);
QtDialogRunner dialogRunner(q);
if (!dialogRunner.initForAlert(alertText))
return;
dialogRunner.run();
}
| C | Chrome | 0 |
CVE-2013-5634 | https://www.cvedetails.com/cve/CVE-2013-5634/ | CWE-399 | https://github.com/torvalds/linux/commit/e8180dcaa8470ceca21109f143876fdcd9fe050a | e8180dcaa8470ceca21109f143876fdcd9fe050a | ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl
Some ARM KVM VCPU ioctls require the vCPU to be properly initialized
with the KVM_ARM_VCPU_INIT ioctl before being used with further
requests. KVM_RUN checks whether this initialization has been
done, but other ioctls do not.
Namely KVM_GET_REG_LIST will dereference an array with index -1
without initialization and thus leads to a kernel oops.
Fix this by adding checks before executing the ioctl handlers.
[ Removed superflous comment from static function - Christoffer ]
Changes from v1:
* moved check into a static function with a meaningful name
Signed-off-by: Andre Przywara <[email protected]>
Signed-off-by: Christoffer Dall <[email protected]> | int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
{
return -EINVAL;
}
| int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
{
return -EINVAL;
}
| C | linux | 0 |
CVE-2017-16227 | https://www.cvedetails.com/cve/CVE-2017-16227/ | CWE-20 | https://git.savannah.gnu.org/cgit/quagga.git/commit/?id=7a42b78be9a4108d98833069a88e6fddb9285008 | 7a42b78be9a4108d98833069a88e6fddb9285008 | null | assegment_prepend_asns (struct assegment *seg, as_t asnum, int num)
{
as_t *newas;
int i;
if (!num)
return seg;
if (num >= AS_SEGMENT_MAX)
return seg; /* we don't do huge prepends */
if ((newas = assegment_data_new (seg->length + num)) == NULL)
return seg;
for (i = 0; i < num; i++)
newas[i] = asnum;
memcpy (newas + num, seg->as, ASSEGMENT_DATA_SIZE (seg->length, 1));
assegment_data_free (seg->as);
seg->as = newas;
seg->length += num;
return seg;
}
| assegment_prepend_asns (struct assegment *seg, as_t asnum, int num)
{
as_t *newas;
int i;
if (!num)
return seg;
if (num >= AS_SEGMENT_MAX)
return seg; /* we don't do huge prepends */
if ((newas = assegment_data_new (seg->length + num)) == NULL)
return seg;
for (i = 0; i < num; i++)
newas[i] = asnum;
memcpy (newas + num, seg->as, ASSEGMENT_DATA_SIZE (seg->length, 1));
assegment_data_free (seg->as);
seg->as = newas;
seg->length += num;
return seg;
}
| C | savannah | 0 |
CVE-2018-20456 | https://www.cvedetails.com/cve/CVE-2018-20456/ | CWE-125 | https://github.com/radare/radare2/commit/9b46d38dd3c4de6048a488b655c7319f845af185 | 9b46d38dd3c4de6048a488b655c7319f845af185 | Fix #12372 and #12373 - Crash in x86 assembler (#12380)
0 ,0,[bP-bL-bP-bL-bL-r-bL-bP-bL-bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx--
leA ,0,[bP-bL-bL-bP-bL-bP-bL-60@bL-
leA ,0,[bP-bL-r-bP-bL-bP-bL-60@bL-
mov ,0,[ax+Bx-ax+Bx-ax+ax+Bx-ax+Bx-- | static int opfcmov(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
char* fcmov = op->mnemonic + strlen("fcmov");
switch (op->operands_count) {
case 2:
if ( op->operands[0].type & OT_FPUREG & ~OT_REGALL && op->operands[0].reg == 0 &&
op->operands[1].type & OT_FPUREG & ~OT_REGALL ) {
if ( !strcmp( fcmov, "b" ) ) {
data[l++] = 0xda;
data[l++] = 0xc0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "e" ) ) {
data[l++] = 0xda;
data[l++] = 0xc8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "be" ) ) {
data[l++] = 0xda;
data[l++] = 0xd0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "u" ) ) {
data[l++] = 0xda;
data[l++] = 0xd8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nb" ) ) {
data[l++] = 0xdb;
data[l++] = 0xc0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "ne" ) ) {
data[l++] = 0xdb;
data[l++] = 0xc8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nbe" ) ) {
data[l++] = 0xdb;
data[l++] = 0xd0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nu" ) ) {
data[l++] = 0xdb;
data[l++] = 0xd8 | op->operands[1].reg;
} else {
return -1;
}
} else {
return -1;
}
break;
default:
return -1;
}
return l;
}
| static int opfcmov(RAsm *a, ut8 *data, const Opcode *op) {
int l = 0;
char* fcmov = op->mnemonic + strlen("fcmov");
switch (op->operands_count) {
case 2:
if ( op->operands[0].type & OT_FPUREG & ~OT_REGALL && op->operands[0].reg == 0 &&
op->operands[1].type & OT_FPUREG & ~OT_REGALL ) {
if ( !strcmp( fcmov, "b" ) ) {
data[l++] = 0xda;
data[l++] = 0xc0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "e" ) ) {
data[l++] = 0xda;
data[l++] = 0xc8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "be" ) ) {
data[l++] = 0xda;
data[l++] = 0xd0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "u" ) ) {
data[l++] = 0xda;
data[l++] = 0xd8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nb" ) ) {
data[l++] = 0xdb;
data[l++] = 0xc0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "ne" ) ) {
data[l++] = 0xdb;
data[l++] = 0xc8 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nbe" ) ) {
data[l++] = 0xdb;
data[l++] = 0xd0 | op->operands[1].reg;
} else if ( !strcmp( fcmov, "nu" ) ) {
data[l++] = 0xdb;
data[l++] = 0xd8 | op->operands[1].reg;
} else {
return -1;
}
} else {
return -1;
}
break;
default:
return -1;
}
return l;
}
| C | radare2 | 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 <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Signed-off-by: Chris Mason <[email protected]> | tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb)
{
struct tree_mod_elem **tm_list = NULL;
int nritems = 0;
int i;
int ret = 0;
if (btrfs_header_level(eb) == 0)
return 0;
if (!tree_mod_need_log(fs_info, NULL))
return 0;
nritems = btrfs_header_nritems(eb);
tm_list = kzalloc(nritems * sizeof(struct tree_mod_elem *),
GFP_NOFS);
if (!tm_list)
return -ENOMEM;
for (i = 0; i < nritems; i++) {
tm_list[i] = alloc_tree_mod_elem(eb, i,
MOD_LOG_KEY_REMOVE_WHILE_FREEING, GFP_NOFS);
if (!tm_list[i]) {
ret = -ENOMEM;
goto free_tms;
}
}
if (tree_mod_dont_log(fs_info, eb))
goto free_tms;
ret = __tree_mod_log_free_eb(fs_info, tm_list, nritems);
tree_mod_log_write_unlock(fs_info);
if (ret)
goto free_tms;
kfree(tm_list);
return 0;
free_tms:
for (i = 0; i < nritems; i++)
kfree(tm_list[i]);
kfree(tm_list);
return ret;
}
| tree_mod_log_free_eb(struct btrfs_fs_info *fs_info, struct extent_buffer *eb)
{
struct tree_mod_elem **tm_list = NULL;
int nritems = 0;
int i;
int ret = 0;
if (btrfs_header_level(eb) == 0)
return 0;
if (!tree_mod_need_log(fs_info, NULL))
return 0;
nritems = btrfs_header_nritems(eb);
tm_list = kzalloc(nritems * sizeof(struct tree_mod_elem *),
GFP_NOFS);
if (!tm_list)
return -ENOMEM;
for (i = 0; i < nritems; i++) {
tm_list[i] = alloc_tree_mod_elem(eb, i,
MOD_LOG_KEY_REMOVE_WHILE_FREEING, GFP_NOFS);
if (!tm_list[i]) {
ret = -ENOMEM;
goto free_tms;
}
}
if (tree_mod_dont_log(fs_info, eb))
goto free_tms;
ret = __tree_mod_log_free_eb(fs_info, tm_list, nritems);
tree_mod_log_write_unlock(fs_info);
if (ret)
goto free_tms;
kfree(tm_list);
return 0;
free_tms:
for (i = 0; i < nritems; i++)
kfree(tm_list[i]);
kfree(tm_list);
return ret;
}
| C | linux | 0 |
CVE-2016-10012 | https://www.cvedetails.com/cve/CVE-2016-10012/ | CWE-119 | https://github.com/openbsd/src/commit/3095060f479b86288e31c79ecbc5131a66bcd2f9 | 3095060f479b86288e31c79ecbc5131a66bcd2f9 | Remove support for pre-authentication compression. Doing compression
early in the protocol probably seemed reasonable in the 1990s, but
today it's clearly a bad idea in terms of both cryptography (cf.
multiple compression oracle attacks in TLS) and attack surface.
Moreover, to support it across privilege-separation zlib needed
the assistance of a complex shared-memory manager that made the
required attack surface considerably larger.
Prompted by Guido Vranken pointing out a compiler-elided security
check in the shared memory manager found by Stack
(http://css.csail.mit.edu/stack/); ok deraadt@ markus@
NB. pre-auth authentication has been disabled by default in sshd
for >10 years. | send_rexec_state(int fd, struct sshbuf *conf)
{
struct sshbuf *m;
int r;
debug3("%s: entering fd = %d config len %zu", __func__, fd,
sshbuf_len(conf));
/*
* Protocol from reexec master to child:
* string configuration
*/
if ((m = sshbuf_new()) == NULL)
fatal("%s: sshbuf_new failed", __func__);
if ((r = sshbuf_put_stringb(m, conf)) != 0)
fatal("%s: buffer error: %s", __func__, ssh_err(r));
if (ssh_msg_send(fd, 0, m) == -1)
fatal("%s: ssh_msg_send failed", __func__);
sshbuf_free(m);
debug3("%s: done", __func__);
}
| send_rexec_state(int fd, struct sshbuf *conf)
{
struct sshbuf *m;
int r;
debug3("%s: entering fd = %d config len %zu", __func__, fd,
sshbuf_len(conf));
/*
* Protocol from reexec master to child:
* string configuration
*/
if ((m = sshbuf_new()) == NULL)
fatal("%s: sshbuf_new failed", __func__);
if ((r = sshbuf_put_stringb(m, conf)) != 0)
fatal("%s: buffer error: %s", __func__, ssh_err(r));
if (ssh_msg_send(fd, 0, m) == -1)
fatal("%s: ssh_msg_send failed", __func__);
sshbuf_free(m);
debug3("%s: done", __func__);
}
| C | src | 0 |
CVE-2013-0886 | https://www.cvedetails.com/cve/CVE-2013-0886/ | null | https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76 | 18d67244984a574ba2dd8779faabc0e3e34f4b76 | Implement TextureImageTransportSurface using texture mailbox
This has a couple of advantages:
- allow tearing down and recreating the UI parent context without
losing the renderer contexts
- do not require a context to be able to generate textures when
creating the GLSurfaceHandle
- clearer ownership semantics that potentially allows for more
robust and easier lost context handling/thumbnailing/etc., since a texture is at
any given time owned by either: UI parent, mailbox, or
TextureImageTransportSurface
- simplify frontbuffer protection logic;
the frontbuffer textures are now owned by RWHV where they are refcounted
The TextureImageTransportSurface informs RenderWidgetHostView of the
mailbox names for the front- and backbuffer textures by
associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message.
During SwapBuffers() or PostSubBuffer() cycles, it then uses
produceTextureCHROMIUM() and consumeTextureCHROMIUM()
to transfer ownership between renderer and browser compositor.
RWHV sends back the surface_handle of the buffer being returned with the Swap ACK
(or 0 if no buffer is being returned in which case TextureImageTransportSurface will
allocate a new texture - note that this could be used to
simply keep textures for thumbnailing).
BUG=154815,139616
[email protected]
Review URL: https://chromiumcodereview.appspot.com/11194042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98 | void RenderWidgetHostViewAndroid::SendGestureEvent(
const WebKit::WebGestureEvent& event) {
if (host_)
host_->ForwardGestureEvent(event);
}
| void RenderWidgetHostViewAndroid::SendGestureEvent(
const WebKit::WebGestureEvent& event) {
if (host_)
host_->ForwardGestureEvent(event);
}
| C | Chrome | 0 |
CVE-2018-18352 | https://www.cvedetails.com/cve/CVE-2018-18352/ | CWE-732 | https://github.com/chromium/chromium/commit/a9cbaa7a40e2b2723cfc2f266c42f4980038a949 | a9cbaa7a40e2b2723cfc2f266c42f4980038a949 | Simplify "WouldTaintOrigin" concept in media/blink
Currently WebMediaPlayer has three predicates:
- DidGetOpaqueResponseFromServiceWorker
- HasSingleSecurityOrigin
- DidPassCORSAccessCheck
. These are used to determine whether the response body is available
for scripts. They are known to be confusing, and actually
MediaElementAudioSourceHandler::WouldTaintOrigin misuses them.
This CL merges the three predicates to one, WouldTaintOrigin, to remove
the confusion. Now the "response type" concept is available and we
don't need a custom CORS check, so this CL removes
BaseAudioContext::WouldTaintOrigin. This CL also renames
URLData::has_opaque_data_ and its (direct and indirect) data accessors
to match the spec.
Bug: 849942, 875153
Change-Id: I6acf50169d7445c4ff614e80ac606f79ee577d2a
Reviewed-on: https://chromium-review.googlesource.com/c/1238098
Reviewed-by: Fredrik Hubinette <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Raymond Toy <[email protected]>
Commit-Queue: Yutaka Hirano <[email protected]>
Cr-Commit-Position: refs/heads/master@{#598258} | bool WebMediaPlayerImpl::IsPrerollAttemptNeeded() {
if (highest_ready_state_ >= ReadyState::kReadyStateHaveFutureData)
return false;
if (highest_ready_state_ <= ReadyState::kReadyStateHaveMetadata &&
network_state_ != WebMediaPlayer::kNetworkStateLoading) {
return true;
}
if (preroll_attempt_pending_)
return true;
if (preroll_attempt_start_time_.is_null())
return false;
base::TimeDelta preroll_attempt_duration =
tick_clock_->NowTicks() - preroll_attempt_start_time_;
return preroll_attempt_duration < kPrerollAttemptTimeout;
}
| bool WebMediaPlayerImpl::IsPrerollAttemptNeeded() {
if (highest_ready_state_ >= ReadyState::kReadyStateHaveFutureData)
return false;
if (highest_ready_state_ <= ReadyState::kReadyStateHaveMetadata &&
network_state_ != WebMediaPlayer::kNetworkStateLoading) {
return true;
}
if (preroll_attempt_pending_)
return true;
if (preroll_attempt_start_time_.is_null())
return false;
base::TimeDelta preroll_attempt_duration =
tick_clock_->NowTicks() - preroll_attempt_start_time_;
return preroll_attempt_duration < kPrerollAttemptTimeout;
}
| C | Chrome | 0 |
CVE-2016-1615 | https://www.cvedetails.com/cve/CVE-2016-1615/ | CWE-254 | https://github.com/chromium/chromium/commit/b399a05453d7b3e2dfdec67865fefe6953bcc59e | b399a05453d7b3e2dfdec67865fefe6953bcc59e | Allocate a FrameSinkId for RenderWidgetHostViewAura in mus+ash
RenderWidgetHostViewChildFrame expects its parent to have a valid
FrameSinkId. Make sure RenderWidgetHostViewAura has a FrameSinkId even
if DelegatedFrameHost is not used (in mus+ash).
BUG=706553
[email protected]
Review-Url: https://codereview.chromium.org/2847253003
Cr-Commit-Position: refs/heads/master@{#468179} | void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
event_handler_->OnScrollEvent(event);
}
| void RenderWidgetHostViewAura::OnScrollEvent(ui::ScrollEvent* event) {
event_handler_->OnScrollEvent(event);
}
| C | Chrome | 0 |
CVE-2013-6661 | https://www.cvedetails.com/cve/CVE-2013-6661/ | null | https://github.com/chromium/chromium/commit/23cbfc1d685fa7389e88588584e02786820d4d26 | 23cbfc1d685fa7389e88588584e02786820d4d26 | Add the SandboxedDMGParser and wire it up to the DownloadProtectionService.
BUG=496898,464083
[email protected], [email protected], [email protected], [email protected]
Review URL: https://codereview.chromium.org/1299223006 .
Cr-Commit-Position: refs/heads/master@{#344876} | void DownloadProtectionService::CheckDownloadUrl(
const content::DownloadItem& item,
const CheckDownloadCallback& callback) {
DCHECK(!item.GetUrlChain().empty());
scoped_refptr<DownloadUrlSBClient> client(
new DownloadUrlSBClient(item, callback, ui_manager_, database_manager_));
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&DownloadUrlSBClient::StartCheck, client));
}
| void DownloadProtectionService::CheckDownloadUrl(
const content::DownloadItem& item,
const CheckDownloadCallback& callback) {
DCHECK(!item.GetUrlChain().empty());
scoped_refptr<DownloadUrlSBClient> client(
new DownloadUrlSBClient(item, callback, ui_manager_, database_manager_));
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
base::Bind(&DownloadUrlSBClient::StartCheck, client));
}
| C | Chrome | 0 |
CVE-2017-7533 | https://www.cvedetails.com/cve/CVE-2017-7533/ | CWE-362 | https://github.com/torvalds/linux/commit/49d31c2f389acfe83417083e1208422b4091cd9e | 49d31c2f389acfe83417083e1208422b4091cd9e | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same structure.
dentry must be held by the caller of take_dentry_name_snapshot(),
but may be freely dropped afterwards - the snapshot will stay
until destroyed by release_dentry_name_snapshot().
Intended use:
struct name_snapshot s;
take_dentry_name_snapshot(&s, dentry);
...
access s.name
...
release_dentry_name_snapshot(&s);
Replaces fsnotify_oldname_...(), gets used in fsnotify to obtain the name
to pass down with event.
Signed-off-by: Al Viro <[email protected]> | static int follow_dotdot(struct nameidata *nd)
{
while(1) {
if (nd->path.dentry == nd->root.dentry &&
nd->path.mnt == nd->root.mnt) {
break;
}
if (nd->path.dentry != nd->path.mnt->mnt_root) {
int ret = path_parent_directory(&nd->path);
if (ret)
return ret;
break;
}
if (!follow_up(&nd->path))
break;
}
follow_mount(&nd->path);
nd->inode = nd->path.dentry->d_inode;
return 0;
}
| static int follow_dotdot(struct nameidata *nd)
{
while(1) {
if (nd->path.dentry == nd->root.dentry &&
nd->path.mnt == nd->root.mnt) {
break;
}
if (nd->path.dentry != nd->path.mnt->mnt_root) {
int ret = path_parent_directory(&nd->path);
if (ret)
return ret;
break;
}
if (!follow_up(&nd->path))
break;
}
follow_mount(&nd->path);
nd->inode = nd->path.dentry->d_inode;
return 0;
}
| C | linux | 0 |
CVE-2019-10638 | https://www.cvedetails.com/cve/CVE-2019-10638/ | CWE-200 | https://github.com/torvalds/linux/commit/df453700e8d81b1bdafdf684365ee2b9431fb702 | df453700e8d81b1bdafdf684365ee2b9431fb702 | inet: switch IP ID generator to siphash
According to Amit Klein and Benny Pinkas, IP ID generation is too weak
and might be used by attackers.
Even with recent net_hash_mix() fix (netns: provide pure entropy for net_hash_mix())
having 64bit key and Jenkins hash is risky.
It is time to switch to siphash and its 128bit keys.
Signed-off-by: Eric Dumazet <[email protected]>
Reported-by: Amit Klein <[email protected]>
Reported-by: Benny Pinkas <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | void __ip_select_ident(struct net *net, struct iphdr *iph, int segs)
{
u32 hash, id;
/* Note the following code is not safe, but this is okay. */
if (unlikely(siphash_key_is_zero(&net->ipv4.ip_id_key)))
get_random_bytes(&net->ipv4.ip_id_key,
sizeof(net->ipv4.ip_id_key));
hash = siphash_3u32((__force u32)iph->daddr,
(__force u32)iph->saddr,
iph->protocol,
&net->ipv4.ip_id_key);
id = ip_idents_reserve(hash, segs);
iph->id = htons(id);
}
| void __ip_select_ident(struct net *net, struct iphdr *iph, int segs)
{
static u32 ip_idents_hashrnd __read_mostly;
u32 hash, id;
net_get_random_once(&ip_idents_hashrnd, sizeof(ip_idents_hashrnd));
hash = jhash_3words((__force u32)iph->daddr,
(__force u32)iph->saddr,
iph->protocol ^ net_hash_mix(net),
ip_idents_hashrnd);
id = ip_idents_reserve(hash, segs);
iph->id = htons(id);
}
| C | linux | 1 |
CVE-2016-3760 | https://www.cvedetails.com/cve/CVE-2016-3760/ | CWE-20 | https://android.googlesource.com/platform/system/bt/+/37c88107679d36c419572732b4af6e18bb2f7dce | 37c88107679d36c419572732b4af6e18bb2f7dce | Add guest mode functionality (2/3)
Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.
Bug: 27410683
Change-Id: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19
| int get_remote_service_record(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
{
/* sanity check */
if (interface_ready() == FALSE)
return BT_STATUS_NOT_READY;
return btif_get_remote_service_record(remote_addr, uuid);
}
| int get_remote_service_record(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
{
/* sanity check */
if (interface_ready() == FALSE)
return BT_STATUS_NOT_READY;
return btif_get_remote_service_record(remote_addr, uuid);
}
| 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) | GF_Err trex_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_TrackExtendsBox *ptr = (GF_TrackExtendsBox *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->trackID);
gf_bs_write_u32(bs, ptr->def_sample_desc_index);
gf_bs_write_u32(bs, ptr->def_sample_duration);
gf_bs_write_u32(bs, ptr->def_sample_size);
gf_bs_write_u32(bs, ptr->def_sample_flags);
return GF_OK;
}
| GF_Err trex_Write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_TrackExtendsBox *ptr = (GF_TrackExtendsBox *) s;
if (!s) return GF_BAD_PARAM;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->trackID);
gf_bs_write_u32(bs, ptr->def_sample_desc_index);
gf_bs_write_u32(bs, ptr->def_sample_duration);
gf_bs_write_u32(bs, ptr->def_sample_size);
gf_bs_write_u32(bs, ptr->def_sample_flags);
return GF_OK;
}
| C | gpac | 0 |
CVE-2016-1631 | https://www.cvedetails.com/cve/CVE-2016-1631/ | CWE-264 | https://github.com/chromium/chromium/commit/dd77c2a41c72589d929db0592565125ca629fb2c | dd77c2a41c72589d929db0592565125ca629fb2c | Fix PPB_Flash_MessageLoop.
This CL suspends script callbacks and resource loads while running nested message loop using PPB_Flash_MessageLoop.
BUG=569496
Review URL: https://codereview.chromium.org/1559113002
Cr-Commit-Position: refs/heads/master@{#374529} | TestFlashMessageLoop::~TestFlashMessageLoop() {
PP_DCHECK(!message_loop_);
ResetTestObject();
if (instance_so_)
instance_so_->clear_owner();
}
| TestFlashMessageLoop::~TestFlashMessageLoop() {
PP_DCHECK(!message_loop_);
}
| C | Chrome | 1 |
CVE-2013-0840 | https://www.cvedetails.com/cve/CVE-2013-0840/ | null | https://github.com/chromium/chromium/commit/7f48b71cb22bb2fc9fcec2013e9eaff55381a43d | 7f48b71cb22bb2fc9fcec2013e9eaff55381a43d | Filter more incoming URLs in the CreateWindow path.
BUG=170532
Review URL: https://chromiumcodereview.appspot.com/12036002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178728 0039d316-1c4b-4281-b951-d872f2087c98 | void RenderViewImpl::OnSetRendererPrefs(
const RendererPreferences& renderer_prefs) {
double old_zoom_level = renderer_preferences_.default_zoom_level;
renderer_preferences_ = renderer_prefs;
UpdateFontRenderingFromRendererPrefs();
#if defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK)
if (renderer_prefs.use_custom_colors) {
WebColorName name = WebKit::WebColorWebkitFocusRingColor;
WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1);
WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval);
#if defined(TOOLKIT_GTK)
ui::NativeTheme::instance()->SetScrollbarColors(
renderer_prefs.thumb_inactive_color,
renderer_prefs.thumb_active_color,
renderer_prefs.track_color);
#endif // defined(TOOLKIT_GTK)
if (webview()) {
#if defined(TOOLKIT_GTK)
webview()->setScrollbarColors(
renderer_prefs.thumb_inactive_color,
renderer_prefs.thumb_active_color,
renderer_prefs.track_color);
#endif // defined(TOOLKIT_GTK)
webview()->setSelectionColors(
renderer_prefs.active_selection_bg_color,
renderer_prefs.active_selection_fg_color,
renderer_prefs.inactive_selection_bg_color,
renderer_prefs.inactive_selection_fg_color);
webview()->themeChanged();
}
}
#endif // defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK)
if (webview() && !webview()->mainFrame()->document().isPluginDocument() &&
ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) {
webview()->setZoomLevel(false, renderer_preferences_.default_zoom_level);
zoomLevelChanged();
}
}
| void RenderViewImpl::OnSetRendererPrefs(
const RendererPreferences& renderer_prefs) {
double old_zoom_level = renderer_preferences_.default_zoom_level;
renderer_preferences_ = renderer_prefs;
UpdateFontRenderingFromRendererPrefs();
#if defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK)
if (renderer_prefs.use_custom_colors) {
WebColorName name = WebKit::WebColorWebkitFocusRingColor;
WebKit::setNamedColors(&name, &renderer_prefs.focus_ring_color, 1);
WebKit::setCaretBlinkInterval(renderer_prefs.caret_blink_interval);
#if defined(TOOLKIT_GTK)
ui::NativeTheme::instance()->SetScrollbarColors(
renderer_prefs.thumb_inactive_color,
renderer_prefs.thumb_active_color,
renderer_prefs.track_color);
#endif // defined(TOOLKIT_GTK)
if (webview()) {
#if defined(TOOLKIT_GTK)
webview()->setScrollbarColors(
renderer_prefs.thumb_inactive_color,
renderer_prefs.thumb_active_color,
renderer_prefs.track_color);
#endif // defined(TOOLKIT_GTK)
webview()->setSelectionColors(
renderer_prefs.active_selection_bg_color,
renderer_prefs.active_selection_fg_color,
renderer_prefs.inactive_selection_bg_color,
renderer_prefs.inactive_selection_fg_color);
webview()->themeChanged();
}
}
#endif // defined(USE_DEFAULT_RENDER_THEME) || defined(TOOLKIT_GTK)
if (webview() && !webview()->mainFrame()->document().isPluginDocument() &&
ZoomValuesEqual(webview()->zoomLevel(), old_zoom_level)) {
webview()->setZoomLevel(false, renderer_preferences_.default_zoom_level);
zoomLevelChanged();
}
}
| C | Chrome | 0 |
CVE-2016-10270 | https://www.cvedetails.com/cve/CVE-2016-10270/ | CWE-125 | https://github.com/vadz/libtiff/commit/9a72a69e035ee70ff5c41541c8c61cd97990d018 | 9a72a69e035ee70ff5c41541c8c61cd97990d018 | * libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
instead of a logic based on the total size of data. Which is faulty is
the total size of data is not sufficient to fill the whole image, and thus
results in reading outside of the StripByCounts/StripOffsets arrays when
using TIFFReadScanline().
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608.
* libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done
for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since
the above change is a better fix that makes it unnecessary. | static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value)
{
enum TIFFReadDirEntryErr err;
uint32 count;
void* origdata;
int32* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_SHORT:
case TIFF_SSHORT:
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_LONG8:
case TIFF_SLONG8:
break;
default:
return(TIFFReadDirEntryErrType);
}
err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata);
if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
{
*value=0;
return(err);
}
switch (direntry->tdir_type)
{
case TIFF_LONG:
{
uint32* m;
uint32 n;
m=(uint32*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong((uint32*)m);
err=TIFFReadDirEntryCheckRangeSlongLong(*m);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(origdata);
return(err);
}
m++;
}
*value=(int32*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
*value=(int32*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong((uint32*)(*value),count);
return(TIFFReadDirEntryErrOk);
}
data=(int32*)_TIFFmalloc(count*4);
if (data==0)
{
_TIFFfree(origdata);
return(TIFFReadDirEntryErrAlloc);
}
switch (direntry->tdir_type)
{
case TIFF_BYTE:
{
uint8* ma;
int32* mb;
uint32 n;
ma=(uint8*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(int32)(*ma++);
}
break;
case TIFF_SBYTE:
{
int8* ma;
int32* mb;
uint32 n;
ma=(int8*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(int32)(*ma++);
}
break;
case TIFF_SHORT:
{
uint16* ma;
int32* mb;
uint32 n;
ma=(uint16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
int16* ma;
int32* mb;
uint32 n;
ma=(int16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)ma);
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_LONG8:
{
uint64* ma;
int32* mb;
uint32 n;
ma=(uint64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(ma);
err=TIFFReadDirEntryCheckRangeSlongLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
int64* ma;
int32* mb;
uint32 n;
ma=(int64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8((uint64*)ma);
err=TIFFReadDirEntryCheckRangeSlongSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(int32)(*ma++);
}
}
break;
}
_TIFFfree(origdata);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
return(err);
}
*value=data;
return(TIFFReadDirEntryErrOk);
}
| static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value)
{
enum TIFFReadDirEntryErr err;
uint32 count;
void* origdata;
int32* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
case TIFF_SBYTE:
case TIFF_SHORT:
case TIFF_SSHORT:
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_LONG8:
case TIFF_SLONG8:
break;
default:
return(TIFFReadDirEntryErrType);
}
err=TIFFReadDirEntryArray(tif,direntry,&count,4,&origdata);
if ((err!=TIFFReadDirEntryErrOk)||(origdata==0))
{
*value=0;
return(err);
}
switch (direntry->tdir_type)
{
case TIFF_LONG:
{
uint32* m;
uint32 n;
m=(uint32*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong((uint32*)m);
err=TIFFReadDirEntryCheckRangeSlongLong(*m);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(origdata);
return(err);
}
m++;
}
*value=(int32*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
*value=(int32*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong((uint32*)(*value),count);
return(TIFFReadDirEntryErrOk);
}
data=(int32*)_TIFFmalloc(count*4);
if (data==0)
{
_TIFFfree(origdata);
return(TIFFReadDirEntryErrAlloc);
}
switch (direntry->tdir_type)
{
case TIFF_BYTE:
{
uint8* ma;
int32* mb;
uint32 n;
ma=(uint8*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(int32)(*ma++);
}
break;
case TIFF_SBYTE:
{
int8* ma;
int32* mb;
uint32 n;
ma=(int8*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(int32)(*ma++);
}
break;
case TIFF_SHORT:
{
uint16* ma;
int32* mb;
uint32 n;
ma=(uint16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
int16* ma;
int32* mb;
uint32 n;
ma=(int16*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort((uint16*)ma);
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_LONG8:
{
uint64* ma;
int32* mb;
uint32 n;
ma=(uint64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(ma);
err=TIFFReadDirEntryCheckRangeSlongLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(int32)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
int64* ma;
int32* mb;
uint32 n;
ma=(int64*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8((uint64*)ma);
err=TIFFReadDirEntryCheckRangeSlongSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
*mb++=(int32)(*ma++);
}
}
break;
}
_TIFFfree(origdata);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
return(err);
}
*value=data;
return(TIFFReadDirEntryErrOk);
}
| C | libtiff | 0 |
CVE-2018-16425 | https://www.cvedetails.com/cve/CVE-2018-16425/ | CWE-415 | https://github.com/OpenSC/OpenSC/commit/360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5 | 360e95d45ac4123255a4c796db96337f332160ad#diff-d643a0fa169471dbf2912f4866dc49c5 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. | int sc_pkcs15emu_sc_hsm_encode_cvc(sc_pkcs15_card_t * p15card,
sc_cvc_t *cvc,
u8 ** buf, size_t *buflen)
{
sc_card_t *card = p15card->card;
struct sc_asn1_entry asn1_cvc[C_ASN1_CVC_SIZE];
struct sc_asn1_entry asn1_cvcert[C_ASN1_CVCERT_SIZE];
struct sc_asn1_entry asn1_cvc_body[C_ASN1_CVC_BODY_SIZE];
struct sc_asn1_entry asn1_cvc_pubkey[C_ASN1_CVC_PUBKEY_SIZE];
size_t lenchr;
size_t lencar;
int r;
sc_copy_asn1_entry(c_asn1_cvc, asn1_cvc);
sc_copy_asn1_entry(c_asn1_cvcert, asn1_cvcert);
sc_copy_asn1_entry(c_asn1_cvc_body, asn1_cvc_body);
sc_copy_asn1_entry(c_asn1_cvc_pubkey, asn1_cvc_pubkey);
asn1_cvc_pubkey[1].flags = SC_ASN1_OPTIONAL;
asn1_cvcert[1].flags = SC_ASN1_OPTIONAL;
sc_format_asn1_entry(asn1_cvc_pubkey , &cvc->pukoid, NULL, 1);
if (cvc->primeOrModulus && (cvc->primeOrModuluslen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 1, cvc->primeOrModulus, &cvc->primeOrModuluslen, 1);
}
sc_format_asn1_entry(asn1_cvc_pubkey + 2, cvc->coefficientAorExponent, &cvc->coefficientAorExponentlen, 1);
if (cvc->coefficientB && (cvc->coefficientBlen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 3, cvc->coefficientB, &cvc->coefficientBlen, 1);
sc_format_asn1_entry(asn1_cvc_pubkey + 4, cvc->basePointG, &cvc->basePointGlen, 1);
sc_format_asn1_entry(asn1_cvc_pubkey + 5, cvc->order, &cvc->orderlen, 1);
if (cvc->publicPoint && (cvc->publicPointlen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 6, cvc->publicPoint, &cvc->publicPointlen, 1);
}
sc_format_asn1_entry(asn1_cvc_pubkey + 7, cvc->cofactor, &cvc->cofactorlen, 1);
}
if (cvc->modulusSize > 0) {
sc_format_asn1_entry(asn1_cvc_pubkey + 8, &cvc->modulusSize, NULL, 1);
}
sc_format_asn1_entry(asn1_cvc_body , &cvc->cpi, NULL, 1);
lencar = strnlen(cvc->car, sizeof cvc->car);
sc_format_asn1_entry(asn1_cvc_body + 1, &cvc->car, &lencar, 1);
sc_format_asn1_entry(asn1_cvc_body + 2, &asn1_cvc_pubkey, NULL, 1);
lenchr = strnlen(cvc->chr, sizeof cvc->chr);
sc_format_asn1_entry(asn1_cvc_body + 3, &cvc->chr, &lenchr, 1);
sc_format_asn1_entry(asn1_cvcert , &asn1_cvc_body, NULL, 1);
if (cvc->signature && (cvc->signatureLen > 0)) {
sc_format_asn1_entry(asn1_cvcert + 1, cvc->signature, &cvc->signatureLen, 1);
}
sc_format_asn1_entry(asn1_cvc , &asn1_cvcert, NULL, 1);
r = sc_asn1_encode(card->ctx, asn1_cvc, buf, buflen);
LOG_TEST_RET(card->ctx, r, "Could not encode card verifiable certificate");
LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
}
| int sc_pkcs15emu_sc_hsm_encode_cvc(sc_pkcs15_card_t * p15card,
sc_cvc_t *cvc,
u8 ** buf, size_t *buflen)
{
sc_card_t *card = p15card->card;
struct sc_asn1_entry asn1_cvc[C_ASN1_CVC_SIZE];
struct sc_asn1_entry asn1_cvcert[C_ASN1_CVCERT_SIZE];
struct sc_asn1_entry asn1_cvc_body[C_ASN1_CVC_BODY_SIZE];
struct sc_asn1_entry asn1_cvc_pubkey[C_ASN1_CVC_PUBKEY_SIZE];
size_t lenchr;
size_t lencar;
int r;
sc_copy_asn1_entry(c_asn1_cvc, asn1_cvc);
sc_copy_asn1_entry(c_asn1_cvcert, asn1_cvcert);
sc_copy_asn1_entry(c_asn1_cvc_body, asn1_cvc_body);
sc_copy_asn1_entry(c_asn1_cvc_pubkey, asn1_cvc_pubkey);
asn1_cvc_pubkey[1].flags = SC_ASN1_OPTIONAL;
asn1_cvcert[1].flags = SC_ASN1_OPTIONAL;
sc_format_asn1_entry(asn1_cvc_pubkey , &cvc->pukoid, NULL, 1);
if (cvc->primeOrModulus && (cvc->primeOrModuluslen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 1, cvc->primeOrModulus, &cvc->primeOrModuluslen, 1);
}
sc_format_asn1_entry(asn1_cvc_pubkey + 2, cvc->coefficientAorExponent, &cvc->coefficientAorExponentlen, 1);
if (cvc->coefficientB && (cvc->coefficientBlen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 3, cvc->coefficientB, &cvc->coefficientBlen, 1);
sc_format_asn1_entry(asn1_cvc_pubkey + 4, cvc->basePointG, &cvc->basePointGlen, 1);
sc_format_asn1_entry(asn1_cvc_pubkey + 5, cvc->order, &cvc->orderlen, 1);
if (cvc->publicPoint && (cvc->publicPointlen > 0)) {
sc_format_asn1_entry(asn1_cvc_pubkey + 6, cvc->publicPoint, &cvc->publicPointlen, 1);
}
sc_format_asn1_entry(asn1_cvc_pubkey + 7, cvc->cofactor, &cvc->cofactorlen, 1);
}
if (cvc->modulusSize > 0) {
sc_format_asn1_entry(asn1_cvc_pubkey + 8, &cvc->modulusSize, NULL, 1);
}
sc_format_asn1_entry(asn1_cvc_body , &cvc->cpi, NULL, 1);
lencar = strnlen(cvc->car, sizeof cvc->car);
sc_format_asn1_entry(asn1_cvc_body + 1, &cvc->car, &lencar, 1);
sc_format_asn1_entry(asn1_cvc_body + 2, &asn1_cvc_pubkey, NULL, 1);
lenchr = strnlen(cvc->chr, sizeof cvc->chr);
sc_format_asn1_entry(asn1_cvc_body + 3, &cvc->chr, &lenchr, 1);
sc_format_asn1_entry(asn1_cvcert , &asn1_cvc_body, NULL, 1);
if (cvc->signature && (cvc->signatureLen > 0)) {
sc_format_asn1_entry(asn1_cvcert + 1, cvc->signature, &cvc->signatureLen, 1);
}
sc_format_asn1_entry(asn1_cvc , &asn1_cvcert, NULL, 1);
r = sc_asn1_encode(card->ctx, asn1_cvc, buf, buflen);
LOG_TEST_RET(card->ctx, r, "Could not encode card verifiable certificate");
LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
}
| C | OpenSC | 0 |
CVE-2013-2635 | https://www.cvedetails.com/cve/CVE-2013-2635/ | CWE-399 | https://github.com/torvalds/linux/commit/84d73cd3fb142bf1298a8c13fd4ca50fd2432372 | 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 | rtnl: fix info leak on RTM_GETLINK request for VF devices
Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes of stack memory to userland
via the netlink interface.
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
rtnl_doit_func doit;
int sz_idx, kind;
int min_len;
int family;
int type;
int err;
type = nlh->nlmsg_type;
if (type > RTM_MAX)
return -EOPNOTSUPP;
type -= RTM_BASE;
/* All the messages must have at least 1 byte length */
if (nlh->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtgenmsg)))
return 0;
family = ((struct rtgenmsg *)NLMSG_DATA(nlh))->rtgen_family;
sz_idx = type>>2;
kind = type&3;
if (kind != 2 && !ns_capable(net->user_ns, CAP_NET_ADMIN))
return -EPERM;
if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
struct sock *rtnl;
rtnl_dumpit_func dumpit;
rtnl_calcit_func calcit;
u16 min_dump_alloc = 0;
dumpit = rtnl_get_dumpit(family, type);
if (dumpit == NULL)
return -EOPNOTSUPP;
calcit = rtnl_get_calcit(family, type);
if (calcit)
min_dump_alloc = calcit(skb, nlh);
__rtnl_unlock();
rtnl = net->rtnl;
{
struct netlink_dump_control c = {
.dump = dumpit,
.min_dump_alloc = min_dump_alloc,
};
err = netlink_dump_start(rtnl, skb, nlh, &c);
}
rtnl_lock();
return err;
}
memset(rta_buf, 0, (rtattr_max * sizeof(struct rtattr *)));
min_len = rtm_min[sz_idx];
if (nlh->nlmsg_len < min_len)
return -EINVAL;
if (nlh->nlmsg_len > min_len) {
int attrlen = nlh->nlmsg_len - NLMSG_ALIGN(min_len);
struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len);
while (RTA_OK(attr, attrlen)) {
unsigned int flavor = attr->rta_type;
if (flavor) {
if (flavor > rta_max[sz_idx])
return -EINVAL;
rta_buf[flavor-1] = attr;
}
attr = RTA_NEXT(attr, attrlen);
}
}
doit = rtnl_get_doit(family, type);
if (doit == NULL)
return -EOPNOTSUPP;
return doit(skb, nlh, (void *)&rta_buf[0]);
}
| static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
{
struct net *net = sock_net(skb->sk);
rtnl_doit_func doit;
int sz_idx, kind;
int min_len;
int family;
int type;
int err;
type = nlh->nlmsg_type;
if (type > RTM_MAX)
return -EOPNOTSUPP;
type -= RTM_BASE;
/* All the messages must have at least 1 byte length */
if (nlh->nlmsg_len < NLMSG_LENGTH(sizeof(struct rtgenmsg)))
return 0;
family = ((struct rtgenmsg *)NLMSG_DATA(nlh))->rtgen_family;
sz_idx = type>>2;
kind = type&3;
if (kind != 2 && !ns_capable(net->user_ns, CAP_NET_ADMIN))
return -EPERM;
if (kind == 2 && nlh->nlmsg_flags&NLM_F_DUMP) {
struct sock *rtnl;
rtnl_dumpit_func dumpit;
rtnl_calcit_func calcit;
u16 min_dump_alloc = 0;
dumpit = rtnl_get_dumpit(family, type);
if (dumpit == NULL)
return -EOPNOTSUPP;
calcit = rtnl_get_calcit(family, type);
if (calcit)
min_dump_alloc = calcit(skb, nlh);
__rtnl_unlock();
rtnl = net->rtnl;
{
struct netlink_dump_control c = {
.dump = dumpit,
.min_dump_alloc = min_dump_alloc,
};
err = netlink_dump_start(rtnl, skb, nlh, &c);
}
rtnl_lock();
return err;
}
memset(rta_buf, 0, (rtattr_max * sizeof(struct rtattr *)));
min_len = rtm_min[sz_idx];
if (nlh->nlmsg_len < min_len)
return -EINVAL;
if (nlh->nlmsg_len > min_len) {
int attrlen = nlh->nlmsg_len - NLMSG_ALIGN(min_len);
struct rtattr *attr = (void *)nlh + NLMSG_ALIGN(min_len);
while (RTA_OK(attr, attrlen)) {
unsigned int flavor = attr->rta_type;
if (flavor) {
if (flavor > rta_max[sz_idx])
return -EINVAL;
rta_buf[flavor-1] = attr;
}
attr = RTA_NEXT(attr, attrlen);
}
}
doit = rtnl_get_doit(family, type);
if (doit == NULL)
return -EOPNOTSUPP;
return doit(skb, nlh, (void *)&rta_buf[0]);
}
| C | linux | 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: [email protected] # v4.13+
Fixes: cd63f3c ("powerpc/tm: Fix saving of TM SPRs in core dump")
Signed-off-by: Gustavo Romero <[email protected]>
Reviewed-by: Cyril Bur <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]> | static int pmu_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
int ret = 0;
/* Build tests */
BUILD_BUG_ON(TSO(siar) + sizeof(unsigned long) != TSO(sdar));
BUILD_BUG_ON(TSO(sdar) + sizeof(unsigned long) != TSO(sier));
BUILD_BUG_ON(TSO(sier) + sizeof(unsigned long) != TSO(mmcr2));
BUILD_BUG_ON(TSO(mmcr2) + sizeof(unsigned long) != TSO(mmcr0));
if (!cpu_has_feature(CPU_FTR_ARCH_207S))
return -ENODEV;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.siar, 0,
sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.sdar, sizeof(unsigned long),
2 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.sier, 2 * sizeof(unsigned long),
3 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.mmcr2, 3 * sizeof(unsigned long),
4 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.mmcr0, 4 * sizeof(unsigned long),
5 * sizeof(unsigned long));
return ret;
}
| static int pmu_set(struct task_struct *target,
const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
int ret = 0;
/* Build tests */
BUILD_BUG_ON(TSO(siar) + sizeof(unsigned long) != TSO(sdar));
BUILD_BUG_ON(TSO(sdar) + sizeof(unsigned long) != TSO(sier));
BUILD_BUG_ON(TSO(sier) + sizeof(unsigned long) != TSO(mmcr2));
BUILD_BUG_ON(TSO(mmcr2) + sizeof(unsigned long) != TSO(mmcr0));
if (!cpu_has_feature(CPU_FTR_ARCH_207S))
return -ENODEV;
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.siar, 0,
sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.sdar, sizeof(unsigned long),
2 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.sier, 2 * sizeof(unsigned long),
3 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.mmcr2, 3 * sizeof(unsigned long),
4 * sizeof(unsigned long));
if (!ret)
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
&target->thread.mmcr0, 4 * sizeof(unsigned long),
5 * sizeof(unsigned long));
return ret;
}
| C | linux | 0 |
CVE-2018-19497 | https://www.cvedetails.com/cve/CVE-2018-19497/ | CWE-125 | https://github.com/sleuthkit/sleuthkit/commit/bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d | bc04aa017c0bd297de8a3b7fc40ffc6ddddbb95d | Merge pull request #1374 from JordyZomer/develop
Fix CVE-2018-19497. | static int hfs_decompress_noncompressed_attr(char* rawBuf, uint32_t rawSize, uint64_t uncSize, char** dstBuf, uint64_t* dstSize, int* dstBufFree) {
if (tsk_verbose)
tsk_fprintf(stderr,
"%s: Leading byte, 0x%02x, indicates that the data is not really compressed.\n"
"%s: Loading the default DATA attribute.", __func__, rawBuf[0], __func__);
*dstBuf = rawBuf + 1; // + 1 indicator byte
*dstSize = uncSize;
*dstBufFree = FALSE;
return 1;
}
| static int hfs_decompress_noncompressed_attr(char* rawBuf, uint32_t rawSize, uint64_t uncSize, char** dstBuf, uint64_t* dstSize, int* dstBufFree) {
if (tsk_verbose)
tsk_fprintf(stderr,
"%s: Leading byte, 0x%02x, indicates that the data is not really compressed.\n"
"%s: Loading the default DATA attribute.", __func__, rawBuf[0], __func__);
*dstBuf = rawBuf + 1; // + 1 indicator byte
*dstSize = uncSize;
*dstBufFree = FALSE;
return 1;
}
| C | sleuthkit | 0 |
CVE-2016-2496 | https://www.cvedetails.com/cve/CVE-2016-2496/ | CWE-264 | https://android.googlesource.com/platform/frameworks/native/+/03a53d1c7765eeb3af0bc34c3dff02ada1953fbf | 03a53d1c7765eeb3af0bc34c3dff02ada1953fbf | Add new MotionEvent flag for partially obscured windows.
Due to more complex window layouts resulting in lots of overlapping
windows, the policy around FLAG_WINDOW_IS_OBSCURED has changed to
only be set when the point at which the window was touched is
obscured. Unfortunately, this doesn't prevent tapjacking attacks that
overlay the dialog's text, making a potentially dangerous operation
seem innocuous. To avoid this on particularly sensitive dialogs,
introduce a new flag that really does tell you when your window is
being even partially overlapped.
We aren't exposing this as API since we plan on making the original
flag more robust. This is really a workaround for system dialogs
since we generally know their layout and screen position, and that
they're unlikely to be overlapped by other applications.
Bug: 26677796
Change-Id: I9e336afe90f262ba22015876769a9c510048fd47
| void InputDispatcher::DeviceResetEntry::appendDescription(String8& msg) const {
msg.appendFormat("DeviceResetEvent(deviceId=%d), policyFlags=0x%08x",
deviceId, policyFlags);
}
| void InputDispatcher::DeviceResetEntry::appendDescription(String8& msg) const {
msg.appendFormat("DeviceResetEvent(deviceId=%d), policyFlags=0x%08x",
deviceId, policyFlags);
}
| C | Android | 0 |
CVE-2017-0377 | https://www.cvedetails.com/cve/CVE-2017-0377/ | CWE-200 | https://github.com/torproject/tor/commit/665baf5ed5c6186d973c46cdea165c0548027350 | 665baf5ed5c6186d973c46cdea165c0548027350 | Consider the exit family when applying guard restrictions.
When the new path selection logic went into place, I accidentally
dropped the code that considered the _family_ of the exit node when
deciding if the guard was usable, and we didn't catch that during
code review.
This patch makes the guard_restriction_t code consider the exit
family as well, and adds some (hopefully redundant) checks for the
case where we lack a node_t for a guard but we have a bridge_info_t
for it.
Fixes bug 22753; bugfix on 0.3.0.1-alpha. Tracked as TROVE-2016-006
and CVE-2017-0377. | pathbias_check_close_success_count(entry_guard_t *node)
{
const or_options_t *options = get_options();
const double EPSILON = 1.0e-9;
/* Note: We rely on the < comparison here to allow us to set a 0
* rate and disable the feature entirely. If refactoring, don't
* change to <= */
if (node->pb.circ_attempts > EPSILON &&
pathbias_get_close_success_count(node)/node->pb.circ_attempts
< pathbias_get_extreme_rate(options) &&
pathbias_get_dropguards(options)) {
node->pb.path_bias_disabled = 1;
log_info(LD_GENERAL,
"Path bias is too high (%f/%f); disabling node %s",
node->pb.circ_successes, node->pb.circ_attempts,
node->nickname);
}
}
| pathbias_check_close_success_count(entry_guard_t *node)
{
const or_options_t *options = get_options();
const double EPSILON = 1.0e-9;
/* Note: We rely on the < comparison here to allow us to set a 0
* rate and disable the feature entirely. If refactoring, don't
* change to <= */
if (node->pb.circ_attempts > EPSILON &&
pathbias_get_close_success_count(node)/node->pb.circ_attempts
< pathbias_get_extreme_rate(options) &&
pathbias_get_dropguards(options)) {
node->pb.path_bias_disabled = 1;
log_info(LD_GENERAL,
"Path bias is too high (%f/%f); disabling node %s",
node->pb.circ_successes, node->pb.circ_attempts,
node->nickname);
}
}
| C | tor | 0 |
CVE-2016-1666 | https://www.cvedetails.com/cve/CVE-2016-1666/ | null | https://github.com/chromium/chromium/commit/8b10115b2410b4bde18e094ad9fb8c5056134c87 | 8b10115b2410b4bde18e094ad9fb8c5056134c87 | Fix ChromeResourceDispatcherHostDelegateMirrorBrowserTest.MirrorRequestHeader with network service.
The functionality worked, as part of converting DICE, however the test code didn't work since it
depended on accessing the net objects directly. Switch the tests to use the EmbeddedTestServer, to
better match production, which removes the dependency on net/.
Also:
-make GetFilePathWithReplacements replace strings in the mock headers if they're present
-add a global to google_util to ignore ports; that way other tests can be converted without having
to modify each callsite to google_util
Bug: 881976
Change-Id: Ic52023495c1c98c1248025c11cdf37f433fef058
Reviewed-on: https://chromium-review.googlesource.com/c/1328142
Commit-Queue: John Abd-El-Malek <[email protected]>
Reviewed-by: Ramin Halavati <[email protected]>
Reviewed-by: Maks Orlovich <[email protected]>
Reviewed-by: Peter Kasting <[email protected]>
Cr-Commit-Position: refs/heads/master@{#607652} | const net::HttpRequestHeaders& request_headers() const {
| const net::HttpRequestHeaders& request_headers() const {
return request_headers_;
}
| C | Chrome | 1 |
CVE-2018-16078 | https://www.cvedetails.com/cve/CVE-2018-16078/ | null | https://github.com/chromium/chromium/commit/b025e82307a8490501bb030266cd955c391abcb7 | b025e82307a8490501bb030266cd955c391abcb7 | [AF] Don't simplify/dedupe suggestions for (partially) filled sections.
Since Autofill does not fill field by field anymore, this simplifying
and deduping of suggestions is not useful anymore.
Bug: 858820
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I36f7cfe425a0bdbf5ba7503a3d96773b405cc19b
Reviewed-on: https://chromium-review.googlesource.com/1128255
Reviewed-by: Roger McFarlane <[email protected]>
Commit-Queue: Sebastien Seguin-Gagnon <[email protected]>
Cr-Commit-Position: refs/heads/master@{#573315} | void CheckSuggestionsAvailableIfScreenReaderRunning() {
EXPECT_EQ(has_active_screen_reader_,
external_delegate_->has_suggestions_available_on_field_focus());
}
| void CheckSuggestionsAvailableIfScreenReaderRunning() {
EXPECT_EQ(has_active_screen_reader_,
external_delegate_->has_suggestions_available_on_field_focus());
}
| C | Chrome | 0 |
CVE-2010-4818 | https://www.cvedetails.com/cve/CVE-2010-4818/ | CWE-20 | https://cgit.freedesktop.org/xorg/xserver/commit?id=3f0d3f4d97bce75c1828635c322b6560a45a037f | 3f0d3f4d97bce75c1828635c322b6560a45a037f | null | int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
}
| int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
{
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
}
| C | xserver | 0 |
CVE-2017-16932 | https://www.cvedetails.com/cve/CVE-2017-16932/ | CWE-835 | https://github.com/GNOME/libxml2/commit/899a5d9f0ed13b8e32449a08a361e0de127dd961 | 899a5d9f0ed13b8e32449a08a361e0de127dd961 | Detect infinite recursion in parameter entities
When expanding a parameter entity in a DTD, infinite recursion could
lead to an infinite loop or memory exhaustion.
Thanks to Wei Lei for the first of many reports.
Fixes bug 759579. | nsPop(xmlParserCtxtPtr ctxt, int nr)
{
int i;
if (ctxt->nsTab == NULL) return(0);
if (ctxt->nsNr < nr) {
xmlGenericError(xmlGenericErrorContext, "Pbm popping %d NS\n", nr);
nr = ctxt->nsNr;
}
if (ctxt->nsNr <= 0)
return (0);
for (i = 0;i < nr;i++) {
ctxt->nsNr--;
ctxt->nsTab[ctxt->nsNr] = NULL;
}
return(nr);
}
| nsPop(xmlParserCtxtPtr ctxt, int nr)
{
int i;
if (ctxt->nsTab == NULL) return(0);
if (ctxt->nsNr < nr) {
xmlGenericError(xmlGenericErrorContext, "Pbm popping %d NS\n", nr);
nr = ctxt->nsNr;
}
if (ctxt->nsNr <= 0)
return (0);
for (i = 0;i < nr;i++) {
ctxt->nsNr--;
ctxt->nsTab[ctxt->nsNr] = NULL;
}
return(nr);
}
| C | libxml2 | 0 |
CVE-2016-5770 | https://www.cvedetails.com/cve/CVE-2016-5770/ | CWE-190 | https://github.com/php/php-src/commit/7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1 | 7245bff300d3fa8bacbef7897ff080a6f1c23eba?w=1 | Fix bug #72262 - do not overflow int | SPL_METHOD(DirectoryIterator, getFilename)
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING(intern->u.dir.entry.d_name, 1);
}
| SPL_METHOD(DirectoryIterator, getFilename)
{
spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
if (zend_parse_parameters_none() == FAILURE) {
return;
}
RETURN_STRING(intern->u.dir.entry.d_name, 1);
}
| C | php-src | 1 |
CVE-2013-1929 | https://www.cvedetails.com/cve/CVE-2013-1929/ | CWE-119 | https://github.com/torvalds/linux/commit/715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string length (32 bytes). On overflow,
truncate the formatted firmware string instead of potentially overwriting
portions of the tg3 struct.
http://cansecwest.com/slides/2013/PrivateCore%20CSW%202013.pdf
Signed-off-by: Kees Cook <[email protected]>
Reported-by: Oded Horovitz <[email protected]>
Reported-by: Brad Spengler <[email protected]>
Cc: [email protected]
Cc: Matt Carlson <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | static void tg3_read_bc_ver(struct tg3 *tp)
{
u32 val, offset, start, ver_offset;
int i, dst_off;
bool newver = false;
if (tg3_nvram_read(tp, 0xc, &offset) ||
tg3_nvram_read(tp, 0x4, &start))
return;
offset = tg3_nvram_logical_addr(tp, offset);
if (tg3_nvram_read(tp, offset, &val))
return;
if ((val & 0xfc000000) == 0x0c000000) {
if (tg3_nvram_read(tp, offset + 4, &val))
return;
if (val == 0)
newver = true;
}
dst_off = strlen(tp->fw_ver);
if (newver) {
if (TG3_VER_SIZE - dst_off < 16 ||
tg3_nvram_read(tp, offset + 8, &ver_offset))
return;
offset = offset + ver_offset - start;
for (i = 0; i < 16; i += 4) {
__be32 v;
if (tg3_nvram_read_be32(tp, offset + i, &v))
return;
memcpy(tp->fw_ver + dst_off + i, &v, sizeof(v));
}
} else {
u32 major, minor;
if (tg3_nvram_read(tp, TG3_NVM_PTREV_BCVER, &ver_offset))
return;
major = (ver_offset & TG3_NVM_BCVER_MAJMSK) >>
TG3_NVM_BCVER_MAJSFT;
minor = ver_offset & TG3_NVM_BCVER_MINMSK;
snprintf(&tp->fw_ver[dst_off], TG3_VER_SIZE - dst_off,
"v%d.%02d", major, minor);
}
}
| static void tg3_read_bc_ver(struct tg3 *tp)
{
u32 val, offset, start, ver_offset;
int i, dst_off;
bool newver = false;
if (tg3_nvram_read(tp, 0xc, &offset) ||
tg3_nvram_read(tp, 0x4, &start))
return;
offset = tg3_nvram_logical_addr(tp, offset);
if (tg3_nvram_read(tp, offset, &val))
return;
if ((val & 0xfc000000) == 0x0c000000) {
if (tg3_nvram_read(tp, offset + 4, &val))
return;
if (val == 0)
newver = true;
}
dst_off = strlen(tp->fw_ver);
if (newver) {
if (TG3_VER_SIZE - dst_off < 16 ||
tg3_nvram_read(tp, offset + 8, &ver_offset))
return;
offset = offset + ver_offset - start;
for (i = 0; i < 16; i += 4) {
__be32 v;
if (tg3_nvram_read_be32(tp, offset + i, &v))
return;
memcpy(tp->fw_ver + dst_off + i, &v, sizeof(v));
}
} else {
u32 major, minor;
if (tg3_nvram_read(tp, TG3_NVM_PTREV_BCVER, &ver_offset))
return;
major = (ver_offset & TG3_NVM_BCVER_MAJMSK) >>
TG3_NVM_BCVER_MAJSFT;
minor = ver_offset & TG3_NVM_BCVER_MINMSK;
snprintf(&tp->fw_ver[dst_off], TG3_VER_SIZE - dst_off,
"v%d.%02d", major, minor);
}
}
| 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 <[email protected]>
Cc: Herbert Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct sock *sk = sock->sk;
struct inet_sock *inet = inet_sk(sk);
DECLARE_SOCKADDR(struct sockaddr_in *, sin, uaddr);
sin->sin_family = AF_INET;
if (peer) {
if (!inet->inet_dport ||
(((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT)) &&
peer == 1))
return -ENOTCONN;
sin->sin_port = inet->inet_dport;
sin->sin_addr.s_addr = inet->inet_daddr;
} else {
__be32 addr = inet->inet_rcv_saddr;
if (!addr)
addr = inet->inet_saddr;
sin->sin_port = inet->inet_sport;
sin->sin_addr.s_addr = addr;
}
memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
*uaddr_len = sizeof(*sin);
return 0;
}
| int inet_getname(struct socket *sock, struct sockaddr *uaddr,
int *uaddr_len, int peer)
{
struct sock *sk = sock->sk;
struct inet_sock *inet = inet_sk(sk);
DECLARE_SOCKADDR(struct sockaddr_in *, sin, uaddr);
sin->sin_family = AF_INET;
if (peer) {
if (!inet->inet_dport ||
(((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_SYN_SENT)) &&
peer == 1))
return -ENOTCONN;
sin->sin_port = inet->inet_dport;
sin->sin_addr.s_addr = inet->inet_daddr;
} else {
__be32 addr = inet->inet_rcv_saddr;
if (!addr)
addr = inet->inet_saddr;
sin->sin_port = inet->inet_sport;
sin->sin_addr.s_addr = addr;
}
memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
*uaddr_len = sizeof(*sin);
return 0;
}
| C | linux | 0 |
CVE-2015-3842 | https://www.cvedetails.com/cve/CVE-2015-3842/ | CWE-119 | https://android.googlesource.com/platform/frameworks/av/+/aeea52da00d210587fb3ed895de3d5f2e0264c88 | aeea52da00d210587fb3ed895de3d5f2e0264c88 | audio effects: fix heap overflow
Check consistency of effect command reply sizes before
copying to reply address.
Also add null pointer check on reply size.
Also remove unused parameter warning.
Bug: 21953516.
Change-Id: I4cf00c12eaed696af28f3b7613f7e36f47a160c4
(cherry picked from commit 0f714a464d2425afe00d6450535e763131b40844)
| int32_t EqualizerGetBandLevel(EffectContext *pContext, int32_t band){
return pContext->pBundledContext->bandGaindB[band] * 100;
}
| int32_t EqualizerGetBandLevel(EffectContext *pContext, int32_t band){
return pContext->pBundledContext->bandGaindB[band] * 100;
}
| C | Android | 0 |
CVE-2013-2206 | https://www.cvedetails.com/cve/CVE-2013-2206/ | null | https://github.com/torvalds/linux/commit/f2815633504b442ca0b0605c16bf3d88a3a0fcea | f2815633504b442ca0b0605c16bf3d88a3a0fcea | sctp: Use correct sideffect command in duplicate cookie handling
When SCTP is done processing a duplicate cookie chunk, it tries
to delete a newly created association. For that, it has to set
the right association for the side-effect processing to work.
However, when it uses the SCTP_CMD_NEW_ASOC command, that performs
more work then really needed (like hashing the associationa and
assigning it an id) and there is no point to do that only to
delete the association as a next step. In fact, it also creates
an impossible condition where an association may be found by
the getsockopt() call, and that association is empty. This
causes a crash in some sctp getsockopts.
The solution is rather simple. We simply use SCTP_CMD_SET_ASOC
command that doesn't have all the overhead and does exactly
what we need.
Reported-by: Karl Heiss <[email protected]>
Tested-by: Karl Heiss <[email protected]>
CC: Neil Horman <[email protected]>
Signed-off-by: Vlad Yasevich <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]> | static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc)
{
sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev;
struct sctp_chunk *repl;
struct sctp_chunk *err;
sctp_disposition_t disposition;
/* new_asoc is a brand-new association, so these are not yet
* side effects--it is safe to run them here.
*/
peer_init = &chunk->subh.cookie_hdr->c.peer_init[0];
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk), peer_init,
GFP_ATOMIC))
goto nomem;
/* Make sure no new addresses are being added during the
* restart. Though this is a pretty complicated attack
* since you'd have to get inside the cookie.
*/
if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands)) {
return SCTP_DISPOSITION_CONSUME;
}
/* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes
* the peer has restarted (Action A), it MUST NOT setup a new
* association but instead resend the SHUTDOWN ACK and send an ERROR
* chunk with a "Cookie Received while Shutting Down" error cause to
* its peer.
*/
if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
disposition = sctp_sf_do_9_2_reshutack(net, ep, asoc,
SCTP_ST_CHUNK(chunk->chunk_hdr->type),
chunk, commands);
if (SCTP_DISPOSITION_NOMEM == disposition)
goto nomem;
err = sctp_make_op_error(asoc, chunk,
SCTP_ERROR_COOKIE_IN_SHUTDOWN,
NULL, 0, 0);
if (err)
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
SCTP_CHUNK(err));
return SCTP_DISPOSITION_CONSUME;
}
/* For now, stop pending T3-rtx and SACK timers, fail any unsent/unacked
* data. Consider the optional choice of resending of this data.
*/
sctp_add_cmd_sf(commands, SCTP_CMD_T3_RTX_TIMERS_STOP, SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
sctp_add_cmd_sf(commands, SCTP_CMD_PURGE_OUTQUEUE, SCTP_NULL());
/* Stop pending T4-rto timer, teardown ASCONF queue, ASCONF-ACK queue
* and ASCONF-ACK cache.
*/
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
sctp_add_cmd_sf(commands, SCTP_CMD_PURGE_ASCONF_QUEUE, SCTP_NULL());
repl = sctp_make_cookie_ack(new_asoc, chunk);
if (!repl)
goto nomem;
/* Report association restart to upper layer. */
ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0,
new_asoc->c.sinit_num_ostreams,
new_asoc->c.sinit_max_instreams,
NULL, GFP_ATOMIC);
if (!ev)
goto nomem_ev;
/* Update the content of current association. */
sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
SCTP_STATE(SCTP_STATE_ESTABLISHED));
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
return SCTP_DISPOSITION_CONSUME;
nomem_ev:
sctp_chunk_free(repl);
nomem:
return SCTP_DISPOSITION_NOMEM;
}
| static sctp_disposition_t sctp_sf_do_dupcook_a(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands,
struct sctp_association *new_asoc)
{
sctp_init_chunk_t *peer_init;
struct sctp_ulpevent *ev;
struct sctp_chunk *repl;
struct sctp_chunk *err;
sctp_disposition_t disposition;
/* new_asoc is a brand-new association, so these are not yet
* side effects--it is safe to run them here.
*/
peer_init = &chunk->subh.cookie_hdr->c.peer_init[0];
if (!sctp_process_init(new_asoc, chunk, sctp_source(chunk), peer_init,
GFP_ATOMIC))
goto nomem;
/* Make sure no new addresses are being added during the
* restart. Though this is a pretty complicated attack
* since you'd have to get inside the cookie.
*/
if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands)) {
return SCTP_DISPOSITION_CONSUME;
}
/* If the endpoint is in the SHUTDOWN-ACK-SENT state and recognizes
* the peer has restarted (Action A), it MUST NOT setup a new
* association but instead resend the SHUTDOWN ACK and send an ERROR
* chunk with a "Cookie Received while Shutting Down" error cause to
* its peer.
*/
if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
disposition = sctp_sf_do_9_2_reshutack(net, ep, asoc,
SCTP_ST_CHUNK(chunk->chunk_hdr->type),
chunk, commands);
if (SCTP_DISPOSITION_NOMEM == disposition)
goto nomem;
err = sctp_make_op_error(asoc, chunk,
SCTP_ERROR_COOKIE_IN_SHUTDOWN,
NULL, 0, 0);
if (err)
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
SCTP_CHUNK(err));
return SCTP_DISPOSITION_CONSUME;
}
/* For now, stop pending T3-rtx and SACK timers, fail any unsent/unacked
* data. Consider the optional choice of resending of this data.
*/
sctp_add_cmd_sf(commands, SCTP_CMD_T3_RTX_TIMERS_STOP, SCTP_NULL());
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
sctp_add_cmd_sf(commands, SCTP_CMD_PURGE_OUTQUEUE, SCTP_NULL());
/* Stop pending T4-rto timer, teardown ASCONF queue, ASCONF-ACK queue
* and ASCONF-ACK cache.
*/
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
sctp_add_cmd_sf(commands, SCTP_CMD_PURGE_ASCONF_QUEUE, SCTP_NULL());
repl = sctp_make_cookie_ack(new_asoc, chunk);
if (!repl)
goto nomem;
/* Report association restart to upper layer. */
ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0,
new_asoc->c.sinit_num_ostreams,
new_asoc->c.sinit_max_instreams,
NULL, GFP_ATOMIC);
if (!ev)
goto nomem_ev;
/* Update the content of current association. */
sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
SCTP_STATE(SCTP_STATE_ESTABLISHED));
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
return SCTP_DISPOSITION_CONSUME;
nomem_ev:
sctp_chunk_free(repl);
nomem:
return SCTP_DISPOSITION_NOMEM;
}
| C | linux | 0 |
CVE-2012-2875 | https://www.cvedetails.com/cve/CVE-2012-2875/ | null | https://github.com/chromium/chromium/commit/d345af9ed62ee5f431be327967f41c3cc3fe936a | d345af9ed62ee5f431be327967f41c3cc3fe936a | [BlackBerry] Adapt to new BlackBerry::Platform::TouchPoint API
https://bugs.webkit.org/show_bug.cgi?id=105143
RIM PR 171941
Reviewed by Rob Buis.
Internally reviewed by George Staikos.
Source/WebCore:
TouchPoint instances now provide document coordinates for the viewport
and content position of the touch event. The pixel coordinates stored
in the TouchPoint should no longer be needed in WebKit.
Also adapt to new method names and encapsulation of TouchPoint data
members.
No change in behavior, no new tests.
* platform/blackberry/PlatformTouchPointBlackBerry.cpp:
(WebCore::PlatformTouchPoint::PlatformTouchPoint):
Source/WebKit/blackberry:
TouchPoint instances now provide document coordinates for the viewport
and content position of the touch event. The pixel coordinates stored
in the TouchPoint should no longer be needed in WebKit. One exception
is when passing events to a full screen plugin.
Also adapt to new method names and encapsulation of TouchPoint data
members.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::touchEvent):
(BlackBerry::WebKit::WebPage::touchPointAsMouseEvent):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchEventToFullScreenPlugin):
(BlackBerry::WebKit::WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
* WebKitSupport/InputHandler.h:
(InputHandler):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::TouchEventHandler::doFatFingers):
(BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
* WebKitSupport/TouchEventHandler.h:
(TouchEventHandler):
Tools:
Adapt to new method names and encapsulation of TouchPoint data members.
* DumpRenderTree/blackberry/EventSender.cpp:
(addTouchPointCallback):
(updateTouchPointCallback):
(touchEndCallback):
(releaseTouchPointCallback):
(sendTouchEvent):
git-svn-id: svn://svn.chromium.org/blink/trunk@137880 bbb929c8-8fbe-4397-9dbb-9b2b20218538 | Platform::NetworkStreamFactory* WebPagePrivate::networkStreamFactory()
{
return m_client->networkStreamFactory();
}
| Platform::NetworkStreamFactory* WebPagePrivate::networkStreamFactory()
{
return m_client->networkStreamFactory();
}
| C | Chrome | 0 |
CVE-2016-5219 | https://www.cvedetails.com/cve/CVE-2016-5219/ | CWE-416 | https://github.com/chromium/chromium/commit/a4150b688a754d3d10d2ca385155b1c95d77d6ae | a4150b688a754d3d10d2ca385155b1c95d77d6ae | Add GL_PROGRAM_COMPLETION_QUERY_CHROMIUM
This makes the query of GL_COMPLETION_STATUS_KHR to programs much
cheaper by minimizing the round-trip to the GPU thread.
Bug: 881152, 957001
Change-Id: Iadfa798af29225e752c710ca5c25f50b3dd3101a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1586630
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Geoff Lang <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Cr-Commit-Position: refs/heads/master@{#657568} | void GLES2DecoderImpl::DoCopyBufferSubData(GLenum readtarget,
GLenum writetarget,
GLintptr readoffset,
GLintptr writeoffset,
GLsizeiptr size) {
buffer_manager()->ValidateAndDoCopyBufferSubData(
&state_, error_state_.get(), readtarget, writetarget, readoffset,
writeoffset, size);
}
| void GLES2DecoderImpl::DoCopyBufferSubData(GLenum readtarget,
GLenum writetarget,
GLintptr readoffset,
GLintptr writeoffset,
GLsizeiptr size) {
buffer_manager()->ValidateAndDoCopyBufferSubData(
&state_, error_state_.get(), readtarget, writetarget, readoffset,
writeoffset, size);
}
| C | Chrome | 0 |
Subsets and Splits