func string | target int64 | cwe list | project string | commit_id string | hash float64 | size int64 | message string |
|---|---|---|---|---|---|---|---|
static ssize_t snd_pcm_write(struct file *file, const char __user *buf,
size_t count, loff_t * offset)
{
struct snd_pcm_file *pcm_file;
struct snd_pcm_substream *substream;
struct snd_pcm_runtime *runtime;
snd_pcm_sframes_t result;
pcm_file = file->private_data;
substream = pcm_file->substream;
if (PCM_... | 0 | [
"CWE-125"
] | linux | 92ee3c60ec9fe64404dc035e7c41277d74aa26cb | 264,647,908,378,742,440,000,000,000,000,000,000,000 | 24 | ALSA: pcm: Fix races among concurrent hw_params and hw_free calls
Currently we have neither proper check nor protection against the
concurrent calls of PCM hw_params and hw_free ioctls, which may result
in a UAF. Since the existing PCM stream lock can't be used for
protecting the whole ioctl operations, we need a new... |
int sysctl_max_threads(struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
struct ctl_table t;
int ret;
int threads = max_threads;
int min = 1;
int max = MAX_THREADS;
t = *table;
t.data = &threads;
t.extra1 = &min;
t.extra2 = &max;
ret = proc_dointvec_minmax(&t, write, b... | 0 | [
"CWE-665",
"CWE-362"
] | linux | b4e00444cab4c3f3fec876dc0cccc8cbb0d1a948 | 259,366,673,273,309,180,000,000,000,000,000,000,000 | 22 | fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
current->group_leader->exit_signal may change during copy_process() if
current->real_parent exits.
Move the assignment inside tasklist_lock to avoid the race.
Signed-off-by: Eddy Wu <eddy_wu@trendmicro.com>
Acked-by: Oleg Nesterov <oleg@redhat.... |
static void tg3_set_msglevel(struct net_device *dev, u32 value)
{
struct tg3 *tp = netdev_priv(dev);
tp->msg_enable = value;
} | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 181,852,636,253,976,170,000,000,000,000,000,000,000 | 5 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
static inline int sctp_sanity_check(void)
{
SCTP_ASSERT(sizeof(struct sctp_ulpevent) <=
sizeof(((struct sk_buff *)0)->cb),
"SCTP: ulpevent does not fit in skb!\n", return 0);
return 1;
} | 0 | [] | linux | 196d67593439b03088913227093e374235596e33 | 156,826,995,284,386,630,000,000,000,000,000,000,000 | 8 | 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.
... |
MagickExport Image *ShadowImage(const Image *image,const double alpha,
const double sigma,const ssize_t x_offset,const ssize_t y_offset,
ExceptionInfo *exception)
{
#define ShadowImageTag "Shadow/Image"
CacheView
*image_view;
ChannelType
channel_mask;
Image
*border_image,
*clone_image,
... | 0 | [
"CWE-369"
] | ImageMagick | 329dd528ab79531d884c0ba131e97d43f872ab5d | 194,135,505,331,637,750,000,000,000,000,000,000,000 | 111 | uses the PerceptibleReciprocal() to prevent the divide-by-zero from occurring (#3194)
Co-authored-by: Zhang Xiaohui <ruc_zhangxiaohui@163.com> |
void *ndp_msg_payload_opts(struct ndp_msg *msg)
{
return msg->opts_start;
} | 0 | [
"CWE-284"
] | libndp | a4892df306e0532487f1634ba6d4c6d4bb381c7f | 322,032,165,522,231,970,000,000,000,000,000,000,000 | 4 | libndp: validate the IPv6 hop limit
None of the NDP messages should ever come from a non-local network; as
stated in RFC4861's 6.1.1 (RS), 6.1.2 (RA), 7.1.1 (NS), 7.1.2 (NA),
and 8.1. (redirect):
- The IP Hop Limit field has a value of 255, i.e., the packet
could not possibly have been forwarded by a router.
T... |
smart_compare(sldns_buffer* pkt, uint8_t* dnow,
uint8_t* dprfirst, uint8_t* dprlast)
{
if(LABEL_IS_PTR(*dnow)) {
/* ptr points to a previous dname */
uint8_t* p;
if((size_t)PTR_OFFSET(dnow[0], dnow[1])
>= sldns_buffer_limit(pkt))
return -1;
p = sldns_buffer_at(pkt, PTR_OFFSET(dnow[0], dnow[1]));
if( ... | 0 | [
"CWE-400"
] | unbound | ba0f382eee814e56900a535778d13206b86b6d49 | 102,331,248,700,518,760,000,000,000,000,000,000,000 | 19 | - CVE-2020-12662 Unbound can be tricked into amplifying an incoming
query into a large number of queries directed to a target.
- CVE-2020-12663 Malformed answers from upstream name servers can be
used to make Unbound unresponsive. |
TEST_P(HeaderIntegrationTest, PathWithEscapedSlashesRejected) {
path_with_escaped_slashes_action_ = envoy::extensions::filters::network::http_connection_manager::
v3::HttpConnectionManager::REJECT_REQUEST;
initializeFilter(HeaderMode::Append, false);
registerTestServerPorts({"http"});
codec_client_ = make... | 0 | [
"CWE-22"
] | envoy | 5333b928d8bcffa26ab19bf018369a835f697585 | 119,479,383,383,926,560,000,000,000,000,000,000,000 | 21 | Implement handling of escaped slash characters in URL path
Fixes: CVE-2021-29492
Signed-off-by: Yan Avlasov <yavlasov@google.com> |
static OPJ_BOOL bmp_read_file_header(FILE* IN, OPJ_BITMAPFILEHEADER* header)
{
header->bfType = (OPJ_UINT16)getc(IN);
header->bfType |= (OPJ_UINT16)((OPJ_UINT32)getc(IN) << 8);
if (header->bfType != 19778) {
fprintf(stderr, "Error, not a BMP file!\n");
return OPJ_FALSE;
}
/* FILE ... | 0 | [
"CWE-119",
"CWE-787"
] | openjpeg | baf0c1ad4572daa89caa3b12985bdd93530f0dd7 | 235,580,347,237,720,700,000,000,000,000,000,000,000 | 29 | bmp_read_info_header(): reject bmp files with biBitCount == 0 (#983) |
void test_getgrnam_r_wrapper(void **state)
{
int ret;
struct group grp;
char *buf;
size_t buf_len;
ret = get_buffer(&buf_len, &buf);
assert_int_equal(ret, 0);
ret = getgrnam_r_wrapper(MAX_BUF, "non_exisiting_group", &grp, &buf, &buf_len);
assert_int_equal(ret, ENOENT);
ret = getgr... | 0 | [
"CWE-19"
] | freeipa | 50c8f0c80175c7812bb523ab2387b19a94245b59 | 151,048,287,435,262,150,000,000,000,000,000,000,000 | 42 | extdom: handle ERANGE return code for getXXYYY_r() calls
The getXXYYY_r() calls require a buffer to store the variable data of
the passwd and group structs. If the provided buffer is too small ERANGE
is returned and the caller can try with a larger buffer again.
Cmocka/cwrap based unit-tests for get*_r_wrapper() are ... |
static u32 bond_ip_hash(u32 hash, struct flow_keys *flow)
{
hash ^= (__force u32)flow_get_u32_dst(flow) ^
(__force u32)flow_get_u32_src(flow);
hash ^= (hash >> 16);
hash ^= (hash >> 8);
/* discard lowest hash bit to deal with the common even ports pattern */
return hash >> 1;
} | 0 | [
"CWE-476",
"CWE-703"
] | linux | 105cd17a866017b45f3c45901b394c711c97bf40 | 131,161,961,181,926,200,000,000,000,000,000,000,000 | 9 | bonding: fix null dereference in bond_ipsec_add_sa()
If bond doesn't have real device, bond->curr_active_slave is null.
But bond_ipsec_add_sa() dereferences bond->curr_active_slave without
null checking.
So, null-ptr-deref would occur.
Test commands:
ip link add bond0 type bond
ip link set bond0 up
ip x s... |
QByteArray PamData::getResponse(const struct pam_message* msg) {
QByteArray response = findPrompt(msg).response;
m_currentRequest.prompts.removeOne(findPrompt(msg));
if (m_currentRequest.prompts.length() == 0)
m_sent = false;
return response;
} | 0 | [
"CWE-613",
"CWE-287",
"CWE-284"
] | sddm | 147cec383892d143b5e02daa70f1e7def50f5d98 | 258,638,995,451,265,300,000,000,000,000,000,000,000 | 7 | Fix authentication when reusing an existing session
- Check the success value before unlocking the session
- Don't attempt to use the nonexistant "sddm-check" PAM service |
int xfrm_policy_flush(struct net *net, u8 type, bool task_valid)
{
int dir, err = 0, cnt = 0;
spin_lock_bh(&net->xfrm.xfrm_policy_lock);
err = xfrm_policy_flush_secctx_check(net, type, task_valid);
if (err)
goto out;
for (dir = 0; dir < XFRM_POLICY_MAX; dir++) {
struct xfrm_policy *pol;
int i;
again1:
... | 0 | [
"CWE-125"
] | ipsec | 7bab09631c2a303f87a7eb7e3d69e888673b9b7e | 159,857,629,977,275,330,000,000,000,000,000,000,000 | 57 | xfrm: policy: check policy direction value
The 'dir' parameter in xfrm_migrate() is a user-controlled byte which is used
as an array index. This can lead to an out-of-bound access, kernel lockup and
DoS. Add a check for the 'dir' value.
This fixes CVE-2017-11600.
References: https://bugzilla.redhat.com/show_bug.cgi?... |
static uint32_t toWire32(uint32_t x) {return htonl(x);} | 0 | [
"CWE-20"
] | thrift | cfaadcc4adcfde2a8232c62ec89870b73ef40df1 | 55,529,451,633,444,390,000,000,000,000,000,000,000 | 1 | THRIFT-3231 CPP: Limit recursion depth to 64
Client: cpp
Patch: Ben Craig <bencraig@apache.org> |
hb_ot_layout_create_for_data (const char *font_data,
int face_index)
{
hb_ot_layout_t *layout;
if (HB_UNLIKELY (font_data == NULL))
return hb_ot_layout_create ();
layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
const OpenTypeFontFile &font = OpenTypeFontFile::get_for_dat... | 0 | [] | pango | 336bb3201096bdd0494d29926dd44e8cca8bed26 | 118,502,337,291,592,580,000,000,000,000,000,000,000 | 19 | [HB] Remove all references to the old code! |
static Image *ReadINLINEImage(const ImageInfo *image_info,
ExceptionInfo *exception)
{
Image
*image;
MagickBooleanType
status;
register size_t
i;
size_t
quantum;
ssize_t
count;
unsigned char
*inline_image;
/*
Open image file.
*/
assert(image_info != (const ImageInfo... | 0 | [
"CWE-772",
"CWE-401"
] | ImageMagick | d5559407ce29f4371e5df9c1cbde65455fe5854c | 251,486,018,350,635,500,000,000,000,000,000,000,000 | 88 | https://github.com/ImageMagick/ImageMagick/issues/572 |
bool Curl_pipeline_wanted(const struct Curl_multi *multi, int bits)
{
return (multi && (multi->pipelining & bits)) ? TRUE : FALSE;
} | 0 | [
"CWE-416"
] | curl | 75dc096e01ef1e21b6c57690d99371dedb2c0b80 | 42,688,952,509,330,840,000,000,000,000,000,000,000 | 4 | curl_multi_cleanup: clear connection pointer for easy handles
CVE-2016-5421
Bug: https://curl.haxx.se/docs/adv_20160803C.html
Reported-by: Marcelo Echeverria and Fernando Muñoz |
onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
{
UChar *p = buf;
if ((code & 0xff000000) != 0) {
*p++ = (UChar )((code >> 24) & 0xff);
}
if ((code & 0xff0000) != 0 || p != buf) {
*p++ = (UChar )((code >> 16) & 0xff);
}
if ((code & 0xff00) != 0 || p != buf) {
*p++ = (U... | 0 | [
"CWE-125"
] | oniguruma | 65a9b1aa03c9bc2dc01b074295b9603232cb3b78 | 328,380,617,574,763,600,000,000,000,000,000,000,000 | 21 | onig-5.9.2 |
int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
{
return -EINVAL;
} | 0 | [
"CWE-399"
] | kvm | 5b40572ed5f0344b9dbee486a17c589ce1abe1a3 | 105,611,468,640,124,640,000,000,000,000,000,000,000 | 4 | KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu->arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.
Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
... |
static long dev_ioctl (struct file *fd, unsigned code, unsigned long value)
{
struct dev_data *dev = fd->private_data;
struct usb_gadget *gadget = dev->gadget;
long ret = -ENOTTY;
spin_lock_irq(&dev->lock);
if (dev->state == STATE_DEV_OPENED ||
dev->state == STATE_DEV_UNBOUND) {
/* Not bound to a UDC */
} ... | 0 | [
"CWE-763"
] | linux | 501e38a5531efbd77d5c73c0ba838a889bfc1d74 | 201,224,353,241,726,660,000,000,000,000,000,000,000 | 23 | usb: gadget: clear related members when goto fail
dev->config and dev->hs_config and dev->dev need to be cleaned if
dev_config fails to avoid UAF.
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20211231172138.7993-3-hbh25y@gmail.com
Signed... |
proto_tree_set_ax25(field_info *fi, const guint8* value)
{
fvalue_set_bytes(&fi->value, value);
} | 0 | [
"CWE-401"
] | wireshark | a9fc769d7bb4b491efb61c699d57c9f35269d871 | 298,806,015,559,233,270,000,000,000,000,000,000,000 | 4 | 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. |
filter_name (struct backend *b)
{
struct backend_filter *f = container_of (b, struct backend_filter, backend);
return f->name;
} | 0 | [
"CWE-406"
] | nbdkit | bf0d61883a2f02f4388ec10dc92d4c61c093679e | 187,327,065,665,435,500,000,000,000,000,000,000,000 | 6 | server: Fix regression for NBD_OPT_INFO before NBD_OPT_GO
Most known NBD clients do not bother with NBD_OPT_INFO (except for
clients like 'qemu-nbd --list' that don't ever intend to connect), but
go straight to NBD_OPT_GO. However, it's not too hard to hack up qemu
to add in an extra client step (whether info on the ... |
virtual void TearDown()
{
} | 0 | [
"CWE-284"
] | Fast-DDS | d2aeab37eb4fad4376b68ea4dfbbf285a2926384 | 136,735,329,814,175,700,000,000,000,000,000,000,000 | 3 | check remote permissions (#1387)
* Refs 5346. Blackbox test
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. one-way string compare
Signed-off-by: Iker Luengo <ikerluengo@eprosima.com>
* Refs 5346. Do not add partition separator on last partition
Signed-off-by: Iker Luengo <ikerluengo@e... |
print_dev_fd_list ()
{
register int i;
fprintf (stderr, "pid %ld: dev_fd_list:", (long)getpid ());
fflush (stderr);
for (i = 0; i < totfds; i++)
{
if (dev_fd_list[i])
fprintf (stderr, " %d", i);
}
fprintf (stderr, "\n");
} | 0 | [] | bash | 955543877583837c85470f7fb8a97b7aa8d45e6c | 14,864,946,506,727,860,000,000,000,000,000,000,000 | 14 | bash-4.4-rc2 release |
void Item_func_set_user_var::save_item_result(Item *item)
{
DBUG_ENTER("Item_func_set_user_var::save_item_result");
switch (args[0]->result_type()) {
case REAL_RESULT:
save_result.vreal= item->val_result();
break;
case INT_RESULT:
save_result.vint= item->val_int_result();
unsigned_flag= item->u... | 0 | [
"CWE-120"
] | server | eca207c46293bc72dd8d0d5622153fab4d3fccf1 | 304,990,792,932,893,100,000,000,000,000,000,000,000 | 25 | MDEV-25317 Assertion `scale <= precision' failed in decimal_bin_size And Assertion `scale >= 0 && precision > 0 && scale <= precision' failed in decimal_bin_size_inline/decimal_bin_size.
Precision should be kept below DECIMAL_MAX_SCALE for computations.
It can be bigger in Item_decimal. I'd fix this too but it changes... |
TEST(EqOp, MatchesMinKey) {
BSONObj operand = BSON("a" << MinKey);
EqualityMatchExpression eq;
eq.init("a", operand["a"]).transitional_ignore();
ASSERT(eq.matchesBSON(BSON("a" << MinKey), NULL));
ASSERT(!eq.matchesBSON(BSON("a" << MaxKey), NULL));
ASSERT(!eq.matchesBSON(BSON("a" << 4), NULL));
} | 0 | [] | mongo | b0ef26c639112b50648a02d969298650fbd402a4 | 123,520,277,374,103,570,000,000,000,000,000,000,000 | 8 | SERVER-51083 Reject invalid UTF-8 from $regex match expressions |
fiber_current(mrb_state *mrb, mrb_value self)
{
if (!mrb->c->fib) {
struct RFiber *f = MRB_OBJ_ALLOC(mrb, MRB_TT_FIBER, mrb_class_ptr(self));
f->cxt = mrb->c;
mrb->c->fib = f;
}
return mrb_obj_value(mrb->c->fib);
} | 0 | [
"CWE-476",
"CWE-703"
] | mruby | da48e7dbb20024c198493b8724adae1b842083aa | 24,336,355,315,918,830,000,000,000,000,000,000,000 | 10 | fiber.c: should pack 15+ arguments in an array. |
SYSCALL_DEFINE4(wait4, pid_t, upid, int __user *, stat_addr,
int, options, struct rusage __user *, ru)
{
struct wait_opts wo;
struct pid *pid = NULL;
enum pid_type type;
long ret;
if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
__WNOTHREAD|__WCLONE|__WALL))
return -EINVAL;
if (upid == -1)
type = PIDTYPE_... | 0 | [
"CWE-20",
"CWE-703",
"CWE-400"
] | linux | b69f2292063d2caf37ca9aec7d63ded203701bf3 | 55,795,843,412,074,420,000,000,000,000,000,000,000 | 38 | block: Fix io_context leak after failure of clone with CLONE_IO
With CLONE_IO, parent's io_context->nr_tasks is incremented, but never
decremented whenever copy_process() fails afterwards, which prevents
exit_io_context() from calling IO schedulers exit functions.
Give a task_struct to exit_io_context(), and call exi... |
bool operator==(const BooleanVal& other) const {
if (is_null && other.is_null) {
return true;
}
if (is_null || other.is_null) {
return false;
}
return val == other.val;
} | 0 | [
"CWE-200"
] | incubator-doris | 246ac4e37aa4da6836b7850cb990f02d1c3725a3 | 268,965,039,164,068,500,000,000,000,000,000,000,000 | 11 | [fix] fix a bug of encryption function with iv may return wrong result (#8277) |
mailimf_to_parse(const char * message, size_t length,
size_t * indx, struct mailimf_to ** result)
{
struct mailimf_address_list * addr_list;
struct mailimf_to * to;
size_t cur_token;
int r;
int res;
cur_token = * indx;
r = mailimf_token_case_insensitive_parse(message, length,
&cur_token, "To"... | 0 | [
"CWE-476"
] | libetpan | 1fe8fbc032ccda1db9af66d93016b49c16c1f22d | 125,540,581,399,713,620,000,000,000,000,000,000,000 | 52 | Fixed crash #274 |
xmlSchemaAugmentImportedIDC(xmlSchemaImportPtr imported, xmlSchemaValidCtxtPtr vctxt) {
if (imported->schema->idcDef != NULL) {
xmlHashScan(imported->schema->idcDef ,
(xmlHashScanner) xmlSchemaAugmentIDC, vctxt);
}
} | 0 | [
"CWE-134"
] | libxml2 | 4472c3a5a5b516aaf59b89be602fbce52756c3e9 | 246,046,685,219,721,400,000,000,000,000,000,000,000 | 6 | Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029
Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports. |
wrap_nettle_hash_output(void *src_ctx, void *digest, size_t digestsize)
{
struct nettle_hash_ctx *ctx;
ctx = src_ctx;
if (digestsize < ctx->length) {
gnutls_assert();
return GNUTLS_E_SHORT_MEMORY_BUFFER;
}
ctx->digest(ctx->ctx_ptr, digestsize, digest);
return 0;
} | 0 | [
"CWE-476"
] | gnutls | 3db352734472d851318944db13be73da61300568 | 105,931,493,415,944,680,000,000,000,000,000,000,000 | 14 | wrap_nettle_hash_fast: avoid calling _update with zero-length input
As Nettle's hash update functions internally call memcpy, providing
zero-length input may cause undefined behavior.
Signed-off-by: Daiki Ueno <ueno@gnu.org> |
static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct ip_tunnel_parm *parm = &tunnel->parms;
if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
nla_put_in_addr(skb, IFLA_IPTUN_LOCAL, parm->iph.saddr) ||
nla_put_in_addr(skb, IF... | 0 | [
"CWE-703",
"CWE-772",
"CWE-401"
] | linux | 07f12b26e21ab359261bf75cfcb424fdc7daeb6d | 264,826,628,707,479,020,000,000,000,000,000,000,000 | 44 | net: sit: fix memory leak in sit_init_net()
If register_netdev() is failed to register sitn->fb_tunnel_dev,
it will go to err_reg_dev and forget to free netdev(sitn->fb_tunnel_dev).
BUG: memory leak
unreferenced object 0xffff888378daad00 (size 512):
comm "syz-executor.1", pid 4006, jiffies 4295121142 (age 16.115s)
... |
find_tabpage(int n)
{
tabpage_T *tp;
int i = 1;
if (n == 0)
return curtab;
for (tp = first_tabpage; tp != NULL && i != n; tp = tp->tp_next)
++i;
return tp;
} | 0 | [
"CWE-416"
] | vim | ec66c41d84e574baf8009dbc0bd088d2bc5b2421 | 244,993,437,719,170,360,000,000,000,000,000,000,000 | 12 | patch 8.1.2136: using freed memory with autocmd from fuzzer
Problem: using freed memory with autocmd from fuzzer. (Dhiraj Mishra,
Dominique Pelle)
Solution: Avoid using "wp" after autocommands. (closes #5041) |
static int btrfs_check_raid_min_devices(struct btrfs_fs_info *fs_info,
u64 num_devices)
{
u64 all_avail;
unsigned seq;
int i;
do {
seq = read_seqbegin(&fs_info->profiles_lock);
all_avail = fs_info->avail_data_alloc_bits |
fs_info->avail_system_alloc_bits |
fs_info->avail_metadata_alloc_bits;
... | 0 | [
"CWE-476",
"CWE-284"
] | linux | 09ba3bc9dd150457c506e4661380a6183af651c1 | 214,758,703,222,070,200,000,000,000,000,000,000,000 | 29 | 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 inline void ehci_update_irq(EHCIState *s)
{
int level = 0;
if ((s->usbsts & USBINTR_MASK) & s->usbintr) {
level = 1;
}
trace_usb_ehci_irq(level, s->frindex, s->usbsts, s->usbintr);
qemu_set_irq(s->irq, level);
} | 0 | [] | qemu | 791f97758e223de3290592d169f8e6339c281714 | 214,813,022,897,138,060,000,000,000,000,000,000,000 | 11 | usb: ehci: fix memory leak in ehci_init_transfer
In ehci_init_transfer function, if the 'cpage' is bigger than 4,
it doesn't free the 'p->sgl' once allocated previously thus leading
a memory leak issue. This patch avoid this.
Signed-off-by: Li Qiang <liqiang6-s@360.cn>
Message-id: 5821c0f4.091c6b0a.e0c92.e811@mx.goog... |
static void ml_ff_destroy(struct ff_device *ff)
{
struct ml_device *ml = ff->private;
kfree(ml->private);
} | 1 | [
"CWE-416"
] | linux | fa3a5a1880c91bb92594ad42dfe9eedad7996b86 | 81,672,553,456,855,890,000,000,000,000,000,000,000 | 6 | Input: ff-memless - kill timer in destroy()
No timer must be left running when the device goes away.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-and-tested-by: syzbot+b6c55daa701fc389e286@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1573726121.17351.3.camel@suse.co... |
static void record_and_restart(struct perf_event *event, unsigned long val,
struct pt_regs *regs)
{
u64 period = event->hw.sample_period;
s64 prev, delta, left;
int record = 0;
if (event->hw.state & PERF_HES_STOPPED) {
write_pmc(event->hw.idx, 0);
return;
}
/* we don't have to worry about interrup... | 0 | [
"CWE-476"
] | linux | 60b7ed54a41b550d50caf7f2418db4a7e75b5bdc | 260,607,011,012,048,420,000,000,000,000,000,000,000 | 97 | powerpc/perf: Fix crash in perf_instruction_pointer() when ppmu is not set
On systems without any specific PMU driver support registered, running
perf record causes Oops.
The relevant portion from call trace:
BUG: Kernel NULL pointer dereference on read at 0x00000040
Faulting instruction address: 0xc0021f0c
Oo... |
mail_compose_send (compose_env_t *env, int save_to)
{
int done = 0;
int rc;
char *savefile = NULL;
int int_cnt;
char *escape;
/* Prepare environment */
rc = mu_temp_stream_create (&env->compstr, 0);
if (rc)
{
mu_error (_("Cannot open temporary file: %s"), mu_strerror (rc));
return 1;
... | 0 | [] | mailutils | 4befcfd015256c568121653038accbd84820198f | 62,453,656,725,413,040,000,000,000,000,000,000,000 | 228 | mail: disable compose escapes in non-interctive mode.
* NEWS: Document changes.
* doc/texinfo/programs/mail.texi: Document changes.
* mail/send.c (mail_compose_send): Recognize escapes only in
interactive mode. |
wireless_get_icon (NMDevice *device,
NMDeviceState state,
NMConnection *connection,
char **tip,
NMApplet *applet)
{
NMSettingConnection *s_con;
NMAccessPoint *ap;
GdkPixbuf *pixbuf = NULL;
const char *id;
char *ssid = NULL;
ap = g_object... | 0 | [
"CWE-310"
] | network-manager-applet | 4020594dfbf566f1852f0acb36ad631a9e73a82b | 39,969,519,152,263,720,000,000,000,000,000,000,000 | 75 | core: fix CA cert mishandling after cert file deletion (deb #560067) (rh #546793)
If a connection was created with a CA certificate, but the user later
moved or deleted that CA certificate, the applet would simply provide the
connection to NetworkManager without any CA certificate. This could cause
NM to connect to t... |
DEFUN (no_vpnv4_network,
no_vpnv4_network_cmd,
"no network A.B.C.D/M rd ASN:nn_or_IP-address:nn tag WORD",
NO_STR
"Specify a network to announce via BGP\n"
"IP prefix <network>/<length>, e.g., 35.0.0.0/8\n"
"Specify Route Distinguisher\n"
"VPN Route Distinguisher\n"
... | 0 | [
"CWE-119"
] | quagga | a3bc7e9400b214a0f078fdb19596ba54214a1442 | 242,747,017,705,931,600,000,000,000,000,000,000,000 | 13 | bgpd: Fix VU#270232, VPNv4 NLRI parser memcpys to stack on unchecked length
Address CERT vulnerability report VU#270232, memcpy to stack data structure
based on length field from packet data whose length field upper-bound was
not properly checked.
This likely allows BGP peers that are enabled to send Labeled-VPN SAFI... |
gdm_user_get_sessions (GdmUser *user)
{
return user->sessions;
} | 0 | [] | gdm | c25ef9245be4e0be2126ef3d075df4401949b570 | 317,001,392,703,699,300,000,000,000,000,000,000,000 | 4 | Store the face and dmrc files in a cache. Refer to bug #565151. |
TRIO_PUBLIC int trio_dscanfv TRIO_ARGS3((fd, format, args), int fd, TRIO_CONST char* format,
trio_pointer_t* args)
{
static va_list unused;
assert(VALID(format));
return TrioScan((trio_pointer_t)&fd, 0, TrioInStreamFileDescriptor, NULL, format, unused,
TrioA... | 0 | [
"CWE-190",
"CWE-125"
] | FreeRDP | 05cd9ea2290d23931f615c1b004d4b2e69074e27 | 103,885,465,443,894,940,000,000,000,000,000,000,000 | 10 | Fixed TrioParse and trio_length limts.
CVE-2020-4030 thanks to @antonio-morales for finding this. |
static int thumb_assemble(ArmOpcode *ao, ut64 off, const char *str) {
ut64 m;
ao->o = UT32_MAX;
if (!strcmpnull (ao->op, "udf")) {
ao->o = 0xde;
ao->o |= getnum (ao->a[0]) << 8;
return 2;
} else
if ((m = opmask (ao->op, "add", S_BIT | W_BIT))) {
ut64 argt = thumb_selector (ao->a);
switch (argt) {
case ... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | e5c14c167b0dcf0a53d76bd50bacbbcc0dfc1ae7 | 250,468,822,101,017,500,000,000,000,000,000,000,000 | 4,762 | Fix #12417/#12418 (arm assembler heap overflows) |
int tipc_sock_accept_local(struct socket *sock, struct socket **newsock,
int flags)
{
struct sock *sk = sock->sk;
int ret;
ret = sock_create_lite(sk->sk_family, sk->sk_type,
sk->sk_protocol, newsock);
if (ret < 0)
return ret;
ret = accept(sock, *newsock, flags);
if (ret < 0) {
sock_release(*... | 0 | [
"CWE-20",
"CWE-269"
] | linux | f3d3342602f8bcbf37d7c46641cb9bca7618eb1c | 312,827,878,203,854,630,000,000,000,000,000,000,000 | 19 | 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... |
static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
struct mm_walk *walk)
{
struct vm_area_struct *vma = walk->vma;
pte_t *pte;
spinlock_t *ptl;
if (pmd_trans_huge_lock(pmd, vma, &ptl) == 1) {
smaps_pmd_entry(pmd, addr, walk);
spin_unlock(ptl);
return 0;
}
if (pmd_trans_uns... | 0 | [
"CWE-200"
] | linux | ab676b7d6fbf4b294bf198fb27ade5b0e865c7ce | 240,329,768,102,616,270,000,000,000,000,000,000,000 | 27 | pagemap: do not leak physical addresses to non-privileged userspace
As pointed by recent post[1] on exploiting DRAM physical imperfection,
/proc/PID/pagemap exposes sensitive information which can be used to do
attacks.
This disallows anybody without CAP_SYS_ADMIN to read the pagemap.
[1] http://googleprojectzero.bl... |
int userfaultfd_unmap_prep(struct vm_area_struct *vma,
unsigned long start, unsigned long end,
struct list_head *unmaps)
{
for ( ; vma && vma->vm_start < end; vma = vma->vm_next) {
struct userfaultfd_unmap_ctx *unmap_ctx;
struct userfaultfd_ctx *ctx = vma->vm_userfaultfd_ctx.ctx;
if (!ctx || !(ctx->... | 0 | [
"CWE-416"
] | linux | 384632e67e0829deb8015ee6ad916b180049d252 | 66,741,490,788,406,070,000,000,000,000,000,000,000 | 25 | userfaultfd: non-cooperative: fix fork use after free
When reading the event from the uffd, we put it on a temporary
fork_event list to detect if we can still access it after releasing and
retaking the event_wqh.lock.
If fork aborts and removes the event from the fork_event all is fine as
long as we're still in the u... |
// [internal] Perform 3d rotation with arbitrary axis and angle.
void _rotate(CImg<T>& res, const CImg<Tfloat>& R,
const unsigned int interpolation, const unsigned int boundary_conditions,
const float w2, const float h2, const float d2,
const float rw2, const f... | 0 | [
"CWE-125"
] | CImg | 10af1e8c1ad2a58a0a3342a856bae63e8f257abb | 320,140,224,858,443,400,000,000,000,000,000,000,000 | 163 | Fix other issues in 'CImg<T>::load_bmp()'. |
load_vector_vector(BitStream& bit_stream,
int nitems1, std::vector<T>& vec1, int T::*nitems2,
int bits_wanted, std::vector<int> T::*vec2)
{
// nitems1 times, read nitems2 (from the ith element of vec1) items
// into the vec2 vector field of the ith item of vec1.
for (size_t i1 = 0; i1 < QIntC::to_... | 0 | [
"CWE-787"
] | qpdf | d71f05ca07eb5c7cfa4d6d23e5c1f2a800f52e8e | 323,339,369,862,451,260,000,000,000,000,000,000,000 | 16 | 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 ... |
TEST(ArrayOpsTest, ExtractImagePatchesShapeTest) {
ShapeInferenceTestOp op("ExtractImagePatches");
auto set_op = [&op](const std::vector<int32>& ksizes,
const std::vector<int32>& strides,
const std::vector<int32>& rates, const string& padding) {
TF_ASSERT_OK(NodeDefBu... | 0 | [
"CWE-125"
] | tensorflow | 7cf73a2274732c9d82af51c2bc2cf90d13cd7e6d | 326,132,618,152,483,870,000,000,000,000,000,000,000 | 35 | Address QuantizeAndDequantizeV* heap oob. Added additional checks for the 'axis' attribute.
PiperOrigin-RevId: 402446942
Change-Id: Id2f6b82e4e740d0550329be02621c46466b5a5b9 |
static int compat_do_replace(struct net *net, sockptr_t arg, unsigned int len)
{
int ret;
struct compat_arpt_replace tmp;
struct xt_table_info *newinfo;
void *loc_cpu_entry;
struct arpt_entry *iter;
if (copy_from_sockptr(&tmp, arg, sizeof(tmp)) != 0)
return -EFAULT;
/* overflow check */
if (tmp.num_counters... | 0 | [
"CWE-787"
] | linux | b29c457a6511435960115c0f548c4360d5f4801d | 321,777,743,782,048,040,000,000,000,000,000,000,000 | 47 | netfilter: x_tables: fix compat match/target pad out-of-bound write
xt_compat_match/target_from_user doesn't check that zeroing the area
to start of next rule won't write past end of allocated ruleset blob.
Remove this code and zero the entire blob beforehand.
Reported-by: syzbot+cfc0247ac173f597aaaa@syzkaller.appsp... |
static char** Sys_ConcatenateFileLists( char **list0, char **list1 )
{
int totalLength = 0;
char** cat = NULL, **dst, **src;
totalLength += Sys_CountFileList(list0);
totalLength += Sys_CountFileList(list1);
/* Create new list. */
dst = cat = Z_Malloc( ( totalLength + 1 ) * sizeof( char* ) );
/* Copy over list... | 0 | [
"CWE-269"
] | ioq3 | 376267d534476a875d8b9228149c4ee18b74a4fd | 67,781,836,078,008,160,000,000,000,000,000,000,000 | 33 | Don't load .pk3s as .dlls, and don't load user config files from .pk3s. |
func_requires_g_prefix(ufunc_T *ufunc)
{
return ufunc->uf_name[0] != K_SPECIAL
&& (ufunc->uf_flags & FC_LAMBDA) == 0
&& vim_strchr(ufunc->uf_name, AUTOLOAD_CHAR) == NULL;
} | 0 | [
"CWE-416"
] | vim | 91c7cbfe31bbef57d5fcf7d76989fc159f73ef15 | 182,287,977,096,935,830,000,000,000,000,000,000,000 | 6 | patch 9.0.0225: using freed memory with multiple line breaks in expression
Problem: Using freed memory with multiple line breaks in expression.
Solution: Free eval_tofree later. |
static int proc_pid_syscall(struct task_struct *task, char *buffer)
{
long nr;
unsigned long args[6], sp, pc;
if (task_current_syscall(task, &nr, args, 6, &sp, &pc))
return sprintf(buffer, "running\n");
if (nr < 0)
return sprintf(buffer, "%ld 0x%lx 0x%lx\n", nr, sp, pc);
return sprintf(buffer,
"%ld... | 0 | [
"CWE-20",
"CWE-362",
"CWE-416"
] | linux | 86acdca1b63e6890540fa19495cfc708beff3d8b | 265,325,061,580,932,600,000,000,000,000,000,000,000 | 17 | fix autofs/afs/etc. magic mountpoint breakage
We end up trying to kfree() nd.last.name on open("/mnt/tmp", O_CREAT)
if /mnt/tmp is an autofs direct mount. The reason is that nd.last_type
is bogus here; we want LAST_BIND for everything of that kind and we
get LAST_NORM left over from finding parent directory.
So make... |
static AESInfo *AcquireAESInfo(void)
{
AESInfo
*aes_info;
aes_info=(AESInfo *) AcquireCriticalMemory(sizeof(*aes_info));
(void) memset(aes_info,0,sizeof(*aes_info));
aes_info->blocksize=AESBlocksize;
aes_info->key=AcquireStringInfo(32);
aes_info->encipher_key=(unsigned int *) AcquireQuantumMemory(60UL,... | 0 | [
"CWE-369"
] | ImageMagick | 70aa86f5d5d8aa605a918ed51f7574f433a18482 | 60,078,510,724,102,030,000,000,000,000,000,000,000 | 21 | possible divide by zero + clear buffers |
static void parseCodeDirectory(RBuffer *b, int offset, int datasize) {
typedef struct __CodeDirectory {
uint32_t magic; /* magic number (CSMAGIC_CODEDIRECTORY) */
uint32_t length; /* total length of CodeDirectory blob */
uint32_t version; /* compatibility version */
uint32_t flags; /* setup and mode flags */... | 0 | [
"CWE-125",
"CWE-787"
] | radare2 | 0052500c1ed5bf8263b26b9fd7773dbdc6f170c4 | 162,482,702,274,276,000,000,000,000,000,000,000,000 | 142 | Fix heap OOB read in macho.iterate_chained_fixups ##crash
* Reported by peacock-doris via huntr.dev
* Reproducer 'tests_65305'
mrmacete:
* Return early if segs_count is 0
* Initialize segs_count also for reconstructed fixups
Co-authored-by: pancake <pancake@nopcode.org>
Co-authored-by: Francesco Tamagni <mrm... |
static bool io_queue_file_removal(struct fixed_file_data *data,
struct file *file)
{
struct io_file_put *pfile, pfile_stack;
DECLARE_COMPLETION_ONSTACK(done);
/*
* If we fail allocating the struct we need for doing async reomval
* of this file, just punt to sync and wait for it.
*/
pfile = kzalloc(size... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 23,226,954,215,158,827,000,000,000,000,000,000,000 | 32 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
destination_from_socket(entry_connection_t *conn, socks_request_t *req)
{
struct sockaddr_storage orig_dst;
socklen_t orig_dst_len = sizeof(orig_dst);
tor_addr_t addr;
#ifdef TRANS_TPROXY
if (get_options()->TransProxyType_parsed == TPT_TPROXY) {
if (getsockname(ENTRY_TO_CONN(conn)->s, (struct sockaddr*)&or... | 0 | [
"CWE-532"
] | tor | 80c404c4b79f3bcba3fc4585d4c62a62a04f3ed9 | 193,058,594,912,032,650,000,000,000,000,000,000,000 | 66 | Log warning when connecting to soon-to-be-deprecated v2 onions. |
int rdma_connect_ece(struct rdma_cm_id *id, struct rdma_conn_param *conn_param,
struct rdma_ucm_ece *ece)
{
struct rdma_id_private *id_priv =
container_of(id, struct rdma_id_private, id);
id_priv->ece.vendor_id = ece->vendor_id;
id_priv->ece.attr_mod = ece->attr_mod;
return rdma_connect(id, conn_param);
... | 0 | [
"CWE-416"
] | linux | bc0bdc5afaa740d782fbf936aaeebd65e5c2921d | 112,906,755,202,186,370,000,000,000,000,000,000,000 | 11 | RDMA/cma: Do not change route.addr.src_addr.ss_family
If the state is not idle then rdma_bind_addr() will immediately fail and
no change to global state should happen.
For instance if the state is already RDMA_CM_LISTEN then this will corrupt
the src_addr and would cause the test in cma_cancel_operation():
if (cma... |
static int do_setvfinfo(struct net_device *dev, struct nlattr *attr)
{
int rem, err = -EINVAL;
struct nlattr *vf;
const struct net_device_ops *ops = dev->netdev_ops;
nla_for_each_nested(vf, attr, rem) {
switch (nla_type(vf)) {
case IFLA_VF_MAC: {
struct ifla_vf_mac *ivm;
ivm = nla_data(vf);
err = -EOP... | 0 | [
"CWE-264"
] | net | 90f62cf30a78721641e08737bda787552428061e | 74,520,757,924,796,110,000,000,000,000,000,000,000 | 63 | 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.
... |
int follow_down(struct path *path)
{
unsigned managed;
int ret;
while (managed = ACCESS_ONCE(path->dentry->d_flags),
unlikely(managed & DCACHE_MANAGED_DENTRY)) {
/* Allow the filesystem to manage the transit without i_mutex
* being held.
*
* We indicate to the filesystem if someone is trying to m... | 0 | [
"CWE-362",
"CWE-399"
] | linux | 49d31c2f389acfe83417083e1208422b4091cd9e | 36,743,625,803,851,773,000,000,000,000,000,000,000 | 42 | dentry name snapshots
take_dentry_name_snapshot() takes a safe snapshot of dentry name;
if the name is a short one, it gets copied into caller-supplied
structure, otherwise an extra reference to external name is grabbed
(those are never modified). In either case the pointer to stable
string is stored into the same st... |
zone_viewname_tostr(dns_zone_t *zone, char *buf, size_t length) {
isc_buffer_t buffer;
REQUIRE(buf != NULL);
REQUIRE(length > 1U);
/*
* Leave space for terminating '\0'.
*/
isc_buffer_init(&buffer, buf, (unsigned int)length - 1);
if (zone->view == NULL) {
isc_buffer_putstr(&buffer, "_none");
} else if ... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 120,048,206,576,511,460,000,000,000,000,000,000,000 | 23 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
static bool encode_dirsync_request(void *mem_ctx, void *in, DATA_BLOB *out)
{
struct ldb_dirsync_control *ldc = talloc_get_type(in, struct ldb_dirsync_control);
struct asn1_data *data = asn1_init(mem_ctx);
if (!data) return false;
if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) {
return false;
}
if (!asn1_write_... | 0 | [
"CWE-399"
] | samba | 530d50a1abdcdf4d1775652d4c456c1274d83d8d | 97,786,726,955,984,610,000,000,000,000,000,000,000 | 35 | CVE-2015-7540: s4: libcli: ldap message - Ensure all asn1_XX returns are checked.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9187
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): F... |
submit_page_section(struct dio *dio, struct page *page,
unsigned offset, unsigned len, sector_t blocknr)
{
int ret = 0;
if (dio->rw & WRITE) {
/*
* Read accounting is performed in submit_bio()
*/
task_io_account_write(len);
}
/*
* Can we just grow the current page's presence in the dio?
*/
if ( (... | 0 | [] | linux-2.6 | 848c4dd5153c7a0de55470ce99a8e13a63b4703f | 165,367,591,373,219,940,000,000,000,000,000,000,000 | 52 | dio: zero struct dio with kzalloc instead of manually
This patch uses kzalloc to zero all of struct dio rather than manually
trying to track which fields we rely on being zero. It passed aio+dio
stress testing and some bug regression testing on ext3.
This patch was introduced by Linus in the conversation that lead u... |
static void mt_set_modes(struct hid_device *hdev, enum latency_mode latency,
bool surface_switch, bool button_switch)
{
struct hid_report_enum *rep_enum;
struct hid_report *rep;
struct hid_usage *usage;
int i, j;
bool update_report;
bool inputmode_found = false;
rep_enum = &hdev->report_enum[HID_FEATURE_REP... | 0 | [
"CWE-787"
] | linux | 35556bed836f8dc07ac55f69c8d17dce3e7f0e25 | 273,086,913,591,019,200,000,000,000,000,000,000,000 | 37 | HID: core: Sanitize event code and type when mapping input
When calling into hid_map_usage(), the passed event code is
blindly stored as is, even if it doesn't fit in the associated bitmap.
This event code can come from a variety of sources, including devices
masquerading as input devices, only a bit more "programmab... |
flatpak_dir_maybe_ensure_repo (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
return _flatpak_dir_ensure_repo (self, TRUE, cancellable, error);
} | 0 | [
"CWE-668"
] | flatpak | cd2142888fc4c199723a0dfca1f15ea8788a5483 | 312,378,787,101,119,340,000,000,000,000,000,000,000 | 6 | 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 ... |
amstar_selfcheck(
application_argument_t *argument)
{
char *option;
if (argument->dle.disk) {
char *qdisk = quote_string(argument->dle.disk);
fprintf(stdout, "OK disk %s\n", qdisk);
amfree(qdisk);
}
fprintf(stdout, "OK amstar version %s\n", VERSION);
fprintf(stdout, "OK amstar\n");
if ... | 1 | [
"CWE-264"
] | amanda | 4bf5b9b356848da98560ffbb3a07a9cb5c4ea6d7 | 90,523,710,162,624,000,000,000,000,000,000,000,000 | 89 | * Add a /etc/amanda-security.conf file
git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/branches/3_3@6486 a8d146d6-cc15-0410-8900-af154a0219e0 |
zone_check_ns(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *version,
dns_name_t *name, bool logit)
{
isc_result_t result;
char namebuf[DNS_NAME_FORMATSIZE];
char altbuf[DNS_NAME_FORMATSIZE];
dns_fixedname_t fixed;
dns_name_t *foundname;
int level;
if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_NOCHECKNS))
re... | 0 | [
"CWE-327"
] | bind9 | f09352d20a9d360e50683cd1d2fc52ccedcd77a0 | 63,792,252,589,994,760,000,000,000,000,000,000,000 | 63 | Update keyfetch_done compute_tag check
If in keyfetch_done the compute_tag fails (because for example the
algorithm is not supported), don't crash, but instead ignore the
key. |
int wc_SetExtKeyUsageOID(Cert *cert, const char *in, word32 sz, byte idx,
void* heap)
{
byte oid[MAX_OID_SZ];
word32 oidSz = MAX_OID_SZ;
if (idx >= CTC_MAX_EKU_NB || sz >= CTC_MAX_EKU_OID_SZ) {
WOLFSSL_MSG("Either idx or sz was too large");
return BAD_FUNC_ARG;
}
if (Encode... | 0 | [
"CWE-125",
"CWE-345"
] | wolfssl | f93083be72a3b3d956b52a7ec13f307a27b6e093 | 117,701,988,390,353,190,000,000,000,000,000,000,000 | 21 | OCSP: improve handling of OCSP no check extension |
ssize_t ProtocolV2::write_message(Message *m, bool more) {
FUNCTRACE(cct);
ceph_assert(connection->center->in_thread());
m->set_seq(++out_seq);
connection->lock.lock();
uint64_t ack_seq = in_seq;
ack_left = 0;
connection->lock.unlock();
ceph_msg_header &header = m->get_header();
ceph_msg_footer &foo... | 0 | [
"CWE-323"
] | ceph | 47c7e623546a7a33bd6bbddfb899fa9c9a40f40a | 26,571,272,868,828,797,000,000,000,000,000,000,000 | 58 | msg/async/ProtocolV2: avoid AES-GCM nonce reuse vulnerabilities
The secure mode uses AES-128-GCM with 96-bit nonces consisting of a
32-bit counter followed by a 64-bit salt. The counter is incremented
after processing each frame, the salt is fixed for the duration of
the session. Both are initialized from the sessio... |
static void tipc_node_read_lock(struct tipc_node *n)
{
read_lock_bh(&n->lock);
} | 0 | [] | linux | 0217ed2848e8538bcf9172d97ed2eeb4a26041bb | 27,585,220,138,286,386,000,000,000,000,000,000,000 | 4 | tipc: better validate user input in tipc_nl_retrieve_key()
Before calling tipc_aead_key_size(ptr), we need to ensure
we have enough data to dereference ptr->keylen.
We probably also want to make sure tipc_aead_key_size()
wont overflow with malicious ptr->keylen values.
Syzbot reported:
BUG: KMSAN: uninit-value in _... |
int seccomp_restrict_namespaces(unsigned long retain) {
uint32_t arch;
int r;
if (DEBUG_LOGGING) {
_cleanup_free_ char *s = NULL;
(void) namespace_flags_to_string(retain, &s);
log_debug("Restricting namespace to: %s.", strna(s));
}
... | 0 | [
"CWE-269"
] | systemd | 3c27973b13724ede05a06a5d346a569794cda433 | 163,991,527,776,273,910,000,000,000,000,000,000,000 | 114 | seccomp: introduce seccomp_restrict_suid_sgid() for blocking chmod() for suid/sgid files |
int fmtutil_is_standard_iff_chunk(deark *c, struct de_iffctx *ictx,
u32 ct)
{
switch(ct) {
case CODE__c_:
case CODE_ANNO:
case CODE_AUTH:
case CODE_NAME:
case CODE_TEXT:
return 1;
}
return 0;
} | 0 | [
"CWE-369"
] | deark | 62acb7753b0e3c0d3ab3c15057b0a65222313334 | 295,992,600,923,761,160,000,000,000,000,000,000,000 | 13 | pict,macrsrc: Fixed a bug that could cause division by 0
Found by F. Çelik. |
static bool auth_request_proxy_is_self(struct auth_request *request)
{
const char *port = NULL;
/* check if the port is the same */
port = auth_fields_find(request->fields.extra_fields, "port");
if (port != NULL && !str_uint_equals(port, request->fields.local_port))
return FALSE;
/* don't check destuser. in som... | 0 | [
"CWE-284"
] | core | 7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904 | 156,749,369,284,482,320,000,000,000,000,000,000,000 | 17 | auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter
The passdb was wrongly deduplicated in this situation, causing wrong
mechanisms or username_filter setting to be used. This would be a rather
unlikely configuration though.
Fixed by moving mechanisms and username_filter fro... |
TEST(FormatTest, MaxArgs) {
EXPECT_EQ("0123456789abcde",
fmt::format("{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e'));
} | 0 | [
"CWE-134",
"CWE-119",
"CWE-787"
] | fmt | 8cf30aa2be256eba07bb1cefb998c52326e846e7 | 26,554,971,738,601,433,000,000,000,000,000,000,000 | 5 | Fix segfault on complex pointer formatting (#642) |
static inline bool io_should_wake(struct io_wait_queue *iowq, bool noflush)
{
struct io_ring_ctx *ctx = iowq->ctx;
/*
* Wake up if we have enough events, or if a timeout occurred since we
* started waiting. For timeouts, we always want to return to userspace,
* regardless of event count.
*/
return io_cqring... | 0 | [] | linux | ff002b30181d30cdfbca316dadd099c3ca0d739c | 288,568,108,343,940,420,000,000,000,000,000,000,000 | 12 | io_uring: grab ->fs as part of async preparation
This passes it in to io-wq, so it assumes the right fs_struct when
executing async work that may need to do lookups.
Cc: stable@vger.kernel.org # 5.3+
Signed-off-by: Jens Axboe <axboe@kernel.dk> |
static int process_line(ASS_Track *track, char *str)
{
skip_spaces(&str);
if (!ass_strncasecmp(str, "[Script Info]", 13)) {
track->parser_priv->state = PST_INFO;
} else if (!ass_strncasecmp(str, "[V4 Styles]", 11)) {
track->parser_priv->state = PST_STYLES;
track->track_type = TRACK_T... | 0 | [
"CWE-369",
"CWE-787"
] | libass | 017137471d0043e0321e377ed8da48e45a3ec632 | 339,152,650,905,289,050,000,000,000,000,000,000,000 | 35 | decode_font: fix subtraction broken by change to unsigned type
This caused a one-byte buffer overwrite and an assertion failure.
Regression in commit 910211f1c0078e37546f73e95306724358b89be2.
Discovered by OSS-Fuzz.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26674.
Fixes https://bugs.chromium.org/p... |
png_set_text_compression_strategy(png_structrp png_ptr, int strategy)
{
png_debug(1, "in png_set_text_compression_strategy");
if (png_ptr == NULL)
return;
png_ptr->zlib_text_strategy = strategy;
} | 0 | [
"CWE-120"
] | libpng | 81f44665cce4cb1373f049a76f3904e981b7a766 | 244,369,619,646,462,860,000,000,000,000,000,000,000 | 9 | [libpng16] Reject attempt to write over-length PLTE chunk |
static int DllInit(void)
{
#if defined(_WIN32_WINNT)
union { int(*f)(void); BYTE *p; } t = { DllInit };
HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
IMAGE_DOS_HEADER *dos_header;
IMAGE_NT_HEADERS *nt_headers;
MODULEENTRY32 me32 = {sizeof(me32)};
hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,0);
... | 0 | [
"CWE-310"
] | openssl | 270881316664396326c461ec7a124aec2c6cc081 | 57,679,761,192,464,680,000,000,000,000,000,000,000 | 35 | Add and use a constant-time memcmp.
This change adds CRYPTO_memcmp, which compares two vectors of bytes in
an amount of time that's independent of their contents. It also changes
several MAC compares in the code to use this over the standard memcmp,
which may leak information about the size of a matching prefix.
(cher... |
static int is_not_headers(apr_bucket *b)
{
return !H2_BUCKET_IS_HEADERS(b);
} | 0 | [
"CWE-770"
] | mod_h2 | dd05d49abe0f67512ce9ed5ba422d7711effecfb | 128,150,382,011,044,110,000,000,000,000,000,000,000 | 4 | * fixes Timeout vs. KeepAliveTimeout behaviour, see PR 63534 (for trunk now,
mpm event backport to 2.4.x up for vote).
* Fixes stream cleanup when connection throttling is in place.
* Counts stream resets by client on streams initiated by client as cause
for connection throttling.
* Header length checks are no... |
static inline apr_size_t am_cache_entry_pool_size(am_mod_cfg_rec *cfg)
{
return cfg->init_entry_size - sizeof(am_cache_entry_t);
} | 0 | [
"CWE-79"
] | mod_auth_mellon | 7af21c53da7bb1de024274ee6da30bc22316a079 | 203,729,633,632,182,270,000,000,000,000,000,000,000 | 4 | Fix Cross-Site Session Transfer vulnerability
mod_auth_mellon did not verify that the site the session was created
for was the same site as the site the user accessed. This allows an
attacker with access to one web site on a server to use the same
session to get access to a different site running on the same server.
... |
void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_,
const Magick::Image &texture_,const Magick::Color &borderColor_,
const bool invert_)
{
PixelInfo
pixel;
modifyImage();
pixel=static_cast<PixelInfo>(borderColor_);
floodFill(x_,y_,&texture_,Magick::Color(),&pixel,invert_);
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 279,784,189,401,777,350,000,000,000,000,000,000,000 | 12 | Added missing return to avoid use after free. |
void set_nlink(struct inode *inode, unsigned int nlink)
{
if (!nlink) {
clear_nlink(inode);
} else {
/* Yes, some filesystems do change nlink from zero to one */
if (inode->i_nlink == 0)
atomic_long_dec(&inode->i_sb->s_remove_count);
inode->__i_nlink = nlink;
}
} | 0 | [
"CWE-269"
] | linux | 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7 | 84,883,251,449,469,920,000,000,000,000,000,000,000 | 12 | Fix up non-directory creation in SGID directories
sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid. This is historically used for
group-shared directories.
But group directories writable b... |
static int cap_sb_show_options(struct seq_file *m, struct super_block *sb)
{
return 0;
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 257,727,790,513,817,250,000,000,000,000,000,000,000 | 4 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
static irqreturn_t dw_spi_irq(int irq, void *dev_id)
{
struct spi_controller *master = dev_id;
struct dw_spi *dws = spi_controller_get_devdata(master);
u16 irq_status = dw_readl(dws, DW_SPI_ISR) & 0x3f;
if (!irq_status)
return IRQ_NONE;
if (!master->cur_msg) {
spi_mask_intr(dws, SPI_INT_TXEI);
return IRQ_H... | 0 | [
"CWE-662"
] | linux | 19b61392c5a852b4e8a0bf35aecb969983c5932d | 173,407,627,746,368,500,000,000,000,000,000,000,000 | 16 | spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls
dw_spi_irq() and dw_spi_transfer_one concurrent calls.
I find a panic in dw_writer(): txw = *(u8 *)(dws->tx), when dw->tx==null,
dw->len==4, and dw->tx_end==1.
When tpm driver's message overtime dw_spi_irq() and dw_spi_transfer_one
may concurrent... |
void Magick::Image::chop(const Geometry &geometry_)
{
MagickCore::Image
*newImage;
RectangleInfo
chopInfo=geometry_;
GetPPException;
newImage=ChopImage(image(),&chopInfo,exceptionInfo);
replaceImage(newImage);
ThrowImageException;
} | 0 | [
"CWE-416"
] | ImageMagick | 8c35502217c1879cb8257c617007282eee3fe1cc | 263,918,935,304,155,600,000,000,000,000,000,000,000 | 13 | Added missing return to avoid use after free. |
static void tg3_wait_for_event_ack(struct tg3 *tp)
{
int i;
unsigned int delay_cnt;
long time_remain;
/* If enough time has passed, no wait is necessary. */
time_remain = (long)(tp->last_event_jiffies + 1 +
usecs_to_jiffies(TG3_FW_EVENT_TIMEOUT_USEC)) -
(long)jiffies;
if (time_remain < 0)
retur... | 0 | [
"CWE-476",
"CWE-119"
] | linux | 715230a44310a8cf66fbfb5a46f9a62a9b2de424 | 117,750,612,396,234,600,000,000,000,000,000,000,000 | 25 | tg3: fix length overflow in VPD firmware parsing
Commit 184b89044fb6e2a74611dafa69b1dce0d98612c6 ("tg3: Use VPD fw version
when present") introduced VPD parsing that contained a potential length
overflow.
Limit the hardware's reported firmware string length (max 255 bytes) to
stay inside the driver's firmware string ... |
static int ipc_check_perms(struct ipc_namespace *ns,
struct kern_ipc_perm *ipcp,
const struct ipc_ops *ops,
struct ipc_params *params)
{
int err;
if (ipcperms(ns, ipcp, params->flg))
err = -EACCES;
else {
err = ops->associate(ipcp, params->flg);
if (!err)
err = ipcp->id;
}
return err;
... | 0 | [
"CWE-362",
"CWE-401"
] | linux | b9a532277938798b53178d5a66af6e2915cb27cf | 97,027,075,431,034,400,000,000,000,000,000,000,000 | 17 | Initialize msg/shm IPC objects before doing ipc_addid()
As reported by Dmitry Vyukov, we really shouldn't do ipc_addid() before
having initialized the IPC object state. Yes, we initialize the IPC
object in a locked state, but with all the lockless RCU lookup work,
that IPC object lock no longer means that the state c... |
zrsearch(i_ctx_t *i_ctx_p)
{
return search_impl(i_ctx_p, false);
} | 0 | [
"CWE-119",
"CWE-787"
] | ghostpdl | 5d499272b95a6b890a1397e11d20937de000d31b | 168,325,254,318,991,810,000,000,000,000,000,000,000 | 4 | Bug 702582, CVE 2020-15900 Memory Corruption in Ghostscript 9.52
Fix the 'rsearch' calculation for the 'post' size to give the correct
size. Previous calculation would result in a size that was too large,
and could underflow to max uint32_t. Also fix 'rsearch' to return the
correct 'pre' string with empty string matc... |
static void skb_free_head(struct sk_buff *skb)
{
if (skb->head_frag)
put_page(virt_to_head_page(skb->head));
else
kfree(skb->head);
} | 0 | [
"CWE-416"
] | net | 36d5fe6a000790f56039afe26834265db0a3ad4c | 328,780,834,773,951,370,000,000,000,000,000,000,000 | 7 | 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... |
void h2o_http2_conn_register_stream(h2o_http2_conn_t *conn, h2o_http2_stream_t *stream)
{
khiter_t iter;
int r;
if (!h2o_http2_stream_is_push(stream->stream_id) && conn->pull_stream_ids.max_open < stream->stream_id)
conn->pull_stream_ids.max_open = stream->stream_id;
iter = kh_put(h2o_http2_st... | 0 | [
"CWE-703"
] | h2o | 1c0808d580da09fdec5a9a74ff09e103ea058dd4 | 222,659,687,684,294,500,000,000,000,000,000,000,000 | 12 | h2: use after free on premature connection close #920
lib/http2/connection.c:on_read() calls parse_input(), which might free
`conn`. It does so in particular if the connection preface isn't
the expected one in expect_preface(). `conn` is then used after the free
in `if (h2o_timeout_is_linked(&conn->_write.timeout_entr... |
alloc8bitTargets(Widget w, TScreen *screen)
{
Atom **resultp = &(screen->selection_targets_8bit);
if (*resultp == 0) {
Atom *result = 0;
if (!overrideTargets(w, screen->eightbit_select_types, &result)) {
result = TypeXtMallocN(Atom, 5);
if (result == NULL) {
TRACE(("Couldn't allocate 8bit select... | 0 | [
"CWE-399"
] | xterm-snapshots | 82ba55b8f994ab30ff561a347b82ea340ba7075c | 178,690,349,367,300,920,000,000,000,000,000,000,000 | 33 | snapshot of project "xterm", label xterm-365d |
static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz) {
const char *section_name = "";
const char *link_section_name = "";
char *end = NULL;
Elf_(Shdr) *link_shdr = NULL;
ut8 dfs[sizeof (Elf_(Verdef))] = {0};
Sdb *sdb;
int cnt, i;
if (shdr->sh_link > bin->ehdr.e_shnum) {
return false... | 1 | [
"CWE-119",
"CWE-787"
] | radare2 | 0b973e28166636e0ff1fad80baa0385c9c09c53a | 146,825,724,244,373,910,000,000,000,000,000,000,000 | 127 | Fixed crash in elf.c with 32bit r2 when shdr->sh_size > max size_t |
void ShowImageInfo(int ShowFileInfo)
{
if (ShowFileInfo){
printf("File name : %s\n",ImageInfo.FileName);
printf("File size : %d bytes\n",ImageInfo.FileSize);
{
char Temp[20];
FileTimeAsString(Temp);
printf("File date : %s\n",Temp);
}
... | 0 | [
"CWE-703"
] | jhead | a50953a266583981b51a181c2fce73dad2ac5d7d | 161,572,230,147,673,440,000,000,000,000,000,000,000 | 265 | Make pointer range checks more consistent.
Also twiddle the unused floating point print code (not used in real exif files),
but fuzz testing hits it. New code is equivalent but doesn't cause bus error (don't understand why, but this is all a very bogus thing anyway, just trying to avoid fuzz testing hits. |
static int hclge_tm_qs_bp_cfg(struct hclge_dev *hdev, u8 tc, u8 grp_id,
u32 bit_map)
{
struct hclge_bp_to_qs_map_cmd *bp_to_qs_map_cmd;
struct hclge_desc desc;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_TM_BP_TO_QSET_MAPPING,
false);
bp_to_qs_map_cmd = (struct hclge_bp_to_qs_map_cmd *)desc.data;
... | 0 | [
"CWE-125"
] | linux | 04f25edb48c441fc278ecc154c270f16966cbb90 | 38,536,157,714,055,310,000,000,000,000,000,000,000 | 17 | net: hns3: add some error checking in hclge_tm module
When hdev->tx_sch_mode is HCLGE_FLAG_VNET_BASE_SCH_MODE, the
hclge_tm_schd_mode_vnet_base_cfg calls hclge_tm_pri_schd_mode_cfg
with vport->vport_id as pri_id, which is used as index for
hdev->tm_info.tc_info, it will cause out of bound access issue
if vport_id is e... |
static void __net_exit ip6_tables_net_exit(struct net *net)
{
xt_proto_fini(net, NFPROTO_IPV6);
} | 0 | [
"CWE-200"
] | linux-2.6 | 6a8ab060779779de8aea92ce3337ca348f973f54 | 191,169,157,076,149,130,000,000,000,000,000,000,000 | 4 | ipv6: netfilter: ip6_tables: fix infoleak to userspace
Structures ip6t_replace, compat_ip6t_replace, and xt_get_revision are
copied from userspace. Fields of these structs that are
zero-terminated strings are not checked. When they are used as argument
to a format string containing "%s" in request_module(), some sen... |
nfs4_ff_end_busy_timer(struct nfs4_ff_busy_timer *timer, ktime_t now)
{
ktime_t start;
if (atomic_dec_return(&timer->n_ops) < 0)
WARN_ON_ONCE(1);
start = timer->start_time;
timer->start_time = now;
return ktime_sub(now, start);
} | 0 | [
"CWE-787"
] | linux | ed34695e15aba74f45247f1ee2cf7e09d449f925 | 262,483,612,549,055,880,000,000,000,000,000,000,000 | 11 | pNFS/flexfiles: fix incorrect size check in decode_nfs_fh()
We (adam zabrocki, alexander matrosov, alexander tereshkin, maksym
bazalii) observed the check:
if (fh->size > sizeof(struct nfs_fh))
should not use the size of the nfs_fh struct which includes an extra two
bytes from the size field.
struct nfs_fh {
unsi... |
int splice_grow_spd(const struct pipe_inode_info *pipe, struct splice_pipe_desc *spd)
{
unsigned int buffers = ACCESS_ONCE(pipe->buffers);
spd->nr_pages_max = buffers;
if (buffers <= PIPE_DEF_BUFFERS)
return 0;
spd->pages = kmalloc(buffers * sizeof(struct page *), GFP_KERNEL);
spd->partial = kmalloc(buffers * ... | 0 | [
"CWE-284",
"CWE-264"
] | linux | 8d0207652cbe27d1f962050737848e5ad4671958 | 323,824,560,526,491,340,000,000,000,000,000,000,000 | 18 | ->splice_write() via ->write_iter()
iter_file_splice_write() - a ->splice_write() instance that gathers the
pipe buffers, builds a bio_vec-based iov_iter covering those and feeds
it to ->write_iter(). A bunch of simple cases coverted to that...
[AV: fixed the braino spotted by Cyrill]
Signed-off-by: Al Viro <viro@z... |
static int selinux_capget(struct task_struct *target, kernel_cap_t *effective,
kernel_cap_t *inheritable, kernel_cap_t *permitted)
{
int error;
error = current_has_perm(target, PROCESS__GETCAP);
if (error)
return error;
return cap_capget(target, effective, inheritable, permitted);
} | 0 | [] | linux-2.6 | ee18d64c1f632043a02e6f5ba5e045bb26a5465f | 262,214,908,989,791,700,000,000,000,000,000,000,000 | 11 | KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]
Add a keyctl to install a process's session keyring onto its parent. This
replaces the parent's session keyring. Because the COW credential code does
not permit one process to change another process's credentials directly, the
change is... |
lyd_insert_before(struct lyd_node *sibling, struct lyd_node *node)
{
if (!node || !sibling) {
LOGARG;
return EXIT_FAILURE;
}
return lyd_insert_nextto(sibling, node, 1, 1);
} | 0 | [
"CWE-119"
] | libyang | 32fb4993bc8bb49e93e84016af3c10ea53964be5 | 249,595,412,958,128,150,000,000,000,000,000,000,000 | 9 | schema tree BUGFIX do not check features while still resolving schema
Fixes #723 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.