func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
int page_trans_huge_mapcount(struct page *page, int *total_mapcount)
{
int i, ret, _total_mapcount, mapcount;
/* hugetlbfs shouldn't call it */
VM_BUG_ON_PAGE(PageHuge(page), page);
if (likely(!PageTransCompound(page))) {
mapcount = atomic_read(&page->_mapcount) + 1;
if (total_mapcount)
*total_mapcount = m... | 0 | [
"CWE-362"
] | linux | a8f97366452ed491d13cf1e44241bc0b5740b1f0 | 245,026,273,009,445,300,000,000,000,000,000,000,000 | 33 | mm, thp: Do not make page table dirty unconditionally in touch_p[mu]d()
Currently, we unconditionally make page table dirty in touch_pmd().
It may result in false-positive can_follow_write_pmd().
We may avoid the situation, if we would only make the page table entry
dirty if caller asks for write access -- FOLL_WRITE... |
bool CModules::OnTimerAutoJoin(CChan& Channel) {
MODHALTCHK(OnTimerAutoJoin(Channel));
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 41,364,741,206,323,886,000,000,000,000,000,000,000 | 3 | Fix remote code execution and privilege escalation vulnerability.
To trigger this, need to have a user already.
Thanks for Jeriko One <jeriko.one@gmx.us> for finding and reporting this.
CVE-2019-12816 |
xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
{
int err = 0;
xmlSchemaRedefPtr redef = WXS_CONSTRUCTOR(pctxt)->redefs;
xmlSchemaBasicItemPtr item;
if (redef == NULL)
return(0);
do {
if (redef->target == NULL) {
redef = redef->next;
continue;
}
item = redef->item;
sw... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 180,346,922,323,357,160,000,000,000,000,000,000,000 | 73 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
ipa_get_jf_arith_result (enum tree_code opcode, tree input, tree operand,
tree res_type)
{
tree res;
if (opcode == NOP_EXPR)
return input;
if (!is_gimple_ip_invariant (input))
return NULL_TREE;
if (!res_type)
{
if (TREE_CODE_CLASS (opcode) == tcc_comparison)
res_type = boolean_type_node... | 0 | [
"CWE-20"
] | gcc | a09ccc22459c565814f79f96586fe4ad083fe4eb | 92,995,611,019,692,040,000,000,000,000,000,000,000 | 30 | Avoid segfault when doing IPA-VRP but not IPA-CP (PR 93015)
2019-12-21 Martin Jambor <mjambor@suse.cz>
PR ipa/93015
* ipa-cp.c (ipcp_store_vr_results): Check that info exists
testsuite/
* gcc.dg/lto/pr93015_0.c: New test.
From-SVN: r279695 |
TEST_F(Http1ClientConnectionImplTest, ResponseWithTrailers) {
initialize();
NiceMock<MockResponseDecoder> response_decoder;
Http::RequestEncoder& request_encoder = codec_->newStream(response_decoder);
TestRequestHeaderMapImpl headers{{":method", "GET"}, {":path", "/"}, {":authority", "host"}};
request_encode... | 0 | [
"CWE-770"
] | envoy | 7ca28ff7d46454ae930e193d97b7d08156b1ba59 | 222,257,519,517,919,500,000,000,000,000,000,000,000 | 14 | [http1] Include request URL in request header size computation, and reject partial headers that exceed configured limits (#145)
Signed-off-by: antonio <avd@google.com> |
static noinline int audit_inode_permission(struct inode *inode,
u32 perms, u32 audited, u32 denied,
int result)
{
struct common_audit_data ad;
struct inode_security_struct *isec = selinux_inode(inode);
int rc;
ad.type = LSM_AUDIT_DATA_INODE;
ad.u.inode = inode;
rc = slow_avc_audit(&selinux_state... | 0 | [
"CWE-349"
] | linux | fb73974172ffaaf57a7c42f35424d9aece1a5af6 | 252,165,187,780,107,680,000,000,000,000,000,000,000 | 18 | selinux: properly handle multiple messages in selinux_netlink_send()
Fix the SELinux netlink_send hook to properly handle multiple netlink
messages in a single sk_buff; each message is parsed and subject to
SELinux access control. Prior to this patch, SELinux only inspected
the first message in the sk_buff.
Cc: stab... |
void __blk_run_queue(struct request_queue *q)
{
lockdep_assert_held(q->queue_lock);
WARN_ON_ONCE(q->mq_ops);
if (unlikely(blk_queue_stopped(q)))
return;
__blk_run_queue_uncond(q);
} | 0 | [
"CWE-416",
"CWE-703"
] | linux | 54648cf1ec2d7f4b6a71767799c45676a138ca24 | 73,886,721,698,487,320,000,000,000,000,000,000,000 | 10 | block: blk_init_allocated_queue() set q->fq as NULL in the fail case
We find the memory use-after-free issue in __blk_drain_queue()
on the kernel 4.14. After read the latest kernel 4.18-rc6 we
think it has the same problem.
Memory is allocated for q->fq in the blk_init_allocated_queue().
If the elevator init function... |
static void __skb_complete_tx_timestamp(struct sk_buff *skb,
struct sock *sk,
int tstype,
bool opt_stats)
{
struct sock_exterr_skb *serr;
int err;
BUILD_BUG_ON(sizeof(struct sock_exterr_skb) > sizeof(skb->cb));
serr = SKB_EXT_ERR(skb);
memset(serr, 0, sizeof(*serr));
serr->ee.ee_errno = ENOMSG;
... | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 209,708,120,465,626,250,000,000,000,000,000,000,000 | 29 | net: create skb_gso_validate_mac_len()
If you take a GSO skb, and split it into packets, will the MAC
length (L2 + L3 + L4 headers + payload) of those packets be small
enough to fit within a given length?
Move skb_gso_mac_seglen() to skbuff.h with other related functions
like skb_gso_network_seglen() so we can use it... |
static void pop_filter_list(filter_rule_list *listp)
{
filter_rule *inherited;
if (!listp->tail)
return;
inherited = listp->tail->next;
/* Truncate any inherited items from the local list. */
listp->tail->next = NULL;
/* Now free everything that is left. */
free_filters(listp->head);
listp->head = inherit... | 0 | [] | rsync | b7231c7d02cfb65d291af74ff66e7d8c507ee871 | 89,751,741,149,699,640,000,000,000,000,000,000,000 | 17 | Some extra file-list safety checks. |
void unpin_user_pages(struct page **pages, unsigned long npages)
{
unsigned long index;
/*
* TODO: this can be optimized for huge pages: if a series of pages is
* physically contiguous and part of the same compound page, then a
* single operation to the head page should suffice.
*/
for (index = 0; index < n... | 0 | [
"CWE-362"
] | linux | 17839856fd588f4ab6b789f482ed3ffd7c403e1f | 31,539,578,585,743,790,000,000,000,000,000,000,000 | 12 | gup: document and work around "COW can break either way" issue
Doing a "get_user_pages()" on a copy-on-write page for reading can be
ambiguous: the page can be COW'ed at any time afterwards, and the
direction of a COW event isn't defined.
Yes, whoever writes to it will generally do the COW, but if the thread
that did... |
void CMSEXPORT cmsIT8DefineDblFormat(cmsHANDLE hIT8, const char* Formatter)
{
cmsIT8* it8 = (cmsIT8*) hIT8;
_cmsAssert(hIT8 != NULL);
if (Formatter == NULL)
strcpy(it8->DoubleFormatter, DEFAULT_DBL_FORMAT);
else
strncpy(it8->DoubleFormatter, Formatter, sizeof(it8->DoubleFormatter));
... | 0 | [
"CWE-190",
"CWE-787"
] | Little-CMS | 768f70ca405cd3159d990e962d54456773bb8cf8 | 235,217,483,739,330,370,000,000,000,000,000,000,000 | 13 | Upgrade Visual studio 2017 15.8
- Upgrade to 15.8
- Add check on CGATS memory allocation (thanks to Quang Nguyen for
pointing out this) |
static void snd_msnd_eval_dsp_msg(struct snd_msnd *chip, u16 wMessage)
{
switch (HIBYTE(wMessage)) {
case HIMT_PLAY_DONE: {
if (chip->banksPlayed < 3)
snd_printdd("%08X: HIMT_PLAY_DONE: %i\n",
(unsigned)jiffies, LOBYTE(wMessage));
if (chip->last_playbank == LOBYTE(wMessage)) {
snd_printdd("chip.last_pl... | 0 | [
"CWE-125",
"CWE-401"
] | linux | 20e2b791796bd68816fa115f12be5320de2b8021 | 165,413,883,732,038,350,000,000,000,000,000,000,000 | 75 | ALSA: msnd: Optimize / harden DSP and MIDI loops
The ISA msnd drivers have loops fetching the ring-buffer head, tail
and size values inside the loops. Such codes are inefficient and
fragile.
This patch optimizes it, and also adds the sanity check to avoid the
endless loops.
Bugzilla: https://bugzilla.kernel.org/sho... |
Bool gf_isom_has_padding_bits(GF_ISOFile *the_file, u32 trackNumber)
{
GF_TrackBox *trak;
trak = gf_isom_get_track_from_file(the_file, trackNumber);
if (!trak) return GF_FALSE;
if (trak->Media->information->sampleTable->PaddingBits) return GF_TRUE;
return GF_FALSE;
} | 0 | [
"CWE-476"
] | gpac | ebfa346eff05049718f7b80041093b4c5581c24e | 173,295,631,295,049,960,000,000,000,000,000,000,000 | 10 | fixed #1706 |
static bool mappings_overlap(struct uid_gid_map *new_map, struct uid_gid_extent *extent)
{
u32 upper_first, lower_first, upper_last, lower_last;
unsigned idx;
upper_first = extent->first;
lower_first = extent->lower_first;
upper_last = upper_first + extent->count - 1;
lower_last = lower_first + extent->count - 1... | 0 | [
"CWE-284",
"CWE-264"
] | linux | e3211c120a85b792978bcb4be7b2886df18d27f0 | 87,443,425,734,862,670,000,000,000,000,000,000,000 | 34 | userns: Check uid_map's opener's fsuid, not the current fsuid
Signed-off-by: Andy Lutomirski <luto@amacapital.net> |
plperl_hash_to_datum(SV *src, TupleDesc td)
{
HeapTuple tup = plperl_build_tuple_result((HV *) SvRV(src), td);
return HeapTupleGetDatum(tup);
} | 0 | [
"CWE-264"
] | postgres | 537cbd35c893e67a63c59bc636c3e888bd228bc7 | 320,129,297,512,777,520,000,000,000,000,000,000,000 | 6 | Prevent privilege escalation in explicit calls to PL validators.
The primary role of PL validators is to be called implicitly during
CREATE FUNCTION, but they are also normal functions that a user can call
explicitly. Add a permissions check to each validator to ensure that a
user cannot use explicit validator calls ... |
static void dmar_disable_qi(struct dmar_drhd_rt *dmar_unit)
{
uint32_t status = 0;
spinlock_obtain(&(dmar_unit->lock));
if ((dmar_unit->gcmd & DMA_GCMD_QIE) == DMA_GCMD_QIE) {
dmar_unit->gcmd &= ~DMA_GCMD_QIE;
iommu_write32(dmar_unit, DMAR_GCMD_REG, dmar_unit->gcmd);
dmar_wait_completion(dmar_unit, DMAR_GSTS... | 0 | [
"CWE-120",
"CWE-787"
] | acrn-hypervisor | 25c0e3817eb332660dd63d1d4522e63dcc94e79a | 31,862,018,921,293,570,000,000,000,000,000,000,000 | 14 | hv: validate input for dmar_free_irte function
Malicious input 'index' may trigger buffer
overflow on array 'irte_alloc_bitmap[]'.
This patch validate that 'index' shall be
less than 'CONFIG_MAX_IR_ENTRIES' and also
remove unnecessary check on 'index' in
'ptirq_free_irte()' function with this fix.
Tracked-On: ... |
static int decode_dynamic_range(DynamicRangeControl *che_drc,
GetBitContext *gb)
{
int n = 1;
int drc_num_bands = 1;
int i;
/* pce_tag_present? */
if (get_bits1(gb)) {
che_drc->pce_instance_tag = get_bits(gb, 4);
skip_bits(gb, 4); // tag_... | 0 | [
"CWE-703"
] | FFmpeg | 6e42ccb9dbc13836cd52cda594f819d17af9afa2 | 188,686,339,054,206,060,000,000,000,000,000,000,000 | 46 | avcodec/aacdec: Fix pulse position checks in decode_pulses()
Fixes out of array read
Fixes: asan_static-oob_1efed25_1887_cov_2013541199_HeyYa_RA10_AAC_192K_30s.rm
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a)
{
BIGNUM *bntmp = NULL;
char *strtmp = NULL;
if(!a) return NULL;
if(!(bntmp = ASN1_INTEGER_to_BN(a, NULL)) ||
!(strtmp = BN_bn2dec(bntmp)) )
X509V3err(X509V3_F_I2S_ASN1_INTEGER,ERR_R_MALLOC_FAILURE);
BN_free(bntmp);
return strtmp;
} | 0 | [] | openssl | a70da5b3ecc3160368529677006801c58cb369db | 136,683,504,946,045,930,000,000,000,000,000,000,000 | 11 | New functions to check a hostname email or IP address against a
certificate. Add options to s_client, s_server and x509 utilities
to print results of checks. |
static u32 lsr_to_dom_key(u32 lsr_k)
{
switch (lsr_k) {
case 0:
return GF_KEY_STAR;
case 1:
return GF_KEY_0;
case 2:
return GF_KEY_1;
case 3:
return GF_KEY_2;
case 4:
return GF_KEY_3;
case 5:
return GF_KEY_4;
case 6:
return GF_KEY_5;
case 7:
return GF_KEY_6;
case 8:
return GF_KEY_7;
case 9:... | 0 | [
"CWE-190"
] | gpac | faa75edde3dfeba1e2cf6ffa48e45a50f1042096 | 184,124,833,331,907,800,000,000,000,000,000,000,000 | 49 | fixed #2213 |
void addReadOnlyAnyDbPrivileges(PrivilegeVector* privileges) {
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forAnyNormalResource(), readRoleActions));
Privilege::addPrivilegeToPrivilegeVector(
privileges, Privilege(ResourcePattern::forClusterResource(), Action... | 0 | [
"CWE-20"
] | mongo | cbec187266a9f902b3906ae8ccef2bbda0c5b27b | 196,981,076,286,926,530,000,000,000,000,000,000,000 | 14 | SERVER-36263 Bypassing operation validation in applyOps should require special privilege |
void FunctionContextImpl::free_local_allocations() {
for (int i = 0; i < _local_allocations.size(); ++i) {
_pool->free(_local_allocations[i]);
}
_local_allocations.clear();
} | 0 | [
"CWE-200"
] | incubator-doris | 246ac4e37aa4da6836b7850cb990f02d1c3725a3 | 176,083,093,764,949,070,000,000,000,000,000,000,000 | 7 | [fix] fix a bug of encryption function with iv may return wrong result (#8277) |
static void tty_write_unlock(struct tty_struct *tty)
{
mutex_unlock(&tty->atomic_write_lock);
wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
} | 0 | [
"CWE-200",
"CWE-362"
] | linux | 5c17c861a357e9458001f021a7afa7aab9937439 | 264,321,874,960,354,340,000,000,000,000,000,000,000 | 5 | tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
ioctl(TIOCGETD) retrieves the line discipline id directly from the
ldisc because the line discipline id (c_line) in termios is untrustworthy;
userspace may have set termios via ioctl(TCSETS*) without actually
changing the line discipline via ioctl(TIOCSETD).
However... |
bit_read_BB (Bit_Chain *dat)
{
unsigned char result;
unsigned char byte;
if (dat->byte >= dat->size)
{
loglevel = dat->opts & DWG_OPTS_LOGLEVEL;
LOG_ERROR ("%s buffer overflow at %lu", __FUNCTION__, dat->byte)
#ifdef DWG_ABORT
if (++errors > DWG_ABORT_LIMIT)
abort();
#endif
re... | 0 | [
"CWE-703",
"CWE-125"
] | libredwg | 95cc9300430d35feb05b06a9badf678419463dbe | 210,695,820,821,619,730,000,000,000,000,000,000,000 | 31 | encode: protect from stack under-flow
From GH #178 fuzzing |
static struct task_struct *copy_process(unsigned long clone_flags,
unsigned long stack_start,
struct pt_regs *regs,
unsigned long stack_size,
int __user *child_tidptr,
struct pid *pid,
int trace)
{
int retval;
struct task_struct *p;
int cgroup_callbacks_done = 0;
if ((clone_flags & (C... | 0 | [
"CWE-264"
] | linux-2.6 | 2d5516cbb9daf7d0e342a2e3b0fc6f8c39a81205 | 286,272,198,661,693,650,000,000,000,000,000,000,000 | 376 | copy_process: fix CLONE_PARENT && parent_exec_id interaction
CLONE_PARENT can fool the ->self_exec_id/parent_exec_id logic. If we
re-use the old parent, we must also re-use ->parent_exec_id to make
sure exit_notify() sees the right ->xxx_exec_id's when the CLONE_PARENT'ed
task exits.
Also, move down the "p->parent_ex... |
static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len)
{
int n;
if (len < 2)
return -EILSEQ;
n = get_unaligned_be16(data);
data += 2;
len -= 2;
if (len < n)
return -EILSEQ;
BT_DBG("filter len %d", n);
#ifdef CONFIG_BT_BNEP_MC_FILTER
n /= (ETH_ALEN * 2);
if (n > 0) {
int i;
... | 0 | [
"CWE-20",
"CWE-284"
] | linux | 71bb99a02b32b4cc4265118e85f6035ca72923f0 | 68,748,057,514,353,480,000,000,000,000,000,000,000 | 59 | Bluetooth: bnep: bnep_add_connection() should verify that it's dealing with l2cap socket
same story as cmtp
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> |
int php_hash_environment(TSRMLS_D)
{
memset(PG(http_globals), 0, sizeof(PG(http_globals)));
zend_activate_auto_globals(TSRMLS_C);
if (PG(register_argc_argv)) {
php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
}
return SUCCESS;
} | 0 | [] | php-src | 2438490addfbfba51e12246a74588b2382caa08a | 36,604,395,657,825,920,000,000,000,000,000,000,000 | 9 | slim post data |
int hm_addhash(struct cli_matcher *root, const char *hash, uint32_t size, const char *virusname) {
const struct cli_htu32_element *item;
struct cli_sz_hash *szh;
struct cli_htu32 *ht;
enum CLI_HASH_TYPE type;
uint8_t binhash[32];
int hashlen, i;
if(!root || !hash) {
cli_errmsg("hm_addhash:... | 0 | [
"CWE-189"
] | clamav-devel | 4842733eb3f09be61caeed83778bb6679141dbc5 | 24,619,173,633,740,063,000,000,000,000,000,000,000 | 90 | bb#2818 |
static int ntop_interface_is_running(lua_State* vm) {
NetworkInterfaceView *ntop_interface = getCurrentInterface(vm);
ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
if(!ntop_interface) return(CONST_LUA_ERROR);
return(ntop_interface->isRunning());
} | 0 | [
"CWE-254"
] | ntopng | 2e0620be3410f5e22c9aa47e261bc5a12be692c6 | 253,672,735,150,291,750,000,000,000,000,000,000,000 | 8 | Added security fix to avoid escalating privileges to non-privileged users
Many thanks to Dolev Farhi for reporting it |
__u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, __u16 *mssp)
{
const struct iphdr *iph = ip_hdr(skb);
const struct tcphdr *th = tcp_hdr(skb);
int mssind;
const __u16 mss = *mssp;
tcp_synq_overflow(sk);
for (mssind = ARRAY_SIZE(msstab) - 1; mssind ; mssind--)
if (mss >= msstab[mssind])
b... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 105,850,742,378,336,990,000,000,000,000,000,000,000 | 20 | 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 ch... |
struct device *device_find_child(struct device *parent, void *data,
int (*match)(struct device *dev, void *data))
{
struct klist_iter i;
struct device *child;
if (!parent)
return NULL;
klist_iter_init(&parent->p->klist_children, &i);
while ((child = next_device(&i)))
if (match(child, data) && get_device... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 1,510,579,401,978,944,400,000,000,000,000,000,000 | 16 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; } | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 17,206,716,276,728,157,000,000,000,000,000,000,000 | 1 | patch 9.0.0020: with some completion reading past end of string
Problem: With some completion reading past end of string.
Solution: Check the length of the string. |
bool git_path_has_non_ascii(const char *path, size_t pathlen)
{
const uint8_t *scan = (const uint8_t *)path, *end;
for (end = scan + pathlen; scan < end; ++scan)
if (*scan & 0x80)
return true;
return false;
} | 0 | [
"CWE-20",
"CWE-706"
] | libgit2 | 3f7851eadca36a99627ad78cbe56a40d3776ed01 | 198,989,224,236,339,050,000,000,000,000,000,000,000 | 10 | Disallow NTFS Alternate Data Stream attacks, even on Linux/macOS
A little-known feature of NTFS is that it offers to store metadata in
so-called "Alternate Data Streams" (inspired by Apple's "resource
forks") that are copied together with the file they are associated with.
These Alternate Data Streams can be accessed ... |
static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, char __user *optval, int __user *optlen)
{
struct sock *sk = sock->sk;
struct l2cap_chan *chan = l2cap_pi(sk)->chan;
struct bt_security sec;
struct bt_power pwr;
int len, err = 0;
BT_DBG("sk %p", sk);
if (level == SOL_L2CAP)
return... | 0 | [
"CWE-200"
] | linux | 792039c73cf176c8e39a6e8beef2c94ff46522ed | 1,040,279,454,413,603,300,000,000,000,000,000,000 | 96 | Bluetooth: L2CAP - Fix info leak via getsockname()
The L2CAP code fails to initialize the l2_bdaddr_type member of struct
sockaddr_l2 and the padding byte added for alignment. It that for leaks
two bytes kernel stack via the getsockname() syscall. Add an explicit
memset(0) before filling the structure to avoid the inf... |
string to_string(const Statement& s) {
stringstream m;
m << s;
return m.str();
} | 0 | [
"CWE-617"
] | ceph | b3118cabb8060a8cc6a01c4e8264cb18e7b1745a | 326,363,378,555,571,260,000,000,000,000,000,000,000 | 5 | rgw: Remove assertions in IAM Policy
A couple of them could be triggered by user input.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com> |
static int exif_scan_thumbnail(image_info_type *ImageInfo TSRMLS_DC)
{
uchar c, *data = (uchar*)ImageInfo->Thumbnail.data;
int n, marker;
size_t length=2, pos=0;
jpeg_sof_info sof_info;
if (!data) {
return FALSE; /* nothing to do here */
}
if (memcmp(data, "\xFF\xD8\xFF", 3)) ... | 1 | [] | php-src | 64043cb9e5d8bc5af719678893e38ee0290e0c0a | 194,530,688,396,187,700,000,000,000,000,000,000,000 | 80 | Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes) |
int tls1_enc(SSL *s, int send)
{
SSL3_RECORD *rec;
EVP_CIPHER_CTX *ds;
unsigned long l;
int bs,i,ii,j,k,n=0;
const EVP_CIPHER *enc;
if (send)
{
if (EVP_MD_CTX_md(s->write_hash))
{
n=EVP_MD_CTX_size(s->write_hash);
OPENSSL_assert(n >= 0);
}
ds=s->enc_write_ctx;
rec= &(s->s3->wrec);
if (s->e... | 1 | [
"CWE-310"
] | openssl | e5420be6cd09af2550b128575a675490cfba0483 | 54,549,257,450,354,890,000,000,000,000,000,000,000 | 154 | Make CBC decoding constant time.
This patch makes the decoding of SSLv3 and TLS CBC records constant
time. Without this, a timing side-channel can be used to build a padding
oracle and mount Vaudenay's attack.
This patch also disables the stitched AESNI+SHA mode pending a similar
fix to that code.
In order to be eas... |
TargetInfo *qmp_query_target(Error **errp)
{
TargetInfo *info = g_malloc0(sizeof(*info));
info->arch = g_strdup(TARGET_NAME);
return info;
} | 0 | [
"CWE-20"
] | qemu | 0be839a2701369f669532ea5884c15bead1c6e08 | 201,227,945,538,697,960,000,000,000,000,000,000,000 | 8 | migration: fix parameter validation on ram load
During migration, the values read from migration stream during ram load
are not validated. Especially offset in host_from_stream_offset() and
also the length of the writes in the callers of said function.
To fix this, we need to make sure that the [offset, offset + leng... |
static void add_root_to_dirty_list(struct btrfs_root *root)
{
spin_lock(&root->fs_info->trans_lock);
if (test_bit(BTRFS_ROOT_TRACK_DIRTY, &root->state) &&
list_empty(&root->dirty_list)) {
list_add(&root->dirty_list,
&root->fs_info->dirty_cowonly_roots);
}
spin_unlock(&root->fs_info->trans_lock);
} | 0 | [
"CWE-416",
"CWE-362"
] | linux | 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 | 286,916,224,726,093,070,000,000,000,000,000,000,000 | 10 | 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 x... |
FriBidiStrIndex *ass_shaper_reorder(ASS_Shaper *shaper, TextInfo *text_info)
{
int i, ret;
// Initialize reorder map
for (i = 0; i < text_info->length; i++)
shaper->cmap[i] = i;
// Create reorder map line-by-line
for (i = 0; i < text_info->n_lines; i++) {
LineInfo *line = text_info... | 0 | [
"CWE-399"
] | libass | aa54e0b59200a994d50a346b5d7ac818ebcf2d4b | 793,927,646,208,142,300,000,000,000,000,000,000 | 23 | shaper: fix reallocation
Update the variable that tracks the allocated size. This potentially
improves performance and avoid some side effects, which lead to
undefined behavior in some cases.
Fixes fuzzer test case id:000051,sig:11,sync:fuzzer3,src:004221. |
void set_offset(void) {
Window w;
if (! subwin) {
return;
}
X_LOCK;
xtranslate(window, rootwin, 0, 0, &off_x, &off_y, &w, 0);
X_UNLOCK;
} | 0 | [
"CWE-862",
"CWE-284",
"CWE-732"
] | x11vnc | 69eeb9f7baa14ca03b16c9de821f9876def7a36a | 287,800,007,472,450,440,000,000,000,000,000,000,000 | 9 | scan: limit access to shared memory segments to current user |
static void test_date()
{
int rc;
myheader("test_date");
rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_date");
myquery(rc);
rc= mysql_query(mysql, "CREATE TABLE test_date(c1 TIMESTAMP, \
c2 TIME, \
... | 0 | [
"CWE-284",
"CWE-295"
] | mysql-server | 3bd5589e1a5a93f9c224badf983cd65c45215390 | 31,144,247,139,525,074,000,000,000,000,000,000,000 | 18 | WL#6791 : Redefine client --ssl option to imply enforced encryption
# Changed the meaning of the --ssl=1 option of all client binaries
to mean force ssl, not try ssl and fail over to eunecrypted
# Added a new MYSQL_OPT_SSL_ENFORCE mysql_options()
option to specify that an ssl connection is required.
# Added a new macr... |
static int io_recvmsg_prep(struct io_kiocb *req,
const struct io_uring_sqe *sqe)
{
struct io_sr_msg *sr = &req->sr_msg;
struct io_async_ctx *io = req->io;
int ret;
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;
sr->msg_flags = READ_ONCE(sqe->msg_flags);
sr->umsg = u64_to_user_ptr(R... | 0 | [] | linux | 0f2122045b946241a9e549c2a76cea54fa58a7ff | 251,183,152,910,122,570,000,000,000,000,000,000,000 | 31 | io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references
issues due to this, we add a per-task note that keeps track of what
io_uring contexts a task has used. When the tasks execs or exits its
assigned files, we cancel requests based on this tracking.
W... |
static void curr_time(struct timespec *now)
{
static clockid_t clockid = CLOCK_MONOTONIC;
int res = clock_gettime(clockid, now);
if (res == -1 && errno == EINVAL) {
clockid = CLOCK_REALTIME;
res = clock_gettime(clockid, now);
}
if (res == -1) {
perror("fuse: clock_gettime");
... | 0 | [] | ntfs-3g | fb28eef6f1c26170566187c1ab7dc913a13ea43c | 299,917,040,236,583,880,000,000,000,000,000,000,000 | 13 | Hardened the checking of directory offset requested by a readdir
When asked for the next directory entries, make sure the chunk offset
is within valid values, otherwise return no more entries in chunk. |
static int ZEND_FASTCALL ZEND_FETCH_FUNC_ARG_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
return zend_fetch_var_address_helper_SPEC_TMP(ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), EX(opline)->extended_value)?BP_VAR_W:BP_VAR_R, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
} | 0 | [] | php-src | ce96fd6b0761d98353761bf78d5bfb55291179fd | 321,006,825,910,693,870,000,000,000,000,000,000,000 | 4 | - fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus |
static void ecryptfs_free_kmem_caches(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) {
struct ecryptfs_cache_info *info;
info = &ecryptfs_cache_infos[i];
if (*(info->cache))
kmem_cache_destroy(*(info->cache));
}
} | 0 | [
"CWE-362",
"CWE-284",
"CWE-264"
] | linux | 764355487ea220fdc2faf128d577d7f679b91f97 | 176,802,676,083,701,700,000,000,000,000,000,000,000 | 12 | Ecryptfs: Add mount option to check uid of device being mounted = expect uid
Close a TOCTOU race for mounts done via ecryptfs-mount-private. The mount
source (device) can be raced when the ownership test is done in userspace.
Provide Ecryptfs a means to force the uid check at mount time.
Signed-off-by: John Johansen... |
int DeCompress(input_buffer& in, int sz, input_buffer& out)
{
return -1;
} | 0 | [
"CWE-254"
] | mysql-server | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 | 41,147,479,961,402,193,000,000,000,000,000,000,000 | 4 | Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED. |
inline internal::Arg BasicFormatter<Char, AF>::parse_arg_index(const Char *&s) {
const char *error = FMT_NULL;
internal::Arg arg = *s < '0' || *s > '9' ?
next_arg(error) : get_arg(internal::parse_nonnegative_int(s), error);
if (error) {
FMT_THROW(FormatError(
*s != '}' && *s != ':' ? "... | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 319,533,600,706,594,740,000,000,000,000,000,000,000 | 10 | Fix segfault on complex pointer formatting (#642) |
inline void append(char *str, uint length)
{
str_value.append(str, length);
max_length= str_value.numchars() * collation.collation->mbmaxlen;
} | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 154,021,727,736,891,500,000,000,000,000,000,000,000 | 5 | Bug#26361149 MYSQL SERVER CRASHES AT: COL IN(IFNULL(CONST,
COL), NAME_CONST('NAME', NULL))
Backport of Bug#19143243 fix.
NAME_CONST item can return NULL_ITEM type in case of incorrect arguments.
NULL_ITEM has special processing in Item_func_in function.
In Item_func_in::fix_length_and_dec an a... |
int do_signal(struct pt_regs *regs, sigset_t *oldset)
{
siginfo_t info;
int signr;
struct k_sigaction ka;
unsigned short inst;
/*
* We want the common case to go fast, which
* is why we may in certain cases get here from
* kernel mode. Just return without doing anything
* if so.
*/
if (!user_mode(regs)... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 226,567,485,524,037,040,000,000,000,000,000,000,000 | 61 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
DEFUN(mouse, MOUSE, "mouse operation")
{
int btn, x, y;
btn = (unsigned char)getch() - 32;
#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
if (cygwin_mouse_btn_swapped) {
if (btn == MOUSE_BTN2_DOWN)
btn = MOUSE_BTN3_DOWN;
else if (btn == MOUSE_BTN3_DOWN)
btn = MOUSE_BTN2_DOWN;
}
... | 0 | [
"CWE-59",
"CWE-241"
] | w3m | 18dcbadf2771cdb0c18509b14e4e73505b242753 | 207,222,992,897,155,940,000,000,000,000,000,000,000 | 24 | Make temporary directory safely when ~/.w3m is unwritable |
lzw_result lzw_decode_init(
struct lzw_ctx *ctx,
const uint8_t *compressed_data,
uint64_t compressed_data_len,
uint64_t compressed_data_pos,
uint8_t code_size,
const uint8_t ** const stack_base_out,
const uint8_t ** const stack_pos_out)
{
struct lzw_dictionary_entry *table = ctx->table;
/* Initialise t... | 0 | [
"CWE-125",
"CWE-787"
] | chafa | e6ce3746cdcf0836b9dae659a5aed15d73a080d8 | 307,614,722,317,486,470,000,000,000,000,000,000,000 | 34 | libnsgif: fix oob in lzw_decode |
static bool is_float() { return true; }
static bool is_inf(const long double val) {
#ifdef isinf
return (bool)isinf(val);
#else
return !is_nan(val) && (val<cimg::type<half>::min() || val>cimg::type<half>::max());
#endif | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 303,290,809,415,469,940,000,000,000,000,000,000,000 | 7 | Fix other issues in 'CImg<T>::load_bmp()'. |
find_file_in_path(
char_u *ptr, // file name
int len, // length of file name
int options,
int first, // use count'th matching file name
char_u *rel_fname) // file name searching relative to
{
return find_file_in_path_option(ptr, len, options, first,
*curbuf->b_p_path == NUL ? p_path :... | 0 | [
"CWE-122"
] | vim | 615ddd5342b50a6878a907062aa471740bd9a847 | 10,044,201,962,689,020,000,000,000,000,000,000,000 | 11 | patch 8.2.3611: crash when using CTRL-W f without finding a file name
Problem: Crash when using CTRL-W f without finding a file name.
Solution: Bail out when the file name length is zero. |
execute_shell_script (sample, sample_len, command, args, env)
char *sample;
int sample_len;
char *command;
char **args, **env;
{
char *execname, *firstarg;
int i, start, size_increment, larry;
/* Find the name of the interpreter to exec. */
execname = getinterp (sample, sample_len, &i);
s... | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 191,753,506,723,304,500,000,000,000,000,000,000,000 | 47 | bash-4.4-rc2 release |
static struct slave *bond_xmit_activebackup_slave_get(struct bonding *bond,
struct sk_buff *skb)
{
return rcu_dereference(bond->curr_active_slave);
} | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 326,813,951,517,653,500,000,000,000,000,000,000,000 | 5 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
format_and_print_line (const char *prefix, const char *line,
int line_length)
{
int remaining_chars;
char *line_dup, *token;
assert (prefix != NULL);
assert (line != NULL);
assert (line_length > TABULATION);
line_dup = xstrdup (line);
if (printf ("%s", prefix) < 0)
{
xf... | 0 | [
"CWE-200"
] | wget | c125d24762962d91050d925fbbd9e6f30b2302f8 | 211,134,449,700,859,700,000,000,000,000,000,000,000 | 55 | Don't use extended attributes (--xattr) by default
* src/init.c (defaults): Set enable_xattr to false by default
* src/main.c (print_help): Reverse option logic of --xattr
* doc/wget.texi: Add description for --xattr
Users may not be aware that the origin URL and Referer are saved
including credentials, and possibly ... |
check_symlinks(struct archive_write_disk *a)
{
#if !defined(HAVE_LSTAT)
/* Platform doesn't have lstat, so we can't look for symlinks. */
(void)a; /* UNUSED */
return (ARCHIVE_OK);
#else
char *pn;
char c;
int r;
struct stat st;
/*
* Guard against symlink tricks. Reject any archive entry whose
* destinatio... | 0 | [
"CWE-703",
"CWE-22"
] | libarchive | 59357157706d47c365b2227739e17daba3607526 | 35,488,339,281,410,580,000,000,000,000,000,000,000 | 91 | Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
This fixes a directory traversal in the cpio tool. |
static SQInteger base_suspend(HSQUIRRELVM v)
{
return sq_suspendvm(v);
} | 0 | [
"CWE-703",
"CWE-787"
] | squirrel | a6413aa690e0bdfef648c68693349a7b878fe60d | 25,514,878,470,320,765,000,000,000,000,000,000,000 | 4 | fix in thread.call |
rsvg_node_image_set_atts (RsvgNode * self, RsvgHandle * ctx, RsvgPropertyBag * atts)
{
const char *klazz = NULL, *id = NULL, *value;
RsvgNodeImage *image = (RsvgNodeImage *) self;
if (rsvg_property_bag_size (atts)) {
if ((value = rsvg_property_bag_lookup (atts, "x")))
image->x = _rsvg_c... | 0 | [] | librsvg | 34c95743ca692ea0e44778e41a7c0a129363de84 | 125,381,250,414,868,830,000,000,000,000,000,000,000 | 37 | Store node type separately in RsvgNode
The node name (formerly RsvgNode:type) cannot be used to infer
the sub-type of RsvgNode that we're dealing with, since for unknown
elements we put type = node-name. This lead to a (potentially exploitable)
crash e.g. when the element name started with "fe" which tricked
the old c... |
static int teardown(void **state)
{
talloc_free(*state);
return 0;
} | 0 | [
"CWE-125"
] | samba | 45b75db50f5c1a7c8c38af59a62fccee5401c845 | 199,878,893,543,304,320,000,000,000,000,000,000,000 | 5 | CVE-2019-3824 ldb: Add tests for ldb_wildcard_match
Add cmocka tests for ldb_wildcard_match.
Running test_wildcard_match under valgrind reproduces
CVE-2019-3824 out of bounds read in wildcard compare (bug 13773)
valgrind --suppressions=lib/ldb/tests/ldb_match_test.valgrind\
bin/ldb_match_test
BUG: https... |
void ElectronWebContentsUtilityHandlerImpl::OnConnectionError() {
delete this;
} | 0 | [] | electron | e9fa834757f41c0b9fe44a4dffe3d7d437f52d34 | 160,547,897,701,318,130,000,000,000,000,000,000,000 | 3 | fix: ensure ElectronBrowser mojo service is only bound to appropriate render frames (#33344)
* fix: ensure ElectronBrowser mojo service is only bound to authorized render frames
Notes: no-notes
* refactor: extract electron API IPC to its own mojo interface
* fix: just check main frame not primary main frame
... |
std::string t_go_generator::publicize(const std::string& value, bool is_args_or_result) const {
if (value.size() <= 0) {
return value;
}
std::string value2(value), prefix;
string::size_type dot_pos = value.rfind('.');
if (dot_pos != string::npos) {
prefix = value.substr(0, dot_pos + 1) + prefix;
... | 0 | [
"CWE-77"
] | thrift | 2007783e874d524a46b818598a45078448ecc53e | 95,068,789,018,476,530,000,000,000,000,000,000,000 | 47 | THRIFT-3893 Command injection in format_go_output
Client: Go
Patch: Jens Geyer |
static bool is_seccomp_filter_available(void) {
return prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0) < 0 &&
errno == EFAULT;
} | 0 | [] | systemd | b835eeb4ec1dd122b6feff2b70881265c529fcdd | 32,993,761,379,006,504,000,000,000,000,000,000,000 | 4 | shared/seccomp: disallow pkey_mprotect the same as mprotect for W^X mappings (#7295)
MemoryDenyWriteExecution policy could be be bypassed by using pkey_mprotect
instead of mprotect to create an executable writable mapping.
The impact is mitigated by the fact that the man page says "Note that this
feature is fully... |
int tmx_init_pretran_table(void)
{
int n;
int pn;
pn = get_max_procs();
if(pn<=0)
return -1;
if(_tmx_ptran_table!=NULL)
return -1;
/* get the highest power of two less than number of processes */
n = -1;
while (pn >> ++n > 0);
n--;
if(n<=1) n = 2;
if(n>8) n = 8;
_tmx_ptran_size = 1<<n;
_tmx_ptran_ta... | 0 | [
"CWE-119",
"CWE-79",
"CWE-787"
] | kamailio | e1d8008a09d9390ebaf698abe8909e10dfec4097 | 65,958,362,839,936,630,000,000,000,000,000,000,000 | 42 | tmx: allocate space to store ending 0 for branch value
- reported by Alfred Farrugia and Sandro Gauci |
void LibRaw::get_mem_image_format(int* width, int* height, int* colors, int* bps) const
{
if (S.flip & 4) {
*width = S.height;
*height = S.width;
}
else {
*width = S.width;
*height = S.height;
}
*colors = P1.colors;
*bps = O.output_bps;
} | 0 | [
"CWE-129"
] | LibRaw | 89d065424f09b788f443734d44857289489ca9e2 | 189,049,270,756,156,300,000,000,000,000,000,000,000 | 14 | fixed two more problems found by fuzzer |
TPMS_NV_CERTIFY_INFO_Unmarshal(TPMS_NV_CERTIFY_INFO *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = TPM2B_NAME_Unmarshal(&target->indexName, buffer, size);
}
if (rc == TPM_RC_SUCCESS) {
rc = UINT16_Unmarshal(&target->offset, buffer, size);
}
... | 0 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 41,702,047,503,979,560,000,000,000,000,000,000,000 | 15 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
static bool push_int_bigendian(struct asn1_data *data, unsigned int i, bool negative)
{
uint8_t lowest = i & 0xFF;
i = i >> 8;
if (i != 0)
if (!push_int_bigendian(data, i, negative))
return false;
if (data->nesting->start+1 == data->ofs) {
/* We did not write anything yet, looking at the highest
* valu... | 0 | [
"CWE-399"
] | samba | 9d989c9dd7a5b92d0c5d65287935471b83b6e884 | 280,642,064,726,572,900,000,000,000,000,000,000,000 | 39 | CVE-2015-7540: lib: util: Check *every* asn1 return call and early return.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep... |
ImageChecker::~ImageChecker()
{
} | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 275,441,240,619,213,600,000,000,000,000,000,000,000 | 3 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static struct Cookie *dup_cookie(struct Cookie *src)
{
struct Cookie *d = calloc(sizeof(struct Cookie), 1);
if(d) {
CLONE(expirestr);
CLONE(domain);
CLONE(path);
CLONE(spath);
CLONE(name);
CLONE(value);
CLONE(maxage);
CLONE(version);
d->expires = src->expires;
d->tailmatch = ... | 0 | [] | curl | 48d7064a49148f03942380967da739dcde1cdc24 | 158,832,033,564,717,850,000,000,000,000,000,000,000 | 25 | cookie: apply limits
- Send no more than 150 cookies per request
- Cap the max length used for a cookie: header to 8K
- Cap the max number of received Set-Cookie: headers to 50
Bug: https://curl.se/docs/CVE-2022-32205.html
CVE-2022-32205
Reported-by: Harry Sintonen
Closes #9048 |
static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
unsigned char *buf, int idx,
int window)
{
int i, j;
int width = 1 << window;
volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
if (bn_wexpand(b, top) == ... | 0 | [
"CWE-200"
] | openssl | d6482a82bc2228327aa4ba98aeeecd9979542a31 | 244,022,839,145,713,750,000,000,000,000,000,000,000 | 53 | bn/bn_exp.c: constant-time MOD_EXP_CTIME_COPY_FROM_PREBUF.
Performance penalty varies from platform to platform, and even
key length. For rsa2048 sign it was observed to reach almost 10%.
CVE-2016-0702
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org> |
static ssize_t wakeup_last_time_ms_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
s64 msec = 0;
bool enabled = false;
spin_lock_irq(&dev->power.lock);
if (dev->power.wakeup) {
msec = ktime_to_ms(dev->power.wakeup->last_time);
enabled = true;
}
spin_unlock_irq(&dev->power.lock)... | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 45,638,843,620,683,330,000,000,000,000,000,000,000 | 15 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
static bool is_valid_atom_char(struct imap_parser *parser, char chr)
{
const char *error_msg;
if (IS_ATOM_PARSER_INPUT((unsigned char)chr))
error_msg = "Invalid characters in atom";
else if ((chr & 0x80) != 0)
error_msg = "8bit data in atom";
else
return TRUE;
if ((parser->flags & IMAP_PARSE_FLAG_ATOM_ALLC... | 0 | [
"CWE-787"
] | core | 85fcb895ca7f0bcb8ee72047fe0e1e78532ff90b | 86,629,364,890,630,630,000,000,000,000,000,000,000 | 17 | lib-imap: Don't accept strings with NULs
IMAP doesn't allow NULs except in binary literals. We'll still allow them
in regular literals as well, but just not in strings.
This fixes a bug with unescaping a string with NULs: str_unescape() could
have been called for memory that points outside the allocated string,
causi... |
inf_gtk_certificate_manager_class_init(
InfGtkCertificateManagerClass* certificate_manager_class)
{
GObjectClass* object_class;
object_class = G_OBJECT_CLASS(certificate_manager_class);
object_class->dispose = inf_gtk_certificate_manager_dispose;
object_class->finalize = inf_gtk_certificate_manager_finalize;... | 0 | [
"CWE-295"
] | libinfinity | c97f870f5ae13112988d9f8ad464b4f679903706 | 86,261,765,101,895,320,000,000,000,000,000,000,000 | 47 | Fix expired certificate validation (gobby #61) |
inline static int IS_SHA(gnutls_digest_algorithm_t algo)
{
if (algo == GNUTLS_DIG_SHA1 || algo == GNUTLS_DIG_SHA224 ||
algo == GNUTLS_DIG_SHA256 || algo == GNUTLS_DIG_SHA384 ||
algo == GNUTLS_DIG_SHA512)
return 1;
return 0;
} | 0 | [
"CWE-310"
] | gnutls | 8dc2822966f64dd9cf7dde9c7aacd80d49d3ffe5 | 250,025,749,225,435,400,000,000,000,000,000,000,000 | 8 | Fixes to avoid a timing attack in TLS CBC record parsing. |
void vrend_render_condition(struct vrend_context *ctx,
uint32_t handle,
bool condition,
uint mode)
{
struct vrend_query *q;
GLenum glmode = 0;
if (handle == 0) {
if (has_feature(feat_gl_conditional_render))
glEn... | 0 | [
"CWE-787"
] | virglrenderer | cbc8d8b75be360236cada63784046688aeb6d921 | 290,428,400,198,280,500,000,000,000,000,000,000,000 | 48 | vrend: check transfer bounds for negative values too and report error
Closes #138
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com> |
__perf_event_ctx_lock_double(struct perf_event *group_leader,
struct perf_event_context *ctx)
{
struct perf_event_context *gctx;
again:
rcu_read_lock();
gctx = READ_ONCE(group_leader->ctx);
if (!refcount_inc_not_zero(&gctx->refcount)) {
rcu_read_unlock();
goto again;
}
rcu_read_unlock();
mutex_lock... | 0 | [
"CWE-401"
] | tip | 7bdb157cdebbf95a1cd94ed2e01b338714075d00 | 286,061,061,716,443,230,000,000,000,000,000,000,000 | 25 | perf/core: Fix a memory leak in perf_event_parse_addr_filter()
As shown through runtime testing, the "filename" allocation is not
always freed in perf_event_parse_addr_filter().
There are three possible ways that this could happen:
- It could be allocated twice on subsequent iterations through the loop,
- or leake... |
static inline void io_rw_done(struct kiocb *kiocb, ssize_t ret)
{
switch (ret) {
case -EIOCBQUEUED:
break;
case -ERESTARTSYS:
case -ERESTARTNOINTR:
case -ERESTARTNOHAND:
case -ERESTART_RESTARTBLOCK:
/*
* We can't just restart the syscall, since previously
* submitted sqes may already be in progress. Jus... | 0 | [] | linux | 181e448d8709e517c9c7b523fcd209f24eb38ca7 | 190,361,450,739,553,100,000,000,000,000,000,000,000 | 20 | io_uring: async workers should inherit the user creds
If we don't inherit the original task creds, then we can confuse users
like fuse that pass creds in the request header. See link below on
identical aio issue.
Link: https://lore.kernel.org/linux-fsdevel/26f0d78e-99ca-2f1b-78b9-433088053a61@scylladb.com/T/#u
Signed... |
xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
const xmlChar **URI, int *tlen) {
const xmlChar *localname;
const xmlChar *prefix;
const xmlChar *attname;
const xmlChar *aprefix;
const xmlChar *nsname;
xmlChar *attvalue;
const xmlChar **atts = ctxt->atts;
... | 0 | [
"CWE-125"
] | libxml2 | 77404b8b69bc122d12231807abf1a837d121b551 | 300,019,762,304,656,430,000,000,000,000,000,000,000 | 421 | Make sure the parser returns when getting a Stop order
patch backported from chromiun bug fixes, assuming author is Chris |
char *findFillDflt(node_t * n, char *dflt)
{
char *color;
color = late_nnstring(n, N_fillcolor, "");
if (!color[0]) {
/* for backward compatibility, default fill is same as pen */
color = late_nnstring(n, N_color, "");
if (!color[0]) {
color = dflt;
}
}
return color;
} | 0 | [
"CWE-120"
] | graphviz | 784411ca3655c80da0f6025ab20634b2a6ff696b | 11,493,660,598,884,464,000,000,000,000,000,000,000 | 14 | fix: out-of-bounds write on invalid label
When the label for a node cannot be parsed (due to it being malformed), it falls
back on the symbol name of the node itself. I.e. the default label the node
would have had if it had no label attribute at all. However, this is applied by
dynamically altering the node's label to... |
static inline void i740outreg(struct i740fb_par *par, u16 port, u8 reg, u8 val)
{
vga_mm_w_fast(par->regs, port, reg, val);
} | 0 | [
"CWE-369"
] | linux-fbdev | 15cf0b82271b1823fb02ab8c377badba614d95d5 | 110,437,418,048,303,330,000,000,000,000,000,000,000 | 4 | video: fbdev: i740fb: Error out if 'pixclock' equals zero
The userspace program could pass any values to the driver through
ioctl() interface. If the driver doesn't check the value of 'pixclock',
it may cause divide error.
Fix this by checking whether 'pixclock' is zero in the function
i740fb_check_var().
The follow... |
static inline void sctp_sysctl_unregister(void) { return; } | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 267,818,716,895,033,050,000,000,000,000,000,000,000 | 1 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
Ptr<DISOpticalFlow> DISOpticalFlow::create(int preset)
{
Ptr<DISOpticalFlow> dis = makePtr<DISOpticalFlowImpl>();
dis->setPatchSize(8);
if (preset == DISOpticalFlow::PRESET_ULTRAFAST)
{
dis->setFinestScale(2);
dis->setPatchStride(4);
dis->setGradientDescentIterations(12);
... | 0 | [
"CWE-125",
"CWE-369"
] | opencv | d1615ba11a93062b1429fce9f0f638d1572d3418 | 142,263,340,406,563,790,000,000,000,000,000,000,000 | 28 | video:fixed DISOpticalFlow segfault from small img |
EntropyParser::EntropyParser(class Frame *frame,class Scan *scan)
: JKeeper(scan->EnvironOf()), m_pScan(scan), m_pFrame(frame)
{
m_ucCount = scan->ComponentsInScan();
// The residual scan uses all components here, not just four, but
// it does not require the component count either.
for(volatile UBYTE i = 0;... | 0 | [
"CWE-476"
] | libjpeg | ea6315164b1649ff932a396b7600eac4bffcfaba | 237,082,159,650,048,760,000,000,000,000,000,000,000 | 22 | Added a check whether all components in a scan are actually present. |
int dtls_construct_change_cipher_spec(SSL *s)
{
unsigned char *p;
p = (unsigned char *)s->init_buf->data;
*p++ = SSL3_MT_CCS;
s->d1->handshake_write_seq = s->d1->next_handshake_write_seq;
s->init_num = DTLS1_CCS_HEADER_LENGTH;
if (s->version == DTLS1_BAD_VER) {
s->d1->next_handshake_wr... | 0 | [
"CWE-399"
] | openssl | df6b5e29ffea2d5a3e08de92fb765fdb21c7a21e | 240,707,536,824,428,200,000,000,000,000,000,000,000 | 28 | Excessive allocation of memory in dtls1_preprocess_fragment()
This issue is very similar to CVE-2016-6307 described in the previous
commit. The underlying defect is different but the security analysis and
impacts are the same except that it impacts DTLS.
A DTLS message includes 3 bytes for its length in the header fo... |
GetFileDownloadLengthErrResponseMsg()
{
char reason [] = "Path length exceeds PATH_MAX (4096) bytes";
int reasonLen = strlen(reason);
return CreateFileDownloadErrMsg(reason, reasonLen);
} | 0 | [
"CWE-416"
] | libvncserver | 73cb96fec028a576a5a24417b57723b55854ad7b | 283,319,636,088,135,700,000,000,000,000,000,000,000 | 7 | tightvnc-filetransfer: wait for download thread end in CloseUndoneFileDownload()
...and use it when deregistering the file transfer extension.
Closes #242 |
static _Bool check_send_notify_okay (const notification_t *n) /* {{{ */
{
static c_complain_t complain_forwarding = C_COMPLAIN_INIT_STATIC;
_Bool received = 0;
if (n->meta == NULL)
return (1);
received = check_notify_received (n);
if (network_config_forward && received)
{
c_complain_once (LOG_ERR... | 0 | [
"CWE-119",
"CWE-787"
] | collectd | b589096f907052b3a4da2b9ccc9b0e2e888dfc18 | 296,124,922,605,506,880,000,000,000,000,000,000,000 | 24 | network plugin: Fix heap overflow in parse_packet().
Emilien Gaspar has identified a heap overflow in parse_packet(), the
function used by the network plugin to parse incoming network packets.
This is a vulnerability in collectd, though the scope is not clear at
this point. At the very least specially crafted network... |
void CairoImageOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str,
int width, int height, GBool invert,
GBool interpolate, GBool inlineImg)
{
cairo_t *cr;
cairo_surface_t *surface;
double x1, y1, x2, y2;
double *ctm;
double mat[6];
CairoImage *image;
ctm = state->getCTM();
... | 0 | [] | poppler | abf167af8b15e5f3b510275ce619e6fdb42edd40 | 75,337,548,139,063,530,000,000,000,000,000,000,000 | 42 | Implement tiling/patterns in SplashOutputDev
Fixes bug 13518 |
int encode_eobrun( abitwriter* huffw, huffCodes* actbl, unsigned int* eobrun )
{
unsigned short n;
unsigned int s;
int hc;
if ( (*eobrun) > 0 ) {
while ( (*eobrun) > actbl->max_eobrun ) {
huffw->write( actbl->cval[ 0xE0 ], actbl->clen[ 0xE0 ] );
huffw->write( E_ENVLI( ... | 0 | [
"CWE-399",
"CWE-190"
] | lepton | 6a5ceefac1162783fffd9506a3de39c85c725761 | 220,739,242,047,108,950,000,000,000,000,000,000,000 | 26 | fix #111 |
static void _mp_complex_pow(const double r1, const double i1,
const double r2, const double i2,
double *ptrd) {
double ro, io;
if (cimg::abs(i2)<1e-15) { // Exponent is real
if (cimg::abs(r1)<1e-15 && cimg::abs(i1)<1e-1... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 192,289,909,197,195,660,000,000,000,000,000,000,000 | 30 | Fix other issues in 'CImg<T>::load_bmp()'. |
asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
{
audit_syscall_exit(regs);
if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT)))
trace_sys_exit(regs, regs->gprs[2]);
if (test_thread_flag(TIF_SYSCALL_TRACE))
tracehook_report_syscall_exit(regs, 0);
} | 0 | [
"CWE-264",
"CWE-269"
] | linux | dab6cf55f81a6e16b8147aed9a843e1691dcd318 | 209,282,929,128,105,770,000,000,000,000,000,000,000 | 10 | s390/ptrace: fix PSW mask check
The PSW mask check of the PTRACE_POKEUSR_AREA command is incorrect.
The PSW_MASK_USER define contains the PSW_MASK_ASC bits, the ptrace
interface accepts all combinations for the address-space-control
bits. To protect the kernel space the PSW mask check in ptrace needs
to reject the add... |
int jas_image_addcmpt(jas_image_t *image, int cmptno,
jas_image_cmptparm_t *cmptparm)
{
jas_image_cmpt_t *newcmpt;
if (cmptno < 0) {
cmptno = image->numcmpts_;
}
assert(cmptno >= 0 && cmptno <= image->numcmpts_);
if (image->numcmpts_ >= image->maxcmpts_) {
if (jas_image_growcmpts(image, image->maxcmpts_ + 12... | 0 | [
"CWE-415"
] | jasper | b35a05635e56f554870ce85f64293a3868793f69 | 272,830,563,583,847,930,000,000,000,000,000,000,000 | 30 | Fixed potential integer overflow problem. |
void MainWindow::on_actionShowTextUnderIcons_toggled(bool b)
{
ui->mainToolBar->setToolButtonStyle(b? Qt::ToolButtonTextUnderIcon : Qt::ToolButtonIconOnly);
Settings.setTextUnderIcons(b);
} | 0 | [
"CWE-89",
"CWE-327",
"CWE-295"
] | shotcut | f008adc039642307f6ee3378d378cdb842e52c1d | 47,266,290,054,530,500,000,000,000,000,000,000,000 | 5 | fix upgrade check is not using TLS correctly |
xfrm_policy_find_inexact_candidates(struct xfrm_pol_inexact_candidates *cand,
struct xfrm_pol_inexact_bin *b,
const xfrm_address_t *saddr,
const xfrm_address_t *daddr)
{
struct xfrm_pol_inexact_node *n;
u16 family;
if (!b)
return false;
family = b->k.family;
memset(cand, 0, sizeof(*cand... | 0 | [
"CWE-703"
] | linux | f85daf0e725358be78dfd208dea5fd665d8cb901 | 288,781,390,346,362,120,000,000,000,000,000,000,000 | 32 | xfrm: xfrm_policy: fix a possible double xfrm_pols_put() in xfrm_bundle_lookup()
xfrm_policy_lookup() will call xfrm_pol_hold_rcu() to get a refcount of
pols[0]. This refcount can be dropped in xfrm_expand_policies() when
xfrm_expand_policies() return error. pols[0]'s refcount is balanced in
here. But xfrm_bundle_look... |
EndExtend(XtermWidget xw,
XEvent *event, /* must be XButtonEvent */
String *params, /* selections */
Cardinal num_params,
Bool use_cursor_loc)
{
CELL cell;
TScreen *screen = TScreenOf(xw);
TRACE_EVENT("EndExtend", event, params, &num_params);
if (use_cursor_loc) {
cell = screen->cursorp;
... | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 205,058,288,956,931,080,000,000,000,000,000,000,000 | 98 | snapshot of project "xterm", label xterm-365d |
schannel_connect_step1(struct Curl_easy *data, struct connectdata *conn,
int sockindex)
{
ssize_t written = -1;
struct ssl_connect_data *connssl = &conn->ssl[sockindex];
SecBuffer outbuf;
SecBufferDesc outbuf_desc;
SecBuffer inbuf;
SecBufferDesc inbuf_desc;
#ifdef HAS_ALPN
unsigned ... | 1 | [
"CWE-290"
] | curl | b09c8ee15771c614c4bf3ddac893cdb12187c844 | 202,935,941,975,922,900,000,000,000,000,000,000,000 | 574 | vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
To make sure we set and extract the correct session.
Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html
CVE-2021-22890 |
static int pfkey_do_dump(struct pfkey_sock *pfk)
{
struct sadb_msg *hdr;
int rc;
rc = pfk->dump.dump(pfk);
if (rc == -ENOBUFS)
return 0;
if (pfk->dump.skb) {
if (!pfkey_can_dump(&pfk->sk))
return 0;
hdr = (struct sadb_msg *) pfk->dump.skb->data;
hdr->sadb_msg_seq = 0;
hdr->sadb_msg_errno = rc;
pf... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 219,912,585,946,496,700,000,000,000,000,000,000,000 | 24 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
static unsigned int hweight32(unsigned int *w)
{
unsigned int res = *w - ((*w >> 1) & 0x55555555);
res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
res = (res + (res >> 4)) & 0x0F0F0F0F;
res = res + (res >> 8);
return (res + (res >> 16)) & 0x000000FF;
} | 0 | [] | char-misc | 95a69adab9acfc3981c504737a2b6578e4d846ef | 22,432,779,485,939,900,000,000,000,000,000,000,000 | 8 | tools: hv: Netlink source address validation allows DoS
The source code without this patch caused hypervkvpd to exit when it processed
a spoofed Netlink packet which has been sent from an untrusted local user.
Now Netlink messages with a non-zero nl_pid source address are ignored
and a warning is printed into the sysl... |
static inline unsigned short ScaleQuantumToShort(const Quantum quantum)
{
if ((IsNaN(quantum) != MagickFalse) || (quantum <= 0.0))
return(0);
if ((quantum/281479271743489.0) >= 65535.0)
return(65535);
return((unsigned short) (quantum/281479271743489.0+0.5));
} | 0 | [
"CWE-190"
] | ImageMagick | 95d4e94e0353e503b71a53f5e6fad173c7c70c90 | 96,673,458,760,176,460,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1751 |
static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
{
struct nfs4_layoutget *lgp = calldata;
struct inode *inode = lgp->args.inode;
struct nfs_server *server = NFS_SERVER(inode);
struct pnfs_layout_hdr *lo;
struct nfs4_state *state = NULL;
dprintk("--> %s\n", __func__);
if (!nfs4_sequence_do... | 0 | [
"CWE-119",
"CWE-401"
] | linux | 7d3e91a89b7adbc2831334def9e494dd9892f9af | 273,247,016,541,870,340,000,000,000,000,000,000,000 | 43 | NFSv4: Check for buffer length in __nfs4_get_acl_uncached
Commit 1f1ea6c "NFSv4: Fix buffer overflow checking in
__nfs4_get_acl_uncached" accidently dropped the checking for too small
result buffer length.
If someone uses getxattr on "system.nfs4_acl" on an NFSv4 mount
supporting ACLs, the ACL has not been cached and... |
static RList *sections(RBinFile *arch) {
struct r_bin_dex_obj_t *bin = arch->o->bin_obj;
RList *ml = methods (arch);
RBinSection *ptr = NULL;
int ns, fsymsz = 0;
RList *ret = NULL;
RListIter *iter;
RBinSymbol *m;
int fsym = 0;
r_list_foreach (ml, iter, m) {
if (!fsym || m->paddr < fsym) {
fsym = m->paddr... | 0 | [
"CWE-125"
] | radare2 | ead645853a63bf83d8386702cad0cf23b31d7eeb | 160,178,566,252,499,820,000,000,000,000,000,000,000 | 74 | fix #6857 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.