func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
smb2_hdr_assemble(struct smb2_sync_hdr *shdr, __le16 smb2_cmd,
const struct cifs_tcon *tcon)
{
shdr->ProtocolId = SMB2_PROTO_NUMBER;
shdr->StructureSize = cpu_to_le16(64);
shdr->Command = smb2_cmd;
if (tcon && tcon->ses && tcon->ses->server) {
struct TCP_Server_Info *server = tcon->ses->server;
spin_lock(&... | 0 | [
"CWE-476"
] | linux | cabfb3680f78981d26c078a26e5c748531257ebb | 316,641,303,288,834,940,000,000,000,000,000,000,000 | 57 | CIFS: Enable encryption during session setup phase
In order to allow encryption on SMB connection we need to exchange
a session key and generate encryption and decryption keys.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com> |
int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr){
int i; /* Used to iterate through segment-readers */
assert( pCsr->zTerm==0 );
assert( pCsr->nTerm==0 );
assert( pCsr->aDoclist==0 );
assert( pCsr->nDoclist==0 );
pCsr->nAdvance = 0;
pCsr->bRestart = 1;
for(i=0; i<pCsr->... | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 242,081,335,625,814,340,000,000,000,000,000,000,000 | 18 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
uint8_t* SecureElementGetPin( void )
{
return SeNvmCtx.Pin;
} | 0 | [
"CWE-120",
"CWE-787"
] | LoRaMac-node | e3063a91daa7ad8a687223efa63079f0c24568e4 | 83,416,115,967,107,730,000,000,000,000,000,000,000 | 4 | Added received buffer size checks. |
uint64_t codec_delay() const { return codec_delay_; } | 0 | [
"CWE-20"
] | libvpx | f00890eecdf8365ea125ac16769a83aa6b68792d | 83,969,694,843,764,850,000,000,000,000,000,000,000 | 1 | update libwebm to libwebm-1.0.0.27-352-g6ab9fcf
https://chromium.googlesource.com/webm/libwebm/+log/af81f26..6ab9fcf
Change-Id: I9d56e1fbaba9b96404b4fbabefddc1a85b79c25d |
static int check_bytes_and_report(struct kmem_cache *s, struct page *page,
u8 *object, char *what,
u8 *start, unsigned int value, unsigned int bytes)
{
u8 *fault;
u8 *end;
fault = check_bytes(start, value, bytes);
if (!fault)
return 1;
end = start + bytes;
while (end > fault && end[-1] == value)
end--... | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 34,752,816,303,176,280,000,000,000,000,000,000,000 | 23 | remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for
div_long_long_rem and it has the downside that one has to be very careful that
the divide doesn't overflow.
The API is a little akward, as the arguments for the unsigned divide are
signed. The signed version also doesn't handle ... |
xt_hook_ops_alloc(const struct xt_table *table, nf_hookfn *fn)
{
unsigned int hook_mask = table->valid_hooks;
uint8_t i, num_hooks = hweight32(hook_mask);
uint8_t hooknum;
struct nf_hook_ops *ops;
if (!num_hooks)
return ERR_PTR(-EINVAL);
ops = kcalloc(num_hooks, sizeof(*ops), GFP_KERNEL);
if (ops == NULL)
... | 0 | [] | linux | 175e476b8cdf2a4de7432583b49c871345e4f8a1 | 323,880,792,793,635,100,000,000,000,000,000,000,000 | 27 | netfilter: x_tables: Use correct memory barriers.
When a new table value was assigned, it was followed by a write memory
barrier. This ensured that all writes before this point would complete
before any writes after this point. However, to determine whether the
rules are unused, the sequence counter is read. To ensure... |
//! Compute distance to a specified value \newinstance.
CImg<Tfloat> get_distance(const T& value, const unsigned int metric=2) const {
return CImg<Tfloat>(*this,false).distance((Tfloat)value,metric); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 203,208,482,697,422,500,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
static void kvmgt_protect_table_destroy(struct kvmgt_guest_info *info)
{
struct kvmgt_pgfn *p;
struct hlist_node *tmp;
int i;
hash_for_each_safe(info->ptable, i, tmp, p, hnode) {
hash_del(&p->hnode);
kfree(p);
}
} | 0 | [
"CWE-20"
] | linux | 51b00d8509dc69c98740da2ad07308b630d3eb7d | 329,621,668,354,296,800,000,000,000,000,000,000,000 | 11 | drm/i915/gvt: Fix mmap range check
This is to fix missed mmap range check on vGPU bar2 region
and only allow to map vGPU allocated GMADDR range, which means
user space should support sparse mmap to get proper offset for
mmap vGPU aperture. And this takes care of actual pgoff in mmap
request as original code always doe... |
Status InputDatasets(std::vector<const DatasetBase*>* inputs) const override {
return Status::OK();
} | 0 | [
"CWE-476"
] | tensorflow | 02cc160e29d20631de3859c6653184e3f876b9d7 | 93,475,095,361,082,080,000,000,000,000,000,000,000 | 3 | Prevent nullptr deref in SparseTensorSliceDataset
The arguments must determine a valid sparse tensor. This means that when indices are empty then the values must be empty too (and the reverse).
Also added test, by modifying existing test with empty sparse tensor to now run with an invalid sparse tensor input.
PiperO... |
static char *convert_path(const char *argument)
{
/* Convert / to \\ to make Windows paths */
char *winfilename= my_strdup(argument, MYF(MY_FAE));
char *pos, *end;
int length= strlen(argument);
for (pos= winfilename, end= pos+length ; pos < end ; pos++)
{
if (*pos == '/')
{
*pos= '\\';
}
... | 0 | [
"CWE-200"
] | mysql-server | 0dbd5a8797ed4bd18e8b883988fb62177eb0f73f | 163,953,017,973,159,170,000,000,000,000,000,000,000 | 16 | Bug#21973610: BUFFER OVERFLOW ISSUES
Description : Incorrect usage of sprintf/strcpy caused
possible buffer overflow issues at various
places.
Solution : - Fixed mysql_plugin and mysqlshow
- Fixed regex library issues
Reviewed-By : Georgi Kodinov <georgi.kodinov@oracle.com>
Rev... |
static int snd_ctl_elem_add(struct snd_ctl_file *file,
struct snd_ctl_elem_info *info, int replace)
{
struct snd_card *card = file->card;
struct snd_kcontrol kctl, *_kctl;
unsigned int access;
long private_size;
struct user_element *ue;
int idx, err;
if (info->count < 1)
return -EINVAL;
access = info-... | 0 | [
"CWE-190",
"CWE-189"
] | linux | ac902c112d90a89e59916f751c2745f4dbdbb4bd | 241,202,275,544,052,560,000,000,000,000,000,000,000 | 109 | ALSA: control: Handle numid overflow
Each control gets automatically assigned its numids when the control is created.
The allocation is done by incrementing the numid by the amount of allocated
numids per allocation. This means that excessive creation and destruction of
controls (e.g. via SNDRV_CTL_IOCTL_ELEM_ADD/REMO... |
QPDFWriter::setNewlineBeforeEndstream(bool val)
{
this->newline_before_endstream = val;
} | 0 | [
"CWE-399",
"CWE-835"
] | qpdf | 8249a26d69f72b9cda584c14cc3f12769985e481 | 22,834,381,676,459,654,000,000,000,000,000,000,000 | 4 | Fix infinite loop in QPDFWriter (fixes #143) |
e_ews_connection_ref_proxy_resolver (EEwsConnection *cnc)
{
GProxyResolver *proxy_resolver = NULL;
g_return_val_if_fail (E_IS_EWS_CONNECTION (cnc), NULL);
g_mutex_lock (&cnc->priv->property_lock);
if (cnc->priv->proxy_resolver != NULL)
proxy_resolver = g_object_ref (cnc->priv->proxy_resolver);
g_mutex_unlock... | 0 | [
"CWE-295"
] | evolution-ews | 915226eca9454b8b3e5adb6f2fff9698451778de | 120,961,737,789,077,480,000,000,000,000,000,000,000 | 15 | I#27 - SSL Certificates are not validated
This depends on https://gitlab.gnome.org/GNOME/evolution-data-server/commit/6672b8236139bd6ef41ecb915f4c72e2a052dba5 too.
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/27 |
PackBSDElf32x86::~PackBSDElf32x86()
{
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 88,438,324,132,702,330,000,000,000,000,000,000,000 | 3 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
bool CModules::OnPrivCTCP(CNick& Nick, CString& sMessage) {
MODHALTCHK(OnPrivCTCP(Nick, sMessage));
} | 0 | [
"CWE-20",
"CWE-264"
] | znc | 8de9e376ce531fe7f3c8b0aa4876d15b479b7311 | 273,260,933,214,540,200,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 |
void UnLoadModuleForUser(const CString& sLine) {
CString sUsername = sLine.Token(1);
CString sModName = sLine.Token(2);
if (sModName.empty()) {
PutModule(t_s("Usage: UnloadModule <username> <modulename>"));
return;
}
CUser* pUser = FindUser(sUsername... | 0 | [
"CWE-20"
] | znc | 64613bc8b6b4adf1e32231f9844d99cd512b8973 | 241,245,830,907,991,520,000,000,000,000,000,000,000 | 14 | Don't crash if user specified invalid encoding.
This is CVE-2019-9917 |
uint32_t enc_untrusted_ql_set_quote_config(const sgx_ql_config_t *config) {
uint32_t result;
CHECK_OCALL(ocall_enc_untrusted_ql_set_quote_config(
&result, config, config->cert_data_size, config->p_cert_data));
return result;
} | 0 | [
"CWE-200",
"CWE-668"
] | asylo | ecfcd0008b6f8f63c6fa3cc1b62fcd4a52f2c0ad | 291,659,534,409,018,770,000,000,000,000,000,000,000 | 6 | Store untrusted input to enclave variable
The untrusted input pointer should be stored to trusted variable before
checking to avoid unexpected modifications after checking.
PiperOrigin-RevId: 362553830
Change-Id: I743f9bd3487de60269e247d74f2188f2ffc06d01 |
inline void MaxPool(const uint8* input_data, const Dims<4>& input_dims,
int stride_width, int stride_height, int pad_width,
int pad_height, int filter_width, int filter_height,
int32 output_activation_min, int32 output_activation_max,
uint8... | 0 | [
"CWE-703",
"CWE-835"
] | tensorflow | dfa22b348b70bb89d6d6ec0ff53973bacb4f4695 | 178,287,551,069,703,300,000,000,000,000,000,000,000 | 17 | Prevent a division by 0 in average ops.
PiperOrigin-RevId: 385184660
Change-Id: I7affd4554f9b336fca29ac68f633232c094d0bd3 |
xmlSchemaVExpandQName(xmlSchemaValidCtxtPtr vctxt,
const xmlChar *value,
const xmlChar **nsName,
const xmlChar **localName)
{
int ret = 0;
if ((nsName == NULL) || (localName == NULL))
return (-1);
*nsName = NULL;
*localName = NULL;
ret = xmlValidateQName(value, 1);
if (ret =... | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 192,457,749,348,833,200,000,000,000,000,000,000,000 | 57 | 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. |
static void xfrm_hash_transfer(struct hlist_head *list,
struct hlist_head *ndsttable,
struct hlist_head *nsrctable,
struct hlist_head *nspitable,
unsigned int nhashmask)
{
struct hlist_node *tmp;
struct xfrm_state *x;
hlist_for_each_entry_safe(x, tmp, list, bydst) {
unsigne... | 0 | [
"CWE-416"
] | linux | dbb2483b2a46fbaf833cfb5deb5ed9cace9c7399 | 100,191,270,286,337,510,000,000,000,000,000,000,000 | 30 | xfrm: clean up xfrm protocol checks
In commit 6a53b7593233 ("xfrm: check id proto in validate_tmpl()")
I introduced a check for xfrm protocol, but according to Herbert
IPSEC_PROTO_ANY should only be used as a wildcard for lookup, so
it should be removed from validate_tmpl().
And, IPSEC_PROTO_ANY is expected to only m... |
void find_state(ctx_t &ctx)
{
return ctx.dc_opts->stadfa
? find_state_specialized<ctx_t, true>(ctx)
: find_state_specialized<ctx_t, false>(ctx);
} | 0 | [
"CWE-787"
] | re2c | a3473fd7be829cb33907cb08612f955133c70a96 | 85,609,073,277,538,840,000,000,000,000,000,000,000 | 6 | Limit maximum allowed NFA and DFA size.
Instead of failing with an out of memory exception or crashing with a
stack overflow, emit an error message and exit. This is a partial fix
for bug #394 "Stack overflow due to recursion in src/dfa/dead_rules.cc",
where re2c hit stack overflow on a counted repetition regexp with ... |
arch_get_unmapped_area(struct file *filp, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
unsigned long limit;
/* "32 bit" actually means 31 bit, since pointers sign extend. */
if (current->personality & ADDR_LIMIT_32BIT)
limit = 0x80000000;
else
limit = TA... | 0 | [
"CWE-703",
"CWE-264",
"CWE-189"
] | linux | 21c5977a836e399fc710ff2c5367845ed5c2527f | 43,142,341,292,382,330,000,000,000,000,000,000,000 | 45 | alpha: fix several security issues
Fix several security issues in Alpha-specific syscalls. Untested, but
mostly trivial.
1. Signedness issue in osf_getdomainname allows copying out-of-bounds
kernel memory to userland.
2. Signedness issue in osf_sysinfo allows copying large amounts of
kernel memory to userland.
3. ... |
static inline int security_acct(struct file *file)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 35,876,640,721,006,866,000,000,000,000,000,000,000 | 4 | 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... |
int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
unsigned long addr, pgprot_t newprot, int prot_numa)
{
struct mm_struct *mm = vma->vm_mm;
spinlock_t *ptl;
pmd_t entry;
bool preserve_write;
int ret;
ptl = __pmd_trans_huge_lock(pmd, vma);
if (!ptl)
return 0;
preserve_write = prot_numa && pmd_wri... | 0 | [
"CWE-459"
] | linux | eb66ae030829605d61fbef1909ce310e29f78821 | 316,138,053,175,117,200,000,000,000,000,000,000,000 | 81 | mremap: properly flush TLB before releasing the page
Jann Horn points out that our TLB flushing was subtly wrong for the
mremap() case. What makes mremap() special is that we don't follow the
usual "add page to list of pages to be freed, then flush tlb, and then
free pages". No, mremap() obviously just _moves_ the p... |
static void mt_release_contacts(struct hid_device *hid)
{
struct hid_input *hidinput;
struct mt_application *application;
struct mt_device *td = hid_get_drvdata(hid);
list_for_each_entry(hidinput, &hid->inputs, list) {
struct input_dev *input_dev = hidinput->input;
struct input_mt *mt = input_dev->mt;
int i;... | 0 | [
"CWE-787"
] | linux | 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 | 145,385,736,007,589,650,000,000,000,000,000,000,000 | 25 | HID: core: Sanitize event code and type when mapping input
When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmab... |
management_delete_event(void *arg, event_t event)
{
struct multi_context *m = (struct multi_context *) arg;
if (m->mtcp)
{
multi_tcp_delete_event(m->mtcp, event);
}
} | 0 | [
"CWE-362",
"CWE-476"
] | openvpn | 37bc691e7d26ea4eb61a8a434ebd7a9ae76225ab | 37,474,150,959,639,780,000,000,000,000,000,000,000 | 8 | Fix illegal client float (CVE-2020-11810)
There is a time frame between allocating peer-id and initializing data
channel key (which is performed on receiving push request or on async
push-reply) in which the existing peer-id float checks do not work right.
If a "rogue" data channel packet arrives during that time fra... |
struct dentry *lookup_create(struct nameidata *nd, int is_dir)
{
struct dentry *dentry = ERR_PTR(-EEXIST);
mutex_lock_nested(&nd->path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
/*
* Yucky last component or no last component at all?
* (foo/., foo/.., /////)
*/
if (nd->last_type != LAST_NORM)
goto fail;
nd... | 0 | [
"CWE-20",
"CWE-362",
"CWE-416"
] | linux | 86acdca1b63e6890540fa19495cfc708beff3d8b | 224,384,703,470,967,500,000,000,000,000,000,000,000 | 41 | fix autofs/afs/etc. magic mountpoint breakage
We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT)
if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type
is bogus here; we want LAST_BIND for everything of that kind and we
get LAST_NORM left over from finding parent directory.
So make... |
PSI_table_share *handler::ha_table_share_psi() const
{
return table_share->m_psi;
} | 0 | [
"CWE-416"
] | server | af810407f78b7f792a9bb8c47c8c532eb3b3a758 | 218,494,358,990,398,800,000,000,000,000,000,000,000 | 4 | MDEV-28098 incorrect key in "dup value" error after long unique
reset errkey after using it, so that it wouldn't affect
the next error message in the next statement |
void CoreUserInputHandler::handleShowkey(const BufferInfo &bufferInfo, const QString &msg)
{
QString bufname = bufferInfo.bufferName().isNull() ? "" : bufferInfo.bufferName();
#ifdef HAVE_QCA2
if (!bufferInfo.isValid())
return;
if (!Cipher::neededFeaturesAvailable()) {
emit displayMsg(Messa... | 0 | [
"CWE-399"
] | quassel | b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8 | 109,416,396,180,284,130,000,000,000,000,000,000,000 | 40 | Improve the message-splitting algorithm for PRIVMSG and CTCP
This introduces a new message splitting algorithm based on
QTextBoundaryFinder. It works by first starting with the entire
message to be sent, encoding it, and checking to see if it is over
the maximum message length. If it is, it uses QTBF to find the
wor... |
pgtable_t get_pmd_huge_pte(struct mm_struct *mm)
{
pgtable_t pgtable;
assert_spin_locked(&mm->page_table_lock);
/* FIFO */
pgtable = mm->pmd_huge_pte;
if (list_empty(&pgtable->lru))
mm->pmd_huge_pte = NULL;
else {
mm->pmd_huge_pte = list_entry(pgtable->lru.next,
struct page, lru);
list_del(&pgt... | 0 | [
"CWE-399"
] | linux | 78f11a255749d09025f54d4e2df4fbcb031530e2 | 286,133,938,561,851,000,000,000,000,000,000,000,000 | 17 | mm: thp: fix /dev/zero MAP_PRIVATE and vm_flags cleanups
The huge_memory.c THP page fault was allowed to run if vm_ops was null
(which would succeed for /dev/zero MAP_PRIVATE, as the f_op->mmap wouldn't
setup a special vma->vm_ops and it would fallback to regular anonymous
memory) but other THP logics weren't fully ac... |
copy_async_data_free (CopyAsyncData *data)
{
g_object_unref (data->source);
g_object_unref (data->destination);
g_slice_free (CopyAsyncData, data);
} | 0 | [
"CWE-362"
] | glib | d8f8f4d637ce43f8699ba94c9b7648beda0ca174 | 260,214,432,941,243,030,000,000,000,000,000,000,000 | 6 | gfile: Limit access to files when copying
file_copy_fallback creates new files with default permissions and
set the correct permissions after the operation is finished. This
might cause that the files can be accessible by more users during
the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
files to lim... |
static void multipath_dtr(struct dm_target *ti)
{
struct multipath *m = ti->private;
flush_multipath_work(m);
free_multipath(m);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | ec8013beddd717d1740cfefb1a9b900deef85462 | 334,841,983,978,217,540,000,000,000,000,000,000,000 | 7 | dm: do not forward ioctls from logical volumes to the underlying device
A logical volume can map to just part of underlying physical volume.
In this case, it must be treated like a partition.
Based on a patch from Alasdair G Kergon.
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Paolo ... |
static int kvm_dying_cpu(unsigned int cpu)
{
raw_spin_lock(&kvm_count_lock);
if (kvm_usage_count)
hardware_disable_nolock(NULL);
raw_spin_unlock(&kvm_count_lock);
return 0; | 0 | [
"CWE-459"
] | linux | 683412ccf61294d727ead4a73d97397396e69a6b | 192,610,161,975,403,470,000,000,000,000,000,000,000 | 8 | KVM: SEV: add cache flush to solve SEV cache incoherency issues
Flush the CPU caches when memory is reclaimed from an SEV guest (where
reclaim also includes it being unmapped from KVM's memslots). Due to lack
of coherency for SEV encrypted memory, failure to flush results in silent
data corruption if userspace is mal... |
static int inc_block_group_ro(struct btrfs_block_group *cache, int force)
{
struct btrfs_space_info *sinfo = cache->space_info;
u64 num_bytes;
int ret = -ENOSPC;
spin_lock(&sinfo->lock);
spin_lock(&cache->lock);
if (cache->swap_extents) {
ret = -ETXTBSY;
goto out;
}
if (cache->ro) {
cache->ro++;
ret ... | 0 | [
"CWE-703",
"CWE-667"
] | linux | 1cb3db1cf383a3c7dbda1aa0ce748b0958759947 | 164,810,727,000,611,730,000,000,000,000,000,000,000 | 71 | btrfs: fix deadlock with concurrent chunk allocations involving system chunks
When a task attempting to allocate a new chunk verifies that there is not
currently enough free space in the system space_info and there is another
task that allocated a new system chunk but it did not finish yet the
creation of the respecti... |
static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
const struct flowi *fl,
u16 family, u32 if_id)
{
struct xfrm_policy *pol;
rcu_read_lock();
again:
pol = rcu_dereference(sk->sk_policy[dir]);
if (pol != NULL) {
bool match;
int err = 0;
if (pol->family != family) ... | 0 | [
"CWE-703"
] | linux | f85daf0e725358be78dfd208dea5fd665d8cb901 | 194,192,897,472,831,000,000,000,000,000,000,000,000 | 42 | 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... |
ZEND_VM_HOT_SEND_HANDLER(100, ZEND_CHECK_FUNC_ARG, UNUSED, NUM, SPEC(QUICK_ARG))
{
USE_OPLINE
uint32_t arg_num = opline->op2.num;
if (EXPECTED(arg_num <= MAX_ARG_FLAG_NUM)) {
if (QUICK_ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
ZEND_ADD_CALL_FLAG(EX(call), ZEND_CALL_SEND_ARG_BY_REF);
} else {
Z... | 0 | [
"CWE-787"
] | php-src | f1ce8d5f5839cb2069ea37ff424fb96b8cd6932d | 322,917,344,775,755,830,000,000,000,000,000,000,000 | 18 | Fix #73122: Integer Overflow when concatenating strings
We must avoid integer overflows in memory allocations, so we introduce
an additional check in the VM, and bail out in the rare case of an
overflow. Since the recent fix for bug #74960 still doesn't catch all
possible overflows, we fix that right away. |
static unsigned check_binary_integrity(const char* libname, const char* symbol)
{
int ret;
unsigned prev;
char mac_file[GNUTLS_PATH_MAX];
char file[GNUTLS_PATH_MAX];
uint8_t hmac[HMAC_SIZE];
uint8_t new_hmac[HMAC_SIZE];
size_t hmac_size;
gnutls_datum_t data;
ret = get_library_path(libname, symbol, file, sizeo... | 0 | [
"CWE-20"
] | gnutls | b0a3048e56611a2deee4976aeba3b8c0740655a6 | 320,174,822,353,232,900,000,000,000,000,000,000,000 | 67 | env: use secure_getenv when reading environment variables |
int main(int argc, char *argv[]) {
GooString *fileName;
UnicodeMap *uMap;
GooString *ownerPW, *userPW;
PDFDoc *doc;
char uBuf[8];
char path[1024];
char *p;
bool ok;
int exitCode;
GooList *embeddedFiles = nullptr;
int nFiles, nPages, n, i, j;
FileSpec *fileSpec;
Page *page;
Annots *annots;
... | 0 | [
"CWE-476"
] | poppler | d2f5d424ba8752f9a9e9dad410546ec1b46caa0a | 101,517,081,425,217,140,000,000,000,000,000,000,000 | 257 | pdfdetach: Check for valid file name of embedded file before using it to determine save path.
Closes #660 |
static void fnhe_flush_routes(struct fib_nh_exception *fnhe)
{
struct rtable *rt;
rt = rcu_dereference(fnhe->fnhe_rth_input);
if (rt) {
RCU_INIT_POINTER(fnhe->fnhe_rth_input, NULL);
dst_dev_put(&rt->dst);
dst_release(&rt->dst);
}
rt = rcu_dereference(fnhe->fnhe_rth_output);
if (rt) {
RCU_INIT_POINTER(fnh... | 0 | [
"CWE-476"
] | linux | bc3aae2bbac46dd894c89db5d5e98f7f0ef9e205 | 138,755,666,189,021,100,000,000,000,000,000,000,000 | 17 | net: check and errout if res->fi is NULL when RTM_F_FIB_MATCH is set
Syzkaller hit 'general protection fault in fib_dump_info' bug on
commit 4.13-rc5..
Guilty file: net/ipv4/fib_semantics.c
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
Modules linked... |
int tls1_heartbeat(SSL *s)
{
unsigned char *buf, *p;
int ret = -1;
unsigned int payload = 18; /* Sequence number + random bytes */
unsigned int padding = 16; /* Use minimum padding */
/* Only send if peer supports and accepts HB requests... */
if (!(s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLED... | 0 | [
"CWE-190"
] | openssl | a004e72b95835136d3f1ea90517f706c24c03da7 | 301,860,165,283,361,330,000,000,000,000,000,000,000 | 77 | Avoid some undefined pointer arithmetic
A common idiom in the codebase is:
if (p + len > limit)
{
return; /* Too long */
}
Where "p" points to some malloc'd data of SIZE bytes and
limit == p + SIZE
"len" here could be from some externally supplied data (e.g. from a TLS
message).
The rules of C pointer arithmet... |
GF_Err xtra_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
GF_XtraBox *ptr = (GF_XtraBox *)s;
u32 i, count = gf_list_count(ptr->tags);
e = gf_isom_box_write_header(s, bs);
if (e) return e;
for (i=0; i<count; i++) {
GF_XtraTag *tag = gf_list_get(ptr->tags, i);
u32 tag_size = 16;
u32 name_len = tag->nam... | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 218,476,963,407,980,340,000,000,000,000,000,000,000 | 27 | fixed #2255 |
static void tcp_illinois_info(struct sock *sk, u32 ext,
struct sk_buff *skb)
{
const struct illinois *ca = inet_csk_ca(sk);
if (ext & (1 << (INET_DIAG_VEGASINFO - 1))) {
struct tcpvegas_info info = {
.tcpv_enabled = 1,
.tcpv_rttcnt = ca->cnt_rtt,
.tcpv_minrtt = ca->base_rtt,
};
if (info.tcpv... | 0 | [
"CWE-703",
"CWE-189"
] | linux | 8f363b77ee4fbf7c3bbcf5ec2c5ca482d396d664 | 151,746,584,966,825,000,000,000,000,000,000,000,000 | 21 | net: fix divide by zero in tcp algorithm illinois
Reading TCP stats when using TCP Illinois congestion control algorithm
can cause a divide by zero kernel oops.
The division by zero occur in tcp_illinois_info() at:
do_div(t, ca->cnt_rtt);
where ca->cnt_rtt can become zero (when rtt_reset is called)
Steps to Reprodu... |
static int sh_init(struct Curl_hash *hash, int hashsize)
{
return Curl_hash_init(hash, hashsize, hash_fd, fd_key_compare,
sh_freeentry);
} | 0 | [
"CWE-416",
"CWE-295"
] | curl | 7f4a9a9b2a49547eae24d2e19bc5c346e9026479 | 279,303,745,074,847,220,000,000,000,000,000,000,000 | 5 | openssl: associate/detach the transfer from connection
CVE-2021-22901
Bug: https://curl.se/docs/CVE-2021-22901.html |
inline T median(T val0, T val1, T val2, T val3, T val4, T val5, T val6,
T val7, T val8, T val9, T val10, T val11, T val12, T val13,
T val14, T val15, T val16, T val17, T val18, T val19, T val20,
T val21, T val22, T val23, T val24, T val25, T val26, T val27... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 320,729,656,038,658,840,000,000,000,000,000,000,000 | 219 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
change_level( struct net_device *dev )
{
struct net_local *nl = (struct net_local *) dev->priv;
if( nl->delta_rxl == 0 ) /* do not auto-negotiate RxL */
return;
if( nl->cur_rxl_index == 0 )
nl->delta_rxl = 1;
else if( nl->cur_rxl_index == 15 )
nl->delta_rxl = -1;
else if( nl->cur_rxl_rcvd < nl->prev_rxl_... | 0 | [
"CWE-264"
] | linux-2.6 | f2455eb176ac87081bbfc9a44b21c7cd2bc1967e | 31,717,482,014,617,370,000,000,000,000,000,000,000 | 21 | wan: Missing capability checks in sbni_ioctl()
There are missing capability checks in the following code:
1300 static int
1301 sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd)
1302 {
[...]
1319 case SIOCDEVRESINSTATS :
1320 if( current->euid != 0 ) /* root only */
1321 ... |
void config__copy(struct mosquitto__config *src, struct mosquitto__config *dest)
{
mosquitto__free(dest->security_options.acl_file);
dest->security_options.acl_file = src->security_options.acl_file;
dest->security_options.allow_anonymous = src->security_options.allow_anonymous;
dest->security_options.allow_zero_le... | 0 | [
"CWE-200",
"CWE-732",
"CWE-254"
] | mosquitto | 9097577b49b7fdcf45d30975976dd93808ccc0c4 | 62,465,766,418,027,680,000,000,000,000,000,000,000 | 61 | Fix acl_file being ignore for default listener if with per_listener_settings
Close #1073. Thanks to Jef Driesen.
Bug: https://github.com/eclipse/mosquitto/issues/1073 |
static inline void CheckScoreSizes(OpKernelContext* context, int num_boxes,
const Tensor& scores) {
// The shape of 'scores' is [num_boxes]
OP_REQUIRES(context, scores.dims() == 1,
errors::InvalidArgument(
"scores must be 1-D", scores.shape().DebugS... | 0 | [
"CWE-369",
"CWE-681"
] | tensorflow | b5cdbf12ffcaaffecf98f22a6be5a64bb96e4f58 | 205,659,703,565,716,700,000,000,000,000,000,000,000 | 13 | Prevent overflow due to integer conversion to unsigned.
PiperOrigin-RevId: 387738045
Change-Id: Id7e95bc07e02df1c66b72bd09f389608c87bdebe |
DLLIMPORT int cfg_opt_setnint(cfg_opt_t *opt, long int value, unsigned int index)
{
cfg_value_t *val;
if (!opt || opt->type != CFGT_INT) {
errno = EINVAL;
return CFG_FAIL;
}
val = cfg_opt_getval(opt, index);
if (!val)
return CFG_FAIL;
val->number = value;
opt->flags |= CFGF_MODIFIED;
return CFG_SUCCES... | 0 | [] | libconfuse | d73777c2c3566fb2647727bb56d9a2295b81669b | 219,311,858,972,731,070,000,000,000,000,000,000,000 | 18 | Fix #163: unterminated username used with getpwnam()
Signed-off-by: Joachim Wiberg <troglobit@gmail.com> |
win_valid(win_T *win)
{
win_T *wp;
if (win == NULL)
return FALSE;
FOR_ALL_WINDOWS(wp)
if (wp == win)
return TRUE;
return win_valid_popup(win);
} | 0 | [
"CWE-416"
] | vim | ec66c41d84e574baf8009dbc0bd088d2bc5b2421 | 311,032,739,692,405,980,000,000,000,000,000,000,000 | 11 | patch 8.1.2136: using freed memory with autocmd from fuzzer
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closes #5041) |
void zgfx_context_free(ZGFX_CONTEXT* zgfx)
{
free(zgfx);
} | 0 | [
"CWE-119",
"CWE-125",
"CWE-787"
] | FreeRDP | 17c363a5162fd4dc77b1df54e48d7bd9bf6b3be7 | 32,129,550,839,547,520,000,000,000,000,000,000,000 | 4 | Fixed CVE-2018-8784
Thanks to Eyal Itkin from Check Point Software Technologies. |
bool isChannelDirty() const { return resolver_->dirty_channel_; } | 0 | [
"CWE-400"
] | envoy | 542f84c66e9f6479bc31c6f53157c60472b25240 | 261,935,115,398,882,550,000,000,000,000,000,000,000 | 1 | overload: Runtime configurable global connection limits (#147)
Signed-off-by: Tony Allen <tony@allen.gg> |
static int ecryptfs_copy_filename(char **copied_name, size_t *copied_name_size,
const char *name, size_t name_size)
{
int rc = 0;
(*copied_name) = kmalloc((name_size + 1), GFP_KERNEL);
if (!(*copied_name)) {
rc = -ENOMEM;
goto out;
}
memcpy((void *)(*copied_name), (void *)name, name_size);
(*copied_nam... | 0 | [
"CWE-189"
] | linux-2.6 | 8faece5f906725c10e7a1f6caf84452abadbdc7b | 164,020,293,538,235,820,000,000,000,000,000,000,000 | 19 | eCryptfs: Allocate a variable number of pages for file headers
When allocating the memory used to store the eCryptfs header contents, a
single, zeroed page was being allocated with get_zeroed_page().
However, the size of an eCryptfs header is either PAGE_CACHE_SIZE or
ECRYPTFS_MINIMUM_HEADER_EXTENT_SIZE (8192), whiche... |
TEST(ExpressionArrayToObjectTest, ListFormWithDuplicates) {
assertExpectedResults("$arrayToObject",
{{{Value(BSON_ARRAY(BSON_ARRAY("key1" << 2) << BSON_ARRAY("key1" << 3)))},
{Value(BSON("key1" << 3))}}});
} | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 316,964,493,679,918,700,000,000,000,000,000,000,000 | 5 | SERVER-38070 fix infinite loop in agg expression |
__acquires(bitlock)
{
struct va_format vaf;
va_list args;
struct ext4_super_block *es = EXT4_SB(sb)->s_es;
es->s_last_error_ino = cpu_to_le32(ino);
es->s_last_error_block = cpu_to_le64(block);
__save_error_info(sb, function, line);
if (ext4_error_ratelimit(sb)) {
va_start(args, fmt);
vaf.fmt = fmt;
vaf.v... | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 96,618,086,339,407,460,000,000,000,000,000,000,000 | 46 | ext4: fix races between page faults and hole punching
Currently, page faults and hole punching are completely unsynchronized.
This can result in page fault faulting in a page into a range that we
are punching after truncate_pagecache_range() has been called and thus
we can end up with a page mapped to disk blocks that... |
inline size_t WriteWrap::StorageSize() const {
return storage_size_;
} | 0 | [
"CWE-416"
] | node | 7f178663ebffc82c9f8a5a1b6bf2da0c263a30ed | 185,352,613,006,085,130,000,000,000,000,000,000,000 | 3 | src: use unique_ptr for WriteWrap
This commit attempts to avoid a use-after-free error by using unqiue_ptr
and passing a reference to it.
CVE-ID: CVE-2020-8265
Fixes: https://github.com/nodejs-private/node-private/issues/227
PR-URL: https://github.com/nodejs-private/node-private/pull/238
Reviewed-By: Michael Dawson <... |
file_regcomp(file_regex_t *rx, const char *pat, int flags)
{
#ifdef USE_C_LOCALE
rx->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
assert(rx->c_lc_ctype != NULL);
rx->old_lc_ctype = uselocale(rx->c_lc_ctype);
assert(rx->old_lc_ctype != NULL);
#else
rx->old_lc_ctype = setlocale(LC_CTYPE, "C");
#endif
rx->pat = pa... | 0 | [
"CWE-787"
] | file | d65781527c8134a1202b2649695d48d5701ac60b | 14,398,374,130,242,642,000,000,000,000,000,000,000 | 14 | PR/62: spinpx: limit size of file_printable. |
void CLASS ppg_interpolate()
{
int dir[5] = { 1, width, -1, -width, 1 };
int row, col, diff[2], guess[2], c, d, i;
ushort (*pix)[4];
border_interpolate(3);
dcraw_message (DCRAW_VERBOSE,_("PPG interpolation...\n"));
/* Fill in the green layer with gradients and pattern recognition: */
for (row=3; row < he... | 0 | [
"CWE-189"
] | rawstudio | 983bda1f0fa5fa86884381208274198a620f006e | 316,667,285,518,067,780,000,000,000,000,000,000,000 | 50 | Avoid overflow in ljpeg_start(). |
bool can_authenticate()
{
return (acl_user && acl_user->can_authenticate);
} | 0 | [] | mysql-server | 25d1b7e03b9b375a243fabdf0556c063c7282361 | 93,618,815,880,169,610,000,000,000,000,000,000,000 | 4 | Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string |
int vb2_ioctl_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
{
struct video_device *vdev = video_devdata(file);
/* No need to call vb2_queue_is_busy(), anyone can query buffers. */
return vb2_querybuf(vdev->queue, p);
} | 0 | [
"CWE-119",
"CWE-787"
] | linux | 2c1f6951a8a82e6de0d82b1158b5e493fc6c54ab | 150,413,475,416,154,800,000,000,000,000,000,000,000 | 7 | [media] videobuf2-v4l2: Verify planes array in buffer dequeueing
When a buffer is being dequeued using VIDIOC_DQBUF IOCTL, the exact buffer
which will be dequeued is not known until the buffer has been removed from
the queue. The number of planes is specific to a buffer, not to the queue.
This does lead to the situat... |
static int __bsg_write(struct bsg_device *bd, const char __user *buf,
size_t count, ssize_t *bytes_written,
fmode_t has_write_perm)
{
struct bsg_command *bc;
struct request *rq;
int ret, nr_commands;
if (count % sizeof(struct sg_io_v4))
return -EINVAL;
nr_commands = count / sizeof(struct sg_i... | 0 | [
"CWE-399"
] | linux-2.6 | f2f1fa78a155524b849edf359e42a3001ea652c0 | 333,347,811,335,818,330,000,000,000,000,000,000,000 | 53 | Enforce a minimum SG_IO timeout
There's no point in having too short SG_IO timeouts, since if the
command does end up timing out, we'll end up through the reset sequence
that is several seconds long in order to abort the command that timed
out.
As a result, shorter timeouts than a few seconds simply do not make
sense... |
static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_t *field, void *dest)
{
bool status;
pb_istream_t substream;
const pb_field_t* submsg_fields = (const pb_field_t*)field->ptr;
if (!pb_make_string_substream(stream, &substream))
return false;
if (field->p... | 0 | [
"CWE-20",
"CWE-119"
] | nanopb | 4fe23595732b6f1254cfc11a9b8d6da900b55b0c | 38,010,786,344,834,306,000,000,000,000,000,000,000 | 23 | Fix memory leak with oneofs and PB_ENABLE_MALLOC (#615)
Nanopb would leak memory when all of the following conditions were true:
- PB_ENABLE_MALLOC is defined at the compile time
- Message definitions contains an oneof field,
the oneof contains a static submessage, and
the static submessage contains a pointer fiel... |
static void posix_acl_fix_xattr_userns(
struct user_namespace *to, struct user_namespace *from,
void *value, size_t size)
{
struct posix_acl_xattr_header *header = value;
struct posix_acl_xattr_entry *entry = (void *)(header + 1), *end;
int count;
kuid_t uid;
kgid_t gid;
if (!value)
return;
if (size < sizeo... | 0 | [
"CWE-284",
"CWE-285"
] | linux | 497de07d89c1410d76a15bec2bb41f24a2a89f31 | 83,921,277,795,972,310,000,000,000,000,000,000,000 | 38 | tmpfs: clear S_ISGID when setting posix ACLs
This change was missed the tmpfs modification in In CVE-2016-7097
commit 073931017b49 ("posix_acl: Clear SGID bit when setting
file permissions")
It can test by xfstest generic/375, which failed to clear
setgid bit in the following test case on tmpfs:
touch $testfile
c... |
virtual String *val_nodeset(String*) { return 0; } | 0 | [] | mysql-server | f7316aa0c9a3909fc7498e7b95d5d3af044a7e21 | 81,028,922,584,003,290,000,000,000,000,000,000,000 | 1 | 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... |
static void ioat3_cleanup(struct ioat2_dma_chan *ioat)
{
struct ioat_chan_common *chan = &ioat->base;
u64 phys_complete;
spin_lock_bh(&chan->cleanup_lock);
if (ioat3_cleanup_preamble(chan, &phys_complete))
__cleanup(ioat, phys_complete);
if (is_ioat_halted(*chan->completion)) {
u32 chanerr = readl(chan->reg... | 0 | [] | linux | 7bced397510ab569d31de4c70b39e13355046387 | 273,940,896,910,120,760,000,000,000,000,000,000,000 | 21 | net_dma: simple removal
Per commit "77873803363c net_dma: mark broken" net_dma is no longer used
and there is no plan to fix it.
This is the mechanical removal of bits in CONFIG_NET_DMA ifdef guards.
Reverting the remainder of the net_dma induced changes is deferred to
subsequent patches.
Marked for stable due to Ro... |
_checksum_update(struct chksumwork *sumwrk, const void *buff, size_t size)
{
switch (sumwrk->alg) {
case CKSUM_NONE:
break;
case CKSUM_SHA1:
archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
break;
case CKSUM_MD5:
archive_md5_update(&(sumwrk->md5ctx), buff, size);
break;
}
} | 0 | [
"CWE-125"
] | libarchive | fa7438a0ff4033e4741c807394a9af6207940d71 | 105,480,943,920,148,770,000,000,000,000,000,000,000 | 14 | Do something sensible for empty strings to make fuzzers happy. |
VAuditF(const char *f, va_list args)
{
char *prefix;
char buf[1024];
int len;
static char oldbuf[1024];
prefix = AuditPrefix();
len = vsnprintf(buf, sizeof(buf), f, args);
if (len == oldlen && strcmp(buf, oldbuf) == 0) {
/* Message already seen */
nrepeat++;
}
else ... | 0 | [
"CWE-863"
] | xserver | da15c7413916f754708c62c2089265528cd661e2 | 121,714,325,084,695,350,000,000,000,000,000,000,000 | 26 | LogFilePrep: add a comment to the unsafe format string.
CVE-2018-14665 also made it possible to exploit this to access
memory. With -logfile forbidden when running with elevated privileges
this is no longer an issue.
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry... |
int ha_myisam::delete_all_rows()
{
return mi_delete_all_rows(file);
} | 0 | [
"CWE-362"
] | mysql-server | 4e5473862e6852b0f3802b0cd0c6fa10b5253291 | 233,258,050,720,102,130,000,000,000,000,000,000,000 | 4 | Bug#24388746: PRIVILEGE ESCALATION AND RACE CONDITION USING CREATE TABLE
During REPAIR TABLE of a MyISAM table, a temporary data file (.TMD)
is created. When repair finishes, this file is renamed to the original
.MYD file. The problem was that during this rename, we copied the
stats from the old file to the new file w... |
bool pushable_cond_checker_for_derived(uchar *arg)
{
return excl_dep_on_table(*((table_map *)arg));
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 244,100,615,888,381,830,000,000,000,000,000,000,000 | 4 | MDEV-26402: A SEGV in Item_field::used_tables/update_depend_map_for_order...
When doing condition pushdown from HAVING into WHERE,
Item_equal::create_pushable_equalities() calls
item->set_extraction_flag(IMMUTABLE_FL) for constant items.
Then, Item::cleanup_excluding_immutables_processor() checks for this flag
to see ... |
int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode)
{
struct p9_stat_dotl *st;
struct v9fs_session_info *v9ses;
unsigned int flags;
v9ses = v9fs_inode2v9ses(inode);
st = p9_client_getattr_dotl(fid, P9_STATS_ALL);
if (IS_ERR(st))
return PTR_ERR(st);
/*
* Don't update inode if the file type i... | 0 | [
"CWE-835"
] | linux | 5e3cc1ee1405a7eb3487ed24f786dec01b4cbe1f | 259,390,511,260,903,240,000,000,000,000,000,000,000 | 27 | 9p: use inode->i_lock to protect i_size_write() under 32-bit
Use inode->i_lock to protect i_size_write(), else i_size_read() in
generic_fillattr() may loop infinitely in read_seqcount_begin() when
multiple processes invoke v9fs_vfs_getattr() or v9fs_vfs_getattr_dotl()
simultaneously under 32-bit SMP environment, and a... |
static int smack_unix_stream_connect(struct sock *sock,
struct sock *other, struct sock *newsk)
{
struct smack_known *skp;
struct smack_known *okp;
struct socket_smack *ssp = sock->sk_security;
struct socket_smack *osp = other->sk_security;
struct socket_smack *nsp = newsk->sk_security;
struct smk_audit_... | 0 | [
"CWE-416"
] | linux | a3727a8bac0a9e77c70820655fd8715523ba3db7 | 178,599,522,582,501,070,000,000,000,000,000,000,000 | 42 | selinux,smack: fix subjective/objective credential use mixups
Jann Horn reported a problem with commit eb1231f73c4d ("selinux:
clarify task subjective and objective credentials") where some LSM
hooks were attempting to access the subjective credentials of a task
other than the current task. Generally speaking, it is ... |
static int mem_open(struct inode* inode, struct file* file)
{
file->private_data = (void*)((long)current->self_exec_id);
/* OK to pass negative loff_t, we can catch out-of-range */
file->f_mode |= FMODE_UNSIGNED_OFFSET;
return 0;
} | 0 | [] | linux | 0499680a42141d86417a8fbaa8c8db806bea1201 | 307,608,507,854,618,300,000,000,000,000,000,000,000 | 7 | procfs: add hidepid= and gid= mount options
Add support for mount options to restrict access to /proc/PID/
directories. The default backward-compatible "relaxed" behaviour is left
untouched.
The first mount option is called "hidepid" and its value defines how much
info about processes we want to be available for non... |
void recvClientFinished(
bool writes = true,
folly::SocketAddress* peerAddress = nullptr,
QuicVersion version = QuicVersion::MVFST) {
auto finished = IOBuf::copyBuffer("FINISHED");
auto nextPacketNum = clientNextHandshakePacketNum++;
auto headerCipher = test::createNoOpHeaderCipher();
... | 0 | [
"CWE-617",
"CWE-703"
] | mvfst | a67083ff4b8dcbb7ee2839da6338032030d712b0 | 83,835,555,363,016,390,000,000,000,000,000,000,000 | 28 | Close connection if we derive an extra 1-rtt write cipher
Summary: Fixes CVE-2021-24029
Reviewed By: mjoras, lnicco
Differential Revision: D26613890
fbshipit-source-id: 19bb2be2c731808144e1a074ece313fba11f1945 |
R_API RBinSymbol *r_bin_get_symbol_at_paddr(RBin *bin, ut64 addr) {
//use skiplist here
RList *symbols = r_bin_get_symbols (bin);
RListIter *iter;
RBinSymbol *symbol;
r_list_foreach (symbols, iter, symbol) {
if (symbol->paddr == addr) {
return symbol;
}
}
return NULL;
} | 0 | [
"CWE-125"
] | radare2 | d31c4d3cbdbe01ea3ded16a584de94149ecd31d9 | 278,540,006,597,557,400,000,000,000,000,000,000,000 | 12 | Fix #8748 - Fix oobread on string search |
static void virtio_gpu_handle_ctrl_cb(VirtIODevice *vdev, VirtQueue *vq)
{
VirtIOGPU *g = VIRTIO_GPU(vdev);
qemu_bh_schedule(g->ctrl_bh);
} | 0 | [] | qemu | acfc4846508a02cc4c83aa27799fd74ac280bdb2 | 80,911,829,121,634,060,000,000,000,000,000,000,000 | 5 | virtio-gpu: use VIRTIO_GPU_MAX_SCANOUTS
The value is defined in virtio_gpu.h already (changing from 4 to 16).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 1463653560-26958-6-git-send-email-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
min (int a, int b) {
return a < b ? a : b;
} | 0 | [
"CWE-787"
] | libvncserver | aac95a9dcf4bbba87b76c72706c3221a842ca433 | 205,225,869,235,629,000,000,000,000,000,000,000,000 | 3 | fix overflow and refactor websockets decode (Hybi)
fix critical heap-based buffer overflow which allowed easy modification
of a return address via an overwritten function pointer
fix bug causing connections to fail due a "one websocket frame = one
ws_read" assumption, which failed with LibVNCServer-0.9.11
refactor w... |
auth_request_set_password(struct auth_request *request, const char *value,
const char *default_scheme, bool noscheme)
{
if (request->passdb_password != NULL) {
e_error(authdb_event(request),
"Multiple password values not supported");
return;
}
/* if the password starts with '{' it most likely contains
... | 0 | [
"CWE-284"
] | core | 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 | 296,004,270,249,825,600,000,000,000,000,000,000,000 | 22 | auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter fro... |
cpuFeatures_t Sys_GetProcessorFeatures( void )
{
cpuFeatures_t features = 0;
#ifndef DEDICATED
if( SDL_HasRDTSC( ) ) features |= CF_RDTSC;
if( SDL_HasMMX( ) ) features |= CF_MMX;
if( SDL_HasMMXExt( ) ) features |= CF_MMX_EXT;
if( SDL_Has3DNow( ) ) features |= CF_3DNOW;
if( SDL_Has3DNowExt( ) ) featu... | 0 | [
"CWE-59"
] | ioq3 | b5acc31a4da72cc3a4a6d88facb15b6214d745c6 | 268,500,527,203,958,220,000,000,000,000,000,000,000 | 17 | CVE-2012-3345 |
static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
{
struct user *dummy = NULL;
addr_t offset;
if (addr < (addr_t) &dummy->regs.acrs) {
/*
* psw and gprs are stored on the stack
*/
if (addr == (addr_t) &dummy->regs.psw.mask &&
#ifdef CONFIG_COMPAT
data != PSW_MASK_MERGE(psw_... | 0 | [
"CWE-399"
] | linux-2.6 | 3d6e48f43340343d97839eadb1ab7b6a3ea98797 | 321,512,267,718,254,500,000,000,000,000,000,000,000 | 78 | [S390] CVE-2008-1514: prevent ptrace padding area read/write in 31-bit mode
When running a 31-bit ptrace, on either an s390 or s390x kernel,
reads and writes into a padding area in struct user_regs_struct32
will result in a kernel panic.
This is also known as CVE-2008-1514.
Test case available here:
http://sources.r... |
process_extended_statvfs(u_int32_t id)
{
char *path;
struct statvfs st;
int r;
if ((r = sshbuf_get_cstring(iqueue, &path, NULL)) != 0)
fatal("%s: buffer error: %s", __func__, ssh_err(r));
debug3("request %u: statvfs", id);
logit("statvfs \"%s\"", path);
if (statvfs(path, &st) != 0)
send_status(id, errno_to... | 0 | [
"CWE-732",
"CWE-703",
"CWE-269"
] | src | a6981567e8e215acc1ef690c8dbb30f2d9b00a19 | 82,717,992,659,996,440,000,000,000,000,000,000,000 | 17 | disallow creation (of empty files) in read-only mode; reported by
Michal Zalewski, feedback & ok deraadt@ |
static int kex_agree_mac(LIBSSH2_SESSION * session,
libssh2_endpoint_data * endpoint, unsigned char *mac,
unsigned long mac_len)
{
const LIBSSH2_MAC_METHOD **macp = _libssh2_mac_methods();
unsigned char *s;
(void) session;
if (endpoint->mac_prefs) {
... | 0 | [
"CWE-200"
] | libssh2 | ca5222ea819cc5ed797860070b4c6c1aeeb28420 | 240,804,494,202,800,400,000,000,000,000,000,000,000 | 47 | diffie_hellman_sha256: convert bytes to bits
As otherwise we get far too small numbers.
Reported-by: Andreas Schneider
CVE-2016-0787 |
MaybeLocal<Value> GetCipherName(Environment* env, const SSL_CIPHER* cipher) {
return GetCipherValue(env, cipher, SSL_CIPHER_get_name);
} | 0 | [
"CWE-295"
] | node | 466e5415a2b7b3574ab5403acb87e89a94a980d1 | 77,274,585,244,466,350,000,000,000,000,000,000,000 | 3 | crypto,tls: implement safe x509 GeneralName format
This change introduces JSON-compatible escaping rules for strings that
include X.509 GeneralName components (see RFC 5280). This non-standard
format avoids ambiguities and prevents injection attacks that could
previously lead to X.509 certificates being accepted even ... |
static struct mm_struct * mm_init(struct mm_struct * mm, struct task_struct *p)
{
atomic_set(&mm->mm_users, 1);
atomic_set(&mm->mm_count, 1);
init_rwsem(&mm->mmap_sem);
INIT_LIST_HEAD(&mm->mmlist);
mm->flags = (current->mm) ?
(current->mm->flags & MMF_INIT_MASK) : default_dump_filter;
mm->core_state = NULL;
mm... | 0 | [
"CWE-20"
] | linux | f106eee10038c2ee5b6056aaf3f6d5229be6dcdd | 106,852,011,745,840,500,000,000,000,000,000,000,000 | 26 | pids: fix fork_idle() to setup ->pids correctly
copy_process(pid => &init_struct_pid) doesn't do attach_pid/etc.
It shouldn't, but this means that the idle threads run with the wrong
pids copied from the caller's task_struct. In x86 case the caller is
either kernel_init() thread or keventd.
In particular, this means... |
static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
unsigned char **eoc,
unsigned int *cls,
unsigned int *con,
unsigned int *tag)
{
unsigned int def, len;
if (!asn1_id_decode(ctx, cls, con, tag))
return 0;
def = len = 0;
if (!asn1_length_decode(ctx, &def, &len))
return 0;
/* pr... | 0 | [
"CWE-119"
] | linux-2.6 | ddb2c43594f22843e9f3153da151deaba1a834c5 | 23,094,602,562,158,224,000,000,000,000,000,000,000 | 25 | asn1: additional sanity checking during BER decoding
- Don't trust a length which is greater than the working buffer.
An invalid length could cause overflow when calculating buffer size
for decoding oid.
- An oid length of zero is invalid and allows for an off-by-one error when
decoding oid because the first su... |
njs_typed_array_prototype_sort(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t unused)
{
u_char *base, *orig;
int64_t length;
uint32_t element_size;
njs_value_t *this, *comparefn;
njs_typed_array_t ... | 0 | [
"CWE-703"
] | njs | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | 167,958,834,162,136,080,000,000,000,000,000,000,000 | 127 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. |
Network::ListenSocketFactory& listenSocketFactory() override { return *socket_factory_; } | 0 | [
"CWE-400"
] | envoy | dfddb529e914d794ac552e906b13d71233609bf7 | 128,906,757,946,039,320,000,000,000,000,000,000,000 | 1 | listener: Add configurable accepted connection limits (#153)
Add support for per-listener limits on accepted connections.
Signed-off-by: Tony Allen <tony@allen.gg> |
**/
CImg<T>& operator%=(const char *const expression) {
return *this%=(+*this)._fill(expression,true,1,0,0,"operator%=",this); | 0 | [
"CWE-119",
"CWE-787"
] | CImg | ac8003393569aba51048c9d67e1491559877b1d1 | 191,948,606,260,042,570,000,000,000,000,000,000,000 | 3 | . |
bool ConnectionManagerImpl::ActiveStreamFilterBase::commonHandleAfterDataCallback(
FilterDataStatus status, Buffer::Instance& provided_data, bool& buffer_was_streaming) {
if (status == FilterDataStatus::Continue) {
if (iteration_state_ == IterationState::StopSingleIteration) {
commonHandleBufferData(pr... | 0 | [
"CWE-400",
"CWE-703"
] | envoy | afc39bea36fd436e54262f150c009e8d72db5014 | 46,761,310,488,051,570,000,000,000,000,000,000,000 | 30 | Track byteSize of HeaderMap internally.
Introduces a cached byte size updated internally in HeaderMap. The value
is stored as an optional, and is cleared whenever a non-const pointer or
reference to a HeaderEntry is accessed. The cached value can be set with
refreshByteSize() which performs an iteration over the Heade... |
enum nss_status _nss_mymachines_getgrnam_r(
const char *name,
struct group *gr,
char *buffer, size_t buflen,
int *errnop) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_bus_message_unref_ sd_bus_message* reply ... | 0 | [
"CWE-415",
"CWE-119"
] | systemd | cb31827d62066a04b02111df3052949fda4b6888 | 206,841,567,663,729,940,000,000,000,000,000,000,000 | 86 | nss-mymachines: do not allow overlong machine names
https://github.com/systemd/systemd/issues/2002 |
check_composite_glyphs (const cairo_composite_rectangles_t *extents,
cairo_scaled_font_t *scaled_font,
cairo_glyph_t *glyphs,
int *num_glyphs)
{
return CAIRO_STATUS_SUCCESS;
} | 0 | [
"CWE-787"
] | cairo | c986a7310bb06582b7d8a566d5f007ba4e5e75bf | 263,828,491,998,441,620,000,000,000,000,000,000,000 | 7 | image: Enable inplace compositing with opacities for general routines
On a SNB i5-2500:
Speedups
========
firefox-chalkboard 34284.16 -> 19637.40: 1.74x speedup
swfdec-giant-steps 778.35 -> 665.37: 1.17x speedup
ocitysmap 485.64 -> 431.94: 1.12x speedup
Slowdowns
===... |
__printf_funct_t print_sar_restart(int *tab, int action, char *cur_date, char *cur_time,
int utc, struct file_header *file_hdr)
{
char restart[64];
printf("\n%-11s", cur_time);
sprintf(restart, " LINUX RESTART\t(%d CPU)\n",
file_hdr->sa_cpu_nr > 1 ? file_hdr->sa_cpu_nr - 1 : 1);
cprintf_s(IS_RESTART, "%s"... | 0 | [
"CWE-125"
] | sysstat | fbc691eaaa10d0bcea6741d5a223dc3906106548 | 260,399,495,003,315,660,000,000,000,000,000,000,000 | 11 | Fix #196 and #199: Out of bound reads security issues
Check args before calling memmove() and memset() in remap_struct()
function to avoid out of bound reads which would possibly lead to
unknown code execution and/or sadf command crash.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com> |
static void *fastrpc_kmap(struct dma_buf *dmabuf, unsigned long pgnum)
{
struct fastrpc_buf *buf = dmabuf->priv;
return buf->virt ? buf->virt + pgnum * PAGE_SIZE : NULL;
} | 0 | [
"CWE-400",
"CWE-401"
] | linux | fc739a058d99c9297ef6bfd923b809d85855b9a9 | 112,329,327,973,417,800,000,000,000,000,000,000,000 | 6 | misc: fastrpc: prevent memory leak in fastrpc_dma_buf_attach
In fastrpc_dma_buf_attach if dma_get_sgtable fails the allocated memory
for a should be released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Link: https://lore.kernel.org/r/20190925152742.16258-1-navid.emamdoost@gmail.com
Signed-off-by: Greg... |
int is_staging_gitmodules_ok(void)
{
return !gitmodules_is_modified;
} | 0 | [] | git | a8dee3ca610f5a1d403634492136c887f83b59d2 | 318,637,709,325,703,120,000,000,000,000,000,000,000 | 4 | Disallow dubiously-nested submodule git directories
Currently it is technically possible to let a submodule's git
directory point right into the git dir of a sibling submodule.
Example: the git directories of two submodules with the names `hippo`
and `hippo/hooks` would be `.git/modules/hippo/` and
`.git/modules/hipp... |
static TValue *trace_exit_cp(lua_State *L, lua_CFunction dummy, void *ud)
{
ExitDataCP *exd = (ExitDataCP *)ud;
cframe_errfunc(L->cframe) = -1; /* Inherit error function. */
/* Always catch error here. */
cframe_nres(L->cframe) = -2*LUAI_MAXSTACK*(int)sizeof(TValue);
exd->pc = lj_snap_restore(exd->J, exd->ex... | 1 | [
"CWE-125"
] | LuaJIT | e296f56b825c688c3530a981dc6b495d972f3d01 | 172,174,871,306,683,640,000,000,000,000,000,000,000 | 10 | Call error function on rethrow after trace exit. |
PHP_FUNCTION(radius_get_vendor_attr)
{
const void *data, *raw;
int len;
u_int32_t vendor;
unsigned char type;
size_t data_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &raw, &len) == FAILURE) {
return;
}
if (rad_get_vendor_attr(&vendor, &type, &data, &data_len, raw, len) == -1) {
RETURN_F... | 0 | [
"CWE-119",
"CWE-787"
] | php-radius | 13c149b051f82b709e8d7cc32111e84b49d57234 | 127,025,569,435,263,470,000,000,000,000,000,000,000 | 23 | Fix a security issue in radius_get_vendor_attr().
The underlying rad_get_vendor_attr() function assumed that it would always be
given valid VSA data. Indeed, the buffer length wasn't even passed in; the
assumption was that the length field within the VSA structure would be valid.
This could result in denial of servic... |
static size_t WritePSDChannel(const PSDInfo *psd_info,
const ImageInfo *image_info,Image *image,Image *next_image,
const QuantumType quantum_type, unsigned char *compact_pixels,
MagickOffsetType size_offset,const MagickBooleanType separate,
const CompressionType compression,ExceptionInfo *exception)
{
MagickB... | 0 | [
"CWE-399",
"CWE-401"
] | ImageMagick | 8a43abefb38c5e29138e1c9c515b313363541c06 | 13,451,907,887,869,636,000,000,000,000,000,000,000 | 132 | https://github.com/ImageMagick/ImageMagick/issues/1451 |
STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; } | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 172,677,173,100,636,870,000,000,000,000,000,000,000 | 1 | stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.
Fixes issue #1178. |
int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring)
{
struct wireless_dev *wdev = wil->wdev;
struct net_device *ndev = wil_to_ndev(wil);
struct wmi_cfg_rx_chain_cmd cmd = {
.action = WMI_RX_CHAIN_ADD,
.rx_sw_ring = {
.max_mpdu_size = cpu_to_le16(
wil_mtu2macbuf(wil->rx_buf_len)),
.ring_... | 0 | [
"CWE-119"
] | linux | b5a8ffcae4103a9d823ea3aa3a761f65779fbe2a | 63,577,220,352,936,760,000,000,000,000,000,000,000 | 62 | wil6210: missing length check in wmi_set_ie
Add a length check in wmi_set_ie to detect unsigned integer
overflow.
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com> |
_cimg_math_parser(const char *const expression, const char *const funcname=0,
const CImg<T>& img_input=CImg<T>::const_empty(), CImg<T> *const img_output=0,
CImgList<T> *const list_images=0, const bool _is_fill=false):
code(_code),code_begin_t(_code_begin_t),... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 154,660,243,746,788,630,000,000,000,000,000,000,000 | 116 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
void qemu_input_event_send_impl(QemuConsole *src, InputEvent *evt)
{
QemuInputHandlerState *s;
qemu_input_event_trace(src, evt);
/* pre processing */
if (graphic_rotate && (evt->type == INPUT_EVENT_KIND_ABS)) {
qemu_input_transform_abs_rotate(evt);
}
/* send event */
s = qemu_... | 0 | [
"CWE-772"
] | qemu | fa18f36a461984eae50ab957e47ec78dae3c14fc | 271,058,347,677,734,700,000,000,000,000,000,000,000 | 19 | input: limit kbd queue depth
Apply a limit to the number of items we accept into the keyboard queue.
Impact: Without this limit vnc clients can exhaust host memory by
sending keyboard events faster than qemu feeds them to the guest.
Fixes: CVE-2017-8379
Cc: P J P <ppandit@redhat.com>
Cc: Huawei PSIRT <PSIRT@huawei.c... |
MagickExport MagickBooleanType ContrastImage(Image *image,
const MagickBooleanType sharpen,ExceptionInfo *exception)
{
#define ContrastImageTag "Contrast/Image"
CacheView
*image_view;
int
sign;
MagickBooleanType
status;
MagickOffsetType
progress;
register ssize_t
i;
ssize_t
... | 0 | [
"CWE-399",
"CWE-119",
"CWE-787"
] | ImageMagick | d4fc44b58a14f76b1ac997517d742ee12c9dc5d3 | 119,932,132,385,380,470,000,000,000,000,000,000,000 | 114 | https://github.com/ImageMagick/ImageMagick/issues/1611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.