func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static void ctnetlink_net_exit(struct net *net)
{
#ifdef CONFIG_NF_CONNTRACK_EVENTS
nf_ct_expect_unregister_notifier(net, &ctnl_notifier_exp);
nf_conntrack_unregister_notifier(net, &ctnl_notifier);
#endif
} | 0 | [
"CWE-120"
] | linux | 1cc5ef91d2ff94d2bf2de3b3585423e8a1051cb6 | 197,595,247,099,281,400,000,000,000,000,000,000,000 | 7 | netfilter: ctnetlink: add a range check for l3/l4 protonum
The indexes to the nf_nat_l[34]protos arrays come from userspace. So
check the tuple's family, e.g. l3num, when creating the conntrack in
order to prevent an OOB memory access during setup. Here is an example
kernel panic on 4.14.180 when userspace passes in ... |
flatpak_bwrap_child_setup (GArray *fd_array,
gboolean close_fd_workaround)
{
int i;
if (close_fd_workaround)
flatpak_close_fds_workaround (3);
/* If no fd_array was specified, don't care. */
if (fd_array == NULL)
return;
/* Otherwise, mark not - close-on-exec all the fds ... | 0 | [
"CWE-94",
"CWE-74"
] | flatpak | 6d1773d2a54dde9b099043f07a2094a4f1c2f486 | 92,694,029,056,664,470,000,000,000,000,000,000,000 | 27 | run: Convert all environment variables into bwrap arguments
This avoids some of them being filtered out by a setuid bwrap. It also
means that if they came from an untrusted source, they cannot be used
to inject arbitrary code into a non-setuid bwrap via mechanisms like
LD_PRELOAD.
Because they get bundled into a memf... |
static inline void hugetlb_set_vma_policy(struct vm_area_struct *vma,
struct inode *inode, pgoff_t index)
{
vma->vm_policy = mpol_shared_policy_lookup(&HUGETLBFS_I(inode)->policy,
index);
} | 0 | [] | linux | 9aacdd354d197ad64685941b36d28ea20ab88757 | 49,053,430,575,828,390,000,000,000,000,000,000,000 | 6 | fs/hugetlbfs/inode.c: fix bugs in hugetlb_vmtruncate_list()
Hillf Danton noticed bugs in the hugetlb_vmtruncate_list routine. The
argument end is of type pgoff_t. It was being converted to a vaddr
offset and passed to unmap_hugepage_range. However, end was also being
used as an argument to the vma_interval_tree_for... |
PHP_METHOD(Phar, canCompress)
{
long method = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &method) == FAILURE) {
return;
}
phar_request_initialize(TSRMLS_C);
switch (method) {
case PHAR_ENT_COMPRESSED_GZ:
if (PHAR_G(has_zlib)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
case PHAR_EN... | 0 | [
"CWE-416"
] | php-src | b2cf3f064b8f5efef89bb084521b61318c71781b | 280,192,347,083,067,000,000,000,000,000,000,000,000 | 30 | Fixed bug #68901 (use after free) |
MessageCompressorRegistry buildRegistry() {
MessageCompressorRegistry ret;
auto compressor = std::make_unique<NoopMessageCompressor>();
std::vector<std::string> compressorList = {compressor->getName()};
ret.setSupportedCompressors(std::move(compressorList));
ret.registerImplementation(std::move(com... | 0 | [
"CWE-697"
] | mongo | 1411cf602a21e45a5ef42b6869c480eb420976ee | 158,094,776,426,600,780,000,000,000,000,000,000,000 | 11 | SERVER-43751 Recompute compressor manager message parameters |
static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
{
struct sock *sk = d->owner, *parent;
unsigned long flags;
if (!sk)
return;
BT_DBG("dlc %p state %ld err %d", d, d->state, err);
local_irq_save(flags);
bh_lock_sock(sk);
if (err)
sk->sk_err = err;
sk->sk_state = d->state;
parent = bt_... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 12,101,545,366,205,203,000,000,000,000,000,000,000 | 43 | net: rework recvmsg handler msg_name and msg_namelen logic
This patch now always passes msg->msg_namelen as 0. recvmsg handlers must
set msg_namelen to the proper size <= sizeof(struct sockaddr_storage)
to return msg_name to the user.
This prevents numerous uninitialized memory leaks we had in the
recvmsg handlers an... |
AP_DECLARE(void) ap_send_interim_response(request_rec *r, int send_headers)
{
hdr_ptr x;
char *status_line = NULL;
request_rec *rr;
if (r->proto_num < HTTP_VERSION(1,1)) {
/* don't send interim response to HTTP/1.0 Client */
return;
}
if (!ap_is_HTTP_INFO(r->status)) {
a... | 0 | [
"CWE-703"
] | httpd | be0f5335e3e73eb63253b050fdc23f252f5c8ae3 | 284,723,638,919,096,760,000,000,000,000,000,000,000 | 47 | *) SECURITY: CVE-2015-0253 (cve.mitre.org)
core: Fix a crash introduced in with ErrorDocument 400 pointing
to a local URL-path with the INCLUDES filter active, introduced
in 2.4.11. PR 57531. [Yann Ylavic]
Submitted By: ylavic
Committed By: covener
git-svn-id: https://svn.apache.org/repos/asf/http... |
void sctp_transport_walk_stop(struct rhashtable_iter *iter)
{
rhashtable_walk_stop(iter);
rhashtable_walk_exit(iter);
} | 0 | [
"CWE-617",
"CWE-362"
] | linux | 2dcab598484185dea7ec22219c76dcdd59e3cb90 | 203,561,810,111,146,970,000,000,000,000,000,000,000 | 5 | sctp: avoid BUG_ON on sctp_wait_for_sndbuf
Alexander Popov reported that an application may trigger a BUG_ON in
sctp_wait_for_sndbuf if the socket tx buffer is full, a thread is
waiting on it to queue more data and meanwhile another thread peels off
the association being used by the first thread.
This patch replaces ... |
static inline int valid_index(struct airo_info *ai, int index)
{
return (index >= 0) && (index <= ai->max_wep_idx);
} | 0 | [
"CWE-703",
"CWE-264"
] | linux | 550fd08c2cebad61c548def135f67aba284c6162 | 203,021,199,512,309,020,000,000,000,000,000,000,000 | 4 | net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling
ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real
hardware call ether_setup for their net_devices and don't hold any state in
their skbs. There... |
do_resources (WinLibrary *fi, const char *type, const char *name, const char *lang, DoResourceCallback cb)
{
WinResource *type_wr;
WinResource *name_wr;
WinResource *lang_wr;
type_wr = malloc(sizeof(WinResource)*3);
name_wr = type_wr + 1;
lang_wr = type_wr + 2;
memset(type_wr, 0, sizeof(Win... | 0 | [] | icoutils | a8c8543731ed255e6f8bb81c662155f98710ac20 | 250,878,872,456,024,960,000,000,000,000,000,000,000 | 15 | wrestool: read_library() moves memory around, check it doesn't overwrite header data |
void lzxd_free(struct lzxd_stream *lzx) {
struct mspack_system *sys;
if (lzx) {
sys = lzx->sys;
sys->free(lzx->inbuf);
sys->free(lzx->window);
sys->free(lzx);
}
} | 1 | [
"CWE-119",
"CWE-787"
] | clamav-devel | a83773682e856ad6529ba6db8d1792e6d515d7f1 | 283,910,552,185,848,320,000,000,000,000,000,000,000 | 9 | fixing potential OOB window write when unpacking chm files |
static int write_pbe_enc_params(ASN1_TYPE pbes2_asn,
const struct pbe_enc_params *params)
{
int result;
ASN1_TYPE pbe_asn = ASN1_TYPE_EMPTY;
/* Write the encryption algorithm
*/
result =
asn1_write_value(pbes2_asn, "encryptionScheme.algorithm",
DES_EDE3_CBC_OID, 1);
if (result != ASN1... | 0 | [] | gnutls | 112d537da5f3500f14316db26d18c37d678a5e0e | 143,014,593,447,621,510,000,000,000,000,000,000,000 | 55 | some changes for 64bit machines. |
QPDF::resolveObjectsInStream(int obj_stream_number)
{
// Force resolution of object stream
QPDFObjectHandle obj_stream = getObjectByID(obj_stream_number, 0);
if (! obj_stream.isStream())
{
throw QPDFExc(qpdf_e_damaged_pdf, this->m->file->getName(),
this->m->last_object_description,
this... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 117,101,854,792,680,300,000,000,000,000,000,000,000 | 102 | Fix sign and conversion warnings (major)
This makes all integer type conversions that have potential data loss
explicit with calls that do range checks and raise an exception. After
this commit, qpdf builds with no warnings when -Wsign-conversion
-Wconversion is used with gcc or clang or when -W3 -Wd4800 is used
with ... |
static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
{
struct ssb_sprom *sprom = dev->bus_sprom;
struct ieee80211_hw *hw;
struct b43_wl *wl;
char chip_name[6];
int queue_num;
hw = ieee80211_alloc_hw(sizeof(*wl), &b43_hw_ops);
if (!hw) {
b43err(NULL, "Could not allocate ieee80211 device\n");
retu... | 0 | [
"CWE-134"
] | wireless | 9538cbaab6e8b8046039b4b2eb6c9d614dc782bd | 103,767,671,221,143,400,000,000,000,000,000,000,000 | 57 | b43: stop format string leaking into error msgs
The module parameter "fwpostfix" is userspace controllable, unfiltered,
and is used to define the firmware filename. b43_do_request_fw() populates
ctx->errors[] on error, containing the firmware filename. b43err()
parses its arguments as a format string. For systems with... |
__weak int __init parse_acpi_topology(void)
{
return 0;
} | 0 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 156,928,101,175,266,740,000,000,000,000,000,000,000 | 4 | drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions
Convert the various sprintf fmaily calls in sysfs device show functions
to sysfs_emit and sysfs_emit_at for PAGE_SIZE buffer safety.
Done with:
$ spatch -sp-file sysfs_emit_dev.cocci --in-place --max-width=80 .
And cocci script:
$ cat s... |
static int64_t find_prev_closest_index(AVStream *st,
AVIndexEntry *e_old,
int nb_old,
int64_t timestamp,
int flag)
{
AVIndexEntry *e_keep = st->index_entries;
... | 0 | [
"CWE-399",
"CWE-834"
] | FFmpeg | 9cb4eb772839c5e1de2855d126bf74ff16d13382 | 245,363,463,509,837,920,000,000,000,000,000,000,000 | 31 | avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
TPMA_NV_Unmarshal(TPMA_NV *target, BYTE **buffer, INT32 *size)
{
TPM_RC rc = TPM_RC_SUCCESS;
if (rc == TPM_RC_SUCCESS) {
rc = UINT32_Unmarshal((UINT32 *)target, buffer, size); /* libtpms changed */
}
if (rc == TPM_RC_SUCCESS) {
if (*target & TPMA_NV_RESERVED) {
rc = TPM_RC_RESERVED_BITS;
}
... | 1 | [
"CWE-787"
] | libtpms | 5cc98a62dc6f204dcf5b87c2ee83ac742a6a319b | 92,099,598,228,187,650,000,000,000,000,000,000,000 | 14 | tpm2: Restore original value if unmarshalled value was illegal
Restore the original value of the memory location where data from
a stream was unmarshalled and the unmarshalled value was found to
be illegal. The goal is to not keep illegal values in memory.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> |
MagickExport void RemoveDuplicateLayers(Image **images,
ExceptionInfo *exception)
{
register Image
*curr,
*next;
RectangleInfo
bounds;
assert((*images) != (const Image *) NULL);
assert((*images)->signature == MagickCoreSignature);
if ((*images)->debug != MagickFalse)
(void) LogMagickEve... | 1 | [
"CWE-369"
] | ImageMagick | 1ddcf2e4f28029a888cadef2e757509ef5047ad8 | 294,885,545,040,076,760,000,000,000,000,000,000,000 | 40 | https://github.com/ImageMagick/ImageMagick/issues/1629 |
usm_set_usmStateReference_auth_key(struct usmStateReference *ref,
u_char * auth_key, size_t auth_key_len)
{
MAKE_ENTRY(ref, u_char, auth_key, auth_key_len,
usr_auth_key, usr_auth_key_length);
} | 0 | [
"CWE-415"
] | net-snmp | 5f881d3bf24599b90d67a45cae7a3eb099cd71c9 | 321,190,795,158,161,160,000,000,000,000,000,000,000 | 6 | libsnmp, USM: Introduce a reference count in struct usmStateReference
This patch fixes https://sourceforge.net/p/net-snmp/bugs/2956/. |
php_libxml_output_buffer_create_filename(const char *URI,
xmlCharEncodingHandlerPtr encoder,
int compression ATTRIBUTE_UNUSED)
{
xmlOutputBufferPtr ret;
xmlURIPtr puri;
void *context = NULL;
char *unescaped = NULL;
if (URI == NULL)
return(NULL);
puri... | 1 | [] | php-src | f15f8fc573eb38c3c73e23e0930063a6f6409ed4 | 97,903,771,262,978,140,000,000,000,000,000,000,000 | 43 | Fix #79971: special character is breaking the path in xml function
The libxml based XML functions accepting a filename actually accept
URIs with possibly percent-encoded characters. Percent-encoded NUL
bytes lead to truncation, like non-encoded NUL bytes would. We catch
those, and let the functions fail with a respe... |
static void __net_exit xfrm_user_net_exit(struct list_head *net_exit_list)
{
struct net *net;
list_for_each_entry(net, net_exit_list, exit_list)
RCU_INIT_POINTER(net->xfrm.nlsk, NULL);
synchronize_net();
list_for_each_entry(net, net_exit_list, exit_list)
netlink_kernel_release(net->xfrm.nlsk_stash);
} | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 159,179,263,430,104,480,000,000,000,000,000,000,000 | 9 | 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.
... |
push_char(struct readbuffer *obuf, int pre_mode, char ch)
{
check_breakpoint(obuf, pre_mode, &ch);
Strcat_char(obuf->line, ch);
obuf->pos++;
set_prevchar(obuf->prevchar, &ch, 1);
if (ch != ' ')
obuf->prev_ctype = PC_ASCII;
obuf->flag |= RB_NFLUSHED;
} | 0 | [
"CWE-476"
] | w3m | 59b91cd8e30c86f23476fa81ae005cabff49ebb6 | 147,546,186,487,247,440,000,000,000,000,000,000,000 | 10 | Prevent segfault with malformed input type
Bug-Debian: https://github.com/tats/w3m/issues/7 |
env_set(struct environment *e, char *var, char *val)
{
char *pair;
debug_decl(env_set, SUDO_DEBUG_ARGS);
pair = sudo_new_key_val(var, val);
if (pair == NULL) {
sudo_fatalx(U_("%s: %s"),
__func__, U_("unable to allocate memory"));
}
env_insert(e, pair);
debug_return;
} | 0 | [
"CWE-193"
] | sudo | b301b46b79c6e2a76d530fa36d05992e74952ee8 | 302,182,081,523,942,250,000,000,000,000,000,000,000 | 14 | Reset valid_flags to MODE_NONINTERACTIVE for sudoedit.
This is consistent with how the -e option is handled.
Also reject -H and -P flags for sudoedit as was done in sudo 1.7.
Found by Qualys, this is part of the fix for CVE-2021-3156. |
void testRangeComparison_RemoveBaseUri_Issue19() {
// scheme
testRemoveBaseUriHelper("scheme://host/source",
"scheme://host/source",
"schemelonger://host/base");
testRemoveBaseUriHelper("schemelonger://host/source",
"schemelonger://host/source",
"scheme://host/base");
// hostTe... | 0 | [
"CWE-787"
] | uriparser | 864f5d4c127def386dd5cc926ad96934b297f04e | 290,750,559,451,100,200,000,000,000,000,000,000,000 | 44 | UriQuery.c: Fix out-of-bounds-write in ComposeQuery and ...Ex
Reported by Google Autofuzz team |
PackLinuxElf32x86::PackLinuxElf32x86(InputFile *f) : super(f)
{
e_machine = Elf32_Ehdr::EM_386;
ei_class = Elf32_Ehdr::ELFCLASS32;
ei_data = Elf32_Ehdr::ELFDATA2LSB;
ei_osabi = Elf32_Ehdr::ELFOSABI_LINUX;
} | 0 | [
"CWE-476"
] | upx | ef336dbcc6dc8344482f8cf6c909ae96c3286317 | 247,471,447,241,759,100,000,000,000,000,000,000,000 | 7 | Protect against bad crafted input.
https://github.com/upx/upx/issues/128
modified: p_lx_elf.cpp |
void gf_dom_event_remove_all_listeners(GF_DOMEventTarget *event_target)
{
while (gf_list_count(event_target->listeners)) {
GF_Node *n = (GF_Node *)gf_list_get(event_target->listeners, 0);
gf_dom_listener_del(n, event_target);
}
} | 1 | [
"CWE-416"
] | gpac | 9723dd0955894f2cb7be13b94cf7a47f2754b893 | 311,702,138,460,666,830,000,000,000,000,000,000,000 | 7 | fixed #2109 |
WandExport DrawInfo *PeekDrawingWand(const DrawingWand *wand)
{
DrawInfo
*draw_info;
assert(wand != (const DrawingWand *) NULL);
assert(wand->signature == MagickWandSignature);
if (wand->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
draw_info=CloneDrawInfo(... | 0 | [
"CWE-476"
] | ImageMagick | 6ad5fc3c9b652eec27fc0b1a0817159f8547d5d9 | 119,172,072,568,724,830,000,000,000,000,000,000,000 | 14 | https://github.com/ImageMagick/ImageMagick/issues/716 |
void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
unsigned long address, bool freeze, struct page *page)
{
spinlock_t *ptl;
struct mmu_notifier_range range;
bool was_locked = false;
pmd_t _pmd;
mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm,
address & HPAGE_PMD_MASK,
(a... | 0 | [
"CWE-362"
] | linux | c444eb564fb16645c172d550359cb3d75fe8a040 | 305,184,181,549,084,050,000,000,000,000,000,000,000 | 69 | mm: thp: make the THP mapcount atomic against __split_huge_pmd_locked()
Write protect anon page faults require an accurate mapcount to decide
if to break the COW or not. This is implemented in the THP path with
reuse_swap_page() ->
page_trans_huge_map_swapcount()/page_trans_huge_mapcount().
If the COW triggers while ... |
flatpak_run_get_pulseaudio_server (void)
{
const char * pulse_clientconfig;
char *pulse_server;
g_autofree char *pulse_user_config = NULL;
pulse_server = g_strdup (g_getenv ("PULSE_SERVER"));
if (pulse_server)
return pulse_server;
pulse_clientconfig = g_getenv ("PULSE_CLIENTCONFIG");
if (pulse_clien... | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 305,259,919,233,734,200,000,000,000,000,000,000,000 | 25 | Don't expose /proc when running apply_extra
As shown by CVE-2019-5736, it is sometimes possible for the sandbox
app to access outside files using /proc/self/exe. This is not
typically an issue for flatpak as the sandbox runs as the user which
has no permissions to e.g. modify the host files.
However, when installing ... |
sctp_disposition_t sctp_sf_cookie_echoed_err(struct net *net,
const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
sctp_errhdr_t *err;
if (!sctp_vtag_verify(chunk, asoc))
retu... | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 162,806,121,741,082,650,000,000,000,000,000,000,000 | 38 | sctp: Add support to per-association statistics via a new SCTP_GET_ASSOC_STATS call
The current SCTP stack is lacking a mechanism to have per association
statistics. This is an implementation modeled after OpenSolaris'
SCTP_GET_ASSOC_STATS.
Userspace part will follow on lksctp if/when there is a general ACK on
this.
... |
static void ssl_update_checksum_sha256( ssl_context *ssl,
const unsigned char *buf, size_t len )
{
sha256_update( &ssl->handshake->fin_sha256, buf, len );
} | 0 | [
"CWE-119"
] | mbedtls | c988f32adde62a169ba340fee0da15aecd40e76e | 70,423,600,379,565,840,000,000,000,000,000,000,000 | 5 | Added max length checking of hostname |
static inline int do_refcount_check(struct mount *mnt, int count)
{
int mycount = mnt_get_count(mnt) - mnt->mnt_ghosts;
return (mycount > count);
} | 0 | [
"CWE-284",
"CWE-264"
] | linux | 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 | 105,019,128,142,791,600,000,000,000,000,000,000,000 | 5 | vfs: Carefully propogate mounts across user namespaces
As a matter of policy MNT_READONLY should not be changable if the
original mounter had more privileges than creator of the mount
namespace.
Add the flag CL_UNPRIVILEGED to note when we are copying a mount from
a mount namespace that requires more privileges to a ... |
static void freecookie(struct Cookie *co)
{
free(co->expirestr);
free(co->domain);
free(co->path);
free(co->spath);
free(co->name);
free(co->value);
free(co->maxage);
free(co->version);
free(co);
} | 0 | [
"CWE-119"
] | curl | b5f947b8ac0e282c61c75b69cd5b9d37dafc6959 | 207,584,527,631,505,360,000,000,000,000,000,000,000 | 12 | cookie: cookie parser out of boundary memory access
The internal libcurl function called sanitize_cookie_path() that cleans
up the path element as given to it from a remote site or when read from
a file, did not properly validate the input. If given a path that
consisted of a single double-quote, libcurl would index a... |
GF_Err gf_isom_hint_sample_description_data(GF_ISOFile *the_file, u32 trackNumber, GF_ISOTrackID SourceTrackID, u32 StreamDescriptionIndex, u16 DataLength, u32 offsetInDescription, u8 AtBegin)
{
GF_TrackBox *trak;
GF_HintSampleEntryBox *entry;
u32 count;
u16 refIndex;
GF_HintPacket *pck;
GF_StreamDescDTE *dte;
G... | 0 | [
"CWE-787"
] | gpac | 86c1566f040b2b84c72afcb6cbd444c5aff56cfe | 242,800,491,694,738,450,000,000,000,000,000,000,000 | 38 | fixed #1894 |
static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req)
{
__be32 *p;
RESERVE_SPACE(4);
WRITE32(OP_READLINK);
return 0;
} | 0 | [
"CWE-703"
] | linux | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 | 9,319,326,920,317,187,000,000,000,000,000,000,000 | 9 | NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> |
static void intel_disable_iommus(void)
{
struct intel_iommu *iommu = NULL;
struct dmar_drhd_unit *drhd;
for_each_iommu(iommu, drhd)
iommu_disable_translation(iommu);
} | 0 | [] | linux | d8b8591054575f33237556c32762d54e30774d28 | 21,950,985,018,710,864,000,000,000,000,000,000,000 | 8 | iommu/vt-d: Disable ATS support on untrusted devices
Commit fb58fdcd295b9 ("iommu/vt-d: Do not enable ATS for untrusted
devices") disables ATS support on the devices which have been marked
as untrusted. Unfortunately this is not enough to fix the DMA attack
vulnerabiltiies because IOMMU driver allows translated reques... |
lzh_br_fillup(struct lzh_stream *strm, struct lzh_br *br)
{
int n = CACHE_BITS - br->cache_avail;
for (;;) {
const int x = n >> 3;
if (strm->avail_in >= x) {
switch (x) {
case 8:
br->cache_buffer =
((uint64_t)strm->next_in[0]) << 56 |
((uint64_t)strm->next_in[1]) << 48 |
((uint6... | 0 | [
"CWE-125"
] | libarchive | 98dcbbf0bf4854bf987557e55e55fff7abbf3ea9 | 70,462,721,796,865,000,000,000,000,000,000,000,000 | 69 | Fail with negative lha->compsize in lha_read_file_header_1()
Fixes a heap buffer overflow reported in Secunia SA74169 |
select_opt_map(OptMap* now, OptMap* alt)
{
static int z = 1<<15; /* 32768: something big value */
int vn, va;
if (alt->value == 0) return ;
if (now->value == 0) {
copy_opt_map(now, alt);
return ;
}
vn = z / now->value;
va = z / alt->value;
if (comp_distance_value(&now->mmd, &alt->mmd, vn, va)... | 0 | [
"CWE-476",
"CWE-125"
] | oniguruma | c509265c5f6ae7264f7b8a8aae1cfa5fc59d108c | 79,531,785,314,270,360,000,000,000,000,000,000,000 | 17 | Fix CVE-2019-13225: problem in converting if-then-else pattern to bytecode. |
static bool is_ASCII_name(const char *hostname)
{
const unsigned char *ch = (const unsigned char *)hostname;
while(*ch) {
if(*ch++ & 0x80)
return FALSE;
}
return TRUE;
} | 0 | [
"CWE-119"
] | curl | 9b5e12a5491d2e6b68e0c88ca56f3a9ef9fba400 | 88,916,260,218,590,950,000,000,000,000,000,000,000 | 10 | url: fix alignment of ssl_backend_data struct
- Align the array of ssl_backend_data on a max 32 byte boundary.
8 is likely to be ok but I went with 32 for posterity should one of
the ssl_backend_data structs change to contain a larger sized variable
in the future.
Prior to this change (since dev 70f1db3, release 7.5... |
escape_quotes(const char *src)
{
char *result = escape_single_quotes_ascii(src);
if (!result)
{
fprintf(stderr, _("%s: out of memory\n"), progname);
exit(1);
}
return result;
} | 0 | [
"CWE-119"
] | postgres | 01824385aead50e557ca1af28640460fa9877d51 | 112,347,332,405,439,070,000,000,000,000,000,000,000 | 11 | Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that a
string being copied into a fixed-size buffer would fit. We believe that
most, perhaps all of these are in fact safe, or are copying data that is
coming from a trusted source so that any overrun i... |
int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
{
int rc = 0;
struct proc_dir_entry *p;
afinfo->seq_ops.start = tcp_seq_start;
afinfo->seq_ops.next = tcp_seq_next;
afinfo->seq_ops.stop = tcp_seq_stop;
p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
afinfo->seq_fops, a... | 0 | [
"CWE-284"
] | linux | ac6e780070e30e4c35bd395acfe9191e6268bdd3 | 108,548,468,492,211,000,000,000,000,000,000,000,000 | 15 | tcp: take care of truncations done by sk_filter()
With syzkaller help, Marco Grassi found a bug in TCP stack,
crashing in tcp_collapse()
Root cause is that sk_filter() can truncate the incoming skb,
but TCP stack was not really expecting this to happen.
It probably was expecting a simple DROP or ACCEPT behavior.
We ... |
void address_space_stw_be(AddressSpace *as, hwaddr addr, uint32_t val,
MemTxAttrs attrs, MemTxResult *result)
{
address_space_stw_internal(as, addr, val, attrs, result,
DEVICE_BIG_ENDIAN);
} | 0 | [] | qemu | e4a511f8cc6f4a46d409fb5c9f72c38ba45f8d83 | 38,487,562,225,073,084,000,000,000,000,000,000,000 | 6 | exec: clamp accesses against the MemoryRegionSection
Because the clamping was done against the MemoryRegion,
address_space_rw was effectively broken if a write spanned
multiple sections that are not linear in underlying memory
(with the memory not being under an IOMMU).
This is visible with the MIPS rc4030 IOMMU, whi... |
static int muscle_set_security_env(sc_card_t *card,
const sc_security_env_t *env,
int se_num)
{
muscle_private_t* priv = MUSCLE_DATA(card);
if (env->operation != SC_SEC_OPERATION_SIGN &&
env->operation != SC_SEC_OPERATION_DECIPHER) {
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Invalid crypto operation... | 0 | [
"CWE-415",
"CWE-119"
] | OpenSC | 360e95d45ac4123255a4c796db96337f332160ad | 298,850,529,181,297,700,000,000,000,000,000,000,000 | 41 | fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems. |
void agp3_generic_cleanup(void)
{
u32 ctrl;
pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, &ctrl);
pci_write_config_dword(agp_bridge->dev, agp_bridge->capndx+AGPCTRL, ctrl & ~AGPCTRL_APERENB);
} | 0 | [
"CWE-190"
] | linux-2.6 | 194b3da873fd334ef183806db751473512af29ce | 87,863,543,649,325,440,000,000,000,000,000,000,000 | 6 | agp: fix arbitrary kernel memory writes
pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl
cmds of agp_ioctl() and passed to agpioc_bind_wrap(). As said in the
comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND,
and it is not checked at all in case of AGPIOC_UNBIND. As a resu... |
GF_Err avcc_box_write(GF_Box *s, GF_BitStream *bs)
{
u32 i, count;
GF_Err e;
GF_AVCConfigurationBox *ptr = (GF_AVCConfigurationBox *) s;
if (!s) return GF_BAD_PARAM;
if (!ptr->config) return GF_OK;
e = gf_isom_box_write_header(s, bs);
if (e) return e;
Bool is_avcc;
if ((ptr->type==GF_ISOM_BOX_TYPE_AVCC) || (p... | 0 | [
"CWE-617",
"CWE-703"
] | gpac | 9ea93a2ec8f555ceed1ee27294cf94822f14f10f | 139,198,389,380,765,690,000,000,000,000,000,000,000 | 65 | fixed #2165 |
int zipTryEncoding(unsigned char *entry, unsigned int entrylen, long long *v, unsigned char *encoding) {
long long value;
if (entrylen >= 32 || entrylen == 0) return 0;
if (string2ll((char*)entry,entrylen,&value)) {
/* Great, the string can be encoded. Check what's the smallest
* of our en... | 0 | [
"CWE-190"
] | redis | f6a40570fa63d5afdd596c78083d754081d80ae3 | 82,207,479,201,333,950,000,000,000,000,000,000,000 | 25 | Fix ziplist and listpack overflows and truncations (CVE-2021-32627, CVE-2021-32628)
- fix possible heap corruption in ziplist and listpack resulting by trying to
allocate more than the maximum size of 4GB.
- prevent ziplist (hash and zset) from reaching size of above 1GB, will be
converted to HT encoding, that's n... |
static size_t ovs_flow_cmd_msg_size(const struct sw_flow_actions *acts)
{
return NLMSG_ALIGN(sizeof(struct ovs_header))
+ nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_KEY */
+ nla_total_size(key_attr_size()) /* OVS_FLOW_ATTR_MASK */
+ nla_total_size(sizeof(struct ovs_flow_stats)) /* OVS_FLOW_ATTR_STATS */
... | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 161,040,931,241,115,070,000,000,000,000,000,000,000 | 10 | 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... |
crypt_block (unsigned char *buffer, size_t length, char *salt, size_t saltlen,
int iter, const void *iv, size_t ivlen,
const char *pw, int cipher_algo, int encrypt)
{
gcry_cipher_hd_t chd;
int rc;
rc = gcry_cipher_open (&chd, cipher_algo, GCRY_CIPHER_MODE_CBC, 0);
if (rc)
{
... | 0 | [] | gnupg | ed8383c618e124cfa708c9ee87563fcdf2f4649c | 323,954,964,213,460,040,000,000,000,000,000,000,000 | 37 | sm: Avoid double-free on iconv failure
* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid
double-free of pwbuf.
--
Observed by Joshua Rogers <honey@internot.info>, who proposed a
slightly different fix.
Debian-Bug-Id: 773472
Added fix at a second place - wk. |
void tsc210x_set_transform(uWireSlave *chip,
MouseTransformInfo *info)
{
TSC210xState *s = (TSC210xState *) chip->opaque;
#if 0
int64_t ltr[8];
ltr[0] = (int64_t) info->a[1] * info->y;
ltr[1] = (int64_t) info->a[4] * info->x;
ltr[2] = (int64_t) info->a[1] * info->a[3] -
... | 0 | [
"CWE-119"
] | qemu | 5193be3be35f29a35bc465036cd64ad60d43385f | 249,662,964,254,458,700,000,000,000,000,000,000,000 | 61 | tsc210x: fix buffer overrun on invalid state load
CVE-2013-4539
s->precision, nextprecision, function and nextfunction
come from wire and are used
as idx into resolution[] in TSC_CUT_RESOLUTION.
Validate after load to avoid buffer overrun.
Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst... |
GF_Err cslg_dump(GF_Box *a, FILE * trace)
{
GF_CompositionToDecodeBox *p;
p = (GF_CompositionToDecodeBox *)a;
gf_isom_box_dump_start(a, "CompositionToDecodeBox", trace);
fprintf(trace, "compositionToDTSShift=\"%d\" leastDecodeToDisplayDelta=\"%d\" compositionStartTime=\"%d\" compositionEndTime=\"%d\">\n", p->least... | 0 | [
"CWE-125"
] | gpac | bceb03fd2be95097a7b409ea59914f332fb6bc86 | 295,506,838,729,576,700,000,000,000,000,000,000,000 | 10 | fixed 2 possible heap overflows (inc. #1088) |
static int ext4_get_block_write_nolock(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
ext4_debug("ext4_get_block_write_nolock: inode %lu, create flag %d\n",
inode->i_ino, create);
return _ext4_get_block(inode, iblock, bh_result,
EXT4_GET_BLOCKS_NO_LOCK);
} | 0 | [
"CWE-362"
] | linux | ea3d7209ca01da209cda6f0dea8be9cc4b7a933b | 125,143,218,717,807,350,000,000,000,000,000,000,000 | 8 | 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... |
int nfc_llcp_data_received(struct nfc_dev *dev, struct sk_buff *skb)
{
struct nfc_llcp_local *local;
local = nfc_llcp_find_local(dev);
if (local == NULL) {
kfree_skb(skb);
return -ENODEV;
}
__nfc_llcp_recv(local, skb);
return 0;
} | 0 | [
"CWE-476"
] | linux | 58bdd544e2933a21a51eecf17c3f5f94038261b5 | 46,929,790,815,578,110,000,000,000,000,000,000,000 | 14 | net: nfc: Fix NULL dereference on nfc_llcp_build_tlv fails
KASAN report this:
BUG: KASAN: null-ptr-deref in nfc_llcp_build_gb+0x37f/0x540 [nfc]
Read of size 3 at addr 0000000000000000 by task syz-executor.0/5401
CPU: 0 PID: 5401 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
Hardware name: QEMU Standard PC (i440FX ... |
static void exif_iif_add_value(image_info_type *image_info, int section_index, char *name, int tag, int format, int length, void* value, size_t value_len, int motorola_intel)
{
size_t idex;
void *vptr, *vptr_end;
image_info_value *info_value;
image_info_data *info_data;
image_info_data *list;
if (length < 0) {... | 0 | [
"CWE-125"
] | php-src | f80ad18afae2230c2c1802c7d829100af646874e | 268,760,631,243,094,750,000,000,000,000,000,000,000 | 140 | Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
I do not completely understand what is going on there, but I am pretty
sure dir_entry <= offset_base if not a normal situation, so we better not
to rely on such dir_entry. |
static int search_frag_moof_offset(MOVFragmentIndex *frag_index, int64_t offset)
{
int a, b, m;
int64_t moof_offset;
// Optimize for appending new entries
if (!frag_index->nb_items ||
frag_index->item[frag_index->nb_items - 1].moof_offset < offset)
return frag_index->nb_items;
a = ... | 0 | [
"CWE-703"
] | FFmpeg | c953baa084607dd1d84c3bfcce3cf6a87c3e6e05 | 137,636,103,884,246,970,000,000,000,000,000,000,000 | 23 | avformat/mov: Check count sums in build_open_gop_key_points()
Fixes: ffmpeg.md
Fixes: Out of array access
Fixes: CVE-2022-2566
Found-by: Andy Nguyen <theflow@google.com>
Found-by: 3pvd <3pvd@google.com>
Reviewed-by: Andy Nguyen <theflow@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> |
static void gfar_timeout(struct net_device *dev, unsigned int txqueue)
{
struct gfar_private *priv = netdev_priv(dev);
dev->stats.tx_errors++;
schedule_work(&priv->reset_task);
} | 0 | [] | linux | d8861bab48b6c1fc3cdbcab8ff9d1eaea43afe7f | 278,140,215,842,020,380,000,000,000,000,000,000,000 | 7 | gianfar: fix jumbo packets+napi+rx overrun crash
When using jumbo packets and overrunning rx queue with napi enabled,
the following sequence is observed in gfar_add_rx_frag:
| lstatus | | skb |
t | lstatus, size, flags | first | len, data_len, *... |
CImg<T>& distance_dijkstra(const T& value, const CImg<t>& metric,
const bool is_high_connectivity=false) {
return get_distance_dijkstra(value,metric,is_high_connectivity).move_to(*this);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 283,030,410,975,492,620,000,000,000,000,000,000,000 | 4 | CImg<>::load_bmp() and CImg<>::load_pandore(): Check that dimensions encoded in file does not exceed file size. |
ldns_rdf2buffer_str_time(ldns_buffer *output, const ldns_rdf *rdf)
{
/* create a YYYYMMDDHHMMSS string if possible */
struct tm tm;
char date_buf[16];
memset(&tm, 0, sizeof(tm));
if (ldns_serial_arithmitics_gmtime_r(ldns_rdf2native_int32(rdf), time(NULL), &tm)
&& strftime(date_buf, 15, "%Y%m%d%H%M%S", &tm)) ... | 0 | [
"CWE-415"
] | ldns | 070b4595981f48a21cc6b4f5047fdc2d09d3da91 | 312,509,349,846,254,530,000,000,000,000,000,000,000 | 13 | CAA and URI |
static void scrub_parity_get(struct scrub_parity *sparity)
{
refcount_inc(&sparity->refs);
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 222,686,231,368,983,360,000,000,000,000,000,000,000 | 4 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
static void iwl_dump_prph(struct iwl_fw_runtime *fwrt,
const struct iwl_prph_range *iwl_prph_dump_addr,
u32 range_len, void *ptr)
{
struct iwl_fw_error_dump_prph *prph;
struct iwl_trans *trans = fwrt->trans;
struct iwl_fw_error_dump_data **data =
(struct iwl_fw_error_dump_data **)ptr;
unsigned long flag... | 0 | [
"CWE-400",
"CWE-401"
] | linux | b4b814fec1a5a849383f7b3886b654a13abbda7d | 1,718,544,559,408,150,800,000,000,000,000,000,000 | 41 | iwlwifi: dbg_ini: fix memory leak in alloc_sgtable
In alloc_sgtable if alloc_page fails, the alocated table should be
released.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com> |
void manager_status_printf(Manager *m, StatusType type, const char *status, const char *format, ...) {
va_list ap;
/* If m is NULL, assume we're after shutdown and let the messages through. */
if (m && !manager_get_show_status(m, type))
return;
/* XXX We should totally... | 0 | [
"CWE-20"
] | systemd | 531ac2b2349da02acc9c382849758e07eb92b020 | 262,653,105,498,767,270,000,000,000,000,000,000,000 | 17 | If the notification message length is 0, ignore the message (#4237)
Fixes #4234.
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org> |
T& _atNXY(const int pos, const int x, const int y, const int z=0, const int c=0) {
return _data[cimg::cut(pos,0,width() - 1)].atXY(x,y,z,c);
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 242,907,545,877,219,230,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 int ldsem_cmpxchg(long *old, long new, struct ld_semaphore *sem)
{
long tmp = *old;
*old = atomic_long_cmpxchg(&sem->count, *old, new);
return *old == tmp;
} | 1 | [
"CWE-362"
] | linux | cf872776fc84128bb779ce2b83a37c884c3203ae | 86,641,282,337,461,900,000,000,000,000,000,000,000 | 6 | tty: Fix hang at ldsem_down_read()
When a controlling tty is being hung up and the hang up is
waiting for a just-signalled tty reader or writer to exit, and a new tty
reader/writer tries to acquire an ldisc reference concurrently with the
ldisc reference release from the signalled reader/writer, the hangup
can hang. T... |
int InputBuffer::completeLine(PromptBase& pi) {
linenoiseCompletions lc;
char c = 0;
// completionCallback() expects a parsable entity, so find the previous break character and
// extract a copy to parse. we also handle the case where tab is hit while not at end-of-line.
int startIndex = pos;
... | 0 | [
"CWE-200"
] | mongo | 035cf2afc04988b22cb67f4ebfd77e9b344cb6e0 | 215,117,682,923,554,830,000,000,000,000,000,000,000 | 229 | SERVER-25335 avoid group and other permissions when creating .dbshell history file |
Field *create_tmp_field(TABLE *table, Item *item,
Item ***copy_func, Field **from_field,
Field **default_field,
bool group, bool modify_item,
bool table_cant_handle_bit_fields,
bool make_copy_field)
{... | 0 | [] | server | 8c34eab9688b4face54f15f89f5d62bdfd93b8a7 | 171,509,148,311,809,280,000,000,000,000,000,000,000 | 17 | MDEV-28094 Window function in expression in ORDER BY
call item->split_sum_func() in setup_order() just as
it's done in setup_fields() |
static int io_renameat(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_rename *ren = &req->rename;
int ret;
if (issue_flags & IO_URING_F_NONBLOCK)
return -EAGAIN;
ret = do_renameat2(ren->old_dfd, ren->oldpath, ren->new_dfd,
ren->newpath, ren->flags);
req->flags &= ~REQ_F_NEED_CLEANUP;
if (ret... | 0 | [
"CWE-667"
] | linux | 3ebba796fa251d042be42b929a2d916ee5c34a49 | 193,124,645,310,468,400,000,000,000,000,000,000,000 | 17 | 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... |
int jas_stream_display(jas_stream_t *stream, FILE *fp, int n)
{
unsigned char buf[16];
int i;
int j;
int m;
int c;
int display;
int cnt;
cnt = n - (n % 16);
display = 1;
for (i = 0; i < n; i += 16) {
if (n > 16 && i > 0) {
display = (i >= cnt) ? 1 : 0;
}
if (display) {
fprintf(fp, "%08x:", i);
... | 0 | [
"CWE-189"
] | jasper | 3c55b399c36ef46befcb21e4ebc4799367f89684 | 221,320,643,386,860,960,000,000,000,000,000,000,000 | 50 | At many places in the code, jas_malloc or jas_recalloc was being
invoked with the size argument being computed in a manner that would not
allow integer overflow to be detected. Now, these places in the code
have been modified to use special-purpose memory allocation functions
(e.g., jas_alloc2, jas_alloc3, jas_realloc... |
static int store_data_record(TABLE *table,
const LEX_STRING *host,
const LEX_STRING *user,
const LEX_STRING *proxied_host,
const LEX_STRING *proxied_user,
bool wit... | 0 | [] | mysql-server | 25d1b7e03b9b375a243fabdf0556c063c7282361 | 64,864,999,014,104,810,000,000,000,000,000,000,000 | 22 | Bug #22722946: integer overflow may lead to wrong results in get_56_lenc_string |
out_flush(void)
{
int len;
if (out_pos != 0)
{
// set out_pos to 0 before ui_write, to avoid recursiveness
len = out_pos;
out_pos = 0;
ui_write(out_buf, len, FALSE);
#ifdef FEAT_JOB_CHANNEL
if (ch_log_output != FALSE)
{
out_buf[len] = NUL;
ch_log(NULL, "raw %s output: \"%s\"",
# ifdef F... | 0 | [
"CWE-125",
"CWE-787"
] | vim | e178af5a586ea023622d460779fdcabbbfac0908 | 32,523,894,770,076,330,000,000,000,000,000,000,000 | 26 | 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 __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
poll_table *wait)
{
struct sock *sk = sock->sk, *other;
unsigned int writable;
__poll_t mask;
sock_poll_wait(file, sock, wait);
mask = 0;
/* exceptional events? */
if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue))
... | 0 | [
"CWE-362"
] | linux | cbcf01128d0a92e131bd09f1688fe032480b65ca | 338,716,016,541,153,730,000,000,000,000,000,000,000 | 57 | af_unix: fix garbage collect vs MSG_PEEK
unix_gc() assumes that candidate sockets can never gain an external
reference (i.e. be installed into an fd) while the unix_gc_lock is
held. Except for MSG_PEEK this is guaranteed by modifying inflight
count under the unix_gc_lock.
MSG_PEEK does not touch any variable protec... |
int yr_re_fast_exec(
uint8_t* code,
uint8_t* input_data,
size_t input_forwards_size,
size_t input_backwards_size,
int flags,
RE_MATCH_CALLBACK_FUNC callback,
void* callback_args)
{
RE_REPEAT_ANY_ARGS* repeat_any_args;
uint8_t* code_stack[MAX_FAST_RE_STACK];
uint8_t* input_stack[MAX_FA... | 0 | [
"CWE-125"
] | yara | 83d799804648c2a0895d40a19835d9b757c6fa4e | 339,359,814,377,197,660,000,000,000,000,000,000,000 | 168 | Fix issue #646 (#648)
* Fix issue #646 and some edge cases with wide regexps using \b and \B
* Rename function IS_WORD_CHAR to _yr_re_is_word_char |
TEST_F(TopologyManagerTestFixture, ShouldUpdateTopologyVersionOnSuccess) {
auto config = SdamConfiguration(kOneServer);
TopologyManager topologyManager(config, clockSource);
auto topologyDescription = topologyManager.getTopologyDescription();
ASSERT_EQUALS(topologyDescription->getServers().size(), 1);
... | 0 | [
"CWE-755"
] | mongo | 75f7184eafa78006a698cda4c4adfb57f1290047 | 184,203,553,920,763,840,000,000,000,000,000,000,000 | 29 | SERVER-50170 fix max staleness read preference parameter for server selection |
ssize_t generic_get(struct gps_device_t *session)
{
return packet_get(session->gpsdata.gps_fd, &session->packet);
} | 0 | [] | gpsd | 08edc49d8f63c75bfdfb480b083b0d960310f94f | 247,547,184,016,056,360,000,000,000,000,000,000,000 | 4 | Address Savannah bug #38511:
ais_context->bitlen <= sizeof(ais_context->bits)/8 is not checked |
*/
const char *netdev_drivername(const struct net_device *dev)
{
const struct device_driver *driver;
const struct device *parent;
const char *empty = "";
parent = dev->dev.parent;
if (!parent)
return empty;
driver = parent->driver;
if (driver && driver->name)
return driver->name;
return empty; | 0 | [
"CWE-400",
"CWE-703"
] | linux | fac8e0f579695a3ecbc4d3cac369139d7f819971 | 149,114,779,546,680,180,000,000,000,000,000,000,000 | 15 | tunnels: Don't apply GRO to multiple layers of encapsulation.
When drivers express support for TSO of encapsulated packets, they
only mean that they can do it for one layer of encapsulation.
Supporting additional levels would mean updating, at a minimum,
more IP length fields and they are unaware of this.
No encapsul... |
void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len)
{
int pos = skb_headlen(skb);
if (len < pos) /* Split line is inside header. */
skb_split_inside_header(skb, skb1, len, pos);
else /* Second chunk has no header, nothing to copy. */
skb_split_no_header(skb, skb1, len, pos);
} | 0 | [] | linux | e89e9cf539a28df7d0eb1d0a545368e9920b34ac | 254,649,743,860,807,870,000,000,000,000,000,000,000 | 9 | [IPv4/IPv6]: UFO Scatter-gather approach
Attached is kernel patch for UDP Fragmentation Offload (UFO) feature.
1. This patch incorporate the review comments by Jeff Garzik.
2. Renamed USO as UFO (UDP Fragmentation Offload)
3. udp sendfile support with UFO
This patches uses scatter-gather feature of skb to generate l... |
void pdin_box_del(GF_Box *s)
{
GF_ProgressiveDownloadBox *ptr = (GF_ProgressiveDownloadBox*)s;
if (ptr == NULL) return;
if (ptr->rates) gf_free(ptr->rates);
if (ptr->times) gf_free(ptr->times);
gf_free(ptr);
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 258,332,595,594,912,360,000,000,000,000,000,000,000 | 8 | fixed #2255 |
static int preserve_crunch_context(struct crunch_sigframe __user *frame)
{
char kbuf[sizeof(*frame) + 8];
struct crunch_sigframe *kframe;
/* the crunch context must be 64 bit aligned */
kframe = (struct crunch_sigframe *)((unsigned long)(kbuf + 8) & ~7);
kframe->magic = CRUNCH_MAGIC;
kframe->size = CRUNCH_STORAG... | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 124,297,365,061,129,410,000,000,000,000,000,000,000 | 12 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen,
const char *label, size_t llen,
const unsigned char *context,
size_t contextlen, int use_context)
{
unsigned char *buff;
unsigned char *val = N... | 0 | [] | openssl | 1a3701f4fe0530a40ec073cd78d02cfcc26c0f8e | 156,918,754,661,454,370,000,000,000,000,000,000,000 | 98 | Sanity check EVP_CTRL_AEAD_TLS_AAD
The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at
least 13 bytes long. Add sanity checks to ensure that the length is at
least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to
represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) ... |
static int ms_pull_ctl_disable_lqfp48(struct rtsx_ucr *ucr)
{
rtsx_usb_init_cmd(ucr);
rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_PULL_CTL1, 0xFF, 0x55);
rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_PULL_CTL2, 0xFF, 0x55);
rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_PULL_CTL3, 0xFF, 0x95);
rtsx_usb_add_cmd(ucr, WRITE_RE... | 0 | [
"CWE-416"
] | linux | 42933c8aa14be1caa9eda41f65cde8a3a95d3e39 | 175,330,394,433,115,200,000,000,000,000,000,000,000 | 13 | memstick: rtsx_usb_ms: fix UAF
This patch fixes the following issues:
1. memstick_free_host() will free the host, so the use of ms_dev(host) after
it will be a problem. To fix this, move memstick_free_host() after when we
are done with ms_dev(host).
2. In rtsx_usb_ms_drv_remove(), pm need to be disabled before we remo... |
static int t_fromb64(unsigned char *a, const char *src)
{
char *loc;
int i, j;
int size;
while(*src && (*src == ' ' || *src == '\t' || *src == '\n'))
++src;
size = strlen((const char *)src);
i = 0;
while(i < size)
{
loc = strchr(b64table, src[i]);
if(loc == (char *) 0) break;
else a[i] = loc - b64tab... | 0 | [] | openssl | edc032b5e3f3ebb1006a9c89e0ae00504f47966f | 195,919,579,093,660,680,000,000,000,000,000,000,000 | 42 | Add SRP support. |
void plugin_shutdown(void)
{
uint i, count= plugin_array.elements;
struct st_plugin_int **plugins, *plugin;
struct st_plugin_dl **dl;
DBUG_ENTER("plugin_shutdown");
if (initialized)
{
mysql_mutex_lock(&LOCK_plugin);
reap_needed= true;
/*
We want to shut down plugins in a reasonable orde... | 0 | [
"CWE-416"
] | server | c05fd700970ad45735caed3a6f9930d4ce19a3bd | 213,848,462,037,058,840,000,000,000,000,000,000,000 | 128 | MDEV-26323 use-after-poison issue of MariaDB server |
CImgDisplay& show_mouse() {
if (is_empty()) return *this;
Display *const dpy = cimg::X11_attr().display;
cimg_lock_display();
XUndefineCursor(dpy,_window);
cimg_unlock_display();
return *this; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 324,070,334,380,931,820,000,000,000,000,000,000,000 | 8 | Fix other issues in 'CImg<T>::load_bmp()'. |
static int StreamTcpHandleFin(ThreadVars *tv, StreamTcpThread *stt,
TcpSession *ssn, Packet *p, PacketQueue *pq)
{
if (PKT_IS_TOSERVER(p)) {
SCLogDebug("ssn %p: pkt (%" PRIu32 ") is to server: SEQ %" PRIu32 ","
" ACK %" PRIu32 "", ssn, p->payload_len, TCP_GET_... | 0 | [] | suricata | 843d0b7a10bb45627f94764a6c5d468a24143345 | 198,912,723,028,534,100,000,000,000,000,000,000,000 | 101 | stream: support RST getting lost/ignored
In case of a valid RST on a SYN, the state is switched to 'TCP_CLOSED'.
However, the target of the RST may not have received it, or may not
have accepted it. Also, the RST may have been injected, so the supposed
sender may not actually be aware of the RST that was sent in it's ... |
void ConnectionManagerImpl::checkForDeferredClose() {
if (drain_state_ == DrainState::Closing && streams_.empty() && !codec_->wantsToWrite()) {
doConnectionClose(Network::ConnectionCloseType::FlushWriteAndDelay, absl::nullopt);
}
} | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 213,927,523,893,092,300,000,000,000,000,000,000,000 | 5 | http/2: add stats and stream flush timeout (#139)
This commit adds a new stream flush timeout to guard against a
remote server that does not open window once an entire stream has
been buffered for flushing. Additional stats have also been added
to better understand the codecs view of active streams as well as
amount o... |
read_image_resource_block (PSDimage *img_a,
FILE *f,
GError **error)
{
guint32 block_len;
guint32 block_end;
if (fread (&block_len, 4, 1, f) < 1)
{
psd_set_error (feof (f), errno, error);
return -1;
}
img_a->image_res_len = GUINT... | 0 | [
"CWE-190"
] | gimp | 88eccea84aa375197cc04a2a0e2e29debb56bfa5 | 42,725,259,657,294,620,000,000,000,000,000,000,000 | 27 | Harden the PSD plugin against integer overflows.
Issues discovered by Stefan Cornelius, Secunia Research, advisory SA37232
and CVE identifier CVE-2009-3909. Fixes bug #600741.
(cherry picked from commit 9cc8d78ff33b7a36852b74e64b427489cad44d0e) |
static int qdisc_notify(struct net *net, struct sk_buff *oskb,
struct nlmsghdr *n, u32 clid,
struct Qdisc *old, struct Qdisc *new)
{
struct sk_buff *skb;
u32 portid = oskb ? NETLINK_CB(oskb).portid : 0;
skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb)
return -ENOBUFS;
if (old && !tc_qdisc_dump_igno... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 132,227,847,002,396,180,000,000,000,000,000,000,000 | 30 | 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.
... |
static int btrfs_ioctl_getflags(struct file *file, void __user *arg)
{
struct btrfs_inode *binode = BTRFS_I(file_inode(file));
unsigned int flags = btrfs_inode_flags_to_fsflags(binode->flags);
if (copy_to_user(arg, &flags, sizeof(flags)))
return -EFAULT;
return 0;
} | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 13,426,293,272,544,768,000,000,000,000,000,000,000 | 9 | btrfs: merge btrfs_find_device and find_device
Both btrfs_find_device() and find_device() does the same thing except
that the latter does not take the seed device onto account in the device
scanning context. We can merge them.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.c... |
static int cp2112_i2c_write_read_req(void *buf, u8 slave_address,
u8 *addr, int addr_length,
int read_length)
{
struct cp2112_write_read_req_report *report = buf;
if (read_length < 1 || read_length > 512 ||
addr_length > sizeof(report->target_address))
return -EINVAL;
report->report = CP21... | 0 | [
"CWE-388"
] | linux | 8e9faa15469ed7c7467423db4c62aeed3ff4cae3 | 142,676,448,696,736,860,000,000,000,000,000,000,000 | 17 | HID: cp2112: fix gpio-callback error handling
In case of a zero-length report, the gpio direction_input callback would
currently return success instead of an errno.
Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable")
Cc: stable <stable@vger.kernel.org> # 4.9
Signed-off-by: Johan Hovold <johan@k... |
static void geneve_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
strlcpy(drvinfo->version, GENEVE_NETDEV_VER, sizeof(drvinfo->version));
strlcpy(drvinfo->driver, "geneve", sizeof(drvinfo->driver));
} | 0 | [] | net | 6c8991f41546c3c472503dff1ea9daaddf9331c2 | 24,535,861,537,048,653,000,000,000,000,000,000,000 | 6 | net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup
ipv6_stub uses the ip6_dst_lookup function to allow other modules to
perform IPv6 lookups. However, this function skips the XFRM layer
entirely.
All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
ip_route_output_key and ip_route_o... |
canon(VALUE x)
{
if (RB_TYPE_P(x, T_RATIONAL)) {
VALUE den = rb_rational_den(x);
if (FIXNUM_P(den) && FIX2LONG(den) == 1)
return rb_rational_num(x);
}
return x;
} | 0 | [] | date | 3959accef8da5c128f8a8e2fd54e932a4fb253b0 | 94,344,961,752,419,350,000,000,000,000,000,000,000 | 9 | Add length limit option for methods that parses date strings
`Date.parse` now raises an ArgumentError when a given date string is
longer than 128. You can configure the limit by giving `limit` keyword
arguments like `Date.parse(str, limit: 1000)`. If you pass `limit: nil`,
the limit is disabled.
Not only `Date.parse`... |
static int php_handler(request_rec *r)
{
php_struct * volatile ctx;
void *conf;
apr_bucket_brigade * volatile brigade;
apr_bucket *bucket;
apr_status_t rv;
request_rec * volatile parent_req = NULL;
TSRMLS_FETCH();
#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
conf = ap_get_module_config(... | 1 | [
"CWE-190",
"CWE-79"
] | php-src | 23b057742e3cf199612fa8050ae86cae675e214e | 78,085,873,328,953,460,000,000,000,000,000,000,000 | 162 | Fix for bug #76582
The brigade seems to end up in a messed up state if something fails
in shutdown, so we clean it up. |
void recovery_cipher_init(bool passphrase_protection, bool pin_protection,
const char *language, const char *label, bool _enforce_wordlist,
uint32_t _auto_lock_delay_ms, uint32_t _u2f_counter, bool _dry_run)
{
enforce_wordlist = _enforce_wordlist;
dry_run = _d... | 1 | [
"CWE-354"
] | keepkey-firmware | 769714fcb569e7a4faff9530a2d9ac1f9d6e5680 | 59,850,176,141,715,090,000,000,000,000,000,000,000 | 47 | firmware: stronger recovery state machine checks |
static MagickBooleanType WritePS3MaskImage(const ImageInfo *image_info,
Image *image,const CompressionType compression,ExceptionInfo *exception)
{
char
buffer[MagickPathExtent];
Image
*mask_image;
MagickBooleanType
status;
MagickOffsetType
offset,
start,
stop;
MemoryInfo
*pix... | 0 | [
"CWE-401"
] | ImageMagick | 7b04c53c69792243d66d6876f843b850b3cc002b | 50,278,300,032,645,130,000,000,000,000,000,000,000 | 189 | Fixed memory leaks reported in #1557. |
rdp_process_server_caps(STREAM s, uint16 length)
{
int n;
uint8 *next, *start;
uint16 ncapsets, capset_type, capset_length;
start = s->p;
in_uint16_le(s, ncapsets);
in_uint8s(s, 2); /* pad */
for (n = 0; n < ncapsets; n++)
{
if (s->p > start + length)
return;
in_uint16_le(s, capset_type);
in_uint16... | 0 | [
"CWE-787"
] | rdesktop | 766ebcf6f23ccfe8323ac10242ae6e127d4505d2 | 275,300,295,241,940,200,000,000,000,000,000,000,000 | 35 | Malicious RDP server security fixes
This commit includes fixes for a set of 21 vulnerabilities in
rdesktop when a malicious RDP server is used.
All vulnerabilities was identified and reported by Eyal Itkin.
* Add rdp_protocol_error function that is used in several fixes
* Refactor of process_bitmap_updates
* Fix pos... |
int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
DEFINE_DELAYED_CALL(done);
struct inode *inode = d_inode(dentry);
const char *link = inode->i_link;
int res;
if (!link) {
link = inode->i_op->get_link(dentry, inode, &done);
if (IS_ERR(link))
return PTR_ERR(link);
}
res = read... | 0 | [
"CWE-284"
] | linux | 9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca | 45,908,890,436,793,530,000,000,000,000,000,000,000 | 16 | vfs: rename: check backing inode being equal
If a file is renamed to a hardlink of itself POSIX specifies that rename(2)
should do nothing and return success.
This condition is checked in vfs_rename(). However it won't detect hard
links on overlayfs where these are given separate inodes on the overlayfs
layer.
Over... |
RADIUS_PACKET *rad_recv(int fd)
{
RADIUS_PACKET *packet;
struct sockaddr_in saremote;
int totallen;
socklen_t salen;
uint8_t *attr;
int count;
radius_packet_t *hdr;
char host_ipaddr[16];
int require_ma = 0;
int seen_ma = 0;
uint8_t data[MAX_PACKET_LEN];
int num_attributes;
/*
* Alloca... | 0 | [] | freeradius-server | 860cad9e02ba344edb0038419e415fe05a9a01f4 | 42,935,978,166,941,500,000,000,000,000,000,000,000 | 350 | Fix crash on Tunnel-Password attributes with zero length |
**/
int window_y() const {
return _window_y; | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 104,126,460,049,192,030,000,000,000,000,000,000,000 | 3 | Fix other issues in 'CImg<T>::load_bmp()'. |
template<typename T>
CImgDisplay& display(const CImgList<T>& list, const char axis='x', const float align=0) {
if (list._width==1) {
const CImg<T>& img = list[0];
if (img._depth==1 && (img._spectrum==1 || img._spectrum>=3) && _normalization!=1) return display(img);
}
CImgList<t... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 136,044,869,502,623,230,000,000,000,000,000,000,000 | 17 | Fix other issues in 'CImg<T>::load_bmp()'. |
gx_dc_pattern2_can_overlap(const gx_device_color *pdevc)
{
gs_pattern2_instance_t * pinst;
if (pdevc->type != &gx_dc_pattern2)
return false;
pinst = (gs_pattern2_instance_t *)pdevc->ccolor.pattern;
switch (pinst->templat.Shading->head.type) {
case 3: case 6: case 7:
return t... | 0 | [
"CWE-704"
] | ghostpdl | 693baf02152119af6e6afd30bb8ec76d14f84bbf | 22,441,983,696,327,638,000,000,000,000,000,000,000 | 14 | PS interpreter - check the Implementation of a Pattern before use
Bug #700141 "Type confusion in setpattern"
As the bug thread says, we were not checking that the Implementation
of a pattern dictionary was a structure type, leading to a crash when
we tried to treat it as one.
Here we make the st_pattern1_instance an... |
proto_tree_add_bitmask_value(proto_tree *parent_tree, tvbuff_t *tvb, const guint offset,
const int hf_hdr, const gint ett, int * const *fields, const guint64 value)
{
return proto_tree_add_bitmask_value_with_flags(parent_tree, tvb, offset,
hf_hdr, ett, fields, value, BMT_NO_INT|BMT_NO_TFS);
} | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 186,554,778,741,846,900,000,000,000,000,000,000,000 | 6 | epan: Fix a memory leak.
Make sure _proto_tree_add_bits_ret_val allocates a bits array using the
packet scope, otherwise we leak memory. Fixes #17032. |
static struct inode_security_struct *inode_security(struct inode *inode)
{
__inode_security_revalidate(inode, NULL, true);
return inode->i_security;
} | 0 | [
"CWE-682"
] | linux-stable | 0c461cb727d146c9ef2d3e86214f498b78b7d125 | 249,099,730,068,366,280,000,000,000,000,000,000,000 | 5 | selinux: fix off-by-one in setprocattr
SELinux tries to support setting/clearing of /proc/pid/attr attributes
from the shell by ignoring terminating newlines and treating an
attribute value that begins with a NUL or newline as an attempt to
clear the attribute. However, the test for clearing attributes has
always bee... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.