func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void sched_dl_do_global(void)
{
u64 new_bw = -1;
struct dl_bw *dl_b;
int cpu;
unsigned long flags;
def_dl_bandwidth.dl_period = global_rt_period();
def_dl_bandwidth.dl_runtime = global_rt_runtime();
if (global_rt_runtime() != RUNTIME_INF)
new_bw = to_ratio(global_rt_period(), global_rt_runtime());
/... | 0 | [
"CWE-119"
] | linux | 29d6455178a09e1dc340380c582b13356227e8df | 242,842,446,570,539,300,000,000,000,000,000,000,000 | 27 | sched: panic on corrupted stack end
Until now, hitting this BUG_ON caused a recursive oops (because oops
handling involves do_exit(), which calls into the scheduler, which in
turn raises an oops), which caused stuff below the stack to be
overwritten until a panic happened (e.g. via an oops in interrupt
context, cause... |
static void frag_kfree_skb(struct netns_frags *nf, struct sk_buff *skb)
{
atomic_sub(skb->truesize, &nf->mem);
kfree_skb(skb);
} | 1 | [] | linux-2.6 | 70789d7052239992824628db8133de08dc78e593 | 201,230,590,527,016,160,000,000,000,000,000,000,000 | 5 | ipv6: discard overlapping fragment
RFC5722 prohibits reassembling fragments when some data overlaps.
Bug spotted by Zhang Zuotao <zuotao.zhang@6wind.com>.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
DxfData::DxfData()
{
} | 0 | [
"CWE-703"
] | openscad | 770e3234cbfe66edbc0333f796b46d36a74aa652 | 183,769,142,566,815,850,000,000,000,000,000,000,000 | 3 | add safety to line lookups in DXF import, fixes #4037
Add safety (test for, and continue past, bad indices).
Report warnings about bad indices
Add variables just to make the array indices easier to read and debug. |
static unsigned int cnt_l_zeroes(const unsigned int bits)
{
spice_extra_assert(bits != 0);
#if defined(__GNUC__) && __GNUC__ >= 4
return __builtin_clz(bits);
#else
if (bits & 0xff800000) {
return lzeroes[bits >> 24];
} else if (bits & 0xffff8000) {
return 8 + lzeroes[(bits >> 16) & 0x000... | 0 | [] | spice-common | 762e0abae36033ccde658fd52d3235887b60862d | 159,263,708,491,263,120,000,000,000,000,000,000,000 | 17 | quic: Check we have some data to start decoding quic image
All paths already pass some data to quic_decode_begin but for the
test check it, it's not that expensive test.
Checking for not 0 is enough, all other words will potentially be
read calling more_io_words but we need one to avoid a potential
initial buffer over... |
static BOOL rdp_write_nsc_server_capability_container(wStream* s, const rdpSettings* settings)
{
WINPR_UNUSED(settings);
if (!Stream_EnsureRemainingCapacity(s, 8))
return FALSE;
Stream_Write_UINT16(s, 4); /* codecPropertiesLength */
Stream_Write_UINT32(s, 0); /* reserved */
return TRUE;
} | 0 | [
"CWE-119",
"CWE-125"
] | FreeRDP | 3627aaf7d289315b614a584afb388f04abfb5bbf | 60,725,325,689,248,990,000,000,000,000,000,000,000 | 10 | Fixed #6011: Bounds check in rdp_read_font_capability_set |
void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
{
const struct iphdr *iph = (const struct iphdr *)icmp_skb->data;
struct tcphdr *th = (struct tcphdr *)(icmp_skb->data + (iph->ihl << 2));
struct inet_connection_sock *icsk;
struct tcp_sock *tp;
struct inet_sock *inet;
const int type = icmp_hdr(icmp_skb)->type;
... | 0 | [
"CWE-362"
] | linux-2.6 | f6d8bd051c391c1c0458a30b2a7abcd939329259 | 329,030,598,180,076,500,000,000,000,000,000,000,000 | 187 | 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... |
bool LEX::add_signal_statement(THD *thd, const sp_condition_value *v)
{
Yacc_state *state= &thd->m_parser_state->m_yacc;
sql_command= SQLCOM_SIGNAL;
m_sql_cmd= new (thd->mem_root) Sql_cmd_signal(v, state->m_set_signal_info);
return m_sql_cmd == NULL;
} | 0 | [
"CWE-703"
] | server | 39feab3cd31b5414aa9b428eaba915c251ac34a2 | 143,317,313,432,443,820,000,000,000,000,000,000,000 | 7 | MDEV-26412 Server crash in Item_field::fix_outer_field for INSERT SELECT
IF an INSERT/REPLACE SELECT statement contained an ON expression in the top
level select and this expression used a subquery with a column reference
that could not be resolved then an attempt to resolve this reference as
an outer reference caused... |
static int sc_pkcs15emu_sc_hsm_get_rsa_public_key(struct sc_context *ctx, sc_cvc_t *cvc, struct sc_pkcs15_pubkey *pubkey)
{
pubkey->algorithm = SC_ALGORITHM_RSA;
pubkey->alg_id = (struct sc_algorithm_id *)calloc(1, sizeof(struct sc_algorithm_id));
if (!pubkey->alg_id)
return SC_ERROR_OUT_OF_MEMORY;
pubkey->alg_... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 136,906,774,189,388,220,000,000,000,000,000,000,000 | 22 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
static struct kobject *cdev_get(struct cdev *p)
{
struct module *owner = p->owner;
struct kobject *kobj;
if (owner && !try_module_get(owner))
return NULL;
kobj = kobject_get(&p->kobj);
if (!kobj)
module_put(owner);
return kobj;
} | 1 | [
"CWE-362"
] | linux | 68faa679b8be1a74e6663c21c3a9d25d32f1c079 | 81,735,454,176,414,830,000,000,000,000,000,000,000 | 12 | chardev: Avoid potential use-after-free in 'chrdev_open()'
'chrdev_open()' calls 'cdev_get()' to obtain a reference to the
'struct cdev *' stashed in the 'i_cdev' field of the target inode
structure. If the pointer is NULL, then it is initialised lazily by
looking up the kobject in the 'cdev_map' and so the whole proc... |
void kvm_hv_set_cpuid(struct kvm_vcpu *vcpu)
{
struct kvm_cpuid_entry2 *entry;
struct kvm_vcpu_hv *hv_vcpu;
entry = kvm_find_cpuid_entry(vcpu, HYPERV_CPUID_INTERFACE, 0);
if (entry && entry->eax == HYPERV_CPUID_SIGNATURE_EAX) {
vcpu->arch.hyperv_enabled = true;
} else {
vcpu->arch.hyperv_enabled = false;
re... | 0 | [
"CWE-476"
] | linux | 7ec37d1cbe17d8189d9562178d8b29167fe1c31a | 47,225,635,763,232,830,000,000,000,000,000,000,000 | 44 | KVM: x86: Check lapic_in_kernel() before attempting to set a SynIC irq
When KVM_CAP_HYPERV_SYNIC{,2} is activated, KVM already checks for
irqchip_in_kernel() so normally SynIC irqs should never be set. It is,
however, possible for a misbehaving VMM to write to SYNIC/STIMER MSRs
causing erroneous behavior.
The immedi... |
RZ_API RZ_OWN RzList /*<RzBinField *>*/ *rz_bin_dex_fields(RZ_NONNULL RzBinDex *dex) {
rz_return_val_if_fail(dex, NULL);
DexClassDef *class_def;
RzList *fields = NULL;
void **it;
ut32 n_fields = rz_pvector_len(dex->field_ids);
ut8 *inserted = RZ_NEWS0(ut8, n_fields);
if (n_fields > 0 && !inserted) {
free(inse... | 0 | [
"CWE-787"
] | rizin | 1524f85211445e41506f98180f8f69f7bf115406 | 110,791,757,736,266,570,000,000,000,000,000,000,000 | 31 | fix #2969 - oob write (1 byte) in dex.c |
static int remove_chunk_item(struct btrfs_trans_handle *trans,
struct map_lookup *map, u64 chunk_offset)
{
int i;
/*
* Removing chunk items and updating the device items in the chunks btree
* requires holding the chunk_mutex.
* See the comment at btrfs_chunk_alloc() for the details.
*/
lockdep_asser... | 0 | [
"CWE-476",
"CWE-703"
] | linux | e4571b8c5e9ffa1e85c0c671995bd4dcc5c75091 | 25,648,960,690,279,510,000,000,000,000,000,000,000 | 22 | btrfs: fix NULL pointer dereference when deleting device by invalid id
[BUG]
It's easy to trigger NULL pointer dereference, just by removing a
non-existing device id:
# mkfs.btrfs -f -m single -d single /dev/test/scratch1 \
/dev/test/scratch2
# mount /dev/test/scratch1 /mnt/btrfs
# btrfs device remove 3 /... |
get_userdefined_compl_info(colnr_T curs_col UNUSED)
{
int ret = FAIL;
#ifdef FEAT_COMPL_FUNC
// Call user defined function 'completefunc' with "a:findstart"
// set to 1 to obtain the length of text to use for completion.
char_u *line;
typval_T args[3];
int col;
char_u *funcname;
pos_T... | 0 | [
"CWE-125"
] | vim | f12129f1714f7d2301935bb21d896609bdac221c | 193,953,275,385,130,800,000,000,000,000,000,000,000 | 84 | 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. |
static inline int compute_score2(struct sock *sk, struct net *net,
__be32 saddr, __be16 sport,
__be32 daddr, unsigned int hnum, int dif)
{
int score = -1;
if (net_eq(sock_net(sk), net) && !ipv6_only_sock(sk)) {
struct inet_sock *inet = inet_sk(sk);
if (inet->inet_rcv_saddr != daddr)
return -1;
if... | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 98,952,028,221,159,900,000,000,000,000,000,000,000 | 33 | net: sk_add_backlog() take rmem_alloc into account
Current socket backlog limit is not enough to really stop DDOS attacks,
because user thread spend many time to process a full backlog each
round, and user might crazy spin on socket lock.
We should add backlog size and receive_queue size (aka rmem_alloc) to
pace writ... |
ms_escher_read_CalloutRule (MSEscherState *state, MSEscherHeader *h)
{
return FALSE;
} | 0 | [
"CWE-119"
] | gnumeric | b5480b69345b3c6d56ee0ed9c9e9880bb2a08cdc | 41,515,233,817,486,594,000,000,000,000,000,000,000 | 4 | xls: fuzzed file crash. |
peekchr(void)
{
static int after_slash = FALSE;
if (curchr == -1)
{
switch (curchr = regparse[0])
{
case '.':
case '[':
case '~':
// magic when 'magic' is on
if (reg_magic >= MAGIC_ON)
curchr = Magic(curchr);
break;
case '(':
case ')':
case '{':
case '%':
case '+':
case '=':
ca... | 0 | [
"CWE-416"
] | vim | 4c13e5e6763c6eb36a343a2b8235ea227202e952 | 109,472,563,047,823,190,000,000,000,000,000,000,000 | 163 | patch 8.2.3949: using freed memory with /\%V
Problem: Using freed memory with /\%V.
Solution: Get the line again after getvvcol(). |
int tls1_cbc_remove_padding(const SSL* s,
SSL3_RECORD *rec,
unsigned block_size,
unsigned mac_size)
{
unsigned padding_length, good, to_check, i;
const char has_explicit_iv = s->version == DTLS1_VERSION;
const unsigned overhead = 1 /* padding length byte */ +
mac_size +
(has_explici... | 0 | [
"CWE-310"
] | openssl | 2928cb4c82d6516d9e65ede4901a5957d8c39c32 | 96,063,129,535,496,750,000,000,000,000,000,000,000 | 91 | Fixups. |
static int h2c_send_conn_wu(struct h2c *h2c)
{
int ret = 1;
if (h2c->rcvd_c <= 0)
return 1;
/* send WU for the connection */
ret = h2c_send_window_update(h2c, 0, h2c->rcvd_c);
if (ret > 0)
h2c->rcvd_c = 0;
return ret;
} | 0 | [
"CWE-119"
] | haproxy | 3f0e1ec70173593f4c2b3681b26c04a4ed5fc588 | 182,836,724,202,048,100,000,000,000,000,000,000,000 | 14 | BUG/CRITICAL: h2: fix incorrect frame length check
The incoming H2 frame length was checked against the max_frame_size
setting instead of being checked against the bufsize. The max_frame_size
only applies to outgoing traffic and not to incoming one, so if a large
enough frame size is advertised in the SETTINGS frame, ... |
void Submit(SQL::Query* call, const std::string& q, const SQL::ParamMap& p) CXX11_OVERRIDE
{
std::string res;
for(std::string::size_type i = 0; i < q.length(); i++)
{
if (q[i] != '$')
res.push_back(q[i]);
else
{
std::string field;
i++;
while (i < q.length() && isalnum(q[i]))
field.... | 0 | [
"CWE-476"
] | inspircd | 8745660fcdac7c1b80c94cfc0ff60928cd4dd4b7 | 19,382,339,174,325,773,000,000,000,000,000,000,000 | 28 | Initialise and deallocate the MySQL library correctly. |
INLINE void gdi_CRgnToRect(INT64 x, INT64 y, INT32 w, INT32 h, HGDI_RECT rect)
{
BOOL invalid = FALSE;
const INT64 r = x + w - 1;
const INT64 b = y + h - 1;
rect->left = (x > 0) ? x : 0;
rect->top = (y > 0) ? y : 0;
rect->right = rect->left;
rect->bottom = rect->top;
if (r > 0)
rect->right = r;
else
inval... | 0 | [
"CWE-190"
] | FreeRDP | ce21b9d7ecd967e0bc98ed31a6b3757848aa6c9e | 61,189,896,804,485,670,000,000,000,000,000,000,000 | 26 | Fix CVE-2020-11523: clamp invalid rectangles to size 0
Thanks to Sunglin and HuanGMz from Knownsec 404 |
static gboolean dissect_parameter_sequence_v2(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
proto_item *parameter_item _U_, proto_item *param_len_item,
gint offset, const guint encoding, int param_length,
guint16 parameter, gu... | 0 | [
"CWE-401"
] | wireshark | 33e63d19e5496c151bad69f65cdbc7cba2b4c211 | 215,046,859,613,049,030,000,000,000,000,000,000,000 | 245 | RTPS: Fixup our coherent set map.
coherent_set_tracking.coherent_set_registry_map uses a struct as a key,
but the hash and comparison routines treat keys as a sequence of bytes.
Make sure every key byte is initialized. Fixes #16994.
Call wmem_strong_hash on our key in coherent_set_key_hash_by_key instead
of creating ... |
static size_t mask_bitmap4(const __u32 *bitmap, const __u32 *mask,
__u32 *res, size_t len)
{
size_t i;
__u32 tmp;
while (len > 0 && (bitmap[len-1] == 0 || mask[len-1] == 0))
len--;
for (i = len; i-- > 0;) {
tmp = bitmap[i] & mask[i];
res[i] = tmp;
}
return len;
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 157,398,576,798,873,840,000,000,000,000,000,000,000 | 14 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
u64 nfs_compat_user_ino64(u64 fileid)
{
int ino;
if (enable_ino64)
return fileid;
ino = fileid;
if (sizeof(ino) < sizeof(fileid))
ino ^= fileid >> (sizeof(fileid)-sizeof(ino)) * 8;
return ino;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 203,692,694,023,767,120,000,000,000,000,000,000,000 | 11 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
*/
YY_EXTRA_TYPE re_yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra; | 0 | [
"CWE-476",
"CWE-703",
"CWE-125"
] | yara | 3119b232c9c453c98d8fa8b6ae4e37ba18117cd4 | 281,561,588,830,871,230,000,000,000,000,000,000,000 | 5 | re_lexer: Make reading escape sequences more robust (#586)
* Add test for issue #503
* re_lexer: Make reading escape sequences more robust
This commit fixes parsing incomplete escape sequences at the end of a
regular expression and parsing things like \xxy (invalid hex digits)
which before were silently turned... |
void var_query_set(VAR *var, const char *query, const char** query_end)
{
char *end = (char*)((query_end && *query_end) ?
*query_end : query + strlen(query));
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL* mysql = cur_con->mysql;
DYNAMIC_STRING ds_query;
DBUG_ENTER("var_query_set");
LINT_INIT(res);
if (... | 0 | [] | server | 01b39b7b0730102b88d8ea43ec719a75e9316a1e | 92,152,511,321,862,900,000,000,000,000,000,000,000 | 107 | mysqltest: don't eat new lines in --exec
pass them through as is |
_dbus_read_local_machine_uuid (DBusGUID *machine_id,
dbus_bool_t create_if_not_found,
DBusError *error)
{
DBusError our_error = DBUS_ERROR_INIT;
DBusError etc_error = DBUS_ERROR_INIT;
DBusString filename;
dbus_bool_t b;
_dbus_string_init_const ... | 0 | [
"CWE-404"
] | dbus | 872b085f12f56da25a2dbd9bd0b2dff31d5aea63 | 31,117,421,040,723,450,000,000,000,000,000,000,000 | 56 | sysdeps-unix: On MSG_CTRUNC, close the fds we did receive
MSG_CTRUNC indicates that we have received fewer fds that we should
have done because the buffer was too small, but we were treating it
as though it indicated that we received *no* fds. If we received any,
we still have to make sure we close them, otherwise the... |
smb2_duplicate_extents(const unsigned int xid,
struct cifsFileInfo *srcfile,
struct cifsFileInfo *trgtfile, u64 src_off,
u64 len, u64 dest_off)
{
int rc;
unsigned int ret_data_len;
struct inode *inode;
struct duplicate_extents_to_file dup_ext_buf;
struct cifs_tcon *tcon = tlink_tcon(trgtfile->tlink);
/*... | 0 | [
"CWE-476"
] | linux | d6f5e358452479fa8a773b5c6ccc9e4ec5a20880 | 316,331,966,003,703,330,000,000,000,000,000,000,000 | 54 | cifs: fix NULL ptr dereference in smb2_ioctl_query_info()
When calling smb2_ioctl_query_info() with invalid
smb_query_info::flags, a NULL ptr dereference is triggered when trying
to kfree() uninitialised rqst[n].rq_iov array.
This also fixes leaked paths that are created in SMB2_open_init()
which required SMB2_open_f... |
static oe_off_t _hostfs_lseek(oe_fd_t* desc, oe_off_t offset, int whence)
{
oe_off_t ret = -1;
file_t* file = _cast_file(desc);
if (!file)
OE_RAISE_ERRNO(OE_EINVAL);
if (file->dir)
ret = _hostfs_lseek_dir(desc, offset, whence);
else
ret = _hostfs_lseek_file(desc, offset, wh... | 0 | [
"CWE-200",
"CWE-552"
] | openenclave | bcac8e7acb514429fee9e0b5d0c7a0308fd4d76b | 116,032,845,288,885,940,000,000,000,000,000,000,000 | 16 | Merge pull request from GHSA-525h-wxcc-f66m
Signed-off-by: Ming-Wei Shih <mishih@microsoft.com> |
struct_va_format(void)
{
} | 0 | [
"CWE-200"
] | linux | ad67b74d2469d9b82aaa572d76474c95bc484d57 | 126,121,945,947,087,220,000,000,000,000,000,000,000 | 3 | printk: hash addresses printed with %p
Currently there exist approximately 14 000 places in the kernel where
addresses are being printed using an unadorned %p. This potentially
leaks sensitive information regarding the Kernel layout in memory. Many
of these calls are stale, instead of fixing every call lets hash the
a... |
static inline struct cfs_rq *cpu_cfs_rq(struct cfs_rq *cfs_rq, int this_cpu)
{
return &cpu_rq(this_cpu)->cfs;
} | 0 | [] | linux-2.6 | 6a6029b8cefe0ca7e82f27f3904dbedba3de4e06 | 192,732,867,353,641,900,000,000,000,000,000,000,000 | 4 | sched: simplify sched_slice()
Use the existing calc_delta_mine() calculation for sched_slice(). This
saves a divide and simplifies the code because we share it with the
other /cfs_rq->load users.
It also improves code size:
text data bss dec hex filename
42659 2740 144 45543 b1e... |
static void test_send_u32(GOutputStream *os, guint32 v)
{
v = GUINT32_TO_BE(v);
g_assert(g_output_stream_write_all(os, &v, 4, NULL, NULL, NULL));
} | 0 | [] | gtk-vnc | ea0386933214c9178aaea9f2f85049ea3fa3e14a | 5,610,233,265,917,677,000,000,000,000,000,000,000 | 5 | Fix bounds checking for RRE, hextile & copyrect encodings
While the client would bounds check the overall update
region, it failed to bounds check the payload data
parameters.
Add a test case to validate bounds checking.
https://bugzilla.gnome.org/show_bug.cgi?id=778048
CVE-2017-5884
Signed-off-by: Daniel P. Berra... |
static void sas_unregister_devs_sas_addr(struct domain_device *parent,
int phy_id, bool last)
{
struct expander_device *ex_dev = &parent->ex_dev;
struct ex_phy *phy = &ex_dev->ex_phy[phy_id];
struct domain_device *child, *n, *found = NULL;
if (last) {
list_for_each_entry_safe(child, n,
&ex_dev->children,... | 0 | [
"CWE-284"
] | linux | 0558f33c06bb910e2879e355192227a8e8f0219d | 266,184,106,882,734,900,000,000,000,000,000,000,000 | 33 | scsi: libsas: direct call probe and destruct
In commit 87c8331fcf72 ("[SCSI] libsas: prevent domain rediscovery
competing with ata error handling") introduced disco mutex to prevent
rediscovery competing with ata error handling and put the whole
revalidation in the mutex. But the rphy add/remove needs to wait for the
... |
void skb_abort_seq_read(struct skb_seq_state *st)
{
if (st->frag_data)
kunmap_atomic(st->frag_data);
} | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 160,715,360,866,738,290,000,000,000,000,000,000,000 | 5 | core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't
orphan them. Also, it doesn't handle errors, so this patch takes care of that
as well, and modify the callers accordingly. skb_tx_error() is also added to
the caller... |
static int smack_inode_listsecurity(struct inode *inode, char *buffer,
size_t buffer_size)
{
int len = strlen(XATTR_NAME_SMACK);
if (buffer != NULL && len <= buffer_size) {
memcpy(buffer, XATTR_NAME_SMACK, len);
return len;
}
return -EINVAL;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 161,996,254,862,986,300,000,000,000,000,000,000,000 | 11 | 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... |
term_cursor_mode(int forced)
{
static int showing_mode = -1;
char_u *p;
// Only do something when redrawing the screen and we can restore the
// mode.
if (!full_screen || *T_CEI == NUL)
{
# ifdef FEAT_TERMRESPONSE
if (forced && initial_cursor_shape > 0)
// Restore to initial values.
... | 0 | [
"CWE-125",
"CWE-787"
] | vim | e178af5a586ea023622d460779fdcabbbfac0908 | 148,149,076,632,353,470,000,000,000,000,000,000,000 | 46 | patch 8.2.5160: accessing invalid memory after changing terminal size
Problem: Accessing invalid memory after changing terminal size.
Solution: Adjust cmdline_row and msg_row to the value of Rows. |
static int write_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa,
void *val, int bytes)
{
struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0];
memcpy(vcpu->run->mmio.data, frag->data, min(8u, frag->len));
return X86EMUL_CONTINUE;
} | 0 | [] | linux | 6d1068b3a98519247d8ba4ec85cd40ac136dbdf9 | 331,269,048,580,901,530,000,000,000,000,000,000,000 | 8 | KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461)
On hosts without the XSAVE support unprivileged local user can trigger
oops similar to the one below by setting X86_CR4_OSXSAVE bit in guest
cr4 register using KVM_SET_SREGS ioctl and later issuing KVM_RUN
ioctl.
invalid opcode: 0000 [#2]... |
MagickExport MagickBooleanType ClampImage(Image *image)
{
MagickBooleanType
status;
status=ClampImageChannel(image,DefaultChannels);
return(status);
} | 0 | [
"CWE-125"
] | ImageMagick6 | 35c7032723d85eee7318ff6c82f031fa2666b773 | 219,012,719,767,312,000,000,000,000,000,000,000,000 | 8 | https://github.com/ImageMagick/ImageMagick/issues/1609 |
static RList * cpfind_double (RCore *core, RBinJavaObj *obj, const char *cmd) {
double value = cmd && *cmd ? strtod (cmd, NULL) : 0.0;
if (value == 0.0 && !(cmd && cmd[0] == '0' && cmd[1] == '.' && cmd[2] == '0')) {
return r_list_new ();
}
return r_bin_java_find_cp_const_by_val ( obj, (const ut8 *) &value, 8, R_B... | 0 | [
"CWE-703",
"CWE-193"
] | radare2 | ced0223c7a1b3b5344af315715cd28fe7c0d9ebc | 193,220,350,359,028,870,000,000,000,000,000,000,000 | 7 | Fix unmatched array length in core_java.c (issue #16304) (#16313) |
get_strings_2_svc(gstrings_arg *arg, struct svc_req *rqstp)
{
static gstrings_ret ret;
char *prime_arg;
gss_buffer_desc client_name,
service_name;
OM_uint32 minor_stat;
kadm5_server_handle_t handle;
co... | 1 | [
"CWE-119",
"CWE-772",
"CWE-401"
] | krb5 | 83ed75feba32e46f736fcce0d96a0445f29b96c2 | 251,239,656,916,377,420,000,000,000,000,000,000,000 | 57 | Fix leaks in kadmin server stubs [CVE-2015-8631]
In each kadmind server stub, initialize the client_name and
server_name variables, and release them in the cleanup handler. Many
of the stubs will otherwise leak the client and server name if
krb5_unparse_name() fails. Also make sure to free the prime_arg
variables in... |
unsigned long nfs_inc_attr_generation_counter(void)
{
return atomic_long_inc_return(&nfs_attr_generation_counter);
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 74,005,611,765,144,070,000,000,000,000,000,000,000 | 4 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
GF_Err odtt_box_size(GF_Box *s)
{
s->size += 16;
return GF_OK;
} | 0 | [
"CWE-703"
] | gpac | f19668964bf422cf5a63e4dbe1d3c6c75edadcbb | 270,409,121,517,376,200,000,000,000,000,000,000,000 | 5 | fixed #1879 |
static void setup_sandbox(struct lo_data *lo, struct fuse_session *se,
bool enable_syslog)
{
if (lo->sandbox == SANDBOX_NAMESPACE) {
setup_namespaces(lo, se);
setup_mounts(lo->source);
} else {
setup_chroot(lo);
}
setup_seccomp(enable_syslog);
setup... | 0 | [] | qemu | 6084633dff3a05d63176e06d7012c7e15aba15be | 170,009,368,945,991,800,000,000,000,000,000,000,000 | 13 | tools/virtiofsd: xattr name mappings: Add option
Add an option to define mappings of xattr names so that
the client and server filesystems see different views.
This can be used to have different SELinux mappings as
seen by the guest, to run the virtiofsd with less privileges
(e.g. in a case where it can't set trusted/... |
face_data_finalizer (void *object)
{
FT_Face face = object;
g_clear_object (&face->generic.data);
} | 0 | [
"CWE-476"
] | gnome-font-viewer | 9661683379806e2bad6a52ce6dde776a33f4f981 | 238,276,368,855,233,320,000,000,000,000,000,000,000 | 5 | Fallback to basename when no family name (CVE-2019-19308)
Instead of possibly returning an empty string, which will cause
issues later on.
We store the GFile that was loaded to create the FT_Face into its
generic client data structure, and load the basename from it when
we don't have a family name.
https://gitlab.gn... |
static int decode_dds1(GetByteContext *gb, uint8_t *frame, int width, int height)
{
const uint8_t *frame_start = frame;
const uint8_t *frame_end = frame + width * height;
int mask = 0x10000, bitbuf = 0;
int i, v, offset, count, segments;
segments = bytestream2_get_le16(gb);
while (segments--)... | 1 | [
"CWE-119",
"CWE-787"
] | FFmpeg | f52fbf4f3ed02a7d872d8a102006f29b4421f360 | 139,879,477,439,925,700,000,000,000,000,000,000,000 | 48 | avcodec/dfa: Fix off by 1 error
Fixes out of array access
Fixes: 1345/clusterfuzz-testcase-minimized-6062963045695488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *sds)
{
unsigned long max_pull, load_above_capacity = ~0UL;
struct sg_lb_stats *local, *busiest;
local = &sds->local_stat;
busiest = &sds->busiest_stat;
if (busiest->group_type == group_imbalanced) {
/*
* In the group_imb case we ... | 0 | [
"CWE-400",
"CWE-703",
"CWE-835"
] | linux | c40f7d74c741a907cfaeb73a7697081881c497d0 | 89,421,697,173,379,870,000,000,000,000,000,000,000 | 74 | sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c
Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the
scheduler under high loads, starting at around the v4.18 time frame,
and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list
manipulation.
Do a (manual) re... |
GF_Err m4ds_dump(GF_Box *a, FILE * trace)
{
u32 i;
GF_Descriptor *desc;
GF_MPEG4ExtensionDescriptorsBox *p = (GF_MPEG4ExtensionDescriptorsBox *) a;
gf_isom_box_dump_start(a, "MPEG4ExtensionDescriptorsBox", trace);
fprintf(trace, ">\n");
i=0;
while ((desc = (GF_Descriptor *)gf_list_enum(p->descriptors, &i))) {
#... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 210,589,980,139,663,870,000,000,000,000,000,000,000 | 19 | fixed 2 possible heap overflows (inc. #1088) |
json_t *json_object_get(const json_t *json, const char *key)
{
json_object_t *object;
if(!json_is_object(json))
return NULL;
object = json_to_object(json);
return hashtable_get(&object->hashtable, key);
} | 0 | [
"CWE-310"
] | jansson | 8f80c2d83808150724d31793e6ade92749b1faa4 | 213,077,481,803,302,000,000,000,000,000,000,000,000 | 10 | CVE-2013-6401: Change hash function, randomize hashes
Thanks to Florian Weimer and Eric Sesterhenn for reporting, reviewing
and testing. |
mmcl_repeat_range_multiply(MinMaxCharLen* to, int mlow, int mhigh)
{
to->min = distance_multiply(to->min, mlow);
if (IS_INFINITE_REPEAT(mhigh))
to->max = INFINITE_LEN;
else
to->max = distance_multiply(to->max, mhigh);
} | 0 | [
"CWE-787"
] | oniguruma | cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0 | 20,153,117,206,209,320,000,000,000,000,000,000,000 | 9 | #207: Out-of-bounds write |
TEST_F(AllowMissingInOrListTest, BadAndGoodJwts) {
EXPECT_CALL(mock_cb_, onComplete(Status::JwtVerificationFail));
auto headers = Http::TestRequestHeaderMapImpl{{kExampleHeader, NonExistKidToken},
{kOtherHeader, OtherGoodToken}};
context_ = Verifier::createContext(h... | 0 | [
"CWE-303",
"CWE-703"
] | envoy | ea39e3cba652bcc4b11bb0d5c62b017e584d2e5a | 106,512,573,225,270,300,000,000,000,000,000,000,000 | 10 | jwt_authn: fix a bug where JWT with wrong issuer is allowed in allow_missing case (#15194)
[jwt] When allow_missing is used inside RequiresAny, the requests with JWT with wrong issuer are accepted. This is a bug, allow_missing should only allow requests without any JWT. This change fixed the above issue by preserving ... |
bool ContentSettingsObserver::IsPluginTemporarilyAllowed(
const std::string& identifier) {
// If the empty string is in here, it means all plugins are allowed.
// TODO(bauerb): Remove this once we only pass in explicit identifiers.
return (temporarily_allowed_plugins_.find(identifier) !=
temporarily... | 0 | [
"CWE-20",
"CWE-200"
] | muon | c18663aa171c6cdf03da3e8c70df8663645b97c4 | 190,103,969,977,247,500,000,000,000,000,000,000,000 | 9 | Issue: 15232 AllowScript should use atom::ContentSettingsManager like other Allow* methods in the observer |
cleanup_prefix_route(struct inet6_ifaddr *ifp, unsigned long expires, bool del_rt)
{
struct rt6_info *rt;
rt = addrconf_get_prefix_route(&ifp->addr,
ifp->prefix_len,
ifp->idev->dev,
0, RTF_GATEWAY | RTF_DEFAULT);
if (rt) {
if (del_rt)
ip6_del_rt(rt);
else {
if (!(rt->rt6i_... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 202,223,205,734,589,700,000,000,000,000,000,000,000 | 18 | ipv6: addrconf: validate new MTU before applying it
Currently we don't check if the new MTU is valid or not and this allows
one to configure a smaller than minimum allowed by RFCs or even bigger
than interface own MTU, which is a problem as it may lead to packet
drops.
If you have a daemon like NetworkManager running... |
ves_icall_GetCurrentMethod (void)
{
MonoMethod *m = mono_method_get_last_managed ();
MONO_ARCH_SAVE_REGS;
return mono_method_get_object (mono_domain_get (), m, NULL);
} | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 50,125,112,444,535,650,000,000,000,000,000,000,000 | 8 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
void sqlite3AddDefaultValue(
Parse *pParse, /* Parsing context */
Expr *pExpr, /* The parsed expression of the default value */
const char *zStart, /* Start of the default value text */
const char *zEnd /* First character past end of defaut value text */
){
Table *p;
Colum... | 0 | [
"CWE-674",
"CWE-787"
] | sqlite | 38096961c7cd109110ac21d3ed7dad7e0cb0ae06 | 299,636,422,335,275,740,000,000,000,000,000,000,000 | 41 | Avoid infinite recursion in the ALTER TABLE code when a view contains an unused CTE that references, directly or indirectly, the view itself.
FossilOrigin-Name: 1d2e53a39b87e364685e21de137655b6eee725e4c6d27fc90865072d7c5892b5 |
_gdata_service_secure_strdup (const gchar *str)
{
#ifdef HAVE_GNOME
return gnome_keyring_memory_strdup (str);
#else /* if !HAVE_GNOME */
return g_strdup (str);
#endif /* !HAVE_GNOME */
} | 0 | [
"CWE-20"
] | libgdata | 6799f2c525a584dc998821a6ce897e463dad7840 | 166,711,812,986,211,160,000,000,000,000,000,000,000 | 8 | core: Validate SSL certificates for all connections
This prevents MitM attacks which use spoofed SSL certificates.
Note that this bumps our libsoup requirement to 2.37.91.
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=671535 |
void daemonize(char *logfile) {
pid_t pid;
// do not daemonize under emperor
if (uwsgi.has_emperor) {
logto(logfile);
return;
}
pid = fork();
if (pid < 0) {
uwsgi_error("fork()");
exit(1);
}
if (pid != 0) {
_exit(0);
}
if (setsid() < 0) {
uwsgi_error("setsid()");
exit(1);
}
/* refork... */... | 0 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | uwsgi | cb4636f7c0af2e97a4eef7a3cdcbd85a71247bfe | 38,906,749,070,081,153,000,000,000,000,000,000,000 | 46 | improve uwsgi_expand_path() to sanitize input, avoiding stack corruption and potential security issue |
GF_Err gf_media_vp9_parse_superframe(GF_BitStream *bs, u64 ivf_frame_size, u32 *num_frames_in_superframe, u32 frame_sizes[VP9_MAX_FRAMES_IN_SUPERFRAME], u32 *superframe_index_size)
{
u32 byte, bytes_per_framesize;
u64 pos = gf_bs_get_position(bs), i = 0;
GF_Err e;
assert(bs && num_frames_in_superframe);
/*initia... | 0 | [
"CWE-190",
"CWE-787"
] | gpac | 51cdb67ff7c5f1242ac58c5aa603ceaf1793b788 | 1,304,801,064,998,964,000,000,000,000,000,000,000 | 40 | add safety in avc/hevc/vvc sps/pps/vps ID check - cf #1720 #1721 #1722 |
void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfig)
{
MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces;
MSUSB_INTERFACE_DESCRIPTOR* MsInterface;
MSUSB_PIPE_DESCRIPTOR** MsPipes;
MSUSB_PIPE_DESCRIPTOR* MsPipe;
UINT32 inum = 0, pnum = 0;
WLog_INFO(TAG, "=================MsConfig:========================");
WLog_I... | 0 | [
"CWE-190"
] | FreeRDP | 9f77fc3dd2394373e1be753952b00dafa1a9b7da | 2,875,273,363,796,621,600,000,000,000,000,000,000 | 50 | Fixed int overflow in msusb_mspipes_read
Thanks to hac425 |
_XkbSetNamesCheck(ClientPtr client, DeviceIntPtr dev,
xkbSetNamesReq * stuff, CARD32 *data)
{
XkbDescRec *xkb;
CARD32 *tmp;
Atom bad = None;
tmp = data;
xkb = dev->key->xkbInfo->desc;
if (stuff->which & XkbKeyTypeNamesMask) {
int i;
CARD32 *old;
if (s... | 1 | [
"CWE-119"
] | xserver | f7cd1276bbd4fe3a9700096dec33b52b8440788d | 77,906,012,909,726,980,000,000,000,000,000,000,000 | 148 | Correct bounds checking in XkbSetNames()
CVE-2020-14345 / ZDI 11428
This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu> |
void bcf_destroy(bcf1_t *v)
{
if (!v) return;
bcf_empty1(v);
free(v);
} | 0 | [
"CWE-787"
] | htslib | dcd4b7304941a8832fba2d0fc4c1e716e7a4e72c | 66,622,947,921,772,140,000,000,000,000,000,000,000 | 6 | Fix check for VCF record size
The check for excessive record size in vcf_parse_format() only
looked at individual fields. It was therefore possible to
exceed the limit and overflow fmt_aux_t::offset by having
multiple fields with a combined size that went over INT_MAX.
Fix by including the amount of memory used so fa... |
static int stbi__pic_test(stbi__context *s)
{
int r = stbi__pic_test_core(s);
stbi__rewind(s);
return r;
} | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 208,331,924,192,908,640,000,000,000,000,000,000,000 | 6 | 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. |
unsigned int scalar0(const mp_func op) {
const unsigned int pos = scalar();
CImg<ulongT>::vector((ulongT)op,pos).move_to(code);
return pos; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 318,323,506,010,417,400,000,000,000,000,000,000,000 | 5 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int packet_rcv_has_room(struct packet_sock *po, struct sk_buff *skb)
{
int ret;
bool has_room;
spin_lock_bh(&po->sk.sk_receive_queue.lock);
ret = __packet_rcv_has_room(po, skb);
has_room = ret == ROOM_NORMAL;
if (po->pressure == has_room)
po->pressure = !has_room;
spin_unlock_bh(&po->sk.sk_receive_queu... | 0 | [
"CWE-416",
"CWE-362"
] | linux | 84ac7260236a49c79eede91617700174c2c19b0c | 61,581,322,872,167,760,000,000,000,000,000,000,000 | 14 | packet: fix race condition in packet_set_ring
When packet_set_ring creates a ring buffer it will initialize a
struct timer_list if the packet version is TPACKET_V3. This value
can then be raced by a different thread calling setsockopt to
set the version to TPACKET_V1 before packet_set_ring has finished.
This leads to... |
TEST(ExpressionConstantTest, ConstantOfValueMissingRemovesField) {
intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
intrusive_ptr<Expression> expression = ExpressionConstant::create(expCtx, Value());
assertBinaryEqual(BSONObj(), toBson(expression->evaluate(Document{{"foo", Val... | 0 | [
"CWE-835"
] | mongo | 0a076417d1d7fba3632b73349a1fd29a83e68816 | 50,390,976,221,158,900,000,000,000,000,000,000,000 | 5 | SERVER-38070 fix infinite loop in agg expression |
int RGWGetBucketLocation::verify_permission()
{
return verify_bucket_owner_or_policy(s, rgw::IAM::s3GetBucketLocation);
} | 0 | [
"CWE-770"
] | ceph | ab29bed2fc9f961fe895de1086a8208e21ddaddc | 265,885,581,463,854,860,000,000,000,000,000,000,000 | 4 | rgw: fix issues with 'enforce bounds' patch
The patch to enforce bounds on max-keys/max-uploads/max-parts had a few
issues that would prevent us from compiling it. Instead of changing the
code provided by the submitter, we're addressing them in a separate
commit to maintain the DCO.
Signed-off-by: Joao Eduardo Luis <... |
void Magick::Image::writePixels(const Magick::QuantumType quantum_,
unsigned char *destination_)
{
QuantumInfo
*quantum_info;
quantum_info=AcquireQuantumInfo(imageInfo(),image());
GetPPException;
ExportQuantumPixels(image(),(MagickCore::CacheView *) NULL,quantum_info,
quantum_,destination_, exception... | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 134,133,860,998,056,470,000,000,000,000,000,000,000 | 13 | Added missing return to avoid use after free. |
TfLiteStatus EvalFloat(const TfLiteTensor* input,
const TfLiteTensor* input_weights,
const TfLiteTensor* recurrent_weights,
const TfLiteTensor* bias, const TfLiteRNNParams* params,
TfLiteTensor* hidden_state, TfLiteTensor* outpu... | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 57,651,248,742,165,410,000,000,000,000,000,000,000 | 27 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
aspath_cmp_left_confed (const struct aspath *aspath1, const struct aspath *aspath2)
{
if (! (aspath1 && aspath2) )
return 0;
if ( !(aspath1->segments && aspath2->segments) )
return 0;
if ( (aspath1->segments->type != AS_CONFED_SEQUENCE)
|| (aspath2->segments->type != AS_CONFED_SEQUENCE) )
... | 0 | [
"CWE-20"
] | quagga | 7a42b78be9a4108d98833069a88e6fddb9285008 | 153,020,005,720,481,000,000,000,000,000,000,000,000 | 17 | bgpd: Fix AS_PATH size calculation for long paths
If you have an AS_PATH with more entries than
what can be written into a single AS_SEGMENT_MAX
it needs to be broken up. The code that noticed
that the AS_PATH needs to be broken up was not
correctly calculating the size of the resulting
message. This patch addresses... |
static int handle_generic_errors(int rc, const char *msg, ...)
{
va_list va;
va_start(va, msg);
errno = -rc;
switch(errno) {
case EINVAL:
case EPERM:
vwarn(msg, va);
rc = MOUNT_EX_USAGE;
break;
case ENOMEM:
vwarn(msg, va);
rc = MOUNT_EX_SYSERR;
break;
default:
vwarn(msg, va);
rc = MOUNT_EX_FAI... | 0 | [
"CWE-200"
] | util-linux | 5ebbc3865d1e53ef42e5f121c41faab23dd59075 | 97,142,872,819,514,150,000,000,000,000,000,000,000 | 25 | mount: sanitize paths from non-root users
$ mount /root/.ssh/../../dev/sda2
mount: only root can mount UUID=17bc65ec-4125-4e7c-8a7d-e2795064c736 on /boot
this is too promiscuous. It seems better to ignore on command line
specified paths which are not resolve-able for non-root users.
Fixed version:
$ mount /root... |
static void ipv4_dst_destroy(struct dst_entry *dst)
{
struct rtable *rt = (struct rtable *) dst;
if (!list_empty(&rt->rt_uncached)) {
spin_lock_bh(&rt_uncached_lock);
list_del(&rt->rt_uncached);
spin_unlock_bh(&rt_uncached_lock);
}
} | 0 | [
"CWE-17"
] | linux | df4d92549f23e1c037e83323aff58a21b3de7fe0 | 150,247,193,048,983,610,000,000,000,000,000,000,000 | 10 | ipv4: try to cache dst_entries which would cause a redirect
Not caching dst_entries which cause redirects could be exploited by hosts
on the same subnet, causing a severe DoS attack. This effect aggravated
since commit f88649721268999 ("ipv4: fix dst race in sk_dst_get()").
Lookups causing redirects will be allocated... |
*/
static inline void skb_checksum_complete_unset(struct sk_buff *skb)
{
if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->ip_summed = CHECKSUM_NONE; | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 171,770,684,177,397,900,000,000,000,000,000,000,000 | 5 | 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... |
int _gnutls_pkcs7_decrypt_data(const gnutls_datum_t * data,
const char *password, gnutls_datum_t * dec)
{
int result, len;
char enc_oid[64];
gnutls_datum_t tmp;
ASN1_TYPE pbes2_asn = ASN1_TYPE_EMPTY, pkcs7_asn = ASN1_TYPE_EMPTY;
int params_start, params_end, params_len;
struct pbkdf2_p... | 0 | [] | gnutls | 112d537da5f3500f14316db26d18c37d678a5e0e | 136,933,103,528,971,570,000,000,000,000,000,000,000 | 94 | some changes for 64bit machines. |
decide_whether_version_node (struct cgraph_node *node)
{
class ipa_node_params *info = IPA_NODE_REF (node);
int i, count = ipa_get_param_count (info);
vec<tree> known_csts;
vec<ipa_polymorphic_call_context> known_contexts;
bool ret = false;
if (count == 0)
return false;
if (dump_file && (dump_flags ... | 0 | [
"CWE-20"
] | gcc | a09ccc22459c565814f79f96586fe4ad083fe4eb | 43,834,343,021,815,150,000,000,000,000,000,000,000 | 95 | 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 |
static ssize_t lbs_bcnmiss_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos)
{
return lbs_threshold_read(TLV_TYPE_BCNMISS, CMD_SUBSCRIBE_BCNMISS,
file, userbuf, count, ppos);
} | 0 | [
"CWE-703",
"CWE-189"
] | linux | a497e47d4aec37aaf8f13509f3ef3d1f6a717d88 | 161,233,608,074,525,710,000,000,000,000,000,000,000 | 6 | libertas: potential oops in debugfs
If we do a zero size allocation then it will oops. Also we can't be
sure the user passes us a NUL terminated string so I've added a
terminator.
This code can only be triggered by root.
Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-... |
static int AppLayerProtoDetectTest13(void)
{
AppLayerProtoDetectUnittestCtxBackup();
AppLayerProtoDetectSetup();
uint8_t l7data[] = "CONNECT www.ssllabs.com:443 HTTP/1.0\r\n";
uint8_t l7data_resp[] = "HTTP/1.1 405 Method Not Allowed\r\n";
int r = 0;
Flow f;
AppProto pm_results[ALPROTO_MAX];... | 0 | [
"CWE-20"
] | suricata | 8357ef3f8ffc7d99ef6571350724160de356158b | 55,255,118,757,833,830,000,000,000,000,000,000,000 | 85 | proto/detect: workaround dns misdetected as dcerpc
The DCERPC UDP detection would misfire on DNS with transaction
ID 0x0400. This would happen as the protocol detection engine
gives preference to pattern based detection over probing parsers for
performance reasons.
This hack/workaround fixes this specific case by sti... |
FIFOSampleBuffer::FIFOSampleBuffer(int numChannels)
{
assert(numChannels > 0);
sizeInBytes = 0; // reasonable initial value
buffer = NULL;
bufferUnaligned = NULL;
samplesInBuffer = 0;
bufferPos = 0;
channels = (uint)numChannels;
ensureCapacity(32); // allocate initial capaci... | 0 | [
"CWE-617"
] | soundtouch | 107f2c5d201a4dfea1b7f15c5957ff2ac9e5f260 | 153,816,731,009,414,360,000,000,000,000,000,000,000 | 11 | Replaced illegal-number-of-channel assertions with run-time exception |
static CURLcode file_disconnect(struct connectdata *conn,
bool dead_connection)
{
struct FILEPROTO *file = conn->data->req.protop;
(void)dead_connection; /* not used */
if(file) {
Curl_safefree(file->freepath);
file->path = NULL;
if(file->fd != -1)
close(file->fd... | 0 | [] | curl | 1b71bc532bde8621fd3260843f8197182a467ff2 | 273,609,591,795,913,850,000,000,000,000,000,000,000 | 16 | file: on Windows, refuse paths that start with \\
... as that might cause an unexpected SMB connection to a given host
name.
Reported-by: Fernando Muñoz
CVE-2019-15601
Bug: https://curl.haxx.se/docs/CVE-2019-15601.html |
static int mv_read_header(AVFormatContext *avctx)
{
MvContext *mv = avctx->priv_data;
AVIOContext *pb = avctx->pb;
AVStream *ast = NULL, *vst = NULL; //initialization to suppress warning
int version, i;
int ret;
avio_skip(pb, 4);
version = avio_rb16(pb);
if (version == 2) {
uin... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 4f05e2e2dc1a89f38cd9f0960a6561083d714f1e | 312,425,910,988,633,840,000,000,000,000,000,000,000 | 139 | avformat/mvdec: Fix DoS due to lack of eof check
Fixes: loop.mv
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static long evdev_do_ioctl(struct file *file, unsigned int cmd,
void __user *p, int compat_mode)
{
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
struct input_dev *dev = evdev->handle.dev;
struct input_absinfo abs;
struct ff_effect effect;
int __user *ip = (int __user... | 0 | [] | linux | 7c4f56070fde2367766fa1fb04852599b5e1ad35 | 81,642,179,211,698,800,000,000,000,000,000,000,000 | 203 | Input: evdev - fix EVIOCG{type} ioctl
The 'max' size passed into the function is measured in number of bits
(KEY_MAX, LED_MAX, etc) so we need to convert it accordingly before trying
to copy the data out, otherwise we will try copying too much and end up
with up with a page fault.
Reported-by: Pavel Machek <pavel@ucw... |
Method* InstanceKlass::method_at_itable(InstanceKlass* holder, int index, TRAPS) {
bool implements_interface; // initialized by method_at_itable_or_null
Method* m = method_at_itable_or_null(holder, index,
implements_interface); // out parameter
if (m != NULL) {
assert(im... | 0 | [] | jdk17u | f8eb9abe034f7c6bea4da05a9ea42017b3f80730 | 5,086,637,255,124,456,000,000,000,000,000,000,000 | 26 | 8270386: Better verification of scan methods
Reviewed-by: coleenp
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
void PDFDoc::replacePageDict(int pageNo, int rotate,
const PDFRectangle *mediaBox,
const PDFRectangle *cropBox)
{
Ref *refPage = getCatalog()->getPageRef(pageNo);
Object page = getXRef()->fetch(*refPage);
Dict *pageDict = page.getDict();
pageDict->remove... | 0 | [
"CWE-787"
] | poppler | fada09a2ccc11a3a1d308e810f1336d8df6011fd | 273,865,978,751,338,970,000,000,000,000,000,000,000 | 36 | pdfunite: Fix stack overflow on broken file
Fixes issue #741 |
STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp)
{
FILE *f = stbi__fopen(filename, "rb");
stbi__uint16 *result;
if (!f) return (stbi_us *) stbi__errpuc("can't fopen", "Unable to open file");
result = stbi_load_from_file_16(f,x,y,comp,req_comp);
fclose(f);
re... | 0 | [
"CWE-787"
] | stb | 5ba0baaa269b3fd681828e0e3b3ac0f1472eaf40 | 7,288,161,404,193,314,000,000,000,000,000,000,000 | 9 | 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. |
static void await_references(H264Context *h)
{
const int mb_xy = h->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
int refs[2][48];
int nrefs[2] = { 0 };
int ref, list;
memset(refs, -1, sizeof(refs));
if (IS_16X16(mb_type)) {
get_lowest_part_y(h, refs, 0, 16, 0,
... | 0 | [
"CWE-703"
] | FFmpeg | 29ffeef5e73b8f41ff3a3f2242d356759c66f91f | 115,934,529,008,473,780,000,000,000,000,000,000,000 | 107 | avcodec/h264: do not trust last_pic_droppable when marking pictures as done
This simplifies the code and fixes a deadlock
Fixes Ticket2927
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
**/
static CImg<T>& empty() {
static CImg<T> _empty;
return _empty.assign(); | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 166,471,937,891,072,850,000,000,000,000,000,000,000 | 4 | Fix other issues in 'CImg<T>::load_bmp()'. |
extract_data(struct archive *ar, struct archive *aw)
{
int r;
size_t size;
const void *block;
int64_t offset;
for (;;) {
r = archive_read_data_block(ar, &block, &size, &offset);
if (r == ARCHIVE_EOF)
return (ARCHIVE_OK);
if (r != ARCHIVE_OK) {
lafe_warnc(archive_errno(ar),
"%s", archive_error_s... | 0 | [
"CWE-703",
"CWE-22"
] | libarchive | 59357157706d47c365b2227739e17daba3607526 | 226,463,568,197,232,100,000,000,000,000,000,000,000 | 24 | Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
This fixes a directory traversal in the cpio tool. |
static uid_t get_caller_uid(GDBusConnection *connection, GDBusMethodInvocation *invocation, const char *caller)
{
GError *error = NULL;
guint caller_uid;
GDBusProxy * proxy = g_dbus_proxy_new_sync(connection,
G_DBUS_PROXY_FLAGS_NONE,
... | 0 | [
"CWE-59"
] | abrt | 7417505e1d93cc95ec648b74e3c801bc67aacb9f | 213,574,268,903,249,760,000,000,000,000,000,000,000 | 48 | daemon, dbus: allow only root to create CCpp, Koops, vmcore and xorg
Florian Weimer <fweimer@redhat.com>:
This prevents users from feeding things that are not actually
coredumps and excerpts from /proc to these analyzers.
For example, it should not be possible to trigger a rule with
“EVENT=post-create... |
build_qfs_info_req(struct kvec *iov, struct cifs_tcon *tcon, int level,
int outbuf_len, u64 persistent_fid, u64 volatile_fid)
{
int rc;
struct smb2_query_info_req *req;
cifs_dbg(FYI, "Query FSInfo level %d\n", level);
if ((tcon->ses == NULL) || (tcon->ses->server == NULL))
return -EIO;
rc = small_smb2_in... | 0 | [
"CWE-476"
] | linux | cabfb3680f78981d26c078a26e5c748531257ebb | 254,578,364,326,228,530,000,000,000,000,000,000,000 | 30 | 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> |
static inline int get_dwords(OHCIState *ohci,
dma_addr_t addr, uint32_t *buf, int num)
{
int i;
addr += ohci->localmem_base;
for (i = 0; i < num; i++, buf++, addr += sizeof(*buf)) {
if (dma_memory_read(ohci->as, addr, buf, sizeof(*buf))) {
return -1;
... | 0 | [
"CWE-835"
] | qemu | 95ed56939eb2eaa4e2f349fe6dcd13ca4edfd8fb | 297,388,094,781,980,520,000,000,000,000,000,000,000 | 16 | usb: ohci: limit the number of link eds
The guest may builds an infinite loop with link eds. This patch
limit the number of linked ed to avoid this.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Message-id: 5899a02e.45ca240a.6c373.93c1@mx.google.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> |
int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox)
{
ADDRESS *p, *last = NULL, *t;
int rv = -1;
p = *a;
last = NULL;
while (p)
{
if (ascii_strcasecmp (mailbox, p->mailbox) == 0)
{
if (last)
last->next = p->next;
else
(*a) = p->next;
t = p;
p = p->next;
... | 0 | [
"CWE-401"
] | mutt | 4a2becbdb4422aaffe3ce314991b9d670b7adf17 | 165,857,264,854,201,600,000,000,000,000,000,000,000 | 29 | Fix memory leak parsing group addresses without a display name.
When there was a group address terminator with no previous
addresses (including the group display-name), an address would be
allocated but not attached to the address list.
Change this to only allocate when last exists.
It would be more correct to not a... |
static char **alloc_pg_vec(struct tpacket_req *req, int order)
{
unsigned int block_nr = req->tp_block_nr;
char **pg_vec;
int i;
pg_vec = kzalloc(block_nr * sizeof(char *), GFP_KERNEL);
if (unlikely(!pg_vec))
goto out;
for (i = 0; i < block_nr; i++) {
pg_vec[i] = alloc_one_pg_vec_page(order);
if (unlikely... | 0 | [
"CWE-909"
] | linux-2.6 | 67286640f638f5ad41a946b9a3dc75327950248f | 286,781,818,804,652,400,000,000,000,000,000,000,000 | 24 | net: packet: fix information leak to userland
packet_getname_spkt() doesn't initialize all members of sa_data field of
sockaddr struct if strlen(dev->name) < 13. This structure is then copied
to userland. It leads to leaking of contents of kernel stack memory.
We have to fully fill sa_data with strncpy() instead of ... |
static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
void *data)
{
struct nfs_closeres *res = data;
struct compound_hdr hdr;
int status;
status = decode_compound_hdr(xdr, &hdr);
if (status)
goto out;
status = decode_sequence(xdr, &res->seq_res, rqstp);
if (status)
goto out;... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 189,722,454,261,122,320,000,000,000,000,000,000,000 | 31 | nfs: Fix getxattr kernel panic and memory overflow
Move the buffer size check to decode_attr_security_label() before memcpy()
Only call memcpy() if the buffer is large enough
Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
Signed-off-by: Jeffrey Mitchell <jeffrey.mitchell@starlab.io>
[Trond: clean u... |
static void
mysql_ssl_free(MYSQL *mysql MY_ATTRIBUTE((unused)))
{
struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd;
DBUG_ENTER("mysql_ssl_free");
my_free(mysql->options.ssl_key);
my_free(mysql->options.ssl_cert);
my_free(mysql->options.ssl_ca);
my_free(mysql->options.ssl_capath);
my_... | 1 | [
"CWE-319"
] | mysql-server | 0002e1380d5f8c113b6bce91f2cf3f75136fd7c7 | 294,174,924,938,812,930,000,000,000,000,000,000,000 | 32 | BUG#25575605: SETTING --SSL-MODE=REQUIRED SENDS CREDENTIALS BEFORE VERIFYING SSL CONNECTION
MYSQL_OPT_SSL_MODE option introduced.
It is set in case of --ssl-mode=REQUIRED and permits only SSL connection.
(cherry picked from commit f91b941842d240b8a62645e507f5554e8be76aec) |
xfs_bmap_add_extent_hole_real(
struct xfs_trans *tp,
struct xfs_inode *ip,
int whichfork,
struct xfs_iext_cursor *icur,
struct xfs_btree_cur **curp,
struct xfs_bmbt_irec *new,
xfs_fsblock_t *first,
struct xfs_defer_ops *dfops,
int *logflagsp)
{
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork);
struc... | 0 | [] | linux | 2c4306f719b083d17df2963bc761777576b8ad1b | 56,241,918,355,446,340,000,000,000,000,000,000,000 | 213 | xfs: set format back to extents if xfs_bmap_extents_to_btree
If xfs_bmap_extents_to_btree fails in a mode where we call
xfs_iroot_realloc(-1) to de-allocate the root, set the
format back to extents.
Otherwise we can assume we can dereference ifp->if_broot
based on the XFS_DINODE_FMT_BTREE format, and crash.
Bugzilla... |
njs_typed_array_prototype_reduce(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t right)
{
int64_t i, from, to, increment, length;
njs_int_t ret;
njs_value_t *this, accumulator;
njs_value_t arguments[5];
njs_function_t *function;
njs_t... | 0 | [
"CWE-703"
] | njs | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | 338,244,635,300,451,000,000,000,000,000,000,000,000 | 80 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. |
static int ssl23_no_ssl2_ciphers(SSL *s)
{
SSL_CIPHER *cipher;
STACK_OF(SSL_CIPHER) *ciphers;
int i;
ssl_set_client_disabled(s);
ciphers = SSL_get_ciphers(s);
for (i = 0; i < sk_SSL_CIPHER_num(ciphers); i++)
{
cipher = sk_SSL_CIPHER_value(ciphers, i);
if (ssl_cipher_disabled(s, cipher, SSL_SECOP_CIPHER_SUP... | 0 | [
"CWE-310"
] | openssl | cf6da05304d554aaa885151451aa4ecaa977e601 | 207,704,078,083,828,000,000,000,000,000,000,000,000 | 17 | Support TLS_FALLBACK_SCSV.
Reviewed-by: Stephen Henson <steve@openssl.org> |
ext4_mb_normalize_request(struct ext4_allocation_context *ac,
struct ext4_allocation_request *ar)
{
struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb);
int bsbits, max;
ext4_lblk_t end;
loff_t size, start_off;
loff_t orig_size __maybe_unused;
ext4_lblk_t start;
struct ext4_inode_info *ei = EXT4_I(ac->ac_inode);
... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 51,210,436,655,620,940,000,000,000,000,000,000,000 | 193 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
static void init_once(void *foo)
{
struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
INIT_LIST_HEAD(&ei->i_orphan);
init_rwsem(&ei->xattr_sem);
init_rwsem(&ei->i_data_sem);
init_rwsem(&ei->i_mmap_sem);
inode_init_once(&ei->vfs_inode);
} | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 331,248,687,112,567,300,000,000,000,000,000,000,000 | 10 | 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... |
void kernel_shutdown_prepare(enum system_states state)
{
blocking_notifier_call_chain(&reboot_notifier_list,
(state == SYSTEM_HALT)?SYS_HALT:SYS_POWER_OFF, NULL);
system_state = state;
device_shutdown();
} | 0 | [
"CWE-20"
] | linux-2.6 | 9926e4c74300c4b31dee007298c6475d33369df0 | 208,713,833,834,523,500,000,000,000,000,000,000,000 | 7 | CPU time limit patch / setrlimit(RLIMIT_CPU, 0) cheat fix
As discovered here today, the change in Kernel 2.6.17 intended to inhibit
users from setting RLIMIT_CPU to 0 (as that is equivalent to unlimited) by
"cheating" and setting it to 1 in such a case, does not make a difference,
as the check is done in the wrong pla... |
string HevcSpsUnit::getDescription() const
{
string result = getProfileString();
result += string(" Resolution: ") + int32ToStr(pic_width_in_luma_samples) + string(":") +
int32ToStr(pic_height_in_luma_samples);
result += (interlaced_source_flag ? string("i") : string("p"));
double fps = g... | 0 | [
"CWE-22"
] | tsMuxer | 3763dd34755a8944d903aa19578fa22cd3734165 | 40,814,793,382,542,377,000,000,000,000,000,000,000 | 12 | Fix Buffer Overflow
Fixes issue #509. |
static void __net_exit nfnetlink_net_exit_batch(struct list_head *net_exit_list)
{
struct net *net;
list_for_each_entry(net, net_exit_list, exit_list)
RCU_INIT_POINTER(net->nfnl, NULL);
synchronize_net();
list_for_each_entry(net, net_exit_list, exit_list)
netlink_kernel_release(net->nfnl_stash);
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 160,859,836,420,100,900,000,000,000,000,000,000,000 | 10 | net: Use netlink_ns_capable to verify the permisions of netlink messages
It is possible by passing a netlink socket to a more privileged
executable and then to fool that executable into writing to the socket
data that happens to be valid netlink message to do something that
privileged executable did not intend to do.
... |
TEST_F(NgramKernelTest, TestOverlappingPaddedNGrams) {
// This test validates that n-grams with both left and right padding in a
// single ngram token are created correctly.
MakeOp("|", {3}, "LP", "RP", -1, false);
// Batch items are:
// 0: "a"
// 1: "b", "c", "d"
// 2: "e", "f"
AddInputFromArray<tstrin... | 0 | [
"CWE-703",
"CWE-787"
] | tensorflow | ba424dd8f16f7110eea526a8086f1a155f14f22b | 203,567,788,802,545,900,000,000,000,000,000,000,000 | 21 | Enhance validation of ngram op and handle case of 0 tokens.
PiperOrigin-RevId: 369940178
Change-Id: Ia82f42c09d14efe76e7dc013505b832a42282f0b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.