func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
send_request_resend(struct neighbour *neigh,
const unsigned char *prefix, unsigned char plen,
unsigned short seqno, unsigned char *id)
{
if(neigh)
send_unicast_multihop_request(neigh, prefix, plen, seqno, id, 127);
else
send_multihop_request(NULL, prefix, ... | 0 | [
"CWE-787"
] | frr | c3793352a8d76d2eee1edc38a9a16c1c8a6573f4 | 76,736,994,927,262,550,000,000,000,000,000,000,000 | 12 | babeld: fix #10502 #10503 by repairing the checks on length
This patch repairs the checking conditions on length in four functions:
babel_packet_examin, parse_hello_subtlv, parse_ihu_subtlv, and parse_update_subtlv
Signed-off-by: qingkaishi <qingkaishi@gmail.com> |
static void vmcs_clear_bits(unsigned long field, u32 mask)
{
vmcs_writel(field, vmcs_readl(field) & ~mask);
} | 0 | [
"CWE-20"
] | linux-2.6 | 16175a796d061833aacfbd9672235f2d2725df65 | 124,747,986,259,635,590,000,000,000,000,000,000,000 | 4 | KVM: VMX: Don't allow uninhibited access to EFER on i386
vmx_set_msr() does not allow i386 guests to touch EFER, but they can still
do so through the default: label in the switch. If they set EFER_LME, they
can oops the host.
Fix by having EFER access through the normal channel (which will check for
EFER_LME) even o... |
static __inline__ void fq_put(struct frag_queue *fq)
{
inet_frag_put(&fq->q, &ip6_frags);
} | 0 | [] | linux-2.6 | 70789d7052239992824628db8133de08dc78e593 | 45,100,017,454,145,240,000,000,000,000,000,000,000 | 4 | ipv6: discard overlapping fragment
RFC5722 prohibits reassembling fragments when some data overlaps.
Bug spotted by Zhang Zuotao <zuotao.zhang@6wind.com>.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net> |
gx_device_set_media_size(gx_device * dev, double media_width, double media_height)
{
dev->MediaSize[0] = media_width;
dev->MediaSize[1] = media_height;
gx_device_set_hwsize_from_media(dev);
} | 0 | [] | ghostpdl | 79cccf641486a6595c43f1de1cd7ade696020a31 | 78,406,016,791,812,950,000,000,000,000,000,000,000 | 6 | Bug 699654(2): preserve LockSafetyParams in the nulldevice
The nulldevice does not necessarily use the normal setpagedevice machinery,
but can be set using the nulldevice operator. In which case, we don't preserve
the settings from the original device (in the way setpagedevice does).
Since nulldevice does nothing, th... |
one_letter_cmd(char_u *p, cmdidx_T *idx)
{
if (in_vim9script())
return FALSE;
if (*p == 'k')
{
*idx = CMD_k;
return TRUE;
}
if (p[0] == 's'
&& ((p[1] == 'c' && (p[2] == NUL || (p[2] != 's' && p[2] != 'r'
&& (p[3] == NUL || (p[3] != 'i' && p[4] != 'p')))))
|| p[1] == 'g'
|| (p[1] == 'i... | 0 | [
"CWE-122"
] | vim | f50808ed135ab973296bca515ae4029b321afe47 | 25,924,418,410,621,777,000,000,000,000,000,000,000 | 22 | patch 8.2.4763: using invalid pointer with "V:" in Ex mode
Problem: Using invalid pointer with "V:" in Ex mode.
Solution: Correctly handle the command being changed to "+". |
static inline double GetDrawValue(const char *magick_restrict string,
char **magick_restrict sentinal)
{
char
**magick_restrict q;
double
value;
q=sentinal;
value=InterpretLocaleValue(string,q);
sentinal=q;
return(value);
} | 0 | [] | ImageMagick | f4cdb3f3aab28273960ffacf1d356312b56ffd27 | 140,774,575,225,314,520,000,000,000,000,000,000,000 | 14 | https://github.com/ImageMagick/ImageMagick/issues/3338 |
TEST_P(ProtocolIntegrationTest, AddBodyToRequestAndWaitForIt) {
config_helper_.prependFilter(R"EOF(
name: wait-for-whole-request-and-response-filter
)EOF");
config_helper_.prependFilter(R"EOF(
name: add-body-filter
)EOF");
initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));
auto res... | 0 | [
"CWE-416"
] | envoy | 148de954ed3585d8b4298b424aa24916d0de6136 | 272,783,858,001,559,520,000,000,000,000,000,000,000 | 22 | CVE-2021-43825
Response filter manager crash
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static void ims_pcu_destroy_bootloader_mode(struct ims_pcu *pcu)
{
/* Make sure our initial firmware request has completed */
wait_for_completion(&pcu->async_firmware_done); | 0 | [
"CWE-703"
] | linux | a0ad220c96692eda76b2e3fd7279f3dcd1d8a8ff | 338,410,277,301,523,980,000,000,000,000,000,000,000 | 5 | Input: ims-pcu - sanity check against missing interfaces
A malicious device missing interface can make the driver oops.
Add sanity checking.
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> |
static inline int pri2fac(const int pri)
{
int fac = pri >> 3;
return (fac > 23) ? LOG_FAC_INVLD : fac;
} | 1 | [] | rsyslog | 8a4ada405e98ed3470f2c5f54e52339e7263c258 | 38,375,841,940,809,113,000,000,000,000,000,000,000 | 5 | prevent PRI underflow |
static void set_writer_options(QPDF& pdf, Options& o, QPDFWriter& w)
{
if (o.qdf_mode)
{
w.setQDFMode(true);
}
if (o.preserve_unreferenced_objects)
{
w.setPreserveUnreferencedObjects(true);
}
if (o.newline_before_endstream)
{
w.setNewlineBeforeEndstream(true);
... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 204,507,140,721,925,460,000,000,000,000,000,000,000 | 92 | 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 ... |
int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
const union sctp_addr *peer_addr,
sctp_init_chunk_t *peer_init, gfp_t gfp)
{
union sctp_params param;
struct sctp_transport *transport;
struct list_head *pos, *temp;
char *cookie;
/* We must include the address that the INIT pack... | 1 | [
"CWE-287"
] | linux-2.6 | add52379dde2e5300e2d574b172e62c6cf43b3d3 | 305,211,551,040,565,700,000,000,000,000,000,000,000 | 167 | sctp: Fix oops when INIT-ACK indicates that peer doesn't support AUTH
If INIT-ACK is received with SupportedExtensions parameter which
indicates that the peer does not support AUTH, the packet will be
silently ignore, and sctp_process_init() do cleanup all of the
transports in the association.
When T1-Init timer is ex... |
int Arg_comparator::compare_e_time()
{
THD *thd= current_thd;
longlong val1= (*a)->val_time_packed(thd);
longlong val2= (*b)->val_time_packed(thd);
if ((*a)->null_value || (*b)->null_value)
return MY_TEST((*a)->null_value && (*b)->null_value);
return MY_TEST(val1 == val2);
} | 0 | [
"CWE-617"
] | server | 807945f2eb5fa22e6f233cc17b85a2e141efe2c8 | 220,664,998,545,665,440,000,000,000,000,000,000,000 | 9 | 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 addrconf_del_rs_timer(struct inet6_dev *idev)
{
if (del_timer(&idev->rs_timer))
__in6_dev_put(idev);
} | 0 | [] | net | 4b08a8f1bd8cb4541c93ec170027b4d0782dab52 | 245,450,335,054,946,960,000,000,000,000,000,000,000 | 5 | ipv6: remove max_addresses check from ipv6_create_tempaddr
Because of the max_addresses check attackers were able to disable privacy
extensions on an interface by creating enough autoconfigured addresses:
<http://seclists.org/oss-sec/2012/q4/292>
But the check is not actually needed: max_addresses protects the
kerne... |
static AVFrame *select_frame(FieldMatchContext *fm, int match)
{
if (match == mP || match == mB) return fm->prv;
else if (match == mN || match == mU) return fm->nxt;
else /* match == mC */ return fm->src;
} | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | e43a0a232dbf6d3c161823c2e07c52e76227a1bc | 60,996,523,525,389,940,000,000,000,000,000,000,000 | 6 | avfilter: fix plane validity checks
Fixes out of array accesses
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
struct ext4_xattr_info *i,
struct ext4_xattr_ibody_find *is)
{
struct ext4_xattr_ibody_header *header;
struct ext4_xattr_search *s = &is->s;
int error;
if (EXT4_I(inode)->i_extra_isize == 0)
return -ENOSPC;
error = ext4_xattr_set_ent... | 1 | [
"CWE-787"
] | linux | 8bc1379b82b8e809eef77a9fedbb75c6c297be19 | 99,789,066,057,453,720,000,000,000,000,000,000,000 | 38 | ext4: avoid running out of journal credits when appending to an inline file
Use a separate journal transaction if it turns out that we need to
convert an inline file to use an data block. Otherwise we could end
up failing due to not having journal credits.
This addresses CVE-2018-10883.
https://bugzilla.kernel.org/... |
void ConnectionManagerImpl::ActiveStream::encodeHeaders(ActiveStreamEncoderFilter* filter,
ResponseHeaderMap& headers,
bool end_stream) {
resetIdleTimer();
disarmRequestTimeout();
// Headers filter ite... | 0 | [
"CWE-400"
] | envoy | 0e49a495826ea9e29134c1bd54fdeb31a034f40c | 7,557,026,897,274,990,000,000,000,000,000,000,000 | 56 | 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... |
static UINT printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp)
{
UINT32 Length;
UINT64 Offset;
rdpPrintJob* printjob = NULL;
UINT error = CHANNEL_RC_OK;
Stream_Read_UINT32(irp->input, Length);
Stream_Read_UINT64(irp->input, Offset);
Stream_Seek(irp->input, 20); /* Padding */
if (printer_dev->prin... | 1 | [
"CWE-125"
] | FreeRDP | 6b485b146a1b9d6ce72dfd7b5f36456c166e7a16 | 104,750,488,265,431,250,000,000,000,000,000,000,000 | 33 | Fixed oob read in irp_write and similar |
StatusWith<AuthzLockGuard> requireWritableAuthSchema28SCRAM(OperationContext* opCtx,
AuthorizationManager* authzManager) {
int foundSchemaVersion;
// We take a MODE_X lock during writes because we want to be sure that we can read any pinned
// user... | 0 | [
"CWE-613"
] | mongo | e55d6e2292e5dbe2f97153251d8193d1cc89f5d7 | 124,117,162,448,346,500,000,000,000,000,000,000,000 | 28 | SERVER-38984 Validate unique User ID on UserCache hit |
static void mdns_mcast_group_ipv4(struct sockaddr_in *ret_sa) {
assert(ret_sa);
memset(ret_sa, 0, sizeof(struct sockaddr_in));
ret_sa->sin_family = AF_INET;
ret_sa->sin_port = htons(AVAHI_MDNS_PORT);
inet_pton(AF_INET, AVAHI_IPV4_MCAST_GROUP, &ret_sa->sin_addr);
} | 0 | [
"CWE-399"
] | avahi | 46109dfec75534fe270c0ab902576f685d5ab3a6 | 310,165,302,841,877,040,000,000,000,000,000,000,000 | 8 | socket: Still read corrupt packets from the sockets
Else, we end up with an infinite loop with 100% CPU.
http://www.avahi.org/ticket/325
https://bugzilla.redhat.com/show_bug.cgi?id=667187 |
void Compute(OpKernelContext* context) override {
const Tensor& filter = context->input(1);
const TensorShape& filter_shape = filter.shape();
const Tensor& out_backprop = context->input(2);
const TensorShape& out_backprop_shape = out_backprop.shape();
TensorShape input_shape;
if (takes_shape... | 0 | [
"CWE-20",
"CWE-703"
] | tensorflow | 174c5096f303d5be7ed2ca2662b08371bff4ab88 | 279,066,523,874,605,860,000,000,000,000,000,000,000 | 58 | Fix failed check in Conv3DBackpropFilterV2.
Passing in a rank-0 `filter_size` causes a check fail and crash,
coming from a `filter_size.vec<>()` call. Here we check the size
first.
PiperOrigin-RevId: 445517122 |
void sqfs_close(void)
{
sqfs_decompressor_cleanup(&ctxt);
free(ctxt.sblk);
ctxt.sblk = NULL;
ctxt.cur_dev = NULL;
} | 0 | [
"CWE-787"
] | u-boot | 2ac0baab4aff1a0b45067d0b62f00c15f4e86856 | 286,356,469,414,565,300,000,000,000,000,000,000,000 | 7 | fs/squashfs: sqfs_read: Prevent arbitrary code execution
Following Jincheng's report, an out-of-band write leading to arbitrary
code execution is possible because on one side the squashfs logic
accepts directory names up to 65535 bytes (u16), while U-Boot fs logic
accepts directory names up to 255 bytes long.
Prevent... |
MODRET auth_post_retr(cmd_rec *cmd) {
if (auth_anon_allow_robots == TRUE) {
return PR_DECLINED(cmd);
}
if (auth_anon_allow_robots_enabled == TRUE) {
int res;
res = pr_unregister_fs("/robots.txt");
if (res < 0) {
pr_log_debug(DEBUG9, "error removing 'robots' FS for '/robots.txt': %s",
... | 0 | [
"CWE-59",
"CWE-295"
] | proftpd | 349addc3be4fcdad9bd4ec01ad1ccd916c898ed8 | 228,633,734,779,389,950,000,000,000,000,000,000,000 | 19 | Walk the entire DefaultRoot path, checking for symlinks of any component,
when AllowChrootSymlinks is disabled. |
Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
Item_equal *item_equal)
{
List<Item> eq_list;
Item_func_eq *eq_item= 0;
if (((Item *) item_equal)->const_item() && !item_equal->val_int())
return new (thd->mem_root) Item_int(thd, (longlong) 0, 1);
Item *it... | 0 | [] | server | ff77a09bda884fe6bf3917eb29b9d3a2f53f919b | 312,381,604,416,830,320,000,000,000,000,000,000,000 | 185 | MDEV-22464 Server crash on UPDATE with nested subquery
Uninitialized ref_pointer_array[] because setup_fields() got empty
fields list. mysql_multi_update() for some reason does that by
substituting the fields list with empty total_list for the
mysql_select() call (looks like wrong merge since total_list is not
used a... |
static inline int security_path_truncate(struct path *path, loff_t length,
unsigned int time_attrs)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 208,876,526,042,254,100,000,000,000,000,000,000,000 | 5 | 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... |
static int walk_hugetlb_range(unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
struct vm_area_struct *vma = walk->vma;
struct hstate *h = hstate_vma(vma);
unsigned long next;
unsigned long hmask = huge_page_mask(h);
unsigned long sz = huge_page_size(h);
pte_t *pte;
int err = 0;
do {
ne... | 0 | [
"CWE-200",
"CWE-703"
] | linux | 373c4557d2aa362702c4c2d41288fb1e54990b7c | 215,645,513,919,133,960,000,000,000,000,000,000,000 | 26 | mm/pagewalk.c: report holes in hugetlb ranges
This matters at least for the mincore syscall, which will otherwise copy
uninitialized memory from the page allocator to userspace. It is
probably also a correctness error for /proc/$pid/pagemap, but I haven't
tested that.
Removing the `walk->hugetlb_entry` condition in ... |
static int mce_timed_out(u64 *t, const char *msg)
{
/*
* The others already did panic for some reason.
* Bail out like in a timeout.
* rmb() to tell the compiler that system_state
* might have been modified by someone else.
*/
rmb();
if (atomic_read(&mce_panicked))
wait_for_panic();
if (!mca_cfg.monarch... | 0 | [
"CWE-362"
] | linux | b3b7c4795ccab5be71f080774c45bbbcc75c2aaf | 185,485,513,488,690,200,000,000,000,000,000,000,000 | 24 | x86/MCE: Serialize sysfs changes
The check_interval file in
/sys/devices/system/machinecheck/machinecheck<cpu number>
directory is a global timer value for MCE polling. If it is changed by one
CPU, mce_restart() broadcasts the event to other CPUs to delete and restart
the MCE polling timer and __mcheck_cpu_init_ti... |
int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
struct file *file,
struct snd_pcm_substream **rsubstream)
{
struct snd_pcm_str * pstr;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
struct snd_card *card;
int prefer_subdevice;
size_t size;
if (snd_BUG_ON(!pcm... | 0 | [
"CWE-416"
] | linux | 362bca57f5d78220f8b5907b875961af9436e229 | 292,089,035,510,406,260,000,000,000,000,000,000,000 | 99 | ALSA: pcm: prevent UAF in snd_pcm_info
When the device descriptor is closed, the `substream->runtime` pointer
is freed. But another thread may be in the ioctl handler, case
SNDRV_CTL_IOCTL_PCM_INFO. This case calls snd_pcm_info_user() which
calls snd_pcm_info() which accesses the now freed `substream->runtime`.
Note:... |
gst_qtdemux_convert_seek (GstPad * pad, GstFormat * format,
GstSeekType cur_type, gint64 * cur, GstSeekType stop_type, gint64 * stop)
{
gboolean res;
g_return_val_if_fail (format != NULL, FALSE);
g_return_val_if_fail (cur != NULL, FALSE);
g_return_val_if_fail (stop != NULL, FALSE);
if (*format == GST_FO... | 0 | [
"CWE-125"
] | gst-plugins-good | d0949baf3dadea6021d54abef6802fed5a06af75 | 326,147,511,582,125,300,000,000,000,000,000,000,000 | 23 | qtdemux: Fix out of bounds read in tag parsing code
We can't simply assume that the length of the tag value as given
inside the stream is correct but should also check against the amount of
data we have actually available.
https://bugzilla.gnome.org/show_bug.cgi?id=775451 |
static __latent_entropy struct task_struct *copy_process(
struct pid *pid,
int trace,
int node,
struct kernel_clone_args *args)
{
int pidfd = -1, retval;
struct task_struct *p;
struct multiprocess_signals delayed;
struct file *pidfile = NULL;
u64 clone_flags = args->flags;
/*
* Don't allow ... | 0 | [
"CWE-416"
] | linux | 16d51a590a8ce3befb1308e0e7ab77f3b661af33 | 186,688,269,507,226,000,000,000,000,000,000,000,000 | 535 | sched/fair: Don't free p->numa_faults with concurrent readers
When going through execve(), zero out the NUMA fault statistics instead of
freeing them.
During execve, the task is reachable through procfs and the scheduler. A
concurrent /proc/*/sched reader can read data from a freed ->numa_faults
allocation (confirmed... |
Header::screenWindowWidth ()
{
return static_cast <FloatAttribute &>
((*this)["screenWindowWidth"]).value();
} | 0 | [
"CWE-125"
] | openexr | e79d2296496a50826a15c667bf92bdc5a05518b4 | 302,820,424,914,085,700,000,000,000,000,000,000,000 | 5 | fix memory leaks and invalid memory accesses
Signed-off-by: Peter Hillman <peterh@wetafx.co.nz> |
static inline int ipmr_forward_finish(struct sk_buff *skb)
{
struct ip_options * opt = &(IPCB(skb)->opt);
IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS);
if (unlikely(opt->optlen))
ip_forward_options(skb);
return dst_output(skb);
} | 0 | [
"CWE-200"
] | linux-2.6 | 9ef1d4c7c7aca1cd436612b6ca785b726ffb8ed8 | 161,965,252,761,347,040,000,000,000,000,000,000,000 | 11 | [NETLINK]: Missing initializations in dumped data
Mostly missing initialization of padding fields of 1 or 2 bytes length,
two instances of uninitialized nlmsgerr->msg of 16 bytes length.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net> |
inline longlong get_row_count_func() const
{
return m_row_count_func;
} | 0 | [
"CWE-416"
] | server | 4681b6f2d8c82b4ec5cf115e83698251963d80d5 | 314,539,214,045,647,600,000,000,000,000,000,000,000 | 4 | 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... |
const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)
{
return group->order;
} | 0 | [] | openssl | 30c22fa8b1d840036b8e203585738df62a03cec8 | 188,003,099,163,019,860,000,000,000,000,000,000,000 | 4 | [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it
The cofactor argument to EC_GROUP_set_generator is optional, and SCA
mitigations for ECC currently use it. So the library currently falls
back to very old SCA-vulnerable code if the cofactor is not present.
This PR allows EC_GROUP_set_generator to ... |
ns_client_log(ns_client_t *client, isc_logcategory_t *category,
isc_logmodule_t *module, int level, const char *fmt, ...) {
va_list ap;
if (!isc_log_wouldlog(ns_lctx, level)) {
return;
}
va_start(ap, fmt);
ns_client_logv(client, category, module, level, fmt, ap);
va_end(ap);
} | 0 | [
"CWE-617"
] | bind9 | 15996f0cb15631b95a801e3e88928494a69ad6ee | 36,567,767,310,499,070,000,000,000,000,000,000,000 | 12 | ns_client_error() could assert if rcode was overridden to NOERROR
The client->rcode_override was originally created to force the server
to send SERVFAIL in some cases when it would normally have sent FORMERR.
More recently, it was used in a3ba95116ed04594ea59a8124bf781b30367a7a2
commit (part of GL #2790) to force the... |
free_config_auth(
config_tree *ptree
)
{
destroy_attr_val_fifo(ptree->auth.crypto_cmd_list);
ptree->auth.crypto_cmd_list = NULL;
destroy_attr_val_fifo(ptree->auth.trusted_key_list);
ptree->auth.trusted_key_list = NULL;
} | 0 | [
"CWE-19"
] | ntp | fe46889f7baa75fc8e6c0fcde87706d396ce1461 | 285,945,812,846,851,760,000,000,000,000,000,000,000 | 9 | [Sec 2942]: Off-path DoS attack on auth broadcast mode. HStenn. |
static void hidp_recv_ctrl_handshake(struct input_device *idev, uint8_t param)
{
bool pending_req_complete = false;
uint8_t pending_req_type;
DBG("");
pending_req_type = idev->report_req_pending & HIDP_HEADER_TRANS_MASK;
switch (param) {
case HIDP_HSHK_SUCCESSFUL:
if (pending_req_type == HIDP_TRANS_SET_REPOR... | 0 | [] | bluez | 3cccdbab2324086588df4ccf5f892fb3ce1f1787 | 293,251,774,088,280,970,000,000,000,000,000,000,000 | 55 | HID accepts bonded device connections only.
This change adds a configuration for platforms to choose a more secure
posture for the HID profile. While some older mice are known to not
support pairing or encryption, some platform may choose a more secure
posture by requiring the device to be bonded and require the
con... |
GF_Err stsg_box_write(GF_Box *s, GF_BitStream *bs)
{
GF_Err e;
u32 i;
GF_SubTrackSampleGroupBox *ptr = (GF_SubTrackSampleGroupBox *)s;
e = gf_isom_full_box_write(s, bs);
if (e) return e;
gf_bs_write_u32(bs, ptr->grouping_type);
gf_bs_write_u16(bs, ptr->nb_groups);
for (i = 0; i < ptr->nb_groups; i++) {
gf_b... | 0 | [
"CWE-787"
] | gpac | 388ecce75d05e11fc8496aa4857b91245007d26e | 70,499,036,788,243,610,000,000,000,000,000,000,000 | 15 | fixed #1587 |
static s32 brcmf_set_frag(struct net_device *ndev, u32 frag_threshold)
{
struct brcmf_if *ifp = netdev_priv(ndev);
struct wiphy *wiphy = ifp->drvr->wiphy;
s32 err = 0;
err = brcmf_fil_iovar_int_set(ifp, "fragthresh",
frag_threshold);
if (err)
bphy_err(wiphy, "Error (%d)\n", err);
return err;
} | 0 | [
"CWE-787"
] | linux | 1b5e2423164b3670e8bc9174e4762d297990deff | 36,729,906,246,704,970,000,000,000,000,000,000,000 | 13 | brcmfmac: assure SSID length from firmware is limited
The SSID length as received from firmware should not exceed
IEEE80211_MAX_SSID_LEN as that would result in heap overflow.
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by:... |
int usbip_recv(struct socket *sock, void *buf, int size)
{
int result;
struct msghdr msg;
struct kvec iov;
int total = 0;
/* for blocks of if (usbip_dbg_flag_xmit) */
char *bp = buf;
int osize = size;
usbip_dbg_xmit("enter\n");
if (!sock || !buf || !size) {
pr_err("invalid arg, sock %p buff %p size %d\n",... | 0 | [
"CWE-200",
"CWE-119"
] | linux | b348d7dddb6c4fbfc810b7a0626e8ec9e29f7cbb | 318,331,424,121,879,100,000,000,000,000,000,000,000 | 58 | USB: usbip: fix potential out-of-bounds write
Fix potential out-of-bounds write to urb->transfer_buffer
usbip handles network communication directly in the kernel. When receiving a
packet from its peer, usbip code parses headers according to protocol. As
part of this parsing urb->actual_length is filled. Since the inp... |
_copyLoadStmt(const LoadStmt *from)
{
LoadStmt *newnode = makeNode(LoadStmt);
COPY_STRING_FIELD(filename);
return newnode;
} | 0 | [
"CWE-362"
] | postgres | 5f173040e324f6c2eebb90d86cf1b0cdb5890f0a | 317,570,604,242,528,680,000,000,000,000,000,000,000 | 8 | Avoid repeated name lookups during table and index DDL.
If the name lookups come to different conclusions due to concurrent
activity, we might perform some parts of the DDL on a different table
than other parts. At least in the case of CREATE INDEX, this can be
used to cause the permissions checks to be performed aga... |
bool is_fullscreen() const {
return _is_fullscreen;
} | 0 | [
"CWE-770"
] | cimg | 619cb58dd90b4e03ac68286c70ed98acbefd1c90 | 63,204,077,396,328,640,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. |
TEST_F(QueryPlannerTest, IntersectDisableAndHash) {
bool oldEnableHashIntersection = internalQueryPlannerEnableHashIntersection.load();
// Turn index intersection on but disable hash-based intersection.
internalQueryPlannerEnableHashIntersection.store(false);
params.options = QueryPlannerParams::NO_TAB... | 0 | [] | mongo | ee97c0699fd55b498310996ee002328e533681a3 | 143,107,077,117,431,780,000,000,000,000,000,000,000 | 32 | SERVER-36993 Fix crash due to incorrect $or pushdown for indexed $expr. |
Field_bit::pack(uchar *to, const uchar *from, uint max_length)
{
DBUG_ASSERT(max_length > 0);
uint length;
if (bit_len > 0)
{
/*
We have the following:
ptr Points into a field in record R1
from Points to a field in a record R2
bit_ptr Points to the byte (in the null ... | 0 | [
"CWE-416",
"CWE-703"
] | server | 08c7ab404f69d9c4ca6ca7a9cf7eec74c804f917 | 78,087,327,722,216,320,000,000,000,000,000,000,000 | 32 | MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()
vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter... |
ObjectSetInUse(
OBJECT *object
)
{
object->attributes.occupied = SET;
} | 0 | [
"CWE-119"
] | libtpms | ea62fd9679f8c6fc5e79471b33cfbd8227bfed72 | 51,572,161,230,651,390,000,000,000,000,000,000,000 | 6 | tpm2: Initialize a whole OBJECT before using it
Initialize a whole OBJECT before using it. This is necessary since
an OBJECT may also be used as a HASH_OBJECT via the ANY_OBJECT
union and that HASH_OBJECT can leave bad size inidicators in TPM2B
buffer in the OBJECT. To get rid of this problem we reset the whole
OBJECT... |
isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
{
isdn_net_local *lp = netdev_priv(dev);
if (!skb)
return;
if (lp->p_encap == ISDN_NET_ENCAP_ETHER) {
const int pullsize = skb_network_offset(skb) - ETH_HLEN;
if (pullsize > 0) {
printk(KERN_DEBUG "isdn_net: Pull junk %d\n", pullsize);
skb_... | 0 | [
"CWE-119"
] | linux | 9f5af546e6acc30f075828cb58c7f09665033967 | 157,902,539,667,856,680,000,000,000,000,000,000,000 | 13 | isdn/i4l: fix buffer overflow
This fixes a potential buffer overflow in isdn_net.c caused by an
unbounded strcpy.
[ ISDN seems to be effectively unmaintained, and the I4L driver in
particular is long deprecated, but in case somebody uses this..
- Linus ]
Signed-off-by: Jiten Thakkar <jitenmt@gmail.com>
Signed-... |
const unsigned char * r_jwe_get_cypher_key(jwe_t * jwe, size_t * key_len) {
if (jwe != NULL) {
if (key_len != NULL) {
*key_len = jwe->key_len;
}
return jwe->key;
}
return NULL;
} | 0 | [
"CWE-787"
] | rhonabwy | b4c2923a1ba4fabf9b55a89244127e153a3e549b | 290,434,543,818,792,800,000,000,000,000,000,000,000 | 9 | Fix buffer overflow on r_jwe_aesgcm_key_unwrap |
BGD_DECLARE(void) gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels)
{
if (im->style)
{
gdFree (im->style);
}
if (overflow2(sizeof (int), noOfPixels)) {
return;
}
im->style = (int *) gdMalloc (sizeof (int) * noOfPixels);
memcpy (im->style, style, sizeof (int) * noOfPixels);
im... | 0 | [
"CWE-190"
] | libgd | cfee163a5e848fc3e3fb1d05a30d7557cdd36457 | 193,057,087,337,741,600,000,000,000,000,000,000,000 | 14 | - #18, Removed invalid gdFree call when overflow2 fails
- #17, Free im->pixels as well on error |
int cil_fill_classperms(struct cil_tree_node *parse_current, struct cil_classperms **cp)
{
int rc = SEPOL_ERR;
enum cil_syntax syntax[] = {
CIL_SYN_STRING,
CIL_SYN_LIST,
CIL_SYN_END
};
int syntax_len = sizeof(syntax)/sizeof(*syntax);
rc = __cil_verify_syntax(parse_current, syntax, syntax_len);
if (rc != SE... | 0 | [
"CWE-125"
] | selinux | 340f0eb7f3673e8aacaf0a96cbfcd4d12a405521 | 309,726,369,495,261,340,000,000,000,000,000,000,000 | 32 | libsepol/cil: Check for statements not allowed in optional blocks
While there are some checks for invalid statements in an optional
block when resolving the AST, there are no checks when building the
AST.
OSS-Fuzz found the following policy which caused a null dereference
in cil_tree_get_next_path().
(blockinherit ... |
int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key)
{
if (ctx->cipher->flags & EVP_CIPH_RAND_KEY)
return EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_RAND_KEY, 0, key);
if (RAND_priv_bytes(key, ctx->key_len) <= 0)
return 0;
return 1;
} | 0 | [
"CWE-190"
] | openssl | 6a51b9e1d0cf0bf8515f7201b68fb0a3482b3dc1 | 66,199,077,742,721,710,000,000,000,000,000,000,000 | 8 | Don't overflow the output length in EVP_CipherUpdate calls
CVE-2021-23840
Reviewed-by: Paul Dale <pauli@openssl.org> |
int dwc3_send_gadget_generic_command(struct dwc3 *dwc, unsigned cmd, u32 param)
{
u32 timeout = 500;
int status = 0;
int ret = 0;
u32 reg;
dwc3_writel(dwc->regs, DWC3_DGCMDPAR, param);
dwc3_writel(dwc->regs, DWC3_DGCMD, cmd | DWC3_DGCMD_CMDACT);
do {
reg = dwc3_readl(dwc->regs, DWC3_DGCMD);
if (!(reg &... | 0 | [
"CWE-703",
"CWE-667",
"CWE-189"
] | linux | c91815b596245fd7da349ecc43c8def670d2269e | 4,149,984,724,839,407,500,000,000,000,000,000,000 | 29 | usb: dwc3: gadget: never call ->complete() from ->ep_queue()
This is a requirement which has always existed but, somehow, wasn't
reflected in the documentation and problems weren't found until now
when Tuba Yavuz found a possible deadlock happening between dwc3 and
f_hid. She described the situation as follows:
spin_... |
static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */,
enum v4l2_tuner_type new_type,
unsigned int type,
v4l2_std_id std,
u16 int_freq)
{
struct xc2028_data *priv = fe->tuner_priv;
int rc = -EINVAL;
unsigned char buf[4];
u32 div, offset = 0;
tuner_dbg("%s... | 0 | [
"CWE-416",
"CWE-284"
] | linux | 8dfbcc4351a0b6d2f2d77f367552f48ffefafe18 | 241,265,337,581,939,100,000,000,000,000,000,000,000 | 148 | [media] xc2028: avoid use after free
If struct xc2028_config is passed without a firmware name,
the following trouble may happen:
[11009.907205] xc2028 5-0061: type set to XCeive xc2028/xc3028 tuner
[11009.907491] ==================================================================
[11009.907750] BUG: KASAN: use-after-... |
static int dccp_invert_tuple(struct nf_conntrack_tuple *inv,
const struct nf_conntrack_tuple *tuple)
{
inv->src.u.dccp.port = tuple->dst.u.dccp.port;
inv->dst.u.dccp.port = tuple->src.u.dccp.port;
return 1;
} | 0 | [] | linux | 2bc780499aa33311ec0f3e42624dfaa7be0ade5e | 232,029,549,503,909,100,000,000,000,000,000,000,000 | 7 | [NETFILTER]: nf_conntrack: add DCCP protocol support
Add DCCP conntrack helper. Thanks to Gerrit Renker <gerrit@erg.abdn.ac.uk>
for review and testing.
Signed-off-by: Patrick McHardy <kaber@trash.net> |
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const TfLiteTensor* input = GetInput(context, node, kInputTensor);
const TfLiteTensor* axis_tensor = GetInput(context, node, kAxisTensor);
int axis = GetTensorData<int32_t>(axis_tensor)[0];
const int rank = NumDimensions(input);
if (axis < 0) {
... | 1 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 243,822,998,324,086,060,000,000,000,000,000,000,000 | 58 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
static int decode_setattr(struct xdr_stream *xdr)
{
int status;
status = decode_op_hdr(xdr, OP_SETATTR);
if (status)
return status;
if (decode_bitmap4(xdr, NULL, 0) >= 0)
return 0;
return -EIO;
} | 0 | [
"CWE-787"
] | linux | b4487b93545214a9db8cbf32e86411677b0cca21 | 43,183,833,224,331,965,000,000,000,000,000,000,000 | 11 | 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... |
regnode(int op)
{
char_u *ret;
ret = regcode;
if (ret == JUST_CALC_SIZE)
regsize += 3;
else
{
*regcode++ = op;
*regcode++ = NUL; // Null "next" pointer.
*regcode++ = NUL;
}
return ret;
} | 0 | [
"CWE-823",
"CWE-703"
] | vim | 6456fae9ba8e72c74b2c0c499eaf09974604ff30 | 45,248,222,473,599,750,000,000,000,000,000,000,000 | 15 | patch 8.2.4440: crash with specific regexp pattern and string
Problem: Crash with specific regexp pattern and string.
Solution: Stop at the start of the string. |
static SLJIT_INLINE void do_reset_match(compiler_common *common, int length)
{
DEFINE_COMPILER;
struct sljit_label *loop;
int i;
SLJIT_ASSERT(length > 1);
/* OVECTOR(1) contains the "string begin - 1" constant. */
if (length > 2)
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(1));
if (length < 8)
{
for (i... | 0 | [
"CWE-125"
] | php-src | 8947fd9e9fdce87cd6c59817b1db58e789538fe9 | 300,456,665,502,020,360,000,000,000,000,000,000,000 | 47 | Fix #78338: Array cross-border reading in PCRE
We backport r1092 from pcre2. |
Perl_my_setenv(pTHX_ const char *nam, const char *val)
{
dVAR;
char *envstr;
const int nlen = strlen(nam);
int vlen;
if (!val) {
val = "";
}
vlen = strlen(val);
Newx(envstr, nlen+vlen+2, char);
my_setenv_format(envstr, nam, nlen, val, vlen);
(void)PerlEnv_putenv(envstr);
... | 1 | [
"CWE-119",
"CWE-703",
"CWE-787"
] | perl5 | 34716e2a6ee2af96078d62b065b7785c001194be | 206,632,993,931,676,100,000,000,000,000,000,000,000 | 16 | Perl_my_setenv(); handle integer wrap
RT #133204
Wean this function off int/I32 and onto UV/Size_t.
Also, replace all malloc-ish calls with a wrapper that does
overflow checks,
In particular, it was doing (nlen + vlen + 2) which could wrap when
the combined length of the environment variable name and value
exceeded ... |
size_t size() const { return headers_.size(); } | 0 | [] | envoy | 2c60632d41555ec8b3d9ef5246242be637a2db0f | 215,865,882,670,971,670,000,000,000,000,000,000,000 | 1 | http: header map security fixes for duplicate headers (#197)
Previously header matching did not match on all headers for
non-inline headers. This patch changes the default behavior to
always logically match on all headers. Multiple individual
headers will be logically concatenated with ',' similar to what
is done with... |
static int ipmr_mfc_seq_show(struct seq_file *seq, void *v)
{
int n;
if (v == SEQ_START_TOKEN) {
seq_puts(seq,
"Group "
"Origin "
"Iif Pkts Bytes Wrong Oifs\n");
} else {
const struct mfc6_cache *mfc = v;
const struct ipmr_mfc_iter *i... | 0 | [
"CWE-20"
] | linux | 99253eb750fda6a644d5188fb26c43bad8d5a745 | 44,820,478,032,255,250,000,000,000,000,000,000,000 | 41 | ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt
Commit 5e1859fbcc3c ("ipv4: ipmr: various fixes and cleanups") fixed
the issue for ipv4 ipmr:
ip_mroute_setsockopt() & ip_mroute_getsockopt() should not
access/set raw_sk(sk)->ipmr_table before making sure the socket
is a raw socket, and prot... |
void *assoc_array_find(const struct assoc_array *array,
const struct assoc_array_ops *ops,
const void *index_key)
{
struct assoc_array_walk_result result;
const struct assoc_array_node *node;
const struct assoc_array_ptr *ptr;
const void *leaf;
int slot;
if (assoc_array_walk(array, ops, index_k... | 0 | [
"CWE-399"
] | linux | 95389b08d93d5c06ec63ab49bd732b0069b7c35e | 213,121,376,501,071,450,000,000,000,000,000,000,000 | 36 | KEYS: Fix termination condition in assoc array garbage collection
This fixes CVE-2014-3631.
It is possible for an associative array to end up with a shortcut node at the
root of the tree if there are more than fan-out leaves in the tree, but they
all crowd into the same slot in the lowest level (ie. they all have the... |
static const char *get_super_prefix_or_empty(void)
{
const char *s = get_super_prefix();
if (!s)
s = "";
return s;
} | 0 | [] | git | a8dee3ca610f5a1d403634492136c887f83b59d2 | 303,195,227,464,501,950,000,000,000,000,000,000,000 | 7 | Disallow dubiously-nested submodule git directories
Currently it is technically possible to let a submodule's git
directory point right into the git dir of a sibling submodule.
Example: the git directories of two submodules with the names `hippo`
and `hippo/hooks` would be `.git/modules/hippo/` and
`.git/modules/hipp... |
static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_hash rhash;
struct shash_alg *salg = __crypto_shash_alg(alg);
strncpy(rhash.type, "shash", sizeof(rhash.type));
rhash.blocksize = alg->cra_blocksize;
rhash.digestsize = salg->digestsize;
if (nla_put(skb, CRYPTOCF... | 0 | [
"CWE-787"
] | linux | af3ff8045bbf3e32f1a448542e73abb4c8ceb6f1 | 107,919,263,414,163,690,000,000,000,000,000,000,000 | 18 | crypto: hmac - require that the underlying hash algorithm is unkeyed
Because the HMAC template didn't check that its underlying hash
algorithm is unkeyed, trying to use "hmac(hmac(sha3-512-generic))"
through AF_ALG or through KEYCTL_DH_COMPUTE resulted in the inner HMAC
being used without having been keyed, resulting ... |
static inline int crypto_drbg_reset_test(struct crypto_rng *drng,
struct drbg_string *pers,
struct drbg_test_data *test_data)
{
int ret;
struct drbg_gen genbuf;
genbuf.outbuf = NULL;
genbuf.outlen = 0;
genbuf.addtl = pers;
genbuf.test_data = test_data;
ret = crypto_rng_reset(drng, (u8 *)&genbuf, 0);
... | 1 | [
"CWE-476"
] | linux | 8fded5925d0a733c46f8d0b5edd1c9b315882b1d | 86,001,706,453,132,720,000,000,000,000,000,000,000 | 13 | crypto: drbg - Convert to new rng interface
This patch converts the DRBG implementation to the new low-level
rng interface.
This allows us to get rid of struct drbg_gen by using the new RNG
API instead.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Stephan Mueller <smueller@chronox.de> |
static void mld_process_v2(struct inet6_dev *idev, struct mld2_query *mld,
unsigned long *max_delay)
{
*max_delay = max(msecs_to_jiffies(mldv2_mrc(mld)), 1UL);
mld_update_qrv(idev, mld);
mld_update_qi(idev, mld);
mld_update_qri(idev, mld);
idev->mc_maxdelay = *max_delay;
return;
} | 0 | [
"CWE-703"
] | linux | 2d3916f3189172d5c69d33065c3c21119fe539fc | 171,954,710,169,195,720,000,000,000,000,000,000,000 | 13 | ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()
While investigating on why a synchronize_net() has been added recently
in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report()
might drop skbs in some cases.
Discussion about removing synchronize_net() from ipv6_mc_down()
will ha... |
passGetScriptToken ()
{
while (passLinepos < passLine.length)
{
passPrevLinepos = passLinepos;
switch (passLine.chars[passLinepos])
{
case '\"':
passLinepos++;
if (passGetString ())
return pass_string;
return pass_invalidToken;
case '@':
passLinepos++;
if (passGetDots ())
r... | 0 | [] | liblouis | dc97ef791a4fae9da11592c79f9f79e010596e0c | 50,171,801,213,390,920,000,000,000,000,000,000,000 | 176 | Merge branch 'table_resolver' |
init_generic_context_from_args (MonoGenericContext *context, MonoArray *type_args, MonoArray *method_args)
{
if (type_args)
context->class_inst = mono_metadata_get_generic_inst (mono_array_length (type_args),
mono_array_addr (type_args, MonoType*, 0));
else
context->class_inst = NULL;
if (method_ar... | 0 | [
"CWE-264"
] | mono | 035c8587c0d8d307e45f1b7171a0d337bb451f1e | 219,060,493,512,024,100,000,000,000,000,000,000,000 | 13 | Allow only primitive types/enums in RuntimeHelpers.InitializeArray (). |
static void __exit bnx2x_cleanup(void)
{
struct list_head *pos, *q;
pci_unregister_driver(&bnx2x_pci_driver);
destroy_workqueue(bnx2x_wq);
destroy_workqueue(bnx2x_iov_wq);
/* Free globally allocated resources */
list_for_each_safe(pos, q, &bnx2x_prev_list) {
struct bnx2x_prev_path_list *tmp =
list_entry(p... | 0 | [
"CWE-20"
] | linux | 8914a595110a6eca69a5e275b323f5d09e18f4f9 | 226,940,805,091,844,150,000,000,000,000,000,000,000 | 17 | bnx2x: disable GSO where gso_size is too big for hardware
If a bnx2x card is passed a GSO packet with a gso_size larger than
~9700 bytes, it will cause a firmware error that will bring the card
down:
bnx2x: [bnx2x_attn_int_deasserted3:4323(enP24p1s0f0)]MC assert!
bnx2x: [bnx2x_mc_assert:720(enP24p1s0f0)]XSTORM_ASSERT... |
static inline int compute_score2(struct sock *sk, struct net *net,
__be32 saddr, __be16 sport,
__be32 daddr, unsigned int hnum, int dif)
{
int score;
struct inet_sock *inet;
if (!net_eq(sock_net(sk), net) ||
ipv6_only_sock(sk))
return -1;
inet = inet_sk(sk);
if (inet->inet_rcv_saddr != daddr ||... | 0 | [
"CWE-358"
] | linux | 197c949e7798fbf28cfadc69d9ca0c2abbf93191 | 56,917,981,030,598,150,000,000,000,000,000,000,000 | 42 | udp: properly support MSG_PEEK with truncated buffers
Backport of this upstream commit into stable kernels :
89c22d8c3b27 ("net: Fix skb csum races when peeking")
exposed a bug in udp stack vs MSG_PEEK support, when user provides
a buffer smaller than skb payload.
In this case,
skb_copy_and_csum_datagram_iovec(skb, s... |
static ssize_t active_time_ms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct wakeup_source *ws = dev_get_drvdata(dev);
ktime_t active_time =
ws->active ? ktime_sub(ktime_get(), ws->last_time) : 0;
return sprintf(buf, "%lld\n", ktime_to_ms(active_time));
} | 1 | [
"CWE-787"
] | linux | aa838896d87af561a33ecefea1caa4c15a68bc47 | 96,531,752,012,520,800,000,000,000,000,000,000,000 | 9 | 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 inline struct hlist_head *mp_hash(struct dentry *dentry)
{
unsigned long tmp = ((unsigned long)dentry / L1_CACHE_BYTES);
tmp = tmp + (tmp >> mp_hash_shift);
return &mountpoint_hashtable[tmp & mp_hash_mask];
} | 0 | [
"CWE-269"
] | user-namespace | a6138db815df5ee542d848318e5dae681590fccd | 144,388,329,750,262,710,000,000,000,000,000,000,000 | 6 | mnt: Only change user settable mount flags in remount
Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
read-only bind mount read-only in a user namespace the
MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
to the remount a read-only mount read-write.
Correct this by replacing t... |
double Magick::Image::strokeDashOffset(void) const
{
return(constOptions()->strokeDashOffset());
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 39,290,370,861,330,760,000,000,000,000,000,000,000 | 4 | Added missing return to avoid use after free. |
static inline bool __l2cap_efs_supported(struct l2cap_conn *conn)
{
return ((conn->local_fixed_chan & L2CAP_FC_A2MP) &&
(conn->feat_mask & L2CAP_FEAT_EXT_FLOW));
} | 0 | [
"CWE-787"
] | linux | e860d2c904d1a9f38a24eb44c9f34b8f915a6ea3 | 215,007,533,609,205,070,000,000,000,000,000,000,000 | 5 | Bluetooth: Properly check L2CAP config option output buffer length
Validate the output buffer length for L2CAP config requests and responses
to avoid overflowing the stack buffer used for building the option blocks.
Cc: stable@vger.kernel.org
Signed-off-by: Ben Seri <ben@armis.com>
Signed-off-by: Marcel Holtmann <mar... |
int input_register_handler(struct input_handler *handler)
{
struct input_dev *dev;
int error;
error = mutex_lock_interruptible(&input_mutex);
if (error)
return error;
INIT_LIST_HEAD(&handler->h_list);
list_add_tail(&handler->node, &input_handler_list);
list_for_each_entry(dev, &input_dev_list, node)
inpu... | 0 | [
"CWE-703",
"CWE-787"
] | linux | cb222aed03d798fc074be55e59d9a112338ee784 | 107,897,113,445,627,690,000,000,000,000,000,000,000 | 21 | Input: add safety guards to input_set_keycode()
If we happen to have a garbage in input device's keycode table with values
too big we'll end up doing clear_bit() with offset way outside of our
bitmaps, damaging other objects within an input device or even outside of
it. Let's add sanity checks to the returned old keyc... |
TfLiteRegistration* Register_COS() {
static TfLiteRegistration r = {
/*init=*/nullptr, /*free=*/nullptr,
elementwise::GenericPrepare<elementwise::IsNumericSupportedType,
elementwise::kCosName>,
elementwise::CosEval};
return &r;
} | 0 | [
"CWE-125",
"CWE-787"
] | tensorflow | 1970c2158b1ffa416d159d03c3370b9a462aee35 | 52,895,304,882,901,730,000,000,000,000,000,000,000 | 8 | [tflite]: Insert `nullptr` checks when obtaining tensors.
As part of ongoing refactoring, `tflite::GetInput`, `tflite::GetOutput`, `tflite::GetTemporary` and `tflite::GetIntermediates` will return `nullptr` in some cases. Hence, we insert the `nullptr` checks on all usages.
We also insert `nullptr` checks on usages o... |
ConnStateData::sslCrtdHandleReply(const Helper::Reply &reply)
{
if (!isOpen()) {
debugs(33, 3, "Connection gone while waiting for ssl_crtd helper reply; helper reply:" << reply);
return;
}
if (reply.result == Helper::BrokenHelper) {
debugs(33, 5, "Certificate for " << tlsConnectHost... | 0 | [
"CWE-116"
] | squid | 7024fb734a59409889e53df2257b3fc817809fb4 | 294,839,303,677,985,340,000,000,000,000,000,000,000 | 42 | Handle more Range requests (#790)
Also removed some effectively unused code. |
int recover_xattr_data(struct inode *inode, struct page *page, block_t blkaddr)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
nid_t prev_xnid = F2FS_I(inode)->i_xattr_nid;
nid_t new_xnid = nid_of_node(page);
struct node_info ni;
struct page *xpage;
if (!prev_xnid)
goto recover_xnid;
/* 1: invalidate the pre... | 0 | [
"CWE-200",
"CWE-362"
] | linux | 30a61ddf8117c26ac5b295e1233eaa9629a94ca3 | 122,429,117,182,570,070,000,000,000,000,000,000,000 | 41 | f2fs: fix race condition in between free nid allocator/initializer
In below concurrent case, allocated nid can be loaded into free nid cache
and be allocated again.
Thread A Thread B
- f2fs_create
- f2fs_new_inode
- alloc_nid
- __insert_nid_to_list(ALLOC_NID_LIST)
- f2fs_balance_fs_bg
- build_free... |
void DeAllocateUntrustedBuffers(void **free_list, size_t count) {
if (!IsValidUntrustedAddress(free_list)) {
TrustedPrimitives::BestEffortAbort(
"free_list expected to be in untrusted memory.");
}
CHECK_OCALL(ocall_enc_untrusted_deallocate_free_list(
free_list, static_cast<uint64_t>(count)));
} | 0 | [
"CWE-200",
"CWE-668"
] | asylo | ecfcd0008b6f8f63c6fa3cc1b62fcd4a52f2c0ad | 202,847,268,029,246,050,000,000,000,000,000,000,000 | 8 | Store untrusted input to enclave variable
The untrusted input pointer should be stored to trusted variable before
checking to avoid unexpected modifications after checking.
PiperOrigin-RevId: 362553830
Change-Id: I743f9bd3487de60269e247d74f2188f2ffc06d01 |
void swapcache_free(swp_entry_t entry, struct page *page)
{
struct swap_info_struct *p;
unsigned char count;
p = swap_info_get(entry);
if (p) {
count = swap_entry_free(p, entry, SWAP_HAS_CACHE);
if (page)
mem_cgroup_uncharge_swapcache(page, entry, count != 0);
spin_unlock(&swap_lock);
}
} | 0 | [
"CWE-264"
] | linux-2.6 | 1a5a9906d4e8d1976b701f889d8f35d54b928f25 | 281,206,625,263,532,250,000,000,000,000,000,000,000 | 13 | mm: thp: fix pmd_bad() triggering in code paths holding mmap_sem read mode
In some cases it may happen that pmd_none_or_clear_bad() is called with
the mmap_sem hold in read mode. In those cases the huge page faults can
allocate hugepmds under pmd_none_or_clear_bad() and that can trigger a
false positive from pmd_bad(... |
operator TwineChar16() const {
return toTwine();
} | 0 | [
"CWE-416",
"CWE-703"
] | hermes | d86e185e485b6330216dee8e854455c694e3a36e | 306,826,610,480,580,930,000,000,000,000,000,000,000 | 3 | Fix a bug in transient object property assignment and getUTF16Ref
Summary:
The returned `UTF16Ref` from `StringView::getUTF16Ref` can be invalidated by
appending more contents to the same allocator.
This case was encountered in `transientObjectPutErrorMessage`, resulting in
using free'd memory.
Reviewed By: tmikov
D... |
Client::getMoreRequestBody(MemBuf &buf)
{
// default implementation does not encode request body content
Must(requestBodySource != NULL);
return requestBodySource->getMoreData(buf);
} | 0 | [
"CWE-20"
] | squid | 6c9c44d0e9cf7b72bb233360c5308aa063af3d69 | 173,950,959,847,365,220,000,000,000,000,000,000,000 | 6 | Handle more partial responses (#791) |
MagickExport char *GetExceptionMessage(const int error)
{
char
exception[MagickPathExtent];
*exception='\0';
#if defined(MAGICKCORE_HAVE_STRERROR_R)
#if !defined(MAGICKCORE_STRERROR_R_CHAR_P)
(void) strerror_r(error,exception,sizeof(exception));
#else
(void) CopyMagickString(exception,strerror_r(error,exce... | 0 | [
"CWE-120",
"CWE-787"
] | ImageMagick | e45e48b881038487d0bc94d92a16c1537616cc0a | 33,624,021,018,314,514,000,000,000,000,000,000,000 | 18 | Suspend exception processing if too many exceptions |
static void ext4_mb_use_group_pa(struct ext4_allocation_context *ac,
struct ext4_prealloc_space *pa)
{
unsigned int len = ac->ac_o_ex.fe_len;
ext4_get_group_no_and_offset(ac->ac_sb, pa->pa_pstart,
&ac->ac_b_ex.fe_group,
&ac->ac_b_ex.fe_start);
ac->ac_b_ex.fe_len = len;
ac->ac_status = AC_STATUS_FOUND... | 0 | [
"CWE-703"
] | linux | ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1 | 232,253,716,874,518,670,000,000,000,000,000,000,000 | 21 | ext4: check journal inode extents more carefully
Currently, system zones just track ranges of block, that are "important"
fs metadata (bitmaps, group descriptors, journal blocks, etc.). This
however complicates how extent tree (or indirect blocks) can be checked
for inodes that actually track such metadata - currently... |
static MagickRealType ApplyEvaluateOperator(RandomInfo *random_info,
const Quantum pixel,const MagickEvaluateOperator op,
const MagickRealType value)
{
MagickRealType
result;
ssize_t
i;
result=0.0;
switch (op)
{
case UndefinedEvaluateOperator:
break;
case AbsEvaluateOperator:
{... | 0 | [] | ImageMagick6 | 072d7b10dbe74d1cf4ec0d008990c1a28c076f9e | 324,476,054,418,512,240,000,000,000,000,000,000,000 | 213 | https://github.com/ImageMagick/ImageMagick/issues/3332 |
static double mp_set_Joff_v(_cimg_math_parser& mp) {
CImg<T> &img = mp.imgout;
const int
ox = (int)mp.mem[_cimg_mp_slot_x], oy = (int)mp.mem[_cimg_mp_slot_y],
oz = (int)mp.mem[_cimg_mp_slot_z], oc = (int)mp.mem[_cimg_mp_slot_c];
const longT
off = img.offset(o... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 135,917,037,464,443,960,000,000,000,000,000,000,000 | 16 | Fix other issues in 'CImg<T>::load_bmp()'. |
}
static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_DC)
{
*table = NULL;
*n = 0; | 0 | [] | php-src | bb057498f7457e8b2eba98332a3bad434de4cf12 | 172,039,001,644,496,560,000,000,000,000,000,000,000 | 6 | Fix #70277: new DateTimeZone($foo) is ignoring text after null byte
The DateTimeZone constructors are not binary safe. They're parsing the timezone
as string, but discard the length when calling timezone_initialize(). This
patch adds a tz_len parameter and a respective check to timezone_initialize(). |
int snd_timer_continue(struct snd_timer_instance *timeri)
{
/* timer can continue only after pause */
if (!(timeri->flags & SNDRV_TIMER_IFLG_PAUSED))
return -EINVAL;
if (timeri->flags & SNDRV_TIMER_IFLG_SLAVE)
return snd_timer_start_slave(timeri, false);
else
return snd_timer_start1(timeri, false, 0);
} | 0 | [
"CWE-200"
] | linux | d11662f4f798b50d8c8743f433842c3e40fe3378 | 211,028,964,264,170,560,000,000,000,000,000,000,000 | 11 | ALSA: timer: Fix race between read and ioctl
The read from ALSA timer device, the function snd_timer_user_tread(),
may access to an uninitialized struct snd_timer_user fields when the
read is concurrently performed while the ioctl like
snd_timer_user_tselect() is invoked. We have already fixed the races
among ioctls ... |
transformOfType(CreateStmtContext *cxt, TypeName *ofTypename)
{
HeapTuple tuple;
TupleDesc tupdesc;
int i;
Oid ofTypeId;
AssertArg(ofTypename);
tuple = typenameType(NULL, ofTypename, NULL);
check_of_type(tuple);
ofTypeId = ((Form_pg_type) GETSTRUCT(tuple))->oid;
ofTypename->typeOid = ofTypeId; /* cached ... | 0 | [
"CWE-94"
] | postgres | 7e92f78abe80e4b30e648a40073abb59057e21f8 | 204,312,868,038,882,800,000,000,000,000,000,000,000 | 43 | In extensions, don't replace objects not belonging to the extension.
Previously, if an extension script did CREATE OR REPLACE and there was
an existing object not belonging to the extension, it would overwrite
the object and adopt it into the extension. This is problematic, first
because the overwrite is probably uni... |
write_tag_11_packet(char *dest, size_t *remaining_bytes, char *contents,
size_t contents_length, size_t *packet_length)
{
size_t packet_size_length;
size_t max_packet_size;
int rc = 0;
(*packet_length) = 0;
/* This format is inspired by OpenPGP; see RFC 2440
* packet tag 11 */
max_packet_size = (1 ... | 0 | [
"CWE-119"
] | linux-2.6 | 6352a29305373ae6196491e6d4669f301e26492e | 51,875,343,202,100,720,000,000,000,000,000,000,000 | 49 | eCryptfs: Check Tag 11 literal data buffer size
Tag 11 packets are stored in the metadata section of an eCryptfs file to
store the key signature(s) used to encrypt the file encryption key.
After extracting the packet length field to determine the key signature
length, a check is not performed to see if the length woul... |
void setDeferredMultiBulkLength(client *c, void *node, long length) {
listNode *ln = (listNode*)node;
robj *len, *next;
/* Abort when *node is NULL (see addDeferredMultiBulkLength). */
if (node == NULL) return;
len = listNodeValue(ln);
len->ptr = sdscatprintf(sdsempty(),"*%ld\r\n",length);
... | 0 | [
"CWE-254"
] | redis | 874804da0c014a7d704b3d285aa500098a931f50 | 134,555,353,298,054,960,000,000,000,000,000,000,000 | 25 | Security: Cross Protocol Scripting protection.
This is an attempt at mitigating problems due to cross protocol
scripting, an attack targeting services using line oriented protocols
like Redis that can accept HTTP requests as valid protocol, by
discarding the invalid parts and accepting the payloads sent, for
example, ... |
static void kvm_init_debug(void)
{
struct kvm_stats_debugfs_item *p;
kvm_debugfs_dir = debugfs_create_dir("kvm", NULL);
kvm_debugfs_num_entries = 0;
for (p = debugfs_entries; p->name; ++p, kvm_debugfs_num_entries++) {
debugfs_create_file(p->name, 0644, kvm_debugfs_dir,
(void *)(long)p->offset,
s... | 0 | [
"CWE-416",
"CWE-362"
] | linux | cfa39381173d5f969daf43582c95ad679189cbc9 | 165,114,099,265,987,600,000,000,000,000,000,000,000 | 13 | kvm: fix kvm_ioctl_create_device() reference counting (CVE-2019-6974)
kvm_ioctl_create_device() does the following:
1. creates a device that holds a reference to the VM object (with a borrowed
reference, the VM's refcount has not been bumped yet)
2. initializes the device
3. transfers the reference to the device t... |
PHP_FUNCTION(ldap_parse_result)
{
zval *link, *result, *errcode, *matcheddn, *errmsg, *referrals;
ldap_linkdata *ld;
LDAPMessage *ldap_result;
char **lreferrals, **refp;
char *lmatcheddn, *lerrmsg;
int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz|zzz", &l... | 0 | [
"CWE-476"
] | php-src | 49782c54994ecca2ef2a061063bd5a7079c43527 | 59,583,297,249,445,980,000,000,000,000,000,000,000 | 62 | Fix bug #76248 - Malicious LDAP-Server Response causes Crash |
( nsis_bzstream* strm,
int verbosity,
int small )
{
DState* s;
if (!bz_config_ok()) return BZ_CONFIG_ERROR;
if (strm == NULL) return BZ_PARAM_ERROR;
if (small != 0 && small != 1) return BZ_PARAM_ERROR;
if (verbosity < 0 |... | 0 | [] | clamav-devel | fcd8091474d12592d509adcfd0bdd0b0dc8835f5 | 120,753,481,009,935,140,000,000,000,000,000,000,000 | 36 | bb#2230-2231 |
static uint8_t nvme_cq_full(NvmeCQueue *cq)
{
return (cq->tail + 1) % cq->size == cq->head;
} | 0 | [] | qemu | 736b01642d85be832385063f278fe7cd4ffb5221 | 140,569,322,026,640,260,000,000,000,000,000,000,000 | 4 | 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 int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MOVContext *mov = s->priv_data;
MOVStreamContext *sc;
AVIndexEntry *sample;
AVStream *st = NULL;
int ret;
mov->fc = s;
retry:
sample = mov_find_next_sample(s, &st);
if (!sample) {
mov->found_mdat = 0;
if (!m... | 0 | [
"CWE-119",
"CWE-787"
] | FFmpeg | 689e59b7ffed34eba6159dcc78e87133862e3746 | 273,725,250,249,454,120,000,000,000,000,000,000,000 | 85 | mov: reset dref_count on realloc to keep values consistent.
This fixes a potential crash.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> |
nfnl_cthelper_dump_policy(struct sk_buff *skb,
struct nf_conntrack_helper *helper)
{
int i;
struct nlattr *nest_parms1, *nest_parms2;
nest_parms1 = nla_nest_start(skb, NFCTH_POLICY | NLA_F_NESTED);
if (nest_parms1 == NULL)
goto nla_put_failure;
if (nla_put_be32(skb, NFCTH_POLICY_SET_NUM,
htonl(helper->e... | 0 | [
"CWE-862"
] | linux | 4b380c42f7d00a395feede754f0bc2292eebe6e5 | 148,604,689,476,533,230,000,000,000,000,000,000,000 | 40 | netfilter: nfnetlink_cthelper: Add missing permission checks
The capability check in nfnetlink_rcv() verifies that the caller
has CAP_NET_ADMIN in the namespace that "owns" the netlink socket.
However, nfnl_cthelper_list is shared by all net namespaces on the
system. An unprivileged user can create user and net names... |
static MagickBooleanType WriteMPCImage(const ImageInfo *image_info,Image *image,
ExceptionInfo *exception)
{
char
buffer[MagickPathExtent],
cache_filename[MagickPathExtent];
const char
*property,
*value;
MagickBooleanType
status;
MagickOffsetType
offset,
scene;
register ssize... | 0 | [
"CWE-772",
"CWE-401"
] | ImageMagick | 66e283e0a9c141b19fe6c4c39f4a41c0d3188ba8 | 84,443,787,635,267,640,000,000,000,000,000,000,000 | 414 | ... |
GF_Err stri_box_size(GF_Box *s)
{
GF_SubTrackInformationBox *ptr = (GF_SubTrackInformationBox *)s;
ptr->size += 8 + 4 * ptr->attribute_count;
return GF_OK;
} | 0 | [
"CWE-787"
] | gpac | 77510778516803b7f7402d7423c6d6bef50254c3 | 147,231,731,596,375,140,000,000,000,000,000,000,000 | 7 | fixed #2255 |
static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host_id)
{
int ret;
tl_hba->dev.bus = &tcm_loop_lld_bus;
tl_hba->dev.parent = tcm_loop_primary;
tl_hba->dev.release = &tcm_loop_release_adapter;
dev_set_name(&tl_hba->dev, "tcm_loop_adapter_%d", tcm_loop_host_id);
ret = device_register(... | 0 | [
"CWE-119",
"CWE-787"
] | linux | 12f09ccb4612734a53e47ed5302e0479c10a50f8 | 143,527,789,566,720,160,000,000,000,000,000,000,000 | 18 | loopback: off by one in tcm_loop_make_naa_tpg()
This is an off by one 'tgpt' check in tcm_loop_make_naa_tpg() that could result
in memory corruption.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> |
static int fts3PendingListAppend(
PendingList **pp, /* IN/OUT: PendingList structure */
sqlite3_int64 iDocid, /* Docid for entry to add */
sqlite3_int64 iCol, /* Column for entry to add */
sqlite3_int64 iPos, /* Position of term for entry to add */
int *pRc ... | 0 | [
"CWE-787"
] | sqlite | c72f2fb7feff582444b8ffdc6c900c69847ce8a9 | 272,794,806,241,731,780,000,000,000,000,000,000,000 | 51 | More improvements to shadow table corruption detection in FTS3.
FossilOrigin-Name: 51525f9c3235967bc00a090e84c70a6400698c897aa4742e817121c725b8c99d |
fr_archive_libarchive_class_init (FrArchiveLibarchiveClass *klass)
{
GObjectClass *gobject_class;
FrArchiveClass *archive_class;
fr_archive_libarchive_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (FrArchiveLibarchivePrivate));
gobject_class = G_OBJECT_CLASS (klass);
... | 0 | [
"CWE-22"
] | file-roller | b147281293a8307808475e102a14857055f81631 | 259,600,929,957,909,920,000,000,000,000,000,000,000 | 24 | libarchive: sanitize filenames before extracting |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.