func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
void *merge_directory_configs(apr_pool_t *mp, void *_parent, void *_child)
{
directory_config *parent = (directory_config *)_parent;
directory_config *child = (directory_config *)_child;
directory_config *merged = create_directory_config(mp, NULL);
#ifdef DEBUG_CONF
ap_log_perror(APLOG_MARK, APLOG_... | 0 | [
"CWE-20",
"CWE-611"
] | ModSecurity | d4d80b38aa85eccb26e3c61b04d16e8ca5de76fe | 174,905,201,113,194,640,000,000,000,000,000,000,000 | 320 | Added SecXmlExternalEntity |
static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
{
clear_bit(flag, bits);
} | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 149,738,681,535,258,100,000,000,000,000,000,000,000 | 4 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
void dcn20_populate_dml_writeback_from_context(
struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes)
{
int pipe_cnt, i;
for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
struct dc_writeback_info *wb_info = &res_ctx->pipe_ctx[i].stream->writeback_info[0];
if (!res_ct... | 0 | [
"CWE-400",
"CWE-703",
"CWE-401"
] | linux | 055e547478a11a6360c7ce05e2afc3e366968a12 | 187,849,459,837,157,730,000,000,000,000,000,000,000 | 36 | drm/amd/display: memory leak
In dcn*_clock_source_create when dcn20_clk_src_construct fails allocated
clk_src needs release.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> |
static ssize_t fuse_direct_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
ssize_t res;
struct inode *inode = file->f_path.dentry->d_inode;
if (is_bad_inode(inode))
return -EIO;
res = fuse_direct_io(file, buf, count, ppos, 0);
fuse_invalidate_attr(inode);
return res;
} | 0 | [] | linux-2.6 | 0bd87182d3ab18a32a8e9175d3f68754c58e3432 | 213,990,682,764,256,540,000,000,000,000,000,000,000 | 15 | fuse: fix kunmap in fuse_ioctl_copy_user
Looks like another victim of the confusing kmap() vs kmap_atomic() API
differences.
Reported-by: Todor Gyumyushev <yodor1@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Cc: stable@kern... |
vhost_user_get_inflight_fd(struct virtio_net **pdev,
struct vhu_msg_context *ctx,
int main_fd __rte_unused)
{
struct rte_vhost_inflight_info_packed *inflight_packed;
uint64_t pervq_inflight_size, mmap_size;
uint16_t num_queues, queue_size;
struct virtio_net *dev = *pdev;
int fd, i, j;
int numa_node = ... | 1 | [
"CWE-703"
] | dpdk | af74f7db384ed149fe42b21dbd7975f8a54ef227 | 33,623,247,974,536,320,000,000,000,000,000,000,000 | 94 | vhost: fix FD leak with inflight messages
Even if unlikely, a buggy vhost-user master might attach fds to inflight
messages. Add checks like for other types of vhost-user messages.
Fixes: d87f1a1cb7b6 ("vhost: support inflight info sharing")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.co... |
void sched_idle_next(void)
{
int this_cpu = smp_processor_id();
struct rq *rq = cpu_rq(this_cpu);
struct task_struct *p = rq->idle;
unsigned long flags;
/* cpu has to be offline */
BUG_ON(cpu_online(this_cpu));
/*
* Strictly not necessary since rest of the CPUs are stopped by now
* and interrupts disabled ... | 0 | [] | linux-2.6 | 8f1bc385cfbab474db6c27b5af1e439614f3025c | 250,992,093,315,132,000,000,000,000,000,000,000,000 | 23 | sched: fair: weight calculations
In order to level the hierarchy, we need to calculate load based on the
root view. That is, each task's load is in the same unit.
A
/ \
B 1
/ \
2 3
To compute 1's load we do:
weight(1)
--------------
rq_weight(A)
To ... |
*/
static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
struct sk_buff_head *head)
{
if (!skb_queue_empty(list)) {
__skb_queue_splice(list, head->prev, (struct sk_buff *) head);
head->qlen += list->qlen;
__skb_queue_head_init(list);
} | 0 | [
"CWE-20"
] | linux | 2b16f048729bf35e6c28a40cbfad07239f9dcd90 | 233,819,840,886,779,000,000,000,000,000,000,000,000 | 9 | 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... |
Binary::Binary() {
format_ = LIEF::EXE_FORMATS::FORMAT_MACHO;
} | 0 | [
"CWE-703"
] | LIEF | 7acf0bc4224081d4f425fcc8b2e361b95291d878 | 334,470,605,167,625,260,000,000,000,000,000,000,000 | 3 | Resolve #764 |
void ZrtpStateClass::evDetect(void) {
DEBUGOUT((cout << "Checking for match in Detect.\n"));
char *msg, first, last;
uint8_t *pkt;
uint32_t errorCode = 0;
/*
* First check the general event type, then discrimnate
* the real event.
*/
if (event->type == ZrtpPacket) {
pkt... | 0 | [
"CWE-119"
] | ZRTPCPP | c8617100f359b217a974938c5539a1dd8a120b0e | 32,885,919,697,249,452,000,000,000,000,000,000,000 | 149 | Fix vulnerabilities found and reported by Mark Dowd
- limit length of memcpy
- limit number of offered algorithms in Hello packet
- length check in PING packet
- fix a small coding error |
print_distance_range(FILE* f, OnigDistance a, OnigDistance b)
{
if (a == ONIG_INFINITE_DISTANCE)
fputs("inf", f);
else
fprintf(f, "(%u)", a);
fputs("-", f);
if (b == ONIG_INFINITE_DISTANCE)
fputs("inf", f);
else
fprintf(f, "(%u)", b);
} | 0 | [
"CWE-125"
] | php-src | c6e34d91b88638966662caac62c4d0e90538e317 | 215,382,974,063,760,570,000,000,000,000,000,000,000 | 14 | Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node) |
R_API int r_socket_close(RSocket *s) {
int ret = false;
if (!s) {
return false;
}
if (s->fd != R_INVALID_SOCKET) {
#if __UNIX__
shutdown (s->fd, SHUT_RDWR);
#endif
#if __WINDOWS__
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms740481(v=vs.85).aspx
shutdown (s->fd, SD_SEND);
if (r_socket_rea... | 0 | [
"CWE-78"
] | radare2 | 04edfa82c1f3fa2bc3621ccdad2f93bdbf00e4f9 | 7,698,250,400,327,171,000,000,000,000,000,000,000 | 32 | Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being creat... |
void APar_ShowMPEG4AACProfileInfo(TrackInfo *track_info) {
if (track_info->descriptor_object_typeID == 1) {
fprintf(stdout, " MPEG-4 AAC Main Profile");
} else if (track_info->descriptor_object_typeID == 2) {
fprintf(
stdout,
" MPEG-4 AAC Low Complexity/LC Profile"); // most files will lan... | 0 | [
"CWE-787"
] | atomicparsley | d72ccf06c98259d7261e0f3ac4fd8717778782c1 | 165,598,504,010,110,280,000,000,000,000,000,000,000 | 80 | Avoid stack overflow
refs: https://github.com/wez/atomicparsley/issues/32 |
static int pgx_gethdr(jas_stream_t *in, pgx_hdr_t *hdr)
{
int c;
uchar buf[2];
if ((c = jas_stream_getc(in)) == EOF) {
goto error;
}
buf[0] = c;
if ((c = jas_stream_getc(in)) == EOF) {
goto error;
}
buf[1] = c;
hdr->magic = buf[0] << 8 | buf[1];
if (hdr->magic != PGX_MAGIC) {
jas_eprintf("invalid PGX s... | 1 | [
"CWE-20",
"CWE-190"
] | jasper | d42b2388f7f8e0332c846675133acea151fc557a | 92,248,045,301,257,220,000,000,000,000,000,000,000 | 46 | The generation of the configuration file jas_config.h has been completely
reworked in order to avoid pollution of the global namespace.
Some problematic types like uchar, ulong, and friends have been replaced
with names with a jas_ prefix.
An option max_samples has been added to the BMP and JPEG decoders to
restrict ... |
static int fuse_fsync(struct file *file, loff_t start, loff_t end,
int datasync)
{
struct inode *inode = file->f_mapping->host;
struct fuse_conn *fc = get_fuse_conn(inode);
int err;
if (is_bad_inode(inode))
return -EIO;
inode_lock(inode);
/*
* Start writeback against all dirty pages of the inode, t... | 1 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 167,431,050,107,389,430,000,000,000,000,000,000,000 | 49 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
CImg<Tfloat> get_RGBtoXYZ(const bool use_D65=true) const {
return CImg<Tfloat>(*this,false).RGBtoXYZ(use_D65);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 254,584,378,258,595,680,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static inline void io_req_complete(struct io_kiocb *req, long res)
{
__io_req_complete(req, 0, res, 0);
} | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 224,832,253,714,481,100,000,000,000,000,000,000,000 | 4 | io_uring: ensure that SQPOLL thread is started for exit
If we create it in a disabled state because IORING_SETUP_R_DISABLED is
set on ring creation, we need to ensure that we've kicked the thread if
we're exiting before it's been explicitly disabled. Otherwise we can run
into a deadlock where exit is waiting go park t... |
void AbstractSqlMigrator::dumpStatus()
{
qWarning() << " executed Query:";
qWarning() << qPrintable(executedQuery());
qWarning() << " bound Values:";
QList<QVariant> list = boundValues();
for (int i = 0; i < list.size(); ++i)
qWarning() << i << ": " << list.at(i).toString().toAscii().data(... | 0 | [
"CWE-89"
] | quassel | aa1008be162cb27da938cce93ba533f54d228869 | 278,182,301,496,813,160,000,000,000,000,000,000,000 | 11 | Fixing security vulnerability with Qt 4.8.5+ and PostgreSQL.
Properly detects whether Qt performs slash escaping in SQL queries or
not, and then configures PostgreSQL accordingly. This bug was a
introduced due to a bugfix in Qt 4.8.5 disables slash escaping when
binding queries: https://bugreports.qt-project.org/brows... |
static void ep_free(struct eventpoll *ep)
{
struct rb_node *rbp;
struct epitem *epi;
/* We need to release all tasks waiting for these file */
if (waitqueue_active(&ep->poll_wait))
ep_poll_safewake(&ep->poll_wait);
/*
* We need to lock this because we could be hit by
* eventpoll_release_file() while we're ... | 0 | [] | linux-2.6 | 28d82dc1c4edbc352129f97f4ca22624d1fe61de | 322,347,267,337,918,430,000,000,000,000,000,000,000 | 44 | epoll: limit paths
The current epoll code can be tickled to run basically indefinitely in
both loop detection path check (on ep_insert()), and in the wakeup paths.
The programs that tickle this behavior set up deeply linked networks of
epoll file descriptors that cause the epoll algorithms to traverse them
indefinitel... |
void dname_pkt_copy(sldns_buffer* pkt, uint8_t* to, uint8_t* dname)
{
/* copy over the dname and decompress it at the same time */
size_t len = 0;
uint8_t lablen;
lablen = *dname++;
while(lablen) {
if(LABEL_IS_PTR(lablen)) {
/* follow pointer */
dname = sldns_buffer_at(pkt, PTR_OFFSET(lablen, *dname));
... | 1 | [
"CWE-835"
] | unbound | 2d444a5037acff6024630b88092d9188f2f5d8fe | 274,904,599,341,244,770,000,000,000,000,000,000,000 | 33 | - Fix Insufficient Handling of Compressed Names in dname_pkt_copy(),
reported by X41 D-Sec. |
connection_write_chunkqueue (connection * const con, chunkqueue * const restrict cq, off_t max_bytes)
{
/*assert(!chunkqueue_is_empty(cq));*//* checked by callers */
con->write_request_ts = log_epoch_secs;
max_bytes = connection_write_throttle(con, max_bytes);
if (0 == max_bytes) return 1;
off_t ... | 0 | [
"CWE-703"
] | lighttpd1.4 | b03b86f47b0d5a553137f081fadc482b4af1372d | 267,932,140,397,626,840,000,000,000,000,000,000,000 | 63 | [core] fix merging large headers across mult reads (fixes #3059)
(thx mitd)
x-ref:
"Connections stuck in Close_Wait causing 100% cpu usage"
https://redmine.lighttpd.net/issues/3059 |
void mem_cgroup_replace_page_cache(struct page *oldpage,
struct page *newpage)
{
struct mem_cgroup *memcg;
struct page_cgroup *pc;
enum charge_type type = MEM_CGROUP_CHARGE_TYPE_CACHE;
if (mem_cgroup_disabled())
return;
pc = lookup_page_cgroup(oldpage);
/* fix accounting on old pages */
lock_page_cgrou... | 0 | [
"CWE-476",
"CWE-415"
] | linux | 371528caec553785c37f73fa3926ea0de84f986f | 28,816,713,359,882,840,000,000,000,000,000,000,000 | 28 | mm: memcg: Correct unregistring of events attached to the same eventfd
There is an issue when memcg unregisters events that were attached to
the same eventfd:
- On the first call mem_cgroup_usage_unregister_event() removes all
events attached to a given eventfd, and if there were no events left,
thresholds->prima... |
RList *r_bin_wasm_get_types (RBinWasmObj *bin) {
RBinWasmSection *type = NULL;
RList *types = NULL;
if (!bin || !bin->g_sections) {
return NULL;
}
if (bin->g_types) {
return bin->g_types;
}
if (!(types = r_bin_wasm_get_sections_by_id (bin->g_sections,
R_BIN_WASM_SECTION_TYPE))) {
return r_list_new... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | d2632f6483a3ceb5d8e0a5fb11142c51c43978b4 | 223,190,246,305,411,270,000,000,000,000,000,000,000 | 26 | Fix crash in fuzzed wasm r2_hoobr_consume_init_expr |
static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
void *data)
{
struct nfs4_accessres *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 ... | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 57,922,618,835,498,235,000,000,000,000,000,000,000 | 24 | 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... |
wc_get_ucs_table(wc_ccs ccs)
{
int f = WC_CCS_INDEX(ccs);
switch (WC_CCS_TYPE(ccs)) {
case WC_CCS_A_CS94:
if (f < WC_F_ISO_BASE || f > WC_F_CS94_END)
return NULL;
return &ucs_cs94_table[f - WC_F_ISO_BASE];
case WC_CCS_A_CS94W:
if (f < WC_F_ISO_BASE || f > WC_F_CS94W_END)
return NULL;
retu... | 0 | [
"CWE-119"
] | w3m | 716bc126638393c733399d11d3228edb82877faa | 51,518,017,312,520,240,000,000,000,000,000,000,000 | 37 | Prevent global-buffer-overflow in wc_any_to_ucs()
Bug-Debian: https://github.com/tats/w3m/issues/43 |
static void account_event(struct perf_event *event)
{
bool inc = false;
if (event->parent)
return;
if (event->attach_state & PERF_ATTACH_TASK)
inc = true;
if (event->attr.mmap || event->attr.mmap_data)
atomic_inc(&nr_mmap_events);
if (event->attr.comm)
atomic_inc(&nr_comm_events);
if (event->attr.task)
... | 0 | [
"CWE-667"
] | linux | 79c9ce57eb2d5f1497546a3946b4ae21b6fdc438 | 46,958,709,560,764,990,000,000,000,000,000,000,000 | 51 | perf/core: Fix perf_event_open() vs. execve() race
Jann reported that the ptrace_may_access() check in
find_lively_task_by_vpid() is racy against exec().
Specifically:
perf_event_open() execve()
ptrace_may_access()
commit_creds()
... if (get_dumpable() != SUID_DUMP_USER)
perf_event_exit_task();
... |
static uint32_t xhci_nec_challenge(uint32_t hi, uint32_t lo)
{
uint32_t val;
val = rotl(lo - 0x49434878, 32 - ((hi>>8) & 0x1F));
val += rotl(lo + 0x49434878, hi & 0x1F);
val -= rotl(hi ^ 0x49434878, (lo >> 16) & 0x1F);
return ~val;
} | 0 | [
"CWE-835"
] | qemu | 96d87bdda3919bb16f754b3d3fd1227e1f38f13c | 118,602,399,513,186,760,000,000,000,000,000,000,000 | 8 | xhci: guard xhci_kick_epctx against recursive calls
Track xhci_kick_epctx processing being active in a variable. Check the
variable before calling xhci_kick_epctx from xhci_kick_ep. Add an
assert to make sure we don't call recursively into xhci_kick_epctx.
Cc: 1653384@bugs.launchpad.net
Fixes: 94b037f2a451b3dc855f9... |
static const char *uvc_print_chain(struct uvc_video_chain *chain)
{
static char buffer[43];
char *p = buffer;
p += uvc_print_terms(&chain->entities, UVC_TERM_INPUT, p);
p += sprintf(p, " -> ");
uvc_print_terms(&chain->entities, UVC_TERM_OUTPUT, p);
return buffer;
} | 0 | [
"CWE-269"
] | linux | 68035c80e129c4cfec659aac4180354530b26527 | 15,936,165,866,801,200,000,000,000,000,000,000,000 | 11 | media: uvcvideo: Avoid cyclic entity chains due to malformed USB descriptors
Way back in 2017, fuzzing the 4.14-rc2 USB stack with syzkaller kicked
up the following WARNING from the UVC chain scanning code:
| list_add double add: new=ffff880069084010, prev=ffff880069084010,
| next=ffff880067d22298.
| ----------... |
void btreeFree(struct BTREE *btree) {
free(btree->records);
} | 0 | [
"CWE-20",
"CWE-703"
] | libmysofa | d39a171e9c6a1c44dbdf43f9db6c3fbd887e38c1 | 202,541,792,151,252,130,000,000,000,000,000,000,000 | 3 | Fixed security issue 1 |
backsql_process_filter_list( backsql_srch_info *bsi, Filter *f, int op )
{
int res;
if ( !f ) {
return 0;
}
backsql_strfcat_x( &bsi->bsi_flt_where,
bsi->bsi_op->o_tmpmemctx, "c", '(' /* ) */ );
while ( 1 ) {
res = backsql_process_filter( bsi, f );
if ( res < 0 ) {
/*
* TimesTen : If the query ... | 0 | [
"CWE-89"
] | openldap | 40f3ae4f5c9a8baf75b237220f62c436a571d66e | 260,044,009,336,828,070,000,000,000,000,000,000,000 | 48 | ITS#9815 slapd-sql: escape filter values
Escape filter values to slapd-sql (CVE-2022-29155) |
struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base,
int pinned)
{
if (pinned || !base->migration_enabled)
return base;
return &per_cpu(hrtimer_bases, get_nohz_timer_target());
} | 0 | [
"CWE-200"
] | tip | dfb4357da6ddbdf57d583ba64361c9d792b0e0b1 | 105,149,527,321,885,480,000,000,000,000,000,000,000 | 7 | time: Remove CONFIG_TIMER_STATS
Currently CONFIG_TIMER_STATS exposes process information across namespaces:
kernel/time/timer_list.c print_timer():
SEQ_printf(m, ", %s/%d", tmp, timer->start_pid);
/proc/timer_list:
#11: <0000000000000000>, hrtimer_wakeup, S:01, do_nanosleep, cron/2570
Given that the trac... |
static int id3_has_changed_values(struct playlist *pls, AVDictionary *metadata,
ID3v2ExtraMetaAPIC *apic)
{
AVDictionaryEntry *entry = NULL;
AVDictionaryEntry *oldentry;
/* check that no keys have changed values */
while ((entry = av_dict_get(metadata, "", entry, AV_DIC... | 0 | [
"CWE-416"
] | FFmpeg | 6959358683c7533f586c07a766acc5fe9544d8b2 | 183,970,058,749,584,140,000,000,000,000,000,000,000 | 27 | avformat/hls: check segment duration value of EXTINF
fix ticket: 8673
set the default EXTINF duration to 1ms if duration is smaller than 1ms
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
(cherry picked from commit 9dfb19baeb86a8bb02c53a441682c6e9a6e104cc) |
~DelayedDelivery() override {
discard();
} | 0 | [
"CWE-287",
"CWE-284"
] | ceph | 5ead97120e07054d80623dada90a5cc764c28468 | 200,658,035,353,410,850,000,000,000,000,000,000,000 | 3 | auth/cephx: add authorizer challenge
Allow the accepting side of a connection to reject an initial authorizer
with a random challenge. The connecting side then has to respond with an
updated authorizer proving they are able to decrypt the service's challenge
and that the new authorizer was produced for this specific ... |
static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
int *valp,
int write, void *data)
{
struct do_proc_dointvec_minmax_conv_param *param = data;
if (write) {
int val = *negp ? -*lvalp : *lvalp;
if ((param->min && *param->min > val) ||
(param->max && *param->max < val))
ret... | 0 | [
"CWE-284",
"CWE-264"
] | linux | bfdc0b497faa82a0ba2f9dddcf109231dd519fcc | 254,587,992,864,343,960,000,000,000,000,000,000,000 | 23 | sysctl: restrict write access to dmesg_restrict
When dmesg_restrict is set to 1 CAP_SYS_ADMIN is needed to read the kernel
ring buffer. But a root user without CAP_SYS_ADMIN is able to reset
dmesg_restrict to 0.
This is an issue when e.g. LXC (Linux Containers) are used and complete
user space is running without CA... |
SkipDataBlocks(gif_source_ptr sinfo)
/* Skip a series of data blocks, until a block terminator is found */
{
U_CHAR buf[256];
while (GetDataBlock(sinfo, buf) > 0)
/* skip */;
} | 0 | [
"CWE-369"
] | libjpeg-turbo | 1719d12e51641cce5c77e259516649ba5ef6303c | 41,639,473,888,115,520,000,000,000,000,000,000,000 | 8 | cjpeg: Fix FPE when compressing 0-width GIF
Fixes #493 |
static void audio_add(VncState *vs)
{
struct audio_capture_ops ops;
if (vs->audio_cap) {
error_report("audio already running");
return;
}
ops.notify = audio_capture_notify;
ops.destroy = audio_capture_destroy;
ops.capture = audio_capture;
vs->audio_cap = AUD_add_capture(vs... | 0 | [
"CWE-401"
] | qemu | 6bf21f3d83e95bcc4ba35a7a07cc6655e8b010b0 | 32,625,888,824,014,160,000,000,000,000,000,000,000 | 18 | vnc: fix memory leak when vnc disconnect
Currently when qemu receives a vnc connect, it creates a 'VncState' to
represent this connection. In 'vnc_worker_thread_loop' it creates a
local 'VncState'. The connection 'VcnState' and local 'VncState' exchange
data in 'vnc_async_encoding_start' and 'vnc_async_encoding_end'.
... |
static Image *ReadHDRImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
char
format[MaxTextExtent],
keyword[MaxTextExtent],
tag[MaxTextExtent],
value[MaxTextExtent];
double
gamma;
Image
*image;
int
c;
MagickBooleanType
status,
value_expected;
register Quan... | 0 | [
"CWE-20",
"CWE-703",
"CWE-835"
] | ImageMagick | 97aa7d7cfd2027f6ba7ce42caf8b798541b9cdc6 | 168,062,288,779,636,910,000,000,000,000,000,000,000 | 369 | Fixed infinite loop and added checks for the sscanf result. |
CryptRsaDecrypt(
TPM2B *dOut, // OUT: the decrypted data
TPM2B *cIn, // IN: the data to decrypt
OBJECT *key, // IN: the key to use for decryption
TPMT_RSA_DECRYPT *scheme, // IN: the padding scheme
const TPM2B *label ... | 1 | [
"CWE-787"
] | libtpms | 505ef841c00b4c096b1977c667cb957bec3a1d8b | 336,056,029,318,474,660,000,000,000,000,000,000,000 | 85 | tpm2: Fix output buffer parameter and size for RSA decyrption
For the RSA decryption we have to use an output buffer of the size of the
(largest possible) RSA key for the decryption to always work.
This fixes a stack corruption bug that caused a SIGBUS and termination of
'swtpm'.
Signed-off-by: Stefan Berger <stefan... |
bool fuse_write_update_size(struct inode *inode, loff_t pos)
{
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_inode *fi = get_fuse_inode(inode);
bool ret = false;
spin_lock(&fi->lock);
fi->attr_version = atomic64_inc_return(&fc->attr_version);
if (pos > inode->i_size) {
i_size_write(inode, pos);
re... | 0 | [
"CWE-459"
] | linux | 5d069dbe8aaf2a197142558b6fb2978189ba3454 | 222,262,658,567,487,700,000,000,000,000,000,000,000 | 16 | fuse: fix bad inode
Jan Kara's analysis of the syzbot report (edited):
The reproducer opens a directory on FUSE filesystem, it then attaches
dnotify mark to the open directory. After that a fuse_do_getattr() call
finds that attributes returned by the server are inconsistent, and calls
make_bad_inode() which,... |
WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
const char *option,const char *arg1n,const char *arg2n)
{
const char /* percent escaped versions of the args */
*arg1,
*arg2;
Image
*new_images;
MagickStatusType
status;
ssize_t
parse;
#define _image_info (... | 0 | [
"CWE-399",
"CWE-401"
] | ImageMagick | 4a334bbf5584de37c6f5a47c380a531c8c4b140a | 166,259,257,869,100,790,000,000,000,000,000,000,000 | 922 | https://github.com/ImageMagick/ImageMagick/issues/1623 |
__switch_to(struct task_struct *prev_p, struct task_struct *next_p)
{
struct thread_struct *prev = &prev_p->thread;
struct thread_struct *next = &next_p->thread;
int cpu = smp_processor_id();
struct tss_struct *tss = &per_cpu(init_tss, cpu);
unsigned fsindex, gsindex;
fpu_switch_t fpu;
fpu = switch_fpu_prepare(... | 1 | [
"CWE-200",
"CWE-401"
] | linux | f647d7c155f069c1a068030255c300663516420e | 92,234,122,397,960,570,000,000,000,000,000,000,000 | 109 | x86_64, switch_to(): Load TLS descriptors before switching DS and ES
Otherwise, if buggy user code points DS or ES into the TLS
array, they would be corrupted after a context switch.
This also significantly improves the comments and documents some
gotchas in the code.
Before this patch, the both tests below failed. ... |
bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
unsigned long address)
{
__bad_area(regs, error_code, address, SEGV_ACCERR);
} | 0 | [
"CWE-264"
] | linux | 548acf19234dbda5a52d5a8e7e205af46e9da840 | 152,000,543,461,170,400,000,000,000,000,000,000,000 | 5 | x86/mm: Expand the exception table logic to allow new handling options
Huge amounts of help from Andy Lutomirski and Borislav Petkov to
produce this. Andy provided the inspiration to add classes to the
exception table with a clever bit-squeezing trick, Boris pointed
out how much cleaner it would all be if we just had... |
inline int32_t QuantizeSoftmaxOutput(float prob_rescaled, int32_t zero_point) {
const int32_t prob_rnd = static_cast<int32_t>(std::round(prob_rescaled));
return prob_rnd + zero_point;
} | 0 | [
"CWE-476",
"CWE-369"
] | tensorflow | 15691e456c7dc9bd6be203b09765b063bf4a380c | 316,745,207,296,189,680,000,000,000,000,000,000,000 | 4 | Prevent dereferencing of null pointers in TFLite's `add.cc`.
PiperOrigin-RevId: 387244946
Change-Id: I56094233327fbd8439b92e1dbb1262176e00eeb9 |
findoprnd(QueryItem *ptr, int size)
{
uint32 pos;
pos = 0;
findoprnd_recurse(ptr, &pos, size);
if (pos != size)
elog(ERROR, "malformed tsquery: extra nodes");
} | 0 | [
"CWE-703",
"CWE-189"
] | postgres | 31400a673325147e1205326008e32135a78b4d8a | 144,980,761,052,676,170,000,000,000,000,000,000,000 | 10 | Predict integer overflow to avoid buffer overruns.
Several functions, mostly type input functions, calculated an allocation
size such that the calculation wrapped to a small positive value when
arguments implied a sufficiently-large requirement. Writes past the end
of the inadvertent small allocation followed shortly... |
CImg<T> get_threshold(const T& value, const bool soft_threshold=false, const bool strict_threshold=false) const {
return (+*this).threshold(value,soft_threshold,strict_threshold);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 170,385,158,191,784,200,000,000,000,000,000,000,000 | 3 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
static int recv_pkt(git_pkt **out, gitno_buffer *buf)
{
const char *ptr = buf->data, *line_end = ptr;
git_pkt *pkt = NULL;
int pkt_type, error = 0, ret;
do {
if (buf->offset > 0)
error = git_pkt_parse_line(&pkt, ptr, &line_end, buf->offset);
else
error = GIT_EBUFS;
if (error == 0)
break; /* return ... | 0 | [
"CWE-476",
"CWE-119"
] | libgit2 | 2fdef641fd0dd2828bd948234ae86de75221a11a | 146,776,508,880,194,530,000,000,000,000,000,000,000 | 35 | smart_pkt: treat empty packet lines as error
The Git protocol does not specify what should happen in the case
of an empty packet line (that is a packet line "0004"). We
currently indicate success, but do not return a packet in the
case where we hit an empty line. The smart protocol was not
prepared to handle such pack... |
static inline int sk_has_account(struct sock *sk)
{
/* return true if protocol supports memory accounting */
return !!sk->sk_prot->memory_allocated;
} | 0 | [
"CWE-400"
] | linux-2.6 | c377411f2494a931ff7facdbb3a6839b1266bcf6 | 146,144,118,591,462,640,000,000,000,000,000,000,000 | 5 | 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... |
MagickExport MagickBooleanType AnnotateImage(Image *image,
const DrawInfo *draw_info)
{
char
*p,
primitive[MaxTextExtent],
*text,
**textlist;
DrawInfo
*annotate,
*annotate_info;
GeometryInfo
geometry_info;
MagickBooleanType
status;
PointInfo
offset;
RectangleInfo
... | 1 | [
"CWE-401"
] | ImageMagick6 | 0b7d3675438cbcde824e751895847a0794406e08 | 43,271,922,742,203,170,000,000,000,000,000,000,000 | 304 | https://github.com/ImageMagick/ImageMagick/issues/1589 |
void utf2char(utf16_t *str, char *buffer, unsigned bufsz)
{
if(bufsz<1) return;
buffer[bufsz-1] = 0;
char *b = buffer;
while (*str != 0x00 && --bufsz>0)
{
char *chr = (char *)str;
*b++ = *chr;
str++;
}
*b = 0;
} | 0 | [
"CWE-787"
] | LibRaw | efd8cfabb93fd0396266a7607069901657c082e3 | 6,051,803,650,346,116,000,000,000,000,000,000,000 | 14 | X3F parser possible buffer overrun |
MONGO_EXPORT mongo_cursor* mongo_cursor_create( void ) {
return (mongo_cursor*)bson_malloc(sizeof(mongo_cursor));
} | 0 | [
"CWE-190"
] | mongo-c-driver-legacy | 1a1f5e26a4309480d88598913f9eebf9e9cba8ca | 134,654,247,628,877,280,000,000,000,000,000,000,000 | 3 | don't mix up int and size_t (first pass to fix that) |
void ConnectionManagerImpl::ActiveStream::refreshDurationTimeout() {
if (!filter_manager_.streamInfo().route() ||
!filter_manager_.streamInfo().route()->routeEntry() || !request_headers_) {
return;
}
const auto& route = filter_manager_.streamInfo().route()->routeEntry();
auto grpc_timeout = Grpc::Com... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 71,523,045,684,460,130,000,000,000,000,000,000,000 | 87 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void arcmsr_iop_parking(struct AdapterControlBlock *acb)
{
if (acb) {
/* stop adapter background rebuild */
if (acb->acb_flags & ACB_F_MSG_START_BGRB) {
uint32_t intmask_org;
acb->acb_flags &= ~ACB_F_MSG_START_BGRB;
intmask_org = arcmsr_disable_outbound_ints(acb);
arcmsr_stop_adapter_bgrb(acb);
... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 7bc2b55a5c030685b399bb65b6baa9ccc3d1f167 | 184,298,711,433,661,430,000,000,000,000,000,000,000 | 14 | scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer()
We need to put an upper bound on "user_len" so the memcpy() doesn't
overflow.
Cc: <stable@vger.kernel.org>
Reported-by: Marco Grassi <marco.gra@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Sig... |
virDomainParseMemory(const char *xpath,
const char *units_xpath,
xmlXPathContextPtr ctxt,
unsigned long long *mem,
bool required,
bool capped)
{
unsigned long long bytes, max;
max = virMemoryMaxValue(capped... | 0 | [
"CWE-212"
] | libvirt | a5b064bf4b17a9884d7d361733737fb614ad8979 | 211,972,771,008,039,650,000,000,000,000,000,000,000 | 24 | conf: Don't format http cookies unless VIR_DOMAIN_DEF_FORMAT_SECURE is used
Starting with 3b076391befc3fe72deb0c244ac6c2b4c100b410
(v6.1.0-122-g3b076391be) we support http cookies. Since they may contain
somewhat sensitive information we should not format them into the XML
unless VIR_DOMAIN_DEF_FORMAT_SECURE is assert... |
njs_typed_array_prototype_index_of(njs_vm_t *vm, njs_value_t *args,
njs_uint_t nargs, njs_index_t type)
{
double v;
int64_t i, i64, from, to, index, increment, offset, length;
njs_int_t ret, integer;
njs_value_t *this;
const float *f32;
cons... | 0 | [
"CWE-703"
] | njs | 5c6130a2a0b4c41ab415f6b8992aa323636338b9 | 87,997,912,113,384,600,000,000,000,000,000,000,000 | 221 | Fixed Array.prototype.fill() for typed-arrays.
This closes #478 issue on Github. |
static void get_object_list(int ac, const char **av)
{
struct rev_info revs;
char line[1000];
int flags = 0;
init_revisions(&revs, NULL);
save_commit_buffer = 0;
setup_revisions(ac, av, &revs, NULL);
/* make sure shallows are read */
is_repository_shallow();
while (fgets(line, sizeof(line), stdin) != NULL) ... | 0 | [
"CWE-119",
"CWE-787"
] | git | de1e67d0703894cb6ea782e36abb63976ab07e60 | 263,807,123,757,459,030,000,000,000,000,000,000,000 | 65 | list-objects: pass full pathname to callbacks
When we find a blob at "a/b/c", we currently pass this to
our show_object_fn callbacks as two components: "a/b/" and
"c". Callbacks which want the full value then call
path_name(), which concatenates the two. But this is an
inefficient interface; the path is a strbuf, and ... |
select_union_direct(THD *thd_arg, select_result *result_arg,
SELECT_LEX *last_select_lex_arg):
select_union(thd_arg), result(result_arg),
last_select_lex(last_select_lex_arg),
done_send_result_set_metadata(false), done_initialize_tables(false),
limit_found_rows(0)
{ send_record... | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 264,390,808,304,949,050,000,000,000,000,000,000,000 | 7 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
void CLASS bad_pixels (const char *cfname)
{
FILE *fp=0;
#ifndef LIBRAW_LIBRARY_BUILD
char *fname, *cp, line[128];
int len, time, row, col, r, c, rad, tot, n, fixed=0;
#else
char *cp, line[128];
int time, row, col, r, c, rad, tot, n;
#ifdef DCRAW_VERBOSE
int fixed = 0;
#endif
#endif
if (!filters) return;... | 0 | [] | LibRaw | c4e374ea6c979a7d1d968f5082b7d0ea8cd27202 | 18,694,756,394,670,820,000,000,000,000,000,000,000 | 59 | additional data checks backported from 0.15.4 |
EIGEN_STRONG_INLINE QInt32 operator*(const QInt8 a, const QUInt8 b) {
return QInt32(static_cast<int32_t>(a.value) * static_cast<int32_t>(b.value));
} | 0 | [
"CWE-908",
"CWE-787"
] | tensorflow | ace0c15a22f7f054abcc1f53eabbcb0a1239a9e2 | 93,212,524,288,380,080,000,000,000,000,000,000,000 | 3 | Default initialize fixed point Eigen types.
In certain cases, tensors are filled with default values of the type. But, for these fixed point types, these values were uninitialized. Thus, we would have uninitialized memory access bugs, some of which were caught by MSAN.
PiperOrigin-RevId: 344101137
Change-Id: I14555fd... |
static bool checkreturn find_extension_field(pb_field_iterator_t *iter)
{
unsigned start = iter->field_index;
do {
if (PB_LTYPE(iter->pos->type) == PB_LTYPE_EXTENSION)
return true;
(void)pb_field_next(iter);
} while (iter->field_index != start);
return false;
} | 0 | [
"CWE-125"
] | nanopb | 7b396821ddd06df8e39143f16e1dc0a4645b89a3 | 22,561,736,283,133,600,000,000,000,000,000,000,000 | 12 | Fix invalid free() after failed realloc() (GHSA-gcx3-7m76-287p) |
static int remove_uuid(struct btd_adapter *adapter, uuid_t *uuid)
{
struct mgmt_cp_remove_uuid cp;
uuid_t uuid128;
uint128_t uint128;
if (!is_supported_uuid(uuid)) {
btd_warn(adapter->dev_id,
"Ignoring unsupported UUID for removal");
return 0;
}
uuid_to_uuid128(&uuid128, uuid);
ntoh128((uint128_t *) u... | 0 | [
"CWE-862",
"CWE-863"
] | bluez | b497b5942a8beb8f89ca1c359c54ad67ec843055 | 228,668,654,098,269,050,000,000,000,000,000,000,000 | 29 | adapter: Fix storing discoverable setting
discoverable setting shall only be store when changed via Discoverable
property and not when discovery client set it as that be considered
temporary just for the lifetime of the discovery. |
static uint16_t nvme_set_zd_ext(NvmeNamespace *ns, NvmeZone *zone)
{
uint16_t status;
uint8_t state = nvme_get_zone_state(zone);
if (state == NVME_ZONE_STATE_EMPTY) {
status = nvme_aor_check(ns, 1, 0);
if (status) {
return status;
}
nvme_aor_inc_active(ns);
... | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 244,825,451,436,646,100,000,000,000,000,000,000,000 | 18 | hw/nvme: fix CVE-2021-3929
This fixes CVE-2021-3929 "locally" by denying DMA to the iomem of the
device itself. This still allows DMA to MMIO regions of other devices
(e.g. doing P2P DMA to the controller memory buffer of another NVMe
device).
Fixes: CVE-2021-3929
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Review... |
static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
__s32 *array, int bytes)
{
BUG_ON(bytes < (DEVCONF_MAX * 4));
memset(array, 0, bytes);
array[DEVCONF_FORWARDING] = cnf->forwarding;
array[DEVCONF_HOPLIMIT] = cnf->hop_limit;
array[DEVCONF_MTU6] = cnf->mtu6;
array[DEVCONF_ACCEPT_RA] = cnf->accept... | 0 | [
"CWE-20"
] | linux | 77751427a1ff25b27d47a4c36b12c3c8667855ac | 139,606,240,346,285,590,000,000,000,000,000,000,000 | 56 | 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... |
void InstanceKlass::print_class_load_logging(ClassLoaderData* loader_data,
const char* module_name,
const ClassFileStream* cfs) const {
if (!log_is_enabled(Info, class, load)) {
return;
}
ResourceMark rm;
LogMessage(c... | 0 | [] | jdk11u-dev | 41825fa33d605f8501164f9296572e4378e8183b | 190,269,224,035,620,220,000,000,000,000,000,000,000 | 81 | 8270386: Better verification of scan methods
Reviewed-by: mbaesken
Backport-of: ac329cef45979bd0159ecd1347e36f7129bb2ce4 |
book_backend_ldap_refresh_sync (EBookBackend *backend,
GCancellable *cancellable,
GError **error)
{
EBookBackendLDAP *ldap_backend = E_BOOK_BACKEND_LDAP (backend);
g_return_val_if_fail (ldap_backend != NULL, FALSE);
g_return_val_if_fail (ldap_backend->priv != NULL, FALSE);
if (!ldap_backend->priv->cache |... | 0 | [] | evolution-data-server | 34bad61738e2127736947ac50e0c7969cc944972 | 218,762,692,655,178,600,000,000,000,000,000,000,000 | 18 | Bug 796174 - strcat() considered unsafe for buffer overflow |
static CURLcode smtp_disconnect(struct connectdata *conn,
bool dead_connection)
{
struct smtp_conn *smtpc = &conn->proto.smtpc;
/* We cannot send quit unconditionally. If this connection is stale or
bad in any way, sending quit and waiting around here will make the
disconn... | 0 | [
"CWE-89"
] | curl | 75ca568fa1c19de4c5358fed246686de8467c238 | 110,249,443,628,201,340,000,000,000,000,000,000,000 | 30 | URL sanitize: reject URLs containing bad data
Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).
URLs containing such codes could easily oth... |
int __weak ftrace_arch_code_modify_prepare(void)
{
return 0;
} | 0 | [
"CWE-703"
] | linux | 6a76f8c0ab19f215af2a3442870eeb5f0e81998d | 170,520,214,581,441,720,000,000,000,000,000,000,000 | 4 | tracing: Fix possible NULL pointer dereferences
Currently set_ftrace_pid and set_graph_function files use seq_lseek
for their fops. However seq_open() is called only for FMODE_READ in
the fops->open() so that if an user tries to seek one of those file
when she open it for writing, it sees NULL seq_file and then panic... |
bool is_empty() { return change_list.is_empty(); } | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 259,296,706,010,508,460,000,000,000,000,000,000,000 | 1 | MDEV-26281 ASAN use-after-poison when complex conversion is involved in blob
the bug was that in_vector array in Item_func_in was allocated in the
statement arena, not in the table->expr_arena.
revert part of the 5acd391e8b2d. Instead, change the arena correctly
in fix_all_session_vcol_exprs().
Remove TABLE_ARENA, t... |
static void read_binary_date(MYSQL_TIME *tm, uchar **pos)
{
uint length= net_field_length(pos);
if (length)
{
uchar *to= *pos;
tm->year = (uint) sint2korr(to);
tm->month= (uint) to[2];
tm->day= (uint) to[3];
tm->hour= tm->minute= tm->second= 0;
tm->second_part= 0;
tm->neg= 0;
t... | 0 | [] | mysql-server | 3d8134d2c9b74bc8883ffe2ef59c168361223837 | 218,224,312,851,683,900,000,000,000,000,000,000,000 | 21 | Bug#25988681: USE-AFTER-FREE IN MYSQL_STMT_CLOSE()
Description: If mysql_stmt_close() encountered error,
it recorded error in prepared statement
but then frees memory assigned to prepared
statement. If mysql_stmt_error() is used
to get error information, it will resu... |
flatpak_remote_state_get_main_metadata (FlatpakRemoteState *self)
{
VarSummaryRef summary;
VarSummaryIndexRef index;
VarMetadataRef meta;
if (self->index)
{
index = var_summary_index_from_gvariant (self->index);
meta = var_summary_index_get_metadata (index);
}
else if (self->summary)
... | 0 | [
"CWE-74"
] | flatpak | fb473cad801c6b61706353256cab32330557374a | 29,614,623,840,403,643,000,000,000,000,000,000,000 | 21 | dir: Pass environment via bwrap --setenv when running apply_extra
This means we can systematically pass the environment variables
through bwrap(1), even if it is setuid and thus is filtering out
security-sensitive environment variables. bwrap ends up being
run with an empty environment instead.
As with the previous c... |
TEST(EqOp, MatchesElement) {
BSONObj operand = BSON("a" << 5);
BSONObj match = BSON("a" << 5.0);
BSONObj notMatch = BSON("a" << 6);
EqualityMatchExpression eq("", operand["a"]);
ASSERT(eq.matchesSingleElement(match.firstElement()));
ASSERT(!eq.matchesSingleElement(notMatch.firstElement()));
... | 0 | [] | mongo | 64095239f41e9f3841d8be9088347db56d35c891 | 303,876,289,915,203,850,000,000,000,000,000,000,000 | 11 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
BGD_DECLARE(int) gdTransformAffineGetImage(gdImagePtr *dst,
const gdImagePtr src,
gdRectPtr src_area,
const double affine[6])
{
int res;
double m[6];
gdRect bbox;
gdRect area_full;
if (src_area == NULL) {
area_full.x = 0;
area_full.y = 0;
area_full.width = gdImageSX(src);
area_full.height = g... | 0 | [
"CWE-399"
] | libgd | 4751b606fa38edc456d627140898a7ec679fcc24 | 232,321,569,154,353,000,000,000,000,000,000,000,000 | 50 | gdImageScaleTwoPass memory leak fix
Fixing memory leak in gdImageScaleTwoPass, as reported by @cmb69 and
confirmed by @vapier. This bug actually bit me in production and I'm
very thankful that it was reported with an easy fix.
Fixes #173. |
xmlValidateNamesValueInternal(xmlDocPtr doc, const xmlChar *value) {
const xmlChar *cur;
int val, len;
if (value == NULL) return(0);
cur = value;
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
if (!xmlIsDocNameStartChar(doc, val))
return(0);
val = xmlStringCurrentChar(NULL,... | 0 | [] | libxml2 | 932cc9896ab41475d4aa429c27d9afd175959d74 | 111,668,422,976,453,460,000,000,000,000,000,000,000 | 42 | Fix buffer size checks in xmlSnprintfElementContent
xmlSnprintfElementContent failed to correctly check the available
buffer space in two locations.
Fixes bug 781333 (CVE-2017-9047) and bug 781701 (CVE-2017-9048).
Thanks to Marcel Böhme and Thuan Pham for the report. |
static int fill_ext_compat(struct usb_configuration *c, u8 *buf)
{
int i, count;
count = 16;
buf += 16;
for (i = 0; i < c->next_interface_id; ++i) {
struct usb_function *f;
int j;
f = c->interface[i];
for (j = 0; j < f->os_desc_n; ++j) {
struct usb_os_desc *d;
if (i != f->os_desc_table[j].if_id)
... | 0 | [
"CWE-476"
] | linux | 75e5b4849b81e19e9efe1654b30d7f3151c33c2c | 166,397,339,931,793,830,000,000,000,000,000,000,000 | 35 | USB: gadget: validate interface OS descriptor requests
Stall the control endpoint in case provided index exceeds array size of
MAX_CONFIG_INTERFACES or when the retrieved function pointer is null.
Signed-off-by: Szymon Heidrich <szymon.heidrich@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregk... |
static connection *connections_get_new_connection(server *srv) {
connections * const conns = &srv->conns;
size_t i;
if (conns->size == conns->used) {
conns->size += srv->max_conns >= 128 ? 128 : srv->max_conns > 16 ? 16 : srv->max_conns;
conns->ptr = realloc(conns->ptr, sizeof(*conns->ptr) * conns->size);
for... | 0 | [
"CWE-703"
] | lighttpd1.4 | b03b86f47b0d5a553137f081fadc482b4af1372d | 189,708,008,353,797,450,000,000,000,000,000,000,000 | 18 | [core] fix merging large headers across mult reads (fixes #3059)
(thx mitd)
x-ref:
"Connections stuck in Close_Wait causing 100% cpu usage"
https://redmine.lighttpd.net/issues/3059 |
check_cursor_lnum(void)
{
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
{
#ifdef FEAT_FOLDING
// If there is a closed fold at the end of the file, put the cursor in
// its first line. Otherwise in the last line.
if (!hasFolding(curbuf->b_ml.ml_line_count,
&curwin->w_cursor.lnum, NULL))
#endi... | 0 | [
"CWE-120"
] | vim | 7ce5b2b590256ce53d6af28c1d203fb3bc1d2d97 | 123,300,629,347,740,980,000,000,000,000,000,000,000 | 15 | patch 8.2.4969: changing text in Visual mode may cause invalid memory access
Problem: Changing text in Visual mode may cause invalid memory access.
Solution: Check the Visual position after making a change. |
static char *format_duration(u64 dur, u32 timescale, char *szDur)
{
u32 h, m, s, ms;
if (!timescale) return NULL;
dur = (u32) (( ((Double) (s64) dur)/timescale)*1000);
h = (u32) (dur / 3600000);
dur -= h*3600000;
m = (u32) (dur / 60000);
dur -= m*60000;
s = (u32) (dur/1000);
dur -= s*1000;
ms = (u32) (dur);
... | 0 | [
"CWE-787"
] | gpac | ea1eca00fd92fa17f0e25ac25652622924a9a6a0 | 42,525,287,213,034,460,000,000,000,000,000,000,000 | 32 | fixed #2138 |
int cli_bytecode_done(struct cli_all_bc *allbc)
{
return cli_bytecode_done_jit(allbc, 0);
} | 0 | [
"CWE-189"
] | clamav-devel | 3d664817f6ef833a17414a4ecea42004c35cc42f | 126,765,269,260,833,430,000,000,000,000,000,000,000 | 4 | fix recursion level crash (bb #3706).
Thanks to Stephane Chazelas for the analysis. |
void CServer::RegisterCommands()
{
// register console commands
Console()->Register("kick", "i[id] ?r[reason]", CFGFLAG_SERVER, ConKick, this, "Kick player with specified id for any reason");
Console()->Register("status", "", CFGFLAG_SERVER, ConStatus, this, "List players");
Console()->Register("shutdown", "", CFGF... | 0 | [
"CWE-20",
"CWE-703",
"CWE-400"
] | teeworlds | c68402fa7e279d42886d5951d1ea8ac2facc1ea5 | 7,230,852,647,582,441,000,000,000,000,000,000,000 | 28 | changed a check |
static inline int cpu_time_before(const clockid_t which_clock,
union cpu_time_count now,
union cpu_time_count then)
{
if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
return now.sched < then.sched;
} else {
return cputime_lt(now.cpu, then.cpu);
}
} | 0 | [
"CWE-189"
] | linux | f8bd2258e2d520dff28c855658bd24bdafb5102d | 108,037,543,700,994,000,000,000,000,000,000,000,000 | 10 | 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 ... |
static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len,
char __user *optval,
int __user *optlen)
{
u32 val;
if (len < sizeof(u32))
return -EINVAL;
len = sizeof(u32);
val = sctp_sk(sk)->pd_point;
if (put_user(len, optlen))
return -EFAULT;
if (copy_to_user(optval, &val, le... | 0 | [
"CWE-20"
] | linux | 726bc6b092da4c093eb74d13c07184b18c1af0f1 | 15,991,317,210,869,460,000,000,000,000,000,000,000 | 19 | net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS
Building sctp may fail with:
In function ‘copy_from_user’,
inlined from ‘sctp_getsockopt_assoc_stats’ at
net/sctp/socket.c:5656:20:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to
‘copy_from_user_overflow’ declared with attribute error: c... |
static void esp_free_tcp_sk(struct rcu_head *head)
{
struct esp_tcp_sk *esk = container_of(head, struct esp_tcp_sk, rcu);
sock_put(esk->sk);
kfree(esk);
} | 0 | [
"CWE-787"
] | linux | ebe48d368e97d007bfeb76fcb065d6cfc4c96645 | 4,720,978,883,545,403,000,000,000,000,000,000,000 | 7 | esp: Fix possible buffer overflow in ESP transformation
The maximum message size that can be send is bigger than
the maximum site that skb_page_frag_refill can allocate.
So it is possible to write beyond the allocated buffer.
Fix this by doing a fallback to COW in that case.
v2:
Avoid get get_order() costs as sugg... |
rad_put_vendor_attr(struct rad_handle *h, int vendor, int type,
const void *value, size_t len)
{
struct vendor_attribute *attr;
int res;
if (!h->request_created) {
generr(h, "Please call rad_create_request()");
return -1;
}
if ((attr = malloc(len + 6)) == NULL) {
generr(h, "ma... | 0 | [
"CWE-119",
"CWE-787"
] | php-radius | 13c149b051f82b709e8d7cc32111e84b49d57234 | 306,249,147,668,903,270,000,000,000,000,000,000,000 | 30 | 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... |
bool operator==(const Component& other) const { return begin == other.begin && len == other.len; } | 0 | [] | envoy | 3b5acb2f43548862dadb243de7cf3994986a8e04 | 184,901,940,652,775,160,000,000,000,000,000,000,000 | 1 | http, url: Bring back chromium_url and http_parser_parse_url (#198)
* Revert GURL as HTTP URL parser utility
This reverts:
1. commit c9c4709c844b90b9bb2935d784a428d667c9df7d
2. commit d828958b591a6d79f4b5fa608ece9962b7afbe32
3. commit 2d69e30c51f2418faf267aaa6c1126fce9948c62
Signed-off-by: Dhi Aurrahman <dio@tetrat... |
static uint64_t reencrypt_length(struct crypt_device *cd,
struct luks2_hdr *hdr,
struct luks2_reencrypt *rh,
uint64_t keyslot_area_length,
uint64_t length_max)
{
unsigned long dummy, optimal_alignment;
uint64_t length, soft_mem_limit;
if (rh->rp.type == REENC_PROTECTION_NONE)
length = length_max ?: LUKS2_... | 0 | [
"CWE-345"
] | cryptsetup | 0113ac2d889c5322659ad0596d4cfc6da53e356c | 88,482,418,784,901,100,000,000,000,000,000,000,000 | 49 | Fix CVE-2021-4122 - LUKS2 reencryption crash recovery attack
Fix possible attacks against data confidentiality through LUKS2 online
reencryption extension crash recovery.
An attacker can modify on-disk metadata to simulate decryption in
progress with crashed (unfinished) reencryption step and persistently
decrypt par... |
finish_input_tga (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
{
/* no work */
} | 0 | [
"CWE-369"
] | libjpeg-turbo | 82923eb93a2eacf4a593e00e3e672bbb86a8a3a0 | 156,876,948,428,426,860,000,000,000,000,000,000,000 | 4 | Check image size when reading targa file
Throw an error when image width or height is 0.
Fixes mozilla/mozjpeg#140, closes #7. |
ByteVector ByteVector::operator+(const ByteVector &v) const
{
ByteVector sum(*this);
sum.append(v);
return sum;
} | 0 | [
"CWE-189"
] | taglib | dcdf4fd954e3213c355746fa15b7480461972308 | 164,016,540,697,953,200,000,000,000,000,000,000,000 | 6 | Avoid uint overflow in case the length + index is over UINT_MAX |
c_pdf14trans_is_friendly(const gs_composite_t * composite_action, byte cmd0, byte cmd1)
{
gs_pdf14trans_t *pct0 = (gs_pdf14trans_t *)composite_action;
int op0 = pct0->params.pdf14_op;
if (op0 == PDF14_PUSH_DEVICE || op0 == PDF14_END_TRANS_GROUP ||
op0 == PDF14_END_TRANS_TEXT_GROUP) {
/* Hal... | 0 | [] | ghostpdl | c432131c3fdb2143e148e8ba88555f7f7a63b25e | 126,487,890,272,269,210,000,000,000,000,000,000,000 | 18 | Bug 699661: Avoid sharing pointers between pdf14 compositors
If a copdevice is triggered when the pdf14 compositor is the device, we make
a copy of the device, then throw an error because, by default we're only allowed
to copy the device prototype - then freeing it calls the finalize, which frees
several pointers shar... |
static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
{
LSIState *s = LSI53C895A(dev);
DeviceState *d = DEVICE(dev);
uint8_t *pci_conf;
pci_conf = dev->config;
/* PCI latency timer = 255 */
pci_conf[PCI_LATENCY_TIMER] = 0xff;
/* Interrupt pin A */
pci_conf[PCI_INTERRUPT_PIN] = 0x0... | 0 | [
"CWE-835"
] | qemu | de594e47659029316bbf9391efb79da0a1a08e08 | 110,324,845,795,501,840,000,000,000,000,000,000,000 | 30 | scsi: lsi: exit infinite loop while executing script (CVE-2019-12068)
When executing script in lsi_execute_script(), the LSI scsi adapter
emulator advances 's->dsp' index to read next opcode. This can lead
to an infinite loop if the next opcode is empty. Move the existing
loop exit after 10k iterations so that it cove... |
void TNEFInitAttachment(Attachment *p) {
INITDTR(p->Date);
INITVARLENGTH(p->Title);
INITVARLENGTH(p->MetaFile);
INITDTR(p->CreateDate);
INITDTR(p->ModifyDate);
INITVARLENGTH(p->TransportFilename);
INITVARLENGTH(p->FileData);
INITVARLENGTH(p->IconData);
memset(&(p->RenderData), 0, sizeof(renddata));
... | 0 | [
"CWE-399",
"CWE-125"
] | ytnef | 3cb0f914d6427073f262e1b2b5fd973e3043cdf7 | 302,615,200,646,317,340,000,000,000,000,000,000,000 | 13 | BugFix - Potential OOB with Fields of Size 0
Thanks to @hannob for contributing a malformed TNEF stream with
a Version field of size 0. Now such files will return an error
indicating invalid data. |
int Item_func_nullif::compare()
{
if (m_cache)
m_cache->cache_value();
return cmp.compare();
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 119,128,696,255,467,920,000,000,000,000,000,000,000 | 6 | 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 ... |
static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
{
static unsigned alloc_hint = 16;
if (map->nodes_nb + nodes > map->nodes_nb_alloc) {
map->nodes_nb_alloc = MAX(alloc_hint, map->nodes_nb + nodes);
map->nodes = g_renew(Node, map->nodes, map->nodes_nb_alloc);
alloc_hint ... | 0 | [
"CWE-787"
] | qemu | 4bfb024bc76973d40a359476dc0291f46e435442 | 273,432,137,934,066,600,000,000,000,000,000,000,000 | 9 | memory: clamp cached translation in case it points to an MMIO region
In using the address_space_translate_internal API, address_space_cache_init
forgot one piece of advice that can be found in the code for
address_space_translate_internal:
/* MMIO registers can be expected to perform full-width accesses based onl... |
apr_byte_t oidc_util_json_merge(request_rec *r, json_t *src, json_t *dst) {
const char *key;
json_t *value = NULL;
void *iter = NULL;
if ((src == NULL) || (dst == NULL))
return FALSE;
oidc_debug(r, "src=%s, dst=%s",
oidc_util_encode_json_object(r, src, JSON_COMPACT),
oidc_util_encode_json_object(r, dst,... | 0 | [
"CWE-79"
] | mod_auth_openidc | 55ea0a085290cd2c8cdfdd960a230cbc38ba8b56 | 248,331,733,074,072,570,000,000,000,000,000,000,000 | 26 | Add a function to escape Javascript characters |
static int selinux_setprocattr(struct task_struct *p,
char *name, void *value, size_t size)
{
struct task_security_struct *tsec;
struct task_struct *tracer;
struct cred *new;
u32 sid = 0, ptsid;
int error;
char *str = value;
if (current != p) {
/* SELinux only allows a process to change its own
... | 0 | [
"CWE-264"
] | linux | 7b0d0b40cd78cadb525df760ee4cac151533c2b5 | 133,941,023,534,540,780,000,000,000,000,000,000,000 | 138 | selinux: Permit bounded transitions under NO_NEW_PRIVS or NOSUID.
If the callee SID is bounded by the caller SID, then allowing
the transition to occur poses no risk of privilege escalation and we can
therefore safely allow the transition to occur. Add this exemption
for both the case where a transition was explicitl... |
static void io_poll_remove_one(struct io_kiocb *req)
{
struct io_poll_iocb *poll = &req->poll;
spin_lock(&poll->head->lock);
WRITE_ONCE(poll->canceled, true);
if (!list_empty(&poll->wait.entry)) {
list_del_init(&poll->wait.entry);
io_queue_async_work(req);
}
spin_unlock(&poll->head->lock);
hash_del(&req->ha... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 150,421,245,021,699,950,000,000,000,000,000,000,000 | 13 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
int compat_ip_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen)
{
int err;
if (level != SOL_IP)
return -ENOPROTOOPT;
if (optname >= MCAST_JOIN_GROUP && optname <= MCAST_MSFILTER)
return compat_mc_setsockopt(sk, level, optname, optval, optlen,
ip_setsockopt);
... | 0 | [
"CWE-476"
] | net | 425aa0e1d01513437668fa3d4a971168bbaa8515 | 28,435,027,104,186,198,000,000,000,000,000,000,000 | 24 | ip_sockglue: Fix missing-check bug in ip_ra_control()
In function ip_ra_control(), the pointer new_ra is allocated a memory
space via kmalloc(). And it is used in the following codes. However,
when there is a memory allocation error, kmalloc() fails. Thus null
pointer dereference may happen. And it will cause the ker... |
MOBI_RET mobi_search_links_kf7(MOBIResult *result, const unsigned char *data_start, const unsigned char *data_end) {
if (!result) {
debug_print("Result structure is null%s", "\n");
return MOBI_PARAM_ERR;
}
result->start = result->end = NULL;
*(result->value) = '\0';
if (!data_start |... | 0 | [
"CWE-703",
"CWE-125"
] | libmobi | fb1ab50e448ddbed746fd27ae07469bc506d838b | 51,230,431,518,316,820,000,000,000,000,000,000,000 | 58 | Fix array boundary check when parsing inflections which could result in buffer over-read with corrupt input |
table_map Item_default_value::used_tables() const
{
if (!field || !field->default_value)
return static_cast<table_map>(0);
if (!field->default_value->expr) // not fully parsed field
return static_cast<table_map>(RAND_TABLE_BIT);
return field->default_value->expr->used_tables();
} | 0 | [
"CWE-416"
] | server | c02ebf3510850ba78a106be9974c94c3b97d8585 | 75,142,770,513,191,800,000,000,000,000,000,000,000 | 8 | MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()
mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session
2. Vanilla cleanups and comments. |
agoo_con_http_write(agooCon c) {
agooRes res = agoo_con_res_pop(c);
agooText message = agoo_res_message_peek(res);
ssize_t cnt = 0;
if (NULL == message) {
return true;
}
c->timeout = dtime() + CON_TIMEOUT;
if (0 == c->wcnt) {
if (agoo_resp_cat.on) {
char buf[4096];
char *hend = ... | 0 | [
"CWE-444",
"CWE-61"
] | agoo | 23d03535cf7b50d679a60a953a0cae9519a4a130 | 59,979,485,829,615,300,000,000,000,000,000,000,000 | 73 | Remote addr (#99)
* REMOTE_ADDR added
* Ready for merge |
static void svm_sync_dirty_debug_regs(struct kvm_vcpu *vcpu)
{
struct vcpu_svm *svm = to_svm(vcpu);
if (vcpu->arch.guest_state_protected)
return;
get_debugreg(vcpu->arch.db[0], 0);
get_debugreg(vcpu->arch.db[1], 1);
get_debugreg(vcpu->arch.db[2], 2);
get_debugreg(vcpu->arch.db[3], 3);
/*
* We cannot reset ... | 0 | [
"CWE-862"
] | kvm | 0f923e07124df069ba68d8bb12324398f4b6b709 | 241,831,822,438,426,730,000,000,000,000,000,000,000 | 20 | KVM: nSVM: avoid picking up unsupported bits from L2 in int_ctl (CVE-2021-3653)
* Invert the mask of bits that we pick from L2 in
nested_vmcb02_prepare_control
* Invert and explicitly use VIRQ related bits bitmask in svm_clear_vintr
This fixes a security issue that allowed a malicious L1 to run L2 with
AVIC enable... |
static double mp_list_ioff(_cimg_math_parser& mp) {
const unsigned int
ind = (unsigned int)cimg::mod((int)_mp_arg(2),mp.imglist.width()),
boundary_conditions = (unsigned int)_mp_arg(4);
const CImg<T> &img = mp.imglist[ind];
const longT
off = (longT)_mp_arg(3),... | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 214,027,813,402,354,970,000,000,000,000,000,000,000 | 23 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
const char *FLTGetBBOX(FilterEncodingNode *psFilterNode, rectObj *psRect)
{
const char *pszReturn = NULL;
if (!psFilterNode || !psRect)
return NULL;
if (psFilterNode->pszValue && strcasecmp(psFilterNode->pszValue, "BBOX") == 0) {
if (psFilterNode->psRightNode && psFilterNode->psRightNode->pOther) {
... | 0 | [
"CWE-200",
"CWE-119"
] | mapserver | e52a436c0e1c5e9f7ef13428dba83194a800f4df | 100,028,346,210,295,360,000,000,000,000,000,000,000 | 28 | security fix (patch by EvenR) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.