idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
21,500
static int proc_self_readlink(struct dentry *dentry, char __user *buffer, int buflen) { struct pid_namespace *ns = dentry->d_sb->s_fs_info; pid_t tgid = task_tgid_nr_ns(current, ns); char tmp[PROC_NUMBUF]; if (!tgid) return -ENOENT; sprintf(tmp, "%d", tgid); return vfs_readlink(dentry,buffer,buflen,tmp); }
null
0
static int proc_self_readlink(struct dentry *dentry, char __user *buffer, int buflen) { struct pid_namespace *ns = dentry->d_sb->s_fs_info; pid_t tgid = task_tgid_nr_ns(current, ns); char tmp[PROC_NUMBUF]; if (!tgid) return -ENOENT; sprintf(tmp, "%d", tgid); return vfs_readlink(dentry,buffer,buflen,tmp); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,501
static ssize_t proc_sessionid_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { struct inode * inode = file->f_path.dentry->d_inode; struct task_struct *task = get_proc_task(inode); ssize_t length; char tmpbuf[TMPBUFLEN]; if (!task) return -ESRCH; length = scnprintf(tmpbuf, TMPBUFLEN, "%u", audit_get_sessionid(task)); put_task_struct(task); return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); }
null
0
static ssize_t proc_sessionid_read(struct file * file, char __user * buf, size_t count, loff_t *ppos) { struct inode * inode = file->f_path.dentry->d_inode; struct task_struct *task = get_proc_task(inode); ssize_t length; char tmpbuf[TMPBUFLEN]; if (!task) return -ESRCH; length = scnprintf(tmpbuf, TMPBUFLEN, "%u", audit_get_sessionid(task)); put_task_struct(task); return simple_read_from_buffer(buf, count, ppos, tmpbuf, length); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,502
int proc_setattr(struct dentry *dentry, struct iattr *attr) { int error; struct inode *inode = dentry->d_inode; if (attr->ia_valid & ATTR_MODE) return -EPERM; error = inode_change_ok(inode, attr); if (error) return error; if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size != i_size_read(inode)) { error = vmtruncate(inode, attr->ia_size); if (error) return error; } setattr_copy(inode, attr); mark_inode_dirty(inode); return 0; }
null
0
int proc_setattr(struct dentry *dentry, struct iattr *attr) { int error; struct inode *inode = dentry->d_inode; if (attr->ia_valid & ATTR_MODE) return -EPERM; error = inode_change_ok(inode, attr); if (error) return error; if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size != i_size_read(inode)) { error = vmtruncate(inode, attr->ia_size); if (error) return error; } setattr_copy(inode, attr); mark_inode_dirty(inode); return 0; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,503
static int proc_single_open(struct inode *inode, struct file *filp) { return single_open(filp, proc_single_show, inode); }
null
0
static int proc_single_open(struct inode *inode, struct file *filp) { return single_open(filp, proc_single_show, inode); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,504
static int proc_single_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct pid_namespace *ns; struct pid *pid; struct task_struct *task; int ret; ns = inode->i_sb->s_fs_info; pid = proc_pid(inode); task = get_pid_task(pid, PIDTYPE_PID); if (!task) return -ESRCH; ret = PROC_I(inode)->op.proc_show(m, ns, pid, task); put_task_struct(task); return ret; }
null
0
static int proc_single_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct pid_namespace *ns; struct pid *pid; struct task_struct *task; int ret; ns = inode->i_sb->s_fs_info; pid = proc_pid(inode); task = get_pid_task(pid, PIDTYPE_PID); if (!task) return -ESRCH; ret = PROC_I(inode)->op.proc_show(m, ns, pid, task); put_task_struct(task); return ret; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,505
static int proc_task_fill_cache(struct file *filp, void *dirent, filldir_t filldir, struct task_struct *task, int tid) { char name[PROC_NUMBUF]; int len = snprintf(name, sizeof(name), "%d", tid); return proc_fill_cache(filp, dirent, filldir, name, len, proc_task_instantiate, task, NULL); }
null
0
static int proc_task_fill_cache(struct file *filp, void *dirent, filldir_t filldir, struct task_struct *task, int tid) { char name[PROC_NUMBUF]; int len = snprintf(name, sizeof(name), "%d", tid); return proc_fill_cache(filp, dirent, filldir, name, len, proc_task_instantiate, task, NULL); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,506
static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { struct inode *inode = dentry->d_inode; struct task_struct *p = get_proc_task(inode); generic_fillattr(inode, stat); if (p) { stat->nlink += get_nr_threads(p); put_task_struct(p); } return 0; }
null
0
static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { struct inode *inode = dentry->d_inode; struct task_struct *p = get_proc_task(inode); generic_fillattr(inode, stat); if (p) { stat->nlink += get_nr_threads(p); put_task_struct(p); } return 0; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,507
static struct dentry *proc_task_instantiate(struct inode *dir, struct dentry *dentry, struct task_struct *task, const void *ptr) { struct dentry *error = ERR_PTR(-ENOENT); struct inode *inode; inode = proc_pid_make_inode(dir->i_sb, task); if (!inode) goto out; inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO; inode->i_op = &proc_tid_base_inode_operations; inode->i_fop = &proc_tid_base_operations; inode->i_flags|=S_IMMUTABLE; inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff, ARRAY_SIZE(tid_base_stuff)); d_set_d_op(dentry, &pid_dentry_operations); d_add(dentry, inode); /* Close the race of the process dying before we return the dentry */ if (pid_revalidate(dentry, NULL)) error = NULL; out: return error; }
null
0
static struct dentry *proc_task_instantiate(struct inode *dir, struct dentry *dentry, struct task_struct *task, const void *ptr) { struct dentry *error = ERR_PTR(-ENOENT); struct inode *inode; inode = proc_pid_make_inode(dir->i_sb, task); if (!inode) goto out; inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO; inode->i_op = &proc_tid_base_inode_operations; inode->i_fop = &proc_tid_base_operations; inode->i_flags|=S_IMMUTABLE; inode->i_nlink = 2 + pid_entry_count_dirs(tid_base_stuff, ARRAY_SIZE(tid_base_stuff)); d_set_d_op(dentry, &pid_dentry_operations); d_add(dentry, inode); /* Close the race of the process dying before we return the dentry */ if (pid_revalidate(dentry, NULL)) error = NULL; out: return error; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,508
static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd) { struct dentry *result = ERR_PTR(-ENOENT); struct task_struct *task; struct task_struct *leader = get_proc_task(dir); unsigned tid; struct pid_namespace *ns; if (!leader) goto out_no_task; tid = name_to_int(dentry); if (tid == ~0U) goto out; ns = dentry->d_sb->s_fs_info; rcu_read_lock(); task = find_task_by_pid_ns(tid, ns); if (task) get_task_struct(task); rcu_read_unlock(); if (!task) goto out; if (!same_thread_group(leader, task)) goto out_drop_task; result = proc_task_instantiate(dir, dentry, task, NULL); out_drop_task: put_task_struct(task); out: put_task_struct(leader); out_no_task: return result; }
null
0
static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd) { struct dentry *result = ERR_PTR(-ENOENT); struct task_struct *task; struct task_struct *leader = get_proc_task(dir); unsigned tid; struct pid_namespace *ns; if (!leader) goto out_no_task; tid = name_to_int(dentry); if (tid == ~0U) goto out; ns = dentry->d_sb->s_fs_info; rcu_read_lock(); task = find_task_by_pid_ns(tid, ns); if (task) get_task_struct(task); rcu_read_unlock(); if (!task) goto out; if (!same_thread_group(leader, task)) goto out_drop_task; result = proc_task_instantiate(dir, dentry, task, NULL); out_drop_task: put_task_struct(task); out: put_task_struct(leader); out_no_task: return result; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,509
static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ return proc_pident_lookup(dir, dentry, tgid_base_stuff, ARRAY_SIZE(tgid_base_stuff)); }
null
0
static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ return proc_pident_lookup(dir, dentry, tgid_base_stuff, ARRAY_SIZE(tgid_base_stuff)); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,510
static int proc_tgid_base_readdir(struct file * filp, void * dirent, filldir_t filldir) { return proc_pident_readdir(filp,dirent,filldir, tgid_base_stuff,ARRAY_SIZE(tgid_base_stuff)); }
null
0
static int proc_tgid_base_readdir(struct file * filp, void * dirent, filldir_t filldir) { return proc_pident_readdir(filp,dirent,filldir, tgid_base_stuff,ARRAY_SIZE(tgid_base_stuff)); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,511
static int proc_tgid_io_accounting(struct task_struct *task, char *buffer) { return do_io_accounting(task, buffer, 1); }
null
0
static int proc_tgid_io_accounting(struct task_struct *task, char *buffer) { return do_io_accounting(task, buffer, 1); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,512
static struct dentry *proc_tid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ return proc_pident_lookup(dir, dentry, tid_base_stuff, ARRAY_SIZE(tid_base_stuff)); }
null
0
static struct dentry *proc_tid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){ return proc_pident_lookup(dir, dentry, tid_base_stuff, ARRAY_SIZE(tid_base_stuff)); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,513
static int proc_tid_base_readdir(struct file * filp, void * dirent, filldir_t filldir) { return proc_pident_readdir(filp,dirent,filldir, tid_base_stuff,ARRAY_SIZE(tid_base_stuff)); }
null
0
static int proc_tid_base_readdir(struct file * filp, void * dirent, filldir_t filldir) { return proc_pident_readdir(filp,dirent,filldir, tid_base_stuff,ARRAY_SIZE(tid_base_stuff)); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,514
static int proc_tid_io_accounting(struct task_struct *task, char *buffer) { return do_io_accounting(task, buffer, 0); }
null
0
static int proc_tid_io_accounting(struct task_struct *task, char *buffer) { return do_io_accounting(task, buffer, 0); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,515
static int sched_autogroup_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_autogroup_show_task(p, m); put_task_struct(p); return 0; }
null
0
static int sched_autogroup_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_autogroup_show_task(p, m); put_task_struct(p); return 0; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,516
static int sched_open(struct inode *inode, struct file *filp) { return single_open(filp, sched_show, inode); }
null
0
static int sched_open(struct inode *inode, struct file *filp) { return single_open(filp, sched_show, inode); }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,517
static int sched_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_show_task(p, m); put_task_struct(p); return 0; }
null
0
static int sched_show(struct seq_file *m, void *v) { struct inode *inode = m->private; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_show_task(p, m); put_task_struct(p); return 0; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,518
sched_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { struct inode *inode = file->f_path.dentry->d_inode; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_set_task(p); put_task_struct(p); return count; }
null
0
sched_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { struct inode *inode = file->f_path.dentry->d_inode; struct task_struct *p; p = get_proc_task(inode); if (!p) return -ESRCH; proc_sched_set_task(p); put_task_struct(p); return count; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,519
static int task_dumpable(struct task_struct *task) { int dumpable = 0; struct mm_struct *mm; task_lock(task); mm = task->mm; if (mm) dumpable = get_dumpable(mm); task_unlock(task); if(dumpable == 1) return 1; return 0; }
null
0
static int task_dumpable(struct task_struct *task) { int dumpable = 0; struct mm_struct *mm; task_lock(task); mm = task->mm; if (mm) dumpable = get_dumpable(mm); task_unlock(task); if(dumpable == 1) return 1; return 0; }
@@ -2708,6 +2708,9 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) struct task_io_accounting acct = task->ioac; unsigned long flags; + if (!ptrace_may_access(task, PTRACE_MODE_READ)) + return -EACCES; + if (whole && lock_task_sighand(task, &flags)) { struct task_struct *t = task; @@ -2839,7 +2842,7 @@ static const struct pid_entry tgid_base_stuff[] = { REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tgid_io_accounting), + INF("io", S_IRUSR, proc_tgid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall), @@ -3181,7 +3184,7 @@ static const struct pid_entry tid_base_stuff[] = { REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations), #endif #ifdef CONFIG_TASK_IO_ACCOUNTING - INF("io", S_IRUGO, proc_tid_io_accounting), + INF("io", S_IRUSR, proc_tid_io_accounting), #endif #ifdef CONFIG_HARDWALL INF("hardwall", S_IRUGO, proc_pid_hardwall),
CWE-264
null
null
21,520
static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { int rc = 0; struct sk_buff *rep_skb; struct cgroupstats *stats; struct nlattr *na; size_t size; u32 fd; struct file *file; int fput_needed; na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; if (!na) return -EINVAL; fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); file = fget_light(fd, &fput_needed); if (!file) return 0; size = nla_total_size(sizeof(struct cgroupstats)); rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) goto err; na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS, sizeof(struct cgroupstats)); stats = nla_data(na); memset(stats, 0, sizeof(*stats)); rc = cgroupstats_build(stats, file->f_dentry); if (rc < 0) { nlmsg_free(rep_skb); goto err; } rc = send_reply(rep_skb, info); err: fput_light(file, fput_needed); return rc; }
+Info
0
static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { int rc = 0; struct sk_buff *rep_skb; struct cgroupstats *stats; struct nlattr *na; size_t size; u32 fd; struct file *file; int fput_needed; na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; if (!na) return -EINVAL; fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); file = fget_light(fd, &fput_needed); if (!file) return 0; size = nla_total_size(sizeof(struct cgroupstats)); rc = prepare_reply(info, CGROUPSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) goto err; na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS, sizeof(struct cgroupstats)); stats = nla_data(na); memset(stats, 0, sizeof(*stats)); rc = cgroupstats_build(stats, file->f_dentry); if (rc < 0) { nlmsg_free(rep_skb); goto err; } rc = send_reply(rep_skb, info); err: fput_light(file, fput_needed); return rc; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,521
static int cmd_attr_pid(struct genl_info *info) { struct taskstats *stats; struct sk_buff *rep_skb; size_t size; u32 pid; int rc; size = taskstats_packet_size(); rc = prepare_reply(info, TASKSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) return rc; rc = -EINVAL; pid = nla_get_u32(info->attrs[TASKSTATS_CMD_ATTR_PID]); stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, pid); if (!stats) goto err; rc = fill_stats_for_pid(pid, stats); if (rc < 0) goto err; return send_reply(rep_skb, info); err: nlmsg_free(rep_skb); return rc; }
+Info
0
static int cmd_attr_pid(struct genl_info *info) { struct taskstats *stats; struct sk_buff *rep_skb; size_t size; u32 pid; int rc; size = taskstats_packet_size(); rc = prepare_reply(info, TASKSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) return rc; rc = -EINVAL; pid = nla_get_u32(info->attrs[TASKSTATS_CMD_ATTR_PID]); stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, pid); if (!stats) goto err; rc = fill_stats_for_pid(pid, stats); if (rc < 0) goto err; return send_reply(rep_skb, info); err: nlmsg_free(rep_skb); return rc; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,522
static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats) { struct task_struct *tsk, *first; unsigned long flags; int rc = -ESRCH; /* * Add additional stats from live tasks except zombie thread group * leaders who are already counted with the dead tasks */ rcu_read_lock(); first = find_task_by_vpid(tgid); if (!first || !lock_task_sighand(first, &flags)) goto out; if (first->signal->stats) memcpy(stats, first->signal->stats, sizeof(*stats)); else memset(stats, 0, sizeof(*stats)); tsk = first; do { if (tsk->exit_state) continue; /* * Accounting subsystem can call its functions here to * fill in relevant parts of struct taskstsats as follows * * per-task-foo(stats, tsk); */ delayacct_add_tsk(stats, tsk); stats->nvcsw += tsk->nvcsw; stats->nivcsw += tsk->nivcsw; } while_each_thread(first, tsk); unlock_task_sighand(first, &flags); rc = 0; out: rcu_read_unlock(); stats->version = TASKSTATS_VERSION; /* * Accounting subsystems can also add calls here to modify * fields of taskstats. */ return rc; }
+Info
0
static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats) { struct task_struct *tsk, *first; unsigned long flags; int rc = -ESRCH; /* * Add additional stats from live tasks except zombie thread group * leaders who are already counted with the dead tasks */ rcu_read_lock(); first = find_task_by_vpid(tgid); if (!first || !lock_task_sighand(first, &flags)) goto out; if (first->signal->stats) memcpy(stats, first->signal->stats, sizeof(*stats)); else memset(stats, 0, sizeof(*stats)); tsk = first; do { if (tsk->exit_state) continue; /* * Accounting subsystem can call its functions here to * fill in relevant parts of struct taskstsats as follows * * per-task-foo(stats, tsk); */ delayacct_add_tsk(stats, tsk); stats->nvcsw += tsk->nvcsw; stats->nivcsw += tsk->nivcsw; } while_each_thread(first, tsk); unlock_task_sighand(first, &flags); rc = 0; out: rcu_read_unlock(); stats->version = TASKSTATS_VERSION; /* * Accounting subsystems can also add calls here to modify * fields of taskstats. */ return rc; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,523
static void fill_tgid_exit(struct task_struct *tsk) { unsigned long flags; spin_lock_irqsave(&tsk->sighand->siglock, flags); if (!tsk->signal->stats) goto ret; /* * Each accounting subsystem calls its functions here to * accumalate its per-task stats for tsk, into the per-tgid structure * * per-task-foo(tsk->signal->stats, tsk); */ delayacct_add_tsk(tsk->signal->stats, tsk); ret: spin_unlock_irqrestore(&tsk->sighand->siglock, flags); return; }
+Info
0
static void fill_tgid_exit(struct task_struct *tsk) { unsigned long flags; spin_lock_irqsave(&tsk->sighand->siglock, flags); if (!tsk->signal->stats) goto ret; /* * Each accounting subsystem calls its functions here to * accumalate its per-task stats for tsk, into the per-tgid structure * * per-task-foo(tsk->signal->stats, tsk); */ delayacct_add_tsk(tsk->signal->stats, tsk); ret: spin_unlock_irqrestore(&tsk->sighand->siglock, flags); return; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,524
static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid) { struct nlattr *na, *ret; int aggr; aggr = (type == TASKSTATS_TYPE_PID) ? TASKSTATS_TYPE_AGGR_PID : TASKSTATS_TYPE_AGGR_TGID; /* * The taskstats structure is internally aligned on 8 byte * boundaries but the layout of the aggregrate reply, with * two NLA headers and the pid (each 4 bytes), actually * force the entire structure to be unaligned. This causes * the kernel to issue unaligned access warnings on some * architectures like ia64. Unfortunately, some software out there * doesn't properly unroll the NLA packet and assumes that the start * of the taskstats structure will always be 20 bytes from the start * of the netlink payload. Aligning the start of the taskstats * structure breaks this software, which we don't want. So, for now * the alignment only happens on architectures that require it * and those users will have to update to fixed versions of those * packages. Space is reserved in the packet only when needed. * This ifdef should be removed in several years e.g. 2012 once * we can be confident that fixed versions are installed on most * systems. We add the padding before the aggregate since the * aggregate is already a defined type. */ #ifdef TASKSTATS_NEEDS_PADDING if (nla_put(skb, TASKSTATS_TYPE_NULL, 0, NULL) < 0) goto err; #endif na = nla_nest_start(skb, aggr); if (!na) goto err; if (nla_put(skb, type, sizeof(pid), &pid) < 0) goto err; ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats)); if (!ret) goto err; nla_nest_end(skb, na); return nla_data(ret); err: return NULL; }
+Info
0
static struct taskstats *mk_reply(struct sk_buff *skb, int type, u32 pid) { struct nlattr *na, *ret; int aggr; aggr = (type == TASKSTATS_TYPE_PID) ? TASKSTATS_TYPE_AGGR_PID : TASKSTATS_TYPE_AGGR_TGID; /* * The taskstats structure is internally aligned on 8 byte * boundaries but the layout of the aggregrate reply, with * two NLA headers and the pid (each 4 bytes), actually * force the entire structure to be unaligned. This causes * the kernel to issue unaligned access warnings on some * architectures like ia64. Unfortunately, some software out there * doesn't properly unroll the NLA packet and assumes that the start * of the taskstats structure will always be 20 bytes from the start * of the netlink payload. Aligning the start of the taskstats * structure breaks this software, which we don't want. So, for now * the alignment only happens on architectures that require it * and those users will have to update to fixed versions of those * packages. Space is reserved in the packet only when needed. * This ifdef should be removed in several years e.g. 2012 once * we can be confident that fixed versions are installed on most * systems. We add the padding before the aggregate since the * aggregate is already a defined type. */ #ifdef TASKSTATS_NEEDS_PADDING if (nla_put(skb, TASKSTATS_TYPE_NULL, 0, NULL) < 0) goto err; #endif na = nla_nest_start(skb, aggr); if (!na) goto err; if (nla_put(skb, type, sizeof(pid), &pid) < 0) goto err; ret = nla_reserve(skb, TASKSTATS_TYPE_STATS, sizeof(struct taskstats)); if (!ret) goto err; nla_nest_end(skb, na); return nla_data(ret); err: return NULL; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,525
static int parse(struct nlattr *na, struct cpumask *mask) { char *data; int len; int ret; if (na == NULL) return 1; len = nla_len(na); if (len > TASKSTATS_CPUMASK_MAXLEN) return -E2BIG; if (len < 1) return -EINVAL; data = kmalloc(len, GFP_KERNEL); if (!data) return -ENOMEM; nla_strlcpy(data, na, len); ret = cpulist_parse(data, mask); kfree(data); return ret; }
+Info
0
static int parse(struct nlattr *na, struct cpumask *mask) { char *data; int len; int ret; if (na == NULL) return 1; len = nla_len(na); if (len > TASKSTATS_CPUMASK_MAXLEN) return -E2BIG; if (len < 1) return -EINVAL; data = kmalloc(len, GFP_KERNEL); if (!data) return -ENOMEM; nla_strlcpy(data, na, len); ret = cpulist_parse(data, mask); kfree(data); return ret; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,526
static void send_cpu_listeners(struct sk_buff *skb, struct listener_list *listeners) { struct genlmsghdr *genlhdr = nlmsg_data(nlmsg_hdr(skb)); struct listener *s, *tmp; struct sk_buff *skb_next, *skb_cur = skb; void *reply = genlmsg_data(genlhdr); int rc, delcount = 0; rc = genlmsg_end(skb, reply); if (rc < 0) { nlmsg_free(skb); return; } rc = 0; down_read(&listeners->sem); list_for_each_entry(s, &listeners->list, list) { skb_next = NULL; if (!list_is_last(&s->list, &listeners->list)) { skb_next = skb_clone(skb_cur, GFP_KERNEL); if (!skb_next) break; } rc = genlmsg_unicast(&init_net, skb_cur, s->pid); if (rc == -ECONNREFUSED) { s->valid = 0; delcount++; } skb_cur = skb_next; } up_read(&listeners->sem); if (skb_cur) nlmsg_free(skb_cur); if (!delcount) return; /* Delete invalidated entries */ down_write(&listeners->sem); list_for_each_entry_safe(s, tmp, &listeners->list, list) { if (!s->valid) { list_del(&s->list); kfree(s); } } up_write(&listeners->sem); }
+Info
0
static void send_cpu_listeners(struct sk_buff *skb, struct listener_list *listeners) { struct genlmsghdr *genlhdr = nlmsg_data(nlmsg_hdr(skb)); struct listener *s, *tmp; struct sk_buff *skb_next, *skb_cur = skb; void *reply = genlmsg_data(genlhdr); int rc, delcount = 0; rc = genlmsg_end(skb, reply); if (rc < 0) { nlmsg_free(skb); return; } rc = 0; down_read(&listeners->sem); list_for_each_entry(s, &listeners->list, list) { skb_next = NULL; if (!list_is_last(&s->list, &listeners->list)) { skb_next = skb_clone(skb_cur, GFP_KERNEL); if (!skb_next) break; } rc = genlmsg_unicast(&init_net, skb_cur, s->pid); if (rc == -ECONNREFUSED) { s->valid = 0; delcount++; } skb_cur = skb_next; } up_read(&listeners->sem); if (skb_cur) nlmsg_free(skb_cur); if (!delcount) return; /* Delete invalidated entries */ down_write(&listeners->sem); list_for_each_entry_safe(s, tmp, &listeners->list, list) { if (!s->valid) { list_del(&s->list); kfree(s); } } up_write(&listeners->sem); }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,527
static int send_reply(struct sk_buff *skb, struct genl_info *info) { struct genlmsghdr *genlhdr = nlmsg_data(nlmsg_hdr(skb)); void *reply = genlmsg_data(genlhdr); int rc; rc = genlmsg_end(skb, reply); if (rc < 0) { nlmsg_free(skb); return rc; } return genlmsg_reply(skb, info); }
+Info
0
static int send_reply(struct sk_buff *skb, struct genl_info *info) { struct genlmsghdr *genlhdr = nlmsg_data(nlmsg_hdr(skb)); void *reply = genlmsg_data(genlhdr); int rc; rc = genlmsg_end(skb, reply); if (rc < 0) { nlmsg_free(skb); return rc; } return genlmsg_reply(skb, info); }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,528
void taskstats_exit(struct task_struct *tsk, int group_dead) { int rc; struct listener_list *listeners; struct taskstats *stats; struct sk_buff *rep_skb; size_t size; int is_thread_group; if (!family_registered) return; /* * Size includes space for nested attributes */ size = taskstats_packet_size(); is_thread_group = !!taskstats_tgid_alloc(tsk); if (is_thread_group) { /* PID + STATS + TGID + STATS */ size = 2 * size; /* fill the tsk->signal->stats structure */ fill_tgid_exit(tsk); } listeners = __this_cpu_ptr(&listener_array); if (list_empty(&listeners->list)) return; rc = prepare_reply(NULL, TASKSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) return; stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, tsk->pid); if (!stats) goto err; fill_stats(tsk, stats); /* * Doesn't matter if tsk is the leader or the last group member leaving */ if (!is_thread_group || !group_dead) goto send; stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, tsk->tgid); if (!stats) goto err; memcpy(stats, tsk->signal->stats, sizeof(*stats)); send: send_cpu_listeners(rep_skb, listeners); return; err: nlmsg_free(rep_skb); }
+Info
0
void taskstats_exit(struct task_struct *tsk, int group_dead) { int rc; struct listener_list *listeners; struct taskstats *stats; struct sk_buff *rep_skb; size_t size; int is_thread_group; if (!family_registered) return; /* * Size includes space for nested attributes */ size = taskstats_packet_size(); is_thread_group = !!taskstats_tgid_alloc(tsk); if (is_thread_group) { /* PID + STATS + TGID + STATS */ size = 2 * size; /* fill the tsk->signal->stats structure */ fill_tgid_exit(tsk); } listeners = __this_cpu_ptr(&listener_array); if (list_empty(&listeners->list)) return; rc = prepare_reply(NULL, TASKSTATS_CMD_NEW, &rep_skb, size); if (rc < 0) return; stats = mk_reply(rep_skb, TASKSTATS_TYPE_PID, tsk->pid); if (!stats) goto err; fill_stats(tsk, stats); /* * Doesn't matter if tsk is the leader or the last group member leaving */ if (!is_thread_group || !group_dead) goto send; stats = mk_reply(rep_skb, TASKSTATS_TYPE_TGID, tsk->tgid); if (!stats) goto err; memcpy(stats, tsk->signal->stats, sizeof(*stats)); send: send_cpu_listeners(rep_skb, listeners); return; err: nlmsg_free(rep_skb); }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,529
void __init taskstats_init_early(void) { unsigned int i; taskstats_cache = KMEM_CACHE(taskstats, SLAB_PANIC); for_each_possible_cpu(i) { INIT_LIST_HEAD(&(per_cpu(listener_array, i).list)); init_rwsem(&(per_cpu(listener_array, i).sem)); } }
+Info
0
void __init taskstats_init_early(void) { unsigned int i; taskstats_cache = KMEM_CACHE(taskstats, SLAB_PANIC); for_each_possible_cpu(i) { INIT_LIST_HEAD(&(per_cpu(listener_array, i).list)); init_rwsem(&(per_cpu(listener_array, i).sem)); } }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,530
static size_t taskstats_packet_size(void) { size_t size; size = nla_total_size(sizeof(u32)) + nla_total_size(sizeof(struct taskstats)) + nla_total_size(0); #ifdef TASKSTATS_NEEDS_PADDING size += nla_total_size(0); /* Padding for alignment */ #endif return size; }
+Info
0
static size_t taskstats_packet_size(void) { size_t size; size = nla_total_size(sizeof(u32)) + nla_total_size(sizeof(struct taskstats)) + nla_total_size(0); #ifdef TASKSTATS_NEEDS_PADDING size += nla_total_size(0); /* Padding for alignment */ #endif return size; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,531
static struct taskstats *taskstats_tgid_alloc(struct task_struct *tsk) { struct signal_struct *sig = tsk->signal; struct taskstats *stats; if (sig->stats || thread_group_empty(tsk)) goto ret; /* No problem if kmem_cache_zalloc() fails */ stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); spin_lock_irq(&tsk->sighand->siglock); if (!sig->stats) { sig->stats = stats; stats = NULL; } spin_unlock_irq(&tsk->sighand->siglock); if (stats) kmem_cache_free(taskstats_cache, stats); ret: return sig->stats; }
+Info
0
static struct taskstats *taskstats_tgid_alloc(struct task_struct *tsk) { struct signal_struct *sig = tsk->signal; struct taskstats *stats; if (sig->stats || thread_group_empty(tsk)) goto ret; /* No problem if kmem_cache_zalloc() fails */ stats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL); spin_lock_irq(&tsk->sighand->siglock); if (!sig->stats) { sig->stats = stats; stats = NULL; } spin_unlock_irq(&tsk->sighand->siglock); if (stats) kmem_cache_free(taskstats_cache, stats); ret: return sig->stats; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,532
static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK]) return cmd_attr_register_cpumask(info); else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK]) return cmd_attr_deregister_cpumask(info); else if (info->attrs[TASKSTATS_CMD_ATTR_PID]) return cmd_attr_pid(info); else if (info->attrs[TASKSTATS_CMD_ATTR_TGID]) return cmd_attr_tgid(info); else return -EINVAL; }
+Info
0
static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info) { if (info->attrs[TASKSTATS_CMD_ATTR_REGISTER_CPUMASK]) return cmd_attr_register_cpumask(info); else if (info->attrs[TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK]) return cmd_attr_deregister_cpumask(info); else if (info->attrs[TASKSTATS_CMD_ATTR_PID]) return cmd_attr_pid(info); else if (info->attrs[TASKSTATS_CMD_ATTR_TGID]) return cmd_attr_tgid(info); else return -EINVAL; }
@@ -655,6 +655,7 @@ static struct genl_ops taskstats_ops = { .cmd = TASKSTATS_CMD_GET, .doit = taskstats_user_cmd, .policy = taskstats_cmd_get_policy, + .flags = GENL_ADMIN_PERM, }; static struct genl_ops cgroupstats_ops = {
CWE-200
null
null
21,533
__releases(bitlock) __acquires(bitlock) { struct va_format vaf; va_list args; struct ext4_super_block *es = EXT4_SB(sb)->s_es; es->s_last_error_ino = cpu_to_le32(ino); es->s_last_error_block = cpu_to_le64(block); __save_error_info(sb, function, line); va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: group %u, ", sb->s_id, function, line, grp); if (ino) printk(KERN_CONT "inode %lu: ", ino); if (block) printk(KERN_CONT "block %llu:", (unsigned long long) block); printk(KERN_CONT "%pV\n", &vaf); va_end(args); if (test_opt(sb, ERRORS_CONT)) { ext4_commit_super(sb, 0); return; } ext4_unlock_group(sb, grp); ext4_handle_error(sb); /* * We only get here in the ERRORS_RO case; relocking the group * may be dangerous, but nothing bad will happen since the * filesystem will have already been marked read/only and the * journal has been aborted. We return 1 as a hint to callers * who might what to use the return value from * ext4_grp_locked_error() to distinguish beween the * ERRORS_CONT and ERRORS_RO case, and perhaps return more * aggressively from the ext4 function in question, with a * more appropriate error code. */ ext4_lock_group(sb, grp); return; }
DoS
0
__releases(bitlock) __acquires(bitlock) { struct va_format vaf; va_list args; struct ext4_super_block *es = EXT4_SB(sb)->s_es; es->s_last_error_ino = cpu_to_le32(ino); es->s_last_error_block = cpu_to_le64(block); __save_error_info(sb, function, line); va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args; printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: group %u, ", sb->s_id, function, line, grp); if (ino) printk(KERN_CONT "inode %lu: ", ino); if (block) printk(KERN_CONT "block %llu:", (unsigned long long) block); printk(KERN_CONT "%pV\n", &vaf); va_end(args); if (test_opt(sb, ERRORS_CONT)) { ext4_commit_super(sb, 0); return; } ext4_unlock_group(sb, grp); ext4_handle_error(sb); /* * We only get here in the ERRORS_RO case; relocking the group * may be dangerous, but nothing bad will happen since the * filesystem will have already been marked read/only and the * journal has been aborted. We return 1 as a hint to callers * who might what to use the return value from * ext4_grp_locked_error() to distinguish beween the * ERRORS_CONT and ERRORS_RO case, and perhaps return more * aggressively from the ext4 function in question, with a * more appropriate error code. */ ext4_lock_group(sb, grp); return; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,534
static ssize_t delayed_allocation_blocks_show(struct ext4_attr *a, struct ext4_sb_info *sbi, char *buf) { return snprintf(buf, PAGE_SIZE, "%llu\n", (s64) percpu_counter_sum(&sbi->s_dirtyblocks_counter)); }
DoS
0
static ssize_t delayed_allocation_blocks_show(struct ext4_attr *a, struct ext4_sb_info *sbi, char *buf) { return snprintf(buf, PAGE_SIZE, "%llu\n", (s64) percpu_counter_sum(&sbi->s_dirtyblocks_counter)); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,535
static int ext4_check_descriptors(struct super_block *sb, ext4_group_t *first_not_zeroed) { struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); ext4_fsblk_t last_block; ext4_fsblk_t block_bitmap; ext4_fsblk_t inode_bitmap; ext4_fsblk_t inode_table; int flexbg_flag = 0; ext4_group_t i, grp = sbi->s_groups_count; if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) flexbg_flag = 1; ext4_debug("Checking group descriptors"); for (i = 0; i < sbi->s_groups_count; i++) { struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL); if (i == sbi->s_groups_count - 1 || flexbg_flag) last_block = ext4_blocks_count(sbi->s_es) - 1; else last_block = first_block + (EXT4_BLOCKS_PER_GROUP(sb) - 1); if ((grp == sbi->s_groups_count) && !(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))) grp = i; block_bitmap = ext4_block_bitmap(sb, gdp); if (block_bitmap < first_block || block_bitmap > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Block bitmap for group %u not in group " "(block %llu)!", i, block_bitmap); return 0; } inode_bitmap = ext4_inode_bitmap(sb, gdp); if (inode_bitmap < first_block || inode_bitmap > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Inode bitmap for group %u not in group " "(block %llu)!", i, inode_bitmap); return 0; } inode_table = ext4_inode_table(sb, gdp); if (inode_table < first_block || inode_table + sbi->s_itb_per_group - 1 > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Inode table for group %u not in group " "(block %llu)!", i, inode_table); return 0; } ext4_lock_group(sb, i); if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Checksum for group %u failed (%u!=%u)", i, le16_to_cpu(ext4_group_desc_csum(sbi, i, gdp)), le16_to_cpu(gdp->bg_checksum)); if (!(sb->s_flags & MS_RDONLY)) { ext4_unlock_group(sb, i); return 0; } } ext4_unlock_group(sb, i); if (!flexbg_flag) first_block += EXT4_BLOCKS_PER_GROUP(sb); } if (NULL != first_not_zeroed) *first_not_zeroed = grp; ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb)); return 1; }
DoS
0
static int ext4_check_descriptors(struct super_block *sb, ext4_group_t *first_not_zeroed) { struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t first_block = le32_to_cpu(sbi->s_es->s_first_data_block); ext4_fsblk_t last_block; ext4_fsblk_t block_bitmap; ext4_fsblk_t inode_bitmap; ext4_fsblk_t inode_table; int flexbg_flag = 0; ext4_group_t i, grp = sbi->s_groups_count; if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) flexbg_flag = 1; ext4_debug("Checking group descriptors"); for (i = 0; i < sbi->s_groups_count; i++) { struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL); if (i == sbi->s_groups_count - 1 || flexbg_flag) last_block = ext4_blocks_count(sbi->s_es) - 1; else last_block = first_block + (EXT4_BLOCKS_PER_GROUP(sb) - 1); if ((grp == sbi->s_groups_count) && !(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))) grp = i; block_bitmap = ext4_block_bitmap(sb, gdp); if (block_bitmap < first_block || block_bitmap > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Block bitmap for group %u not in group " "(block %llu)!", i, block_bitmap); return 0; } inode_bitmap = ext4_inode_bitmap(sb, gdp); if (inode_bitmap < first_block || inode_bitmap > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Inode bitmap for group %u not in group " "(block %llu)!", i, inode_bitmap); return 0; } inode_table = ext4_inode_table(sb, gdp); if (inode_table < first_block || inode_table + sbi->s_itb_per_group - 1 > last_block) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Inode table for group %u not in group " "(block %llu)!", i, inode_table); return 0; } ext4_lock_group(sb, i); if (!ext4_group_desc_csum_verify(sbi, i, gdp)) { ext4_msg(sb, KERN_ERR, "ext4_check_descriptors: " "Checksum for group %u failed (%u!=%u)", i, le16_to_cpu(ext4_group_desc_csum(sbi, i, gdp)), le16_to_cpu(gdp->bg_checksum)); if (!(sb->s_flags & MS_RDONLY)) { ext4_unlock_group(sb, i); return 0; } } ext4_unlock_group(sb, i); if (!flexbg_flag) first_block += EXT4_BLOCKS_PER_GROUP(sb); } if (NULL != first_not_zeroed) *first_not_zeroed = grp; ext4_free_blocks_count_set(sbi->s_es, ext4_count_free_blocks(sb)); sbi->s_es->s_free_inodes_count =cpu_to_le32(ext4_count_free_inodes(sb)); return 1; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,536
static void ext4_destroy_inode(struct inode *inode) { ext4_ioend_wait(inode); if (!list_empty(&(EXT4_I(inode)->i_orphan))) { ext4_msg(inode->i_sb, KERN_ERR, "Inode %lu (%p): orphan list check failed!", inode->i_ino, EXT4_I(inode)); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 16, 4, EXT4_I(inode), sizeof(struct ext4_inode_info), true); dump_stack(); } call_rcu(&inode->i_rcu, ext4_i_callback); }
DoS
0
static void ext4_destroy_inode(struct inode *inode) { ext4_ioend_wait(inode); if (!list_empty(&(EXT4_I(inode)->i_orphan))) { ext4_msg(inode->i_sb, KERN_ERR, "Inode %lu (%p): orphan list check failed!", inode->i_ino, EXT4_I(inode)); print_hex_dump(KERN_INFO, "", DUMP_PREFIX_ADDRESS, 16, 4, EXT4_I(inode), sizeof(struct ext4_inode_info), true); dump_stack(); } call_rcu(&inode->i_rcu, ext4_i_callback); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,537
static int ext4_feature_set_ok(struct super_block *sb, int readonly) { if (EXT4_HAS_INCOMPAT_FEATURE(sb, ~EXT4_FEATURE_INCOMPAT_SUPP)) { ext4_msg(sb, KERN_ERR, "Couldn't mount because of " "unsupported optional features (%x)", (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_incompat) & ~EXT4_FEATURE_INCOMPAT_SUPP)); return 0; } if (readonly) return 1; /* Check that feature set is OK for a read-write mount */ if (EXT4_HAS_RO_COMPAT_FEATURE(sb, ~EXT4_FEATURE_RO_COMPAT_SUPP)) { ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of " "unsupported optional features (%x)", (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_ro_compat) & ~EXT4_FEATURE_RO_COMPAT_SUPP)); return 0; } /* * Large file size enabled file system can only be mounted * read-write on 32-bit systems if kernel is built with CONFIG_LBDAF */ if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_HUGE_FILE)) { if (sizeof(blkcnt_t) < sizeof(u64)) { ext4_msg(sb, KERN_ERR, "Filesystem with huge files " "cannot be mounted RDWR without " "CONFIG_LBDAF"); return 0; } } return 1; }
DoS
0
static int ext4_feature_set_ok(struct super_block *sb, int readonly) { if (EXT4_HAS_INCOMPAT_FEATURE(sb, ~EXT4_FEATURE_INCOMPAT_SUPP)) { ext4_msg(sb, KERN_ERR, "Couldn't mount because of " "unsupported optional features (%x)", (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_incompat) & ~EXT4_FEATURE_INCOMPAT_SUPP)); return 0; } if (readonly) return 1; /* Check that feature set is OK for a read-write mount */ if (EXT4_HAS_RO_COMPAT_FEATURE(sb, ~EXT4_FEATURE_RO_COMPAT_SUPP)) { ext4_msg(sb, KERN_ERR, "couldn't mount RDWR because of " "unsupported optional features (%x)", (le32_to_cpu(EXT4_SB(sb)->s_es->s_feature_ro_compat) & ~EXT4_FEATURE_RO_COMPAT_SUPP)); return 0; } /* * Large file size enabled file system can only be mounted * read-write on 32-bit systems if kernel is built with CONFIG_LBDAF */ if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_HUGE_FILE)) { if (sizeof(blkcnt_t) < sizeof(u64)) { ext4_msg(sb, KERN_ERR, "Filesystem with huge files " "cannot be mounted RDWR without " "CONFIG_LBDAF"); return 0; } } return 1; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,538
static int ext4_fill_flex_info(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_group_desc *gdp = NULL; ext4_group_t flex_group_count; ext4_group_t flex_group; int groups_per_flex = 0; size_t size; int i; sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex; groups_per_flex = 1 << sbi->s_log_groups_per_flex; if (groups_per_flex < 2) { sbi->s_log_groups_per_flex = 0; return 1; } /* We allocate both existing and potentially added groups */ flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) + ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) << EXT4_DESC_PER_BLOCK_BITS(sb))) / groups_per_flex; size = flex_group_count * sizeof(struct flex_groups); sbi->s_flex_groups = kzalloc(size, GFP_KERNEL); if (sbi->s_flex_groups == NULL) { sbi->s_flex_groups = vzalloc(size); if (sbi->s_flex_groups == NULL) { ext4_msg(sb, KERN_ERR, "not enough memory for %u flex groups", flex_group_count); goto failed; } } for (i = 0; i < sbi->s_groups_count; i++) { gdp = ext4_get_group_desc(sb, i, NULL); flex_group = ext4_flex_group(sbi, i); atomic_add(ext4_free_inodes_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_inodes); atomic_add(ext4_free_blks_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_blocks); atomic_add(ext4_used_dirs_count(sb, gdp), &sbi->s_flex_groups[flex_group].used_dirs); } return 1; failed: return 0; }
DoS
0
static int ext4_fill_flex_info(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_group_desc *gdp = NULL; ext4_group_t flex_group_count; ext4_group_t flex_group; int groups_per_flex = 0; size_t size; int i; sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex; groups_per_flex = 1 << sbi->s_log_groups_per_flex; if (groups_per_flex < 2) { sbi->s_log_groups_per_flex = 0; return 1; } /* We allocate both existing and potentially added groups */ flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) + ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) << EXT4_DESC_PER_BLOCK_BITS(sb))) / groups_per_flex; size = flex_group_count * sizeof(struct flex_groups); sbi->s_flex_groups = kzalloc(size, GFP_KERNEL); if (sbi->s_flex_groups == NULL) { sbi->s_flex_groups = vzalloc(size); if (sbi->s_flex_groups == NULL) { ext4_msg(sb, KERN_ERR, "not enough memory for %u flex groups", flex_group_count); goto failed; } } for (i = 0; i < sbi->s_groups_count; i++) { gdp = ext4_get_group_desc(sb, i, NULL); flex_group = ext4_flex_group(sbi, i); atomic_add(ext4_free_inodes_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_inodes); atomic_add(ext4_free_blks_count(sb, gdp), &sbi->s_flex_groups[flex_group].free_blocks); atomic_add(ext4_used_dirs_count(sb, gdp), &sbi->s_flex_groups[flex_group].used_dirs); } return 1; failed: return 0; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,539
__u32 ext4_free_blks_count(struct super_block *sb, struct ext4_group_desc *bg) { return le16_to_cpu(bg->bg_free_blocks_count_lo) | (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? (__u32)le16_to_cpu(bg->bg_free_blocks_count_hi) << 16 : 0); }
DoS
0
__u32 ext4_free_blks_count(struct super_block *sb, struct ext4_group_desc *bg) { return le16_to_cpu(bg->bg_free_blocks_count_lo) | (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT ? (__u32)le16_to_cpu(bg->bg_free_blocks_count_hi) << 16 : 0); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,540
void ext4_free_blks_set(struct super_block *sb, struct ext4_group_desc *bg, __u32 count) { bg->bg_free_blocks_count_lo = cpu_to_le16((__u16)count); if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) bg->bg_free_blocks_count_hi = cpu_to_le16(count >> 16); }
DoS
0
void ext4_free_blks_set(struct super_block *sb, struct ext4_group_desc *bg, __u32 count) { bg->bg_free_blocks_count_lo = cpu_to_le16((__u16)count); if (EXT4_DESC_SIZE(sb) >= EXT4_MIN_DESC_SIZE_64BIT) bg->bg_free_blocks_count_hi = cpu_to_le16(count >> 16); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,541
static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi) { unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride); unsigned long stripe_width = le32_to_cpu(sbi->s_es->s_raid_stripe_width); if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) return sbi->s_stripe; if (stripe_width <= sbi->s_blocks_per_group) return stripe_width; if (stride <= sbi->s_blocks_per_group) return stride; return 0; }
DoS
0
static unsigned long ext4_get_stripe_size(struct ext4_sb_info *sbi) { unsigned long stride = le16_to_cpu(sbi->s_es->s_raid_stride); unsigned long stripe_width = le32_to_cpu(sbi->s_es->s_raid_stripe_width); if (sbi->s_stripe && sbi->s_stripe <= sbi->s_blocks_per_group) return sbi->s_stripe; if (stripe_width <= sbi->s_blocks_per_group) return stripe_width; if (stride <= sbi->s_blocks_per_group) return stride; return 0; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,542
static int __init ext4_init_fs(void) { int i, err; ext4_check_flag_values(); for (i = 0; i < EXT4_WQ_HASH_SZ; i++) { mutex_init(&ext4__aio_mutex[i]); init_waitqueue_head(&ext4__ioend_wq[i]); } err = ext4_init_pageio(); if (err) return err; err = ext4_init_system_zone(); if (err) goto out7; ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj); if (!ext4_kset) goto out6; ext4_proc_root = proc_mkdir("fs/ext4", NULL); if (!ext4_proc_root) goto out5; err = ext4_init_feat_adverts(); if (err) goto out4; err = ext4_init_mballoc(); if (err) goto out3; err = ext4_init_xattr(); if (err) goto out2; err = init_inodecache(); if (err) goto out1; register_as_ext2(); register_as_ext3(); err = register_filesystem(&ext4_fs_type); if (err) goto out; ext4_li_info = NULL; mutex_init(&ext4_li_mtx); return 0; out: unregister_as_ext2(); unregister_as_ext3(); destroy_inodecache(); out1: ext4_exit_xattr(); out2: ext4_exit_mballoc(); out3: ext4_exit_feat_adverts(); out4: remove_proc_entry("fs/ext4", NULL); out5: kset_unregister(ext4_kset); out6: ext4_exit_system_zone(); out7: ext4_exit_pageio(); return err; }
DoS
0
static int __init ext4_init_fs(void) { int i, err; ext4_check_flag_values(); for (i = 0; i < EXT4_WQ_HASH_SZ; i++) { mutex_init(&ext4__aio_mutex[i]); init_waitqueue_head(&ext4__ioend_wq[i]); } err = ext4_init_pageio(); if (err) return err; err = ext4_init_system_zone(); if (err) goto out7; ext4_kset = kset_create_and_add("ext4", NULL, fs_kobj); if (!ext4_kset) goto out6; ext4_proc_root = proc_mkdir("fs/ext4", NULL); if (!ext4_proc_root) goto out5; err = ext4_init_feat_adverts(); if (err) goto out4; err = ext4_init_mballoc(); if (err) goto out3; err = ext4_init_xattr(); if (err) goto out2; err = init_inodecache(); if (err) goto out1; register_as_ext2(); register_as_ext3(); err = register_filesystem(&ext4_fs_type); if (err) goto out; ext4_li_info = NULL; mutex_init(&ext4_li_mtx); return 0; out: unregister_as_ext2(); unregister_as_ext3(); destroy_inodecache(); out1: ext4_exit_xattr(); out2: ext4_exit_mballoc(); out3: ext4_exit_feat_adverts(); out4: remove_proc_entry("fs/ext4", NULL); out5: kset_unregister(ext4_kset); out6: ext4_exit_system_zone(); out7: ext4_exit_pageio(); return err; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,543
handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) { journal_t *journal; if (sb->s_flags & MS_RDONLY) return ERR_PTR(-EROFS); vfs_check_frozen(sb, SB_FREEZE_TRANS); /* Special case here: if the journal has aborted behind our * backs (eg. EIO in the commit thread), then we still need to * take the FS itself readonly cleanly. */ journal = EXT4_SB(sb)->s_journal; if (journal) { if (is_journal_aborted(journal)) { ext4_abort(sb, "Detected aborted journal"); return ERR_PTR(-EROFS); } return jbd2_journal_start(journal, nblocks); } return ext4_get_nojournal(); }
DoS
0
handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) { journal_t *journal; if (sb->s_flags & MS_RDONLY) return ERR_PTR(-EROFS); vfs_check_frozen(sb, SB_FREEZE_TRANS); /* Special case here: if the journal has aborted behind our * backs (eg. EIO in the commit thread), then we still need to * take the FS itself readonly cleanly. */ journal = EXT4_SB(sb)->s_journal; if (journal) { if (is_journal_aborted(journal)) { ext4_abort(sb, "Detected aborted journal"); return ERR_PTR(-EROFS); } return jbd2_journal_start(journal, nblocks); } return ext4_get_nojournal(); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,544
static void ext4_lazyinode_timeout(unsigned long data) { struct task_struct *p = (struct task_struct *)data; wake_up_process(p); }
DoS
0
static void ext4_lazyinode_timeout(unsigned long data) { struct task_struct *p = (struct task_struct *)data; wake_up_process(p); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,545
static loff_t ext4_max_size(int blkbits, int has_huge_files) { loff_t res; loff_t upper_limit = MAX_LFS_FILESIZE; /* small i_blocks in vfs inode? */ if (!has_huge_files || sizeof(blkcnt_t) < sizeof(u64)) { /* * CONFIG_LBDAF is not enabled implies the inode * i_block represent total blocks in 512 bytes * 32 == size of vfs inode i_blocks * 8 */ upper_limit = (1LL << 32) - 1; /* total blocks in file system block size */ upper_limit >>= (blkbits - 9); upper_limit <<= blkbits; } /* 32-bit extent-start container, ee_block */ res = 1LL << 32; res <<= blkbits; res -= 1; /* Sanity check against vm- & vfs- imposed limits */ if (res > upper_limit) res = upper_limit; return res; }
DoS
0
static loff_t ext4_max_size(int blkbits, int has_huge_files) { loff_t res; loff_t upper_limit = MAX_LFS_FILESIZE; /* small i_blocks in vfs inode? */ if (!has_huge_files || sizeof(blkcnt_t) < sizeof(u64)) { /* * CONFIG_LBDAF is not enabled implies the inode * i_block represent total blocks in 512 bytes * 32 == size of vfs inode i_blocks * 8 */ upper_limit = (1LL << 32) - 1; /* total blocks in file system block size */ upper_limit >>= (blkbits - 9); upper_limit <<= blkbits; } /* 32-bit extent-start container, ee_block */ res = 1LL << 32; res <<= blkbits; res -= 1; /* Sanity check against vm- & vfs- imposed limits */ if (res > upper_limit) res = upper_limit; return res; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,546
static void ext4_put_super(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; int i, err; ext4_unregister_li_request(sb); dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); flush_workqueue(sbi->dio_unwritten_wq); destroy_workqueue(sbi->dio_unwritten_wq); lock_super(sb); if (sb->s_dirt) ext4_commit_super(sb, 1); if (sbi->s_journal) { err = jbd2_journal_destroy(sbi->s_journal); sbi->s_journal = NULL; if (err < 0) ext4_abort(sb, "Couldn't clean up the journal"); } del_timer(&sbi->s_err_report); ext4_release_system_zone(sb); ext4_mb_release(sb); ext4_ext_release(sb); ext4_xattr_put_super(sb); if (!(sb->s_flags & MS_RDONLY)) { EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); es->s_state = cpu_to_le16(sbi->s_mount_state); ext4_commit_super(sb, 1); } if (sbi->s_proc) { remove_proc_entry(sb->s_id, ext4_proc_root); } kobject_del(&sbi->s_kobj); for (i = 0; i < sbi->s_gdb_count; i++) brelse(sbi->s_group_desc[i]); kfree(sbi->s_group_desc); if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups); else kfree(sbi->s_flex_groups); percpu_counter_destroy(&sbi->s_freeblocks_counter); percpu_counter_destroy(&sbi->s_freeinodes_counter); percpu_counter_destroy(&sbi->s_dirs_counter); percpu_counter_destroy(&sbi->s_dirtyblocks_counter); brelse(sbi->s_sbh); #ifdef CONFIG_QUOTA for (i = 0; i < MAXQUOTAS; i++) kfree(sbi->s_qf_names[i]); #endif /* Debugging code just in case the in-memory inode orphan list * isn't empty. The on-disk one can be non-empty if we've * detected an error and taken the fs readonly, but the * in-memory list had better be clean by this point. */ if (!list_empty(&sbi->s_orphan)) dump_orphan_list(sb, sbi); J_ASSERT(list_empty(&sbi->s_orphan)); invalidate_bdev(sb->s_bdev); if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { /* * Invalidate the journal device's buffers. We don't want them * floating about in memory - the physical journal device may * hotswapped, and it breaks the `ro-after' testing code. */ sync_blockdev(sbi->journal_bdev); invalidate_bdev(sbi->journal_bdev); ext4_blkdev_remove(sbi); } sb->s_fs_info = NULL; /* * Now that we are completely done shutting down the * superblock, we need to actually destroy the kobject. */ unlock_super(sb); kobject_put(&sbi->s_kobj); wait_for_completion(&sbi->s_kobj_unregister); kfree(sbi->s_blockgroup_lock); kfree(sbi); }
DoS
0
static void ext4_put_super(struct super_block *sb) { struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; int i, err; ext4_unregister_li_request(sb); dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED); flush_workqueue(sbi->dio_unwritten_wq); destroy_workqueue(sbi->dio_unwritten_wq); lock_super(sb); if (sb->s_dirt) ext4_commit_super(sb, 1); if (sbi->s_journal) { err = jbd2_journal_destroy(sbi->s_journal); sbi->s_journal = NULL; if (err < 0) ext4_abort(sb, "Couldn't clean up the journal"); } del_timer(&sbi->s_err_report); ext4_release_system_zone(sb); ext4_mb_release(sb); ext4_ext_release(sb); ext4_xattr_put_super(sb); if (!(sb->s_flags & MS_RDONLY)) { EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); es->s_state = cpu_to_le16(sbi->s_mount_state); ext4_commit_super(sb, 1); } if (sbi->s_proc) { remove_proc_entry(sb->s_id, ext4_proc_root); } kobject_del(&sbi->s_kobj); for (i = 0; i < sbi->s_gdb_count; i++) brelse(sbi->s_group_desc[i]); kfree(sbi->s_group_desc); if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups); else kfree(sbi->s_flex_groups); percpu_counter_destroy(&sbi->s_freeblocks_counter); percpu_counter_destroy(&sbi->s_freeinodes_counter); percpu_counter_destroy(&sbi->s_dirs_counter); percpu_counter_destroy(&sbi->s_dirtyblocks_counter); brelse(sbi->s_sbh); #ifdef CONFIG_QUOTA for (i = 0; i < MAXQUOTAS; i++) kfree(sbi->s_qf_names[i]); #endif /* Debugging code just in case the in-memory inode orphan list * isn't empty. The on-disk one can be non-empty if we've * detected an error and taken the fs readonly, but the * in-memory list had better be clean by this point. */ if (!list_empty(&sbi->s_orphan)) dump_orphan_list(sb, sbi); J_ASSERT(list_empty(&sbi->s_orphan)); invalidate_bdev(sb->s_bdev); if (sbi->journal_bdev && sbi->journal_bdev != sb->s_bdev) { /* * Invalidate the journal device's buffers. We don't want them * floating about in memory - the physical journal device may * hotswapped, and it breaks the `ro-after' testing code. */ sync_blockdev(sbi->journal_bdev); invalidate_bdev(sbi->journal_bdev); ext4_blkdev_remove(sbi); } sb->s_fs_info = NULL; /* * Now that we are completely done shutting down the * superblock, we need to actually destroy the kobject. */ unlock_super(sb); kobject_put(&sbi->s_kobj); wait_for_completion(&sbi->s_kobj_unregister); kfree(sbi->s_blockgroup_lock); kfree(sbi); }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,547
static int ext4_remount(struct super_block *sb, int *flags, char *data) { struct ext4_super_block *es; struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t n_blocks_count = 0; unsigned long old_sb_flags; struct ext4_mount_options old_opts; int enable_quota = 0; ext4_group_t g; unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; int err; #ifdef CONFIG_QUOTA int i; #endif char *orig_data = kstrdup(data, GFP_KERNEL); /* Store the original options */ lock_super(sb); old_sb_flags = sb->s_flags; old_opts.s_mount_opt = sbi->s_mount_opt; old_opts.s_mount_opt2 = sbi->s_mount_opt2; old_opts.s_resuid = sbi->s_resuid; old_opts.s_resgid = sbi->s_resgid; old_opts.s_commit_interval = sbi->s_commit_interval; old_opts.s_min_batch_time = sbi->s_min_batch_time; old_opts.s_max_batch_time = sbi->s_max_batch_time; #ifdef CONFIG_QUOTA old_opts.s_jquota_fmt = sbi->s_jquota_fmt; for (i = 0; i < MAXQUOTAS; i++) old_opts.s_qf_names[i] = sbi->s_qf_names[i]; #endif if (sbi->s_journal && sbi->s_journal->j_task->io_context) journal_ioprio = sbi->s_journal->j_task->io_context->ioprio; /* * Allow the "check" option to be passed as a remount option. */ if (!parse_options(data, sb, NULL, &journal_ioprio, &n_blocks_count, 1)) { err = -EINVAL; goto restore_opts; } if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) ext4_abort(sb, "Abort forced by user"); sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); es = sbi->s_es; if (sbi->s_journal) { ext4_init_journal_params(sb, sbi->s_journal); set_task_ioprio(sbi->s_journal->j_task, journal_ioprio); } if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY) || n_blocks_count > ext4_blocks_count(es)) { if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) { err = -EROFS; goto restore_opts; } if (*flags & MS_RDONLY) { err = dquot_suspend(sb, -1); if (err < 0) goto restore_opts; /* * First of all, the unconditional stuff we have to do * to disable replay of the journal when we next remount */ sb->s_flags |= MS_RDONLY; /* * OK, test if we are remounting a valid rw partition * readonly, and if so set the rdonly flag and then * mark the partition as valid again. */ if (!(es->s_state & cpu_to_le16(EXT4_VALID_FS)) && (sbi->s_mount_state & EXT4_VALID_FS)) es->s_state = cpu_to_le16(sbi->s_mount_state); if (sbi->s_journal) ext4_mark_recovery_complete(sb, es); } else { /* Make sure we can mount this feature set readwrite */ if (!ext4_feature_set_ok(sb, 0)) { err = -EROFS; goto restore_opts; } /* * Make sure the group descriptor checksums * are sane. If they aren't, refuse to remount r/w. */ for (g = 0; g < sbi->s_groups_count; g++) { struct ext4_group_desc *gdp = ext4_get_group_desc(sb, g, NULL); if (!ext4_group_desc_csum_verify(sbi, g, gdp)) { ext4_msg(sb, KERN_ERR, "ext4_remount: Checksum for group %u failed (%u!=%u)", g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), le16_to_cpu(gdp->bg_checksum)); err = -EINVAL; goto restore_opts; } } /* * If we have an unprocessed orphan list hanging * around from a previously readonly bdev mount, * require a full umount/remount for now. */ if (es->s_last_orphan) { ext4_msg(sb, KERN_WARNING, "Couldn't " "remount RDWR because of unprocessed " "orphan inode list. Please " "umount/remount instead"); err = -EINVAL; goto restore_opts; } /* * Mounting a RDONLY partition read-write, so reread * and store the current valid flag. (It may have * been changed by e2fsck since we originally mounted * the partition.) */ if (sbi->s_journal) ext4_clear_journal_err(sb, es); sbi->s_mount_state = le16_to_cpu(es->s_state); if ((err = ext4_group_extend(sb, es, n_blocks_count))) goto restore_opts; if (!ext4_setup_super(sb, es, 0)) sb->s_flags &= ~MS_RDONLY; enable_quota = 1; } } /* * Reinitialize lazy itable initialization thread based on * current settings */ if ((sb->s_flags & MS_RDONLY) || !test_opt(sb, INIT_INODE_TABLE)) ext4_unregister_li_request(sb); else { ext4_group_t first_not_zeroed; first_not_zeroed = ext4_has_uninit_itable(sb); ext4_register_li_request(sb, first_not_zeroed); } ext4_setup_system_zone(sb); if (sbi->s_journal == NULL) ext4_commit_super(sb, 1); #ifdef CONFIG_QUOTA /* Release old quota file names */ for (i = 0; i < MAXQUOTAS; i++) if (old_opts.s_qf_names[i] && old_opts.s_qf_names[i] != sbi->s_qf_names[i]) kfree(old_opts.s_qf_names[i]); #endif unlock_super(sb); if (enable_quota) dquot_resume(sb, -1); ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data); kfree(orig_data); return 0; restore_opts: sb->s_flags = old_sb_flags; sbi->s_mount_opt = old_opts.s_mount_opt; sbi->s_mount_opt2 = old_opts.s_mount_opt2; sbi->s_resuid = old_opts.s_resuid; sbi->s_resgid = old_opts.s_resgid; sbi->s_commit_interval = old_opts.s_commit_interval; sbi->s_min_batch_time = old_opts.s_min_batch_time; sbi->s_max_batch_time = old_opts.s_max_batch_time; #ifdef CONFIG_QUOTA sbi->s_jquota_fmt = old_opts.s_jquota_fmt; for (i = 0; i < MAXQUOTAS; i++) { if (sbi->s_qf_names[i] && old_opts.s_qf_names[i] != sbi->s_qf_names[i]) kfree(sbi->s_qf_names[i]); sbi->s_qf_names[i] = old_opts.s_qf_names[i]; } #endif unlock_super(sb); kfree(orig_data); return err; }
DoS
0
static int ext4_remount(struct super_block *sb, int *flags, char *data) { struct ext4_super_block *es; struct ext4_sb_info *sbi = EXT4_SB(sb); ext4_fsblk_t n_blocks_count = 0; unsigned long old_sb_flags; struct ext4_mount_options old_opts; int enable_quota = 0; ext4_group_t g; unsigned int journal_ioprio = DEFAULT_JOURNAL_IOPRIO; int err; #ifdef CONFIG_QUOTA int i; #endif char *orig_data = kstrdup(data, GFP_KERNEL); /* Store the original options */ lock_super(sb); old_sb_flags = sb->s_flags; old_opts.s_mount_opt = sbi->s_mount_opt; old_opts.s_mount_opt2 = sbi->s_mount_opt2; old_opts.s_resuid = sbi->s_resuid; old_opts.s_resgid = sbi->s_resgid; old_opts.s_commit_interval = sbi->s_commit_interval; old_opts.s_min_batch_time = sbi->s_min_batch_time; old_opts.s_max_batch_time = sbi->s_max_batch_time; #ifdef CONFIG_QUOTA old_opts.s_jquota_fmt = sbi->s_jquota_fmt; for (i = 0; i < MAXQUOTAS; i++) old_opts.s_qf_names[i] = sbi->s_qf_names[i]; #endif if (sbi->s_journal && sbi->s_journal->j_task->io_context) journal_ioprio = sbi->s_journal->j_task->io_context->ioprio; /* * Allow the "check" option to be passed as a remount option. */ if (!parse_options(data, sb, NULL, &journal_ioprio, &n_blocks_count, 1)) { err = -EINVAL; goto restore_opts; } if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) ext4_abort(sb, "Abort forced by user"); sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); es = sbi->s_es; if (sbi->s_journal) { ext4_init_journal_params(sb, sbi->s_journal); set_task_ioprio(sbi->s_journal->j_task, journal_ioprio); } if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY) || n_blocks_count > ext4_blocks_count(es)) { if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) { err = -EROFS; goto restore_opts; } if (*flags & MS_RDONLY) { err = dquot_suspend(sb, -1); if (err < 0) goto restore_opts; /* * First of all, the unconditional stuff we have to do * to disable replay of the journal when we next remount */ sb->s_flags |= MS_RDONLY; /* * OK, test if we are remounting a valid rw partition * readonly, and if so set the rdonly flag and then * mark the partition as valid again. */ if (!(es->s_state & cpu_to_le16(EXT4_VALID_FS)) && (sbi->s_mount_state & EXT4_VALID_FS)) es->s_state = cpu_to_le16(sbi->s_mount_state); if (sbi->s_journal) ext4_mark_recovery_complete(sb, es); } else { /* Make sure we can mount this feature set readwrite */ if (!ext4_feature_set_ok(sb, 0)) { err = -EROFS; goto restore_opts; } /* * Make sure the group descriptor checksums * are sane. If they aren't, refuse to remount r/w. */ for (g = 0; g < sbi->s_groups_count; g++) { struct ext4_group_desc *gdp = ext4_get_group_desc(sb, g, NULL); if (!ext4_group_desc_csum_verify(sbi, g, gdp)) { ext4_msg(sb, KERN_ERR, "ext4_remount: Checksum for group %u failed (%u!=%u)", g, le16_to_cpu(ext4_group_desc_csum(sbi, g, gdp)), le16_to_cpu(gdp->bg_checksum)); err = -EINVAL; goto restore_opts; } } /* * If we have an unprocessed orphan list hanging * around from a previously readonly bdev mount, * require a full umount/remount for now. */ if (es->s_last_orphan) { ext4_msg(sb, KERN_WARNING, "Couldn't " "remount RDWR because of unprocessed " "orphan inode list. Please " "umount/remount instead"); err = -EINVAL; goto restore_opts; } /* * Mounting a RDONLY partition read-write, so reread * and store the current valid flag. (It may have * been changed by e2fsck since we originally mounted * the partition.) */ if (sbi->s_journal) ext4_clear_journal_err(sb, es); sbi->s_mount_state = le16_to_cpu(es->s_state); if ((err = ext4_group_extend(sb, es, n_blocks_count))) goto restore_opts; if (!ext4_setup_super(sb, es, 0)) sb->s_flags &= ~MS_RDONLY; enable_quota = 1; } } /* * Reinitialize lazy itable initialization thread based on * current settings */ if ((sb->s_flags & MS_RDONLY) || !test_opt(sb, INIT_INODE_TABLE)) ext4_unregister_li_request(sb); else { ext4_group_t first_not_zeroed; first_not_zeroed = ext4_has_uninit_itable(sb); ext4_register_li_request(sb, first_not_zeroed); } ext4_setup_system_zone(sb); if (sbi->s_journal == NULL) ext4_commit_super(sb, 1); #ifdef CONFIG_QUOTA /* Release old quota file names */ for (i = 0; i < MAXQUOTAS; i++) if (old_opts.s_qf_names[i] && old_opts.s_qf_names[i] != sbi->s_qf_names[i]) kfree(old_opts.s_qf_names[i]); #endif unlock_super(sb); if (enable_quota) dquot_resume(sb, -1); ext4_msg(sb, KERN_INFO, "re-mounted. Opts: %s", orig_data); kfree(orig_data); return 0; restore_opts: sb->s_flags = old_sb_flags; sbi->s_mount_opt = old_opts.s_mount_opt; sbi->s_mount_opt2 = old_opts.s_mount_opt2; sbi->s_resuid = old_opts.s_resuid; sbi->s_resgid = old_opts.s_resgid; sbi->s_commit_interval = old_opts.s_commit_interval; sbi->s_min_batch_time = old_opts.s_min_batch_time; sbi->s_max_batch_time = old_opts.s_max_batch_time; #ifdef CONFIG_QUOTA sbi->s_jquota_fmt = old_opts.s_jquota_fmt; for (i = 0; i < MAXQUOTAS; i++) { if (sbi->s_qf_names[i] && old_opts.s_qf_names[i] != sbi->s_qf_names[i]) kfree(sbi->s_qf_names[i]); sbi->s_qf_names[i] = old_opts.s_qf_names[i]; } #endif unlock_super(sb); kfree(orig_data); return err; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,548
static int ext4_run_lazyinit_thread(void) { ext4_lazyinit_task = kthread_run(ext4_lazyinit_thread, ext4_li_info, "ext4lazyinit"); if (IS_ERR(ext4_lazyinit_task)) { int err = PTR_ERR(ext4_lazyinit_task); ext4_clear_request_list(); del_timer_sync(&ext4_li_info->li_timer); kfree(ext4_li_info); ext4_li_info = NULL; printk(KERN_CRIT "EXT4: error %d creating inode table " "initialization thread\n", err); return err; } ext4_li_info->li_state |= EXT4_LAZYINIT_RUNNING; wait_event(ext4_li_info->li_wait_task, ext4_li_info->li_task != NULL); return 0; }
DoS
0
static int ext4_run_lazyinit_thread(void) { ext4_lazyinit_task = kthread_run(ext4_lazyinit_thread, ext4_li_info, "ext4lazyinit"); if (IS_ERR(ext4_lazyinit_task)) { int err = PTR_ERR(ext4_lazyinit_task); ext4_clear_request_list(); del_timer_sync(&ext4_li_info->li_timer); kfree(ext4_li_info); ext4_li_info = NULL; printk(KERN_CRIT "EXT4: error %d creating inode table " "initialization thread\n", err); return err; } ext4_li_info->li_state |= EXT4_LAZYINIT_RUNNING; wait_event(ext4_li_info->li_wait_task, ext4_li_info->li_task != NULL); return 0; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,549
static int ext4_run_li_request(struct ext4_li_request *elr) { struct ext4_group_desc *gdp = NULL; ext4_group_t group, ngroups; struct super_block *sb; unsigned long timeout = 0; int ret = 0; sb = elr->lr_super; ngroups = EXT4_SB(sb)->s_groups_count; for (group = elr->lr_next_group; group < ngroups; group++) { gdp = ext4_get_group_desc(sb, group, NULL); if (!gdp) { ret = 1; break; } if (!(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))) break; } if (group == ngroups) ret = 1; if (!ret) { timeout = jiffies; ret = ext4_init_inode_table(sb, group, elr->lr_timeout ? 0 : 1); if (elr->lr_timeout == 0) { timeout = jiffies - timeout; if (elr->lr_sbi->s_li_wait_mult) timeout *= elr->lr_sbi->s_li_wait_mult; else timeout *= 20; elr->lr_timeout = timeout; } elr->lr_next_sched = jiffies + elr->lr_timeout; elr->lr_next_group = group + 1; } return ret; }
DoS
0
static int ext4_run_li_request(struct ext4_li_request *elr) { struct ext4_group_desc *gdp = NULL; ext4_group_t group, ngroups; struct super_block *sb; unsigned long timeout = 0; int ret = 0; sb = elr->lr_super; ngroups = EXT4_SB(sb)->s_groups_count; for (group = elr->lr_next_group; group < ngroups; group++) { gdp = ext4_get_group_desc(sb, group, NULL); if (!gdp) { ret = 1; break; } if (!(gdp->bg_flags & cpu_to_le16(EXT4_BG_INODE_ZEROED))) break; } if (group == ngroups) ret = 1; if (!ret) { timeout = jiffies; ret = ext4_init_inode_table(sb, group, elr->lr_timeout ? 0 : 1); if (elr->lr_timeout == 0) { timeout = jiffies - timeout; if (elr->lr_sbi->s_li_wait_mult) timeout *= elr->lr_sbi->s_li_wait_mult; else timeout *= 20; elr->lr_timeout = timeout; } elr->lr_next_sched = jiffies + elr->lr_timeout; elr->lr_next_group = group + 1; } return ret; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,550
static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) { int def_errors; unsigned long def_mount_opts; struct super_block *sb = vfs->mnt_sb; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; def_mount_opts = le32_to_cpu(es->s_default_mount_opts); def_errors = le16_to_cpu(es->s_errors); if (sbi->s_sb_block != 1) seq_printf(seq, ",sb=%llu", sbi->s_sb_block); if (test_opt(sb, MINIX_DF)) seq_puts(seq, ",minixdf"); if (test_opt(sb, GRPID) && !(def_mount_opts & EXT4_DEFM_BSDGROUPS)) seq_puts(seq, ",grpid"); if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS)) seq_puts(seq, ",nogrpid"); if (sbi->s_resuid != EXT4_DEF_RESUID || le16_to_cpu(es->s_def_resuid) != EXT4_DEF_RESUID) { seq_printf(seq, ",resuid=%u", sbi->s_resuid); } if (sbi->s_resgid != EXT4_DEF_RESGID || le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) { seq_printf(seq, ",resgid=%u", sbi->s_resgid); } if (test_opt(sb, ERRORS_RO)) { if (def_errors == EXT4_ERRORS_PANIC || def_errors == EXT4_ERRORS_CONTINUE) { seq_puts(seq, ",errors=remount-ro"); } } if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE) seq_puts(seq, ",errors=continue"); if (test_opt(sb, ERRORS_PANIC) && def_errors != EXT4_ERRORS_PANIC) seq_puts(seq, ",errors=panic"); if (test_opt(sb, NO_UID32) && !(def_mount_opts & EXT4_DEFM_UID16)) seq_puts(seq, ",nouid32"); if (test_opt(sb, DEBUG) && !(def_mount_opts & EXT4_DEFM_DEBUG)) seq_puts(seq, ",debug"); if (test_opt(sb, OLDALLOC)) seq_puts(seq, ",oldalloc"); #ifdef CONFIG_EXT4_FS_XATTR if (test_opt(sb, XATTR_USER)) seq_puts(seq, ",user_xattr"); if (!test_opt(sb, XATTR_USER)) seq_puts(seq, ",nouser_xattr"); #endif #ifdef CONFIG_EXT4_FS_POSIX_ACL if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL)) seq_puts(seq, ",acl"); if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) seq_puts(seq, ",noacl"); #endif if (sbi->s_commit_interval != JBD2_DEFAULT_MAX_COMMIT_AGE*HZ) { seq_printf(seq, ",commit=%u", (unsigned) (sbi->s_commit_interval / HZ)); } if (sbi->s_min_batch_time != EXT4_DEF_MIN_BATCH_TIME) { seq_printf(seq, ",min_batch_time=%u", (unsigned) sbi->s_min_batch_time); } if (sbi->s_max_batch_time != EXT4_DEF_MAX_BATCH_TIME) { seq_printf(seq, ",max_batch_time=%u", (unsigned) sbi->s_min_batch_time); } /* * We're changing the default of barrier mount option, so * let's always display its mount state so it's clear what its * status is. */ seq_puts(seq, ",barrier="); seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0"); if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) seq_puts(seq, ",journal_async_commit"); else if (test_opt(sb, JOURNAL_CHECKSUM)) seq_puts(seq, ",journal_checksum"); if (test_opt(sb, I_VERSION)) seq_puts(seq, ",i_version"); if (!test_opt(sb, DELALLOC) && !(def_mount_opts & EXT4_DEFM_NODELALLOC)) seq_puts(seq, ",nodelalloc"); if (!test_opt(sb, MBLK_IO_SUBMIT)) seq_puts(seq, ",nomblk_io_submit"); if (sbi->s_stripe) seq_printf(seq, ",stripe=%lu", sbi->s_stripe); /* * journal mode get enabled in different ways * So just print the value even if we didn't specify it */ if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) seq_puts(seq, ",data=journal"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) seq_puts(seq, ",data=ordered"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) seq_puts(seq, ",data=writeback"); if (sbi->s_inode_readahead_blks != EXT4_DEF_INODE_READAHEAD_BLKS) seq_printf(seq, ",inode_readahead_blks=%u", sbi->s_inode_readahead_blks); if (test_opt(sb, DATA_ERR_ABORT)) seq_puts(seq, ",data_err=abort"); if (test_opt(sb, NO_AUTO_DA_ALLOC)) seq_puts(seq, ",noauto_da_alloc"); if (test_opt(sb, DISCARD) && !(def_mount_opts & EXT4_DEFM_DISCARD)) seq_puts(seq, ",discard"); if (test_opt(sb, NOLOAD)) seq_puts(seq, ",norecovery"); if (test_opt(sb, DIOREAD_NOLOCK)) seq_puts(seq, ",dioread_nolock"); if (test_opt(sb, BLOCK_VALIDITY) && !(def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY)) seq_puts(seq, ",block_validity"); if (!test_opt(sb, INIT_INODE_TABLE)) seq_puts(seq, ",noinit_inode_table"); else if (sbi->s_li_wait_mult) seq_printf(seq, ",init_inode_table=%u", (unsigned) sbi->s_li_wait_mult); ext4_show_quota_options(seq, sb); return 0; }
DoS
0
static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) { int def_errors; unsigned long def_mount_opts; struct super_block *sb = vfs->mnt_sb; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; def_mount_opts = le32_to_cpu(es->s_default_mount_opts); def_errors = le16_to_cpu(es->s_errors); if (sbi->s_sb_block != 1) seq_printf(seq, ",sb=%llu", sbi->s_sb_block); if (test_opt(sb, MINIX_DF)) seq_puts(seq, ",minixdf"); if (test_opt(sb, GRPID) && !(def_mount_opts & EXT4_DEFM_BSDGROUPS)) seq_puts(seq, ",grpid"); if (!test_opt(sb, GRPID) && (def_mount_opts & EXT4_DEFM_BSDGROUPS)) seq_puts(seq, ",nogrpid"); if (sbi->s_resuid != EXT4_DEF_RESUID || le16_to_cpu(es->s_def_resuid) != EXT4_DEF_RESUID) { seq_printf(seq, ",resuid=%u", sbi->s_resuid); } if (sbi->s_resgid != EXT4_DEF_RESGID || le16_to_cpu(es->s_def_resgid) != EXT4_DEF_RESGID) { seq_printf(seq, ",resgid=%u", sbi->s_resgid); } if (test_opt(sb, ERRORS_RO)) { if (def_errors == EXT4_ERRORS_PANIC || def_errors == EXT4_ERRORS_CONTINUE) { seq_puts(seq, ",errors=remount-ro"); } } if (test_opt(sb, ERRORS_CONT) && def_errors != EXT4_ERRORS_CONTINUE) seq_puts(seq, ",errors=continue"); if (test_opt(sb, ERRORS_PANIC) && def_errors != EXT4_ERRORS_PANIC) seq_puts(seq, ",errors=panic"); if (test_opt(sb, NO_UID32) && !(def_mount_opts & EXT4_DEFM_UID16)) seq_puts(seq, ",nouid32"); if (test_opt(sb, DEBUG) && !(def_mount_opts & EXT4_DEFM_DEBUG)) seq_puts(seq, ",debug"); if (test_opt(sb, OLDALLOC)) seq_puts(seq, ",oldalloc"); #ifdef CONFIG_EXT4_FS_XATTR if (test_opt(sb, XATTR_USER)) seq_puts(seq, ",user_xattr"); if (!test_opt(sb, XATTR_USER)) seq_puts(seq, ",nouser_xattr"); #endif #ifdef CONFIG_EXT4_FS_POSIX_ACL if (test_opt(sb, POSIX_ACL) && !(def_mount_opts & EXT4_DEFM_ACL)) seq_puts(seq, ",acl"); if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT4_DEFM_ACL)) seq_puts(seq, ",noacl"); #endif if (sbi->s_commit_interval != JBD2_DEFAULT_MAX_COMMIT_AGE*HZ) { seq_printf(seq, ",commit=%u", (unsigned) (sbi->s_commit_interval / HZ)); } if (sbi->s_min_batch_time != EXT4_DEF_MIN_BATCH_TIME) { seq_printf(seq, ",min_batch_time=%u", (unsigned) sbi->s_min_batch_time); } if (sbi->s_max_batch_time != EXT4_DEF_MAX_BATCH_TIME) { seq_printf(seq, ",max_batch_time=%u", (unsigned) sbi->s_min_batch_time); } /* * We're changing the default of barrier mount option, so * let's always display its mount state so it's clear what its * status is. */ seq_puts(seq, ",barrier="); seq_puts(seq, test_opt(sb, BARRIER) ? "1" : "0"); if (test_opt(sb, JOURNAL_ASYNC_COMMIT)) seq_puts(seq, ",journal_async_commit"); else if (test_opt(sb, JOURNAL_CHECKSUM)) seq_puts(seq, ",journal_checksum"); if (test_opt(sb, I_VERSION)) seq_puts(seq, ",i_version"); if (!test_opt(sb, DELALLOC) && !(def_mount_opts & EXT4_DEFM_NODELALLOC)) seq_puts(seq, ",nodelalloc"); if (!test_opt(sb, MBLK_IO_SUBMIT)) seq_puts(seq, ",nomblk_io_submit"); if (sbi->s_stripe) seq_printf(seq, ",stripe=%lu", sbi->s_stripe); /* * journal mode get enabled in different ways * So just print the value even if we didn't specify it */ if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) seq_puts(seq, ",data=journal"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA) seq_puts(seq, ",data=ordered"); else if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA) seq_puts(seq, ",data=writeback"); if (sbi->s_inode_readahead_blks != EXT4_DEF_INODE_READAHEAD_BLKS) seq_printf(seq, ",inode_readahead_blks=%u", sbi->s_inode_readahead_blks); if (test_opt(sb, DATA_ERR_ABORT)) seq_puts(seq, ",data_err=abort"); if (test_opt(sb, NO_AUTO_DA_ALLOC)) seq_puts(seq, ",noauto_da_alloc"); if (test_opt(sb, DISCARD) && !(def_mount_opts & EXT4_DEFM_DISCARD)) seq_puts(seq, ",discard"); if (test_opt(sb, NOLOAD)) seq_puts(seq, ",norecovery"); if (test_opt(sb, DIOREAD_NOLOCK)) seq_puts(seq, ",dioread_nolock"); if (test_opt(sb, BLOCK_VALIDITY) && !(def_mount_opts & EXT4_DEFM_BLOCK_VALIDITY)) seq_puts(seq, ",block_validity"); if (!test_opt(sb, INIT_INODE_TABLE)) seq_puts(seq, ",noinit_inode_table"); else if (sbi->s_li_wait_mult) seq_printf(seq, ",init_inode_table=%u", (unsigned) sbi->s_li_wait_mult); ext4_show_quota_options(seq, sb); return 0; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,551
static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) { struct super_block *sb = dentry->d_sb; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; u64 fsid; if (test_opt(sb, MINIX_DF)) { sbi->s_overhead_last = 0; } else if (sbi->s_blocks_last != ext4_blocks_count(es)) { ext4_group_t i, ngroups = ext4_get_groups_count(sb); ext4_fsblk_t overhead = 0; /* * Compute the overhead (FS structures). This is constant * for a given filesystem unless the number of block groups * changes so we cache the previous value until it does. */ /* * All of the blocks before first_data_block are * overhead */ overhead = le32_to_cpu(es->s_first_data_block); /* * Add the overhead attributed to the superblock and * block group descriptors. If the sparse superblocks * feature is turned on, then not all groups have this. */ for (i = 0; i < ngroups; i++) { overhead += ext4_bg_has_super(sb, i) + ext4_bg_num_gdb(sb, i); cond_resched(); } /* * Every block group has an inode bitmap, a block * bitmap, and an inode table. */ overhead += ngroups * (2 + sbi->s_itb_per_group); sbi->s_overhead_last = overhead; smp_wmb(); sbi->s_blocks_last = ext4_blocks_count(es); } buf->f_type = EXT4_SUPER_MAGIC; buf->f_bsize = sb->s_blocksize; buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last; buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter) - percpu_counter_sum_positive(&sbi->s_dirtyblocks_counter); buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es); if (buf->f_bfree < ext4_r_blocks_count(es)) buf->f_bavail = 0; buf->f_files = le32_to_cpu(es->s_inodes_count); buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter); buf->f_namelen = EXT4_NAME_LEN; fsid = le64_to_cpup((void *)es->s_uuid) ^ le64_to_cpup((void *)es->s_uuid + sizeof(u64)); buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL; buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL; return 0; }
DoS
0
static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) { struct super_block *sb = dentry->d_sb; struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_super_block *es = sbi->s_es; u64 fsid; if (test_opt(sb, MINIX_DF)) { sbi->s_overhead_last = 0; } else if (sbi->s_blocks_last != ext4_blocks_count(es)) { ext4_group_t i, ngroups = ext4_get_groups_count(sb); ext4_fsblk_t overhead = 0; /* * Compute the overhead (FS structures). This is constant * for a given filesystem unless the number of block groups * changes so we cache the previous value until it does. */ /* * All of the blocks before first_data_block are * overhead */ overhead = le32_to_cpu(es->s_first_data_block); /* * Add the overhead attributed to the superblock and * block group descriptors. If the sparse superblocks * feature is turned on, then not all groups have this. */ for (i = 0; i < ngroups; i++) { overhead += ext4_bg_has_super(sb, i) + ext4_bg_num_gdb(sb, i); cond_resched(); } /* * Every block group has an inode bitmap, a block * bitmap, and an inode table. */ overhead += ngroups * (2 + sbi->s_itb_per_group); sbi->s_overhead_last = overhead; smp_wmb(); sbi->s_blocks_last = ext4_blocks_count(es); } buf->f_type = EXT4_SUPER_MAGIC; buf->f_bsize = sb->s_blocksize; buf->f_blocks = ext4_blocks_count(es) - sbi->s_overhead_last; buf->f_bfree = percpu_counter_sum_positive(&sbi->s_freeblocks_counter) - percpu_counter_sum_positive(&sbi->s_dirtyblocks_counter); buf->f_bavail = buf->f_bfree - ext4_r_blocks_count(es); if (buf->f_bfree < ext4_r_blocks_count(es)) buf->f_bavail = 0; buf->f_files = le32_to_cpu(es->s_inodes_count); buf->f_ffree = percpu_counter_sum_positive(&sbi->s_freeinodes_counter); buf->f_namelen = EXT4_NAME_LEN; fsid = le64_to_cpup((void *)es->s_uuid) ^ le64_to_cpup((void *)es->s_uuid + sizeof(u64)); buf->f_fsid.val[0] = fsid & 0xFFFFFFFFUL; buf->f_fsid.val[1] = (fsid >> 32) & 0xFFFFFFFFUL; return 0; }
@@ -3391,6 +3391,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) get_random_bytes(&sbi->s_next_generation, sizeof(u32)); spin_lock_init(&sbi->s_next_gen_lock); + init_timer(&sbi->s_err_report); + sbi->s_err_report.function = print_daily_error_info; + sbi->s_err_report.data = (unsigned long) sb; + err = percpu_counter_init(&sbi->s_freeblocks_counter, ext4_count_free_blocks(sb)); if (!err) { @@ -3652,9 +3656,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) "Opts: %s%s%s", descr, sbi->s_es->s_mount_opts, *sbi->s_es->s_mount_opts ? "; " : "", orig_data); - init_timer(&sbi->s_err_report); - sbi->s_err_report.function = print_daily_error_info; - sbi->s_err_report.data = (unsigned long) sb; if (es->s_error_count) mod_timer(&sbi->s_err_report, jiffies + 300*HZ); /* 5 minutes */ @@ -3678,6 +3679,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) sbi->s_journal = NULL; } failed_mount3: + del_timer(&sbi->s_err_report); if (sbi->s_flex_groups) { if (is_vmalloc_addr(sbi->s_flex_groups)) vfree(sbi->s_flex_groups);
null
null
null
21,552
static int do_recv_NPByteRange(rpc_message_t *message, void *p_value) { NPByteRange **rangeListPtr = (NPByteRange **)p_value; if (rangeListPtr == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; *rangeListPtr = NULL; for (;;) { int error; uint32_t cont; if ((error = rpc_message_recv_uint32(message, &cont)) < 0) return error; if (!cont) break; NPByteRange *range = malloc(sizeof(*range)); if (range == NULL) return RPC_ERROR_NO_MEMORY; range->next = NULL; if ((error = rpc_message_recv_int32(message, &range->offset)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &range->length)) < 0) return error; *rangeListPtr = range; rangeListPtr = &range->next; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPByteRange(rpc_message_t *message, void *p_value) { NPByteRange **rangeListPtr = (NPByteRange **)p_value; if (rangeListPtr == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; *rangeListPtr = NULL; for (;;) { int error; uint32_t cont; if ((error = rpc_message_recv_uint32(message, &cont)) < 0) return error; if (!cont) break; NPByteRange *range = malloc(sizeof(*range)); if (range == NULL) return RPC_ERROR_NO_MEMORY; range->next = NULL; if ((error = rpc_message_recv_int32(message, &range->offset)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &range->length)) < 0) return error; *rangeListPtr = range; rangeListPtr = &range->next; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,553
static int do_recv_NPEvent(rpc_message_t *message, void *p_value) { NPEvent *event = (NPEvent *)p_value; int32_t event_type; int error; if ((error = rpc_message_recv_int32(message, &event_type)) < 0) return error; memset(event, 0, sizeof(*event)); event->type = event_type; switch (event->type) { case GraphicsExpose: if ((error = do_recv_XGraphicsExposeEvent(message, event)) < 0) return error; break; case FocusIn: case FocusOut: if ((error = do_recv_XFocusChangeEvent(message, event)) < 0) return error; break; case EnterNotify: case LeaveNotify: if ((error = do_recv_XCrossingEvent(message, event)) < 0) return error; break; case MotionNotify: if ((error = do_recv_XMotionEvent(message, event)) < 0) return error; break; case ButtonPress: case ButtonRelease: if ((error = do_recv_XButtonEvent(message, event)) < 0) return error; break; case KeyPress: case KeyRelease: if ((error = do_recv_XKeyEvent(message, event)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPEvent(rpc_message_t *message, void *p_value) { NPEvent *event = (NPEvent *)p_value; int32_t event_type; int error; if ((error = rpc_message_recv_int32(message, &event_type)) < 0) return error; memset(event, 0, sizeof(*event)); event->type = event_type; switch (event->type) { case GraphicsExpose: if ((error = do_recv_XGraphicsExposeEvent(message, event)) < 0) return error; break; case FocusIn: case FocusOut: if ((error = do_recv_XFocusChangeEvent(message, event)) < 0) return error; break; case EnterNotify: case LeaveNotify: if ((error = do_recv_XCrossingEvent(message, event)) < 0) return error; break; case MotionNotify: if ((error = do_recv_XMotionEvent(message, event)) < 0) return error; break; case ButtonPress: case ButtonRelease: if ((error = do_recv_XButtonEvent(message, event)) < 0) return error; break; case KeyPress: case KeyRelease: if ((error = do_recv_XKeyEvent(message, event)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,554
static int do_recv_NPIdentifier(rpc_message_t *message, void *p_value) { int error; uint32_t id; if ((error = rpc_message_recv_uint32(message, &id)) < 0) return error; NPIdentifier ident = NULL; if (id) { #ifdef BUILD_WRAPPER ident = id_lookup(id); #endif #ifdef BUILD_VIEWER ident = (void *)(uintptr_t)id; #endif assert(ident != NULL); } *((NPIdentifier *)p_value) = ident; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPIdentifier(rpc_message_t *message, void *p_value) { int error; uint32_t id; if ((error = rpc_message_recv_uint32(message, &id)) < 0) return error; NPIdentifier ident = NULL; if (id) { #ifdef BUILD_WRAPPER ident = id_lookup(id); #endif #ifdef BUILD_VIEWER ident = (void *)(uintptr_t)id; #endif assert(ident != NULL); } *((NPIdentifier *)p_value) = ident; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,555
static int do_recv_NPP(rpc_message_t *message, void *p_value) { int error; NPW_PluginInstance *plugin; if ((error = do_recv_NPW_PluginInstance(message, &plugin)) < 0) return error; *((NPP *)p_value) = plugin ? plugin->instance : NULL; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPP(rpc_message_t *message, void *p_value) { int error; NPW_PluginInstance *plugin; if ((error = do_recv_NPW_PluginInstance(message, &plugin)) < 0) return error; *((NPP *)p_value) = plugin ? plugin->instance : NULL; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,556
static int do_recv_NPPrint(rpc_message_t *message, void *p_value) { NPPrint *printInfo = (NPPrint *)p_value; uint32_t print_mode; int error; if ((error = rpc_message_recv_uint32(message, &print_mode)) < 0) return error; switch (print_mode) { case NP_FULL: if ((error = do_recv_NPFullPrint(message, &printInfo->print.fullPrint)) < 0) return error; break; case NP_EMBED: if ((error = do_recv_NPEmbedPrint(message, &printInfo->print.embedPrint)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } printInfo->mode = print_mode; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPPrint(rpc_message_t *message, void *p_value) { NPPrint *printInfo = (NPPrint *)p_value; uint32_t print_mode; int error; if ((error = rpc_message_recv_uint32(message, &print_mode)) < 0) return error; switch (print_mode) { case NP_FULL: if ((error = do_recv_NPFullPrint(message, &printInfo->print.fullPrint)) < 0) return error; break; case NP_EMBED: if ((error = do_recv_NPEmbedPrint(message, &printInfo->print.embedPrint)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } printInfo->mode = print_mode; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,557
static int do_recv_NPPrintData(rpc_message_t *message, void *p_value) { NPPrintData *printData = (NPPrintData *)p_value; int error; if ((error = rpc_message_recv_uint32(message, &printData->size)) < 0) return error; if ((error = rpc_message_recv_bytes(message, printData->data, printData->size)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPPrintData(rpc_message_t *message, void *p_value) { NPPrintData *printData = (NPPrintData *)p_value; int error; if ((error = rpc_message_recv_uint32(message, &printData->size)) < 0) return error; if ((error = rpc_message_recv_bytes(message, printData->data, printData->size)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,558
static int do_recv_NPRect(rpc_message_t *message, void *p_value) { NPRect *rect = (NPRect *)p_value; uint32_t top, left, bottom, right; int error; if ((error = rpc_message_recv_uint32(message, &top)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &left)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &bottom)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &right)) < 0) return error; rect->top = top; rect->left = left; rect->bottom = bottom; rect->right = right; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPRect(rpc_message_t *message, void *p_value) { NPRect *rect = (NPRect *)p_value; uint32_t top, left, bottom, right; int error; if ((error = rpc_message_recv_uint32(message, &top)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &left)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &bottom)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &right)) < 0) return error; rect->top = top; rect->left = left; rect->bottom = bottom; rect->right = right; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,559
static int do_recv_NPSetWindowCallbackStruct(rpc_message_t *message, void *p_value) { NPSetWindowCallbackStruct **ws_info_p = (NPSetWindowCallbackStruct **)p_value; NPSetWindowCallbackStruct *ws_info; int32_t type; uint32_t has_ws_info, visual_id, colormap, depth; int error; if (ws_info_p) *ws_info_p = NULL; if ((error = rpc_message_recv_uint32(message, &has_ws_info)) < 0) return error; if (has_ws_info) { if ((error = rpc_message_recv_int32(message, &type)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &visual_id)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &colormap)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &depth)) < 0) return error; if (ws_info_p) { if ((ws_info = calloc(1, sizeof(*ws_info))) == NULL) return RPC_ERROR_NO_MEMORY; ws_info->type = type; ws_info->visual = (void *)(uintptr_t)visual_id; ws_info->colormap = colormap; ws_info->depth = depth; *ws_info_p = ws_info; } } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPSetWindowCallbackStruct(rpc_message_t *message, void *p_value) { NPSetWindowCallbackStruct **ws_info_p = (NPSetWindowCallbackStruct **)p_value; NPSetWindowCallbackStruct *ws_info; int32_t type; uint32_t has_ws_info, visual_id, colormap, depth; int error; if (ws_info_p) *ws_info_p = NULL; if ((error = rpc_message_recv_uint32(message, &has_ws_info)) < 0) return error; if (has_ws_info) { if ((error = rpc_message_recv_int32(message, &type)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &visual_id)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &colormap)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &depth)) < 0) return error; if (ws_info_p) { if ((ws_info = calloc(1, sizeof(*ws_info))) == NULL) return RPC_ERROR_NO_MEMORY; ws_info->type = type; ws_info->visual = (void *)(uintptr_t)visual_id; ws_info->colormap = colormap; ws_info->depth = depth; *ws_info_p = ws_info; } } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,560
static int do_recv_NPStream(rpc_message_t *message, void *p_value) { int error; uint32_t stream_id; if ((error = rpc_message_recv_uint32(message, &stream_id)) < 0) return error; NPW_StreamInstance *stream = id_lookup(stream_id); *((NPStream **)p_value) = stream ? stream->stream : NULL; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPStream(rpc_message_t *message, void *p_value) { int error; uint32_t stream_id; if ((error = rpc_message_recv_uint32(message, &stream_id)) < 0) return error; NPW_StreamInstance *stream = id_lookup(stream_id); *((NPStream **)p_value) = stream ? stream->stream : NULL; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,561
static int do_recv_NPString(rpc_message_t *message, void *p_value) { NPString *string = (NPString *)p_value; if (string == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; string->UTF8Length = 0; string->UTF8Characters = NULL; int error = rpc_message_recv_uint32(message, &string->UTF8Length); if (error < 0) return error; if ((string->UTF8Characters = NPN_MemAlloc(string->UTF8Length + 1)) == NULL) return RPC_ERROR_NO_MEMORY; if (string->UTF8Length > 0) { if ((error = rpc_message_recv_bytes(message, (unsigned char *)string->UTF8Characters, string->UTF8Length)) < 0) return error; } ((char *)string->UTF8Characters)[string->UTF8Length] = '\0'; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPString(rpc_message_t *message, void *p_value) { NPString *string = (NPString *)p_value; if (string == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; string->UTF8Length = 0; string->UTF8Characters = NULL; int error = rpc_message_recv_uint32(message, &string->UTF8Length); if (error < 0) return error; if ((string->UTF8Characters = NPN_MemAlloc(string->UTF8Length + 1)) == NULL) return RPC_ERROR_NO_MEMORY; if (string->UTF8Length > 0) { if ((error = rpc_message_recv_bytes(message, (unsigned char *)string->UTF8Characters, string->UTF8Length)) < 0) return error; } ((char *)string->UTF8Characters)[string->UTF8Length] = '\0'; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,562
static int do_recv_NPUTF8(rpc_message_t *message, void *p_value) { NPUTF8 **string_p = (NPUTF8 **)p_value; NPUTF8 *string = NULL; uint32_t len; int error = rpc_message_recv_uint32(message, &len); if (error < 0) return error; if ((string = NPN_MemAlloc(len)) == NULL) return RPC_ERROR_NO_MEMORY; if (len > 0) { if ((error = rpc_message_recv_bytes(message, (unsigned char *)string, len)) < 0) return error; } if (string_p) *string_p = string; else if (string) NPN_MemFree(string); return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPUTF8(rpc_message_t *message, void *p_value) { NPUTF8 **string_p = (NPUTF8 **)p_value; NPUTF8 *string = NULL; uint32_t len; int error = rpc_message_recv_uint32(message, &len); if (error < 0) return error; if ((string = NPN_MemAlloc(len)) == NULL) return RPC_ERROR_NO_MEMORY; if (len > 0) { if ((error = rpc_message_recv_bytes(message, (unsigned char *)string, len)) < 0) return error; } if (string_p) *string_p = string; else if (string) NPN_MemFree(string); return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,563
static int do_recv_NPVariant(rpc_message_t *message, void *p_value) { NPVariant *variant = (NPVariant *)p_value; if (variant) VOID_TO_NPVARIANT(*variant); uint32_t type; int error = rpc_message_recv_uint32(message, &type); if (error < 0) return error; NPVariant result; VOID_TO_NPVARIANT(result); switch (type) { case NPVariantType_Void: VOID_TO_NPVARIANT(result); break; case NPVariantType_Null: NULL_TO_NPVARIANT(result); break; case NPVariantType_Bool: { uint32_t value; if ((error = rpc_message_recv_uint32(message, &value)) < 0) return error; result.value.boolValue = value; break; } case NPVariantType_Int32: if ((error = rpc_message_recv_int32(message, &result.value.intValue)) < 0) return error; break; case NPVariantType_Double: if ((error = rpc_message_recv_double(message, &result.value.doubleValue)) < 0) return error; break; case NPVariantType_String: if ((error = do_recv_NPString(message, &result.value.stringValue)) < 0) return error; break; case NPVariantType_Object: if ((error = do_recv_NPObject(message, &result.value.objectValue)) < 0) return error; if (NPW_IS_BROWSER) { /* Note: it's not necessary to propagate the refcount back to the plugin-side since the object will be unref'ed through NPN_ReleaseVariantValue() once we are done with processing the RPC args. */ NPN_RetainObject(result.value.objectValue); } break; } if (variant) { *variant = result; variant->type = type; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPVariant(rpc_message_t *message, void *p_value) { NPVariant *variant = (NPVariant *)p_value; if (variant) VOID_TO_NPVARIANT(*variant); uint32_t type; int error = rpc_message_recv_uint32(message, &type); if (error < 0) return error; NPVariant result; VOID_TO_NPVARIANT(result); switch (type) { case NPVariantType_Void: VOID_TO_NPVARIANT(result); break; case NPVariantType_Null: NULL_TO_NPVARIANT(result); break; case NPVariantType_Bool: { uint32_t value; if ((error = rpc_message_recv_uint32(message, &value)) < 0) return error; result.value.boolValue = value; break; } case NPVariantType_Int32: if ((error = rpc_message_recv_int32(message, &result.value.intValue)) < 0) return error; break; case NPVariantType_Double: if ((error = rpc_message_recv_double(message, &result.value.doubleValue)) < 0) return error; break; case NPVariantType_String: if ((error = do_recv_NPString(message, &result.value.stringValue)) < 0) return error; break; case NPVariantType_Object: if ((error = do_recv_NPObject(message, &result.value.objectValue)) < 0) return error; if (NPW_IS_BROWSER) { /* Note: it's not necessary to propagate the refcount back to the plugin-side since the object will be unref'ed through NPN_ReleaseVariantValue() once we are done with processing the RPC args. */ NPN_RetainObject(result.value.objectValue); } break; } if (variant) { *variant = result; variant->type = type; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,564
static int do_recv_NPW_PluginInstance(rpc_message_t *message, void *p_value) { int error; uint32_t instance_id; if ((error = rpc_message_recv_uint32(message, &instance_id)) < 0) return error; NPW_PluginInstance *plugin = id_lookup(instance_id); if (instance_id && plugin == NULL) npw_printf("ERROR: no valid NPP -> PluginInstance mapping found\n"); else if (plugin && plugin->instance == NULL) npw_printf("ERROR: no valid PluginInstance -> NPP mapping found\n"); else if (plugin && !npw_plugin_instance_is_valid(plugin)) npw_printf("ERROR: received PluginInstance was invalidated earlier\n"); *((NPW_PluginInstance **)p_value) = plugin; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPW_PluginInstance(rpc_message_t *message, void *p_value) { int error; uint32_t instance_id; if ((error = rpc_message_recv_uint32(message, &instance_id)) < 0) return error; NPW_PluginInstance *plugin = id_lookup(instance_id); if (instance_id && plugin == NULL) npw_printf("ERROR: no valid NPP -> PluginInstance mapping found\n"); else if (plugin && plugin->instance == NULL) npw_printf("ERROR: no valid PluginInstance -> NPP mapping found\n"); else if (plugin && !npw_plugin_instance_is_valid(plugin)) npw_printf("ERROR: received PluginInstance was invalidated earlier\n"); *((NPW_PluginInstance **)p_value) = plugin; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,565
static int do_recv_NPWindow(rpc_message_t *message, void *p_value) { NPWindow **window_p = (NPWindow **)p_value; NPWindow *window; uint32_t window_valid; int error; if (window_p) *window_p = NULL; if ((error = rpc_message_recv_uint32(message, &window_valid)) < 0) return error; if (window_valid) { if ((window = malloc(sizeof(NPWindow))) == NULL) return RPC_ERROR_NO_MEMORY; if ((error = do_recv_NPWindowData(message, window)) < 0) { free(window); return error; } if (window_p) *window_p = window; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPWindow(rpc_message_t *message, void *p_value) { NPWindow **window_p = (NPWindow **)p_value; NPWindow *window; uint32_t window_valid; int error; if (window_p) *window_p = NULL; if ((error = rpc_message_recv_uint32(message, &window_valid)) < 0) return error; if (window_valid) { if ((window = malloc(sizeof(NPWindow))) == NULL) return RPC_ERROR_NO_MEMORY; if ((error = do_recv_NPWindowData(message, window)) < 0) { free(window); return error; } if (window_p) *window_p = window; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,566
static int do_recv_NPWindowData(rpc_message_t *message, void *p_value) { NPWindow *window = (NPWindow *)p_value; NPSetWindowCallbackStruct *ws_info; uint32_t window_id; int32_t window_type; int error; if (window == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; if ((error = rpc_message_recv_uint32(message, &window_id)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window->x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window->y)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window->width)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window->height)) < 0) return error; if ((error = do_recv_NPRect(message, &window->clipRect)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window_type)) < 0) return error; if ((error = do_recv_NPSetWindowCallbackStruct(message, &ws_info)) < 0) return error; window->type = window_type; window->window = (void *)(Window)window_id; window->ws_info = ws_info; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NPWindowData(rpc_message_t *message, void *p_value) { NPWindow *window = (NPWindow *)p_value; NPSetWindowCallbackStruct *ws_info; uint32_t window_id; int32_t window_type; int error; if (window == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; if ((error = rpc_message_recv_uint32(message, &window_id)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window->x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window->y)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window->width)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window->height)) < 0) return error; if ((error = do_recv_NPRect(message, &window->clipRect)) < 0) return error; if ((error = rpc_message_recv_int32(message, &window_type)) < 0) return error; if ((error = do_recv_NPSetWindowCallbackStruct(message, &ws_info)) < 0) return error; window->type = window_type; window->window = (void *)(Window)window_id; window->ws_info = ws_info; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,567
static int do_recv_NotifyData(rpc_message_t *message, void *p_value) { int error; uint64_t id; if ((error = rpc_message_recv_uint64(message, &id)) < 0) return error; if (sizeof(void *) == 4 && ((uint32_t)(id >> 32)) != 0) { npw_printf("ERROR: 64-bit viewers in 32-bit wrappers are not supported\n"); abort(); } *((void **)p_value) = (void *)(uintptr_t)id; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_NotifyData(rpc_message_t *message, void *p_value) { int error; uint64_t id; if ((error = rpc_message_recv_uint64(message, &id)) < 0) return error; if (sizeof(void *) == 4 && ((uint32_t)(id >> 32)) != 0) { npw_printf("ERROR: 64-bit viewers in 32-bit wrappers are not supported\n"); abort(); } *((void **)p_value) = (void *)(uintptr_t)id; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,568
static int do_recv_XAnyEvent(rpc_message_t *message, XEvent *xevent) { uint32_t serial, send_event, window; int error; if ((error = rpc_message_recv_uint32(message, &serial)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &send_event)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window)) < 0) return error; xevent->xany.serial = serial; xevent->xany.send_event = send_event; xevent->xany.window = window; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XAnyEvent(rpc_message_t *message, XEvent *xevent) { uint32_t serial, send_event, window; int error; if ((error = rpc_message_recv_uint32(message, &serial)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &send_event)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &window)) < 0) return error; xevent->xany.serial = serial; xevent->xany.send_event = send_event; xevent->xany.window = window; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,569
static int do_recv_XButtonEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state, button; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &button)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xbutton.root = root; xevent->xbutton.subwindow = subwindow; xevent->xbutton.time = time; xevent->xbutton.x = x; xevent->xbutton.y = y; xevent->xbutton.x_root = x_root; xevent->xbutton.y_root = y_root; xevent->xbutton.state = state; xevent->xbutton.button = button; xevent->xbutton.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XButtonEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state, button; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &button)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xbutton.root = root; xevent->xbutton.subwindow = subwindow; xevent->xbutton.time = time; xevent->xbutton.x = x; xevent->xbutton.y = y; xevent->xbutton.x_root = x_root; xevent->xbutton.y_root = y_root; xevent->xbutton.state = state; xevent->xbutton.button = button; xevent->xbutton.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,570
static int do_recv_XFocusChangeEvent(rpc_message_t *message, XEvent *xevent) { return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XFocusChangeEvent(rpc_message_t *message, XEvent *xevent) { return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,571
static int do_recv_XGraphicsExposeEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y; uint32_t width, height; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &width)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &height)) < 0) return error; xevent->xgraphicsexpose.x = x; xevent->xgraphicsexpose.y = y; xevent->xgraphicsexpose.width = width; xevent->xgraphicsexpose.height = height; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XGraphicsExposeEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y; uint32_t width, height; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &width)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &height)) < 0) return error; xevent->xgraphicsexpose.x = x; xevent->xgraphicsexpose.y = y; xevent->xgraphicsexpose.width = width; xevent->xgraphicsexpose.height = height; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,572
static int do_recv_XKeyEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state, keycode; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &keycode)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xkey.root = root; xevent->xkey.subwindow = subwindow; xevent->xkey.time = time; xevent->xkey.x = x; xevent->xkey.y = y; xevent->xkey.x_root = x_root; xevent->xkey.y_root = y_root; xevent->xkey.state = state; xevent->xkey.keycode = keycode; xevent->xkey.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XKeyEvent(rpc_message_t *message, XEvent *xevent) { int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state, keycode; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &keycode)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xkey.root = root; xevent->xkey.subwindow = subwindow; xevent->xkey.time = time; xevent->xkey.x = x; xevent->xkey.y = y; xevent->xkey.x_root = x_root; xevent->xkey.y_root = y_root; xevent->xkey.state = state; xevent->xkey.keycode = keycode; xevent->xkey.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,573
static int do_recv_XMotionEvent(rpc_message_t *message, XEvent *xevent) { char is_hint; int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_char(message, &is_hint)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xmotion.root = root; xevent->xmotion.subwindow = subwindow; xevent->xmotion.time = time; xevent->xmotion.x = x; xevent->xmotion.y = y; xevent->xmotion.x_root = x_root; xevent->xmotion.y_root = y_root; xevent->xmotion.state = state; xevent->xmotion.is_hint = is_hint; xevent->xmotion.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_recv_XMotionEvent(rpc_message_t *message, XEvent *xevent) { char is_hint; int32_t x, y, x_root, y_root, same_screen; uint32_t root, subwindow, time, state; int error; if ((error = do_recv_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &subwindow)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &time)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y)) < 0) return error; if ((error = rpc_message_recv_int32(message, &x_root)) < 0) return error; if ((error = rpc_message_recv_int32(message, &y_root)) < 0) return error; if ((error = rpc_message_recv_uint32(message, &state)) < 0) return error; if ((error = rpc_message_recv_char(message, &is_hint)) < 0) return error; if ((error = rpc_message_recv_int32(message, &same_screen)) < 0) return error; xevent->xmotion.root = root; xevent->xmotion.subwindow = subwindow; xevent->xmotion.time = time; xevent->xmotion.x = x; xevent->xmotion.y = y; xevent->xmotion.x_root = x_root; xevent->xmotion.y_root = y_root; xevent->xmotion.state = state; xevent->xmotion.is_hint = is_hint; xevent->xmotion.same_screen = same_screen; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,574
static int do_send_NPByteRange(rpc_message_t *message, void *p_value) { NPByteRange *range = (NPByteRange *)p_value; while (range) { int error; if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = rpc_message_send_int32(message, range->offset)) < 0) return error; if ((error = rpc_message_send_uint32(message, range->length)) < 0) return error; range = range->next; } return rpc_message_send_uint32(message, 0); }
Bypass
0
static int do_send_NPByteRange(rpc_message_t *message, void *p_value) { NPByteRange *range = (NPByteRange *)p_value; while (range) { int error; if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = rpc_message_send_int32(message, range->offset)) < 0) return error; if ((error = rpc_message_send_uint32(message, range->length)) < 0) return error; range = range->next; } return rpc_message_send_uint32(message, 0); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,575
static int do_send_NPEmbedPrint(rpc_message_t *message, void *p_value) { NPEmbedPrint *embedPrint = (NPEmbedPrint *)p_value; int error; if ((error = do_send_NPWindowData(message, &embedPrint->window)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPEmbedPrint(rpc_message_t *message, void *p_value) { NPEmbedPrint *embedPrint = (NPEmbedPrint *)p_value; int error; if ((error = do_send_NPWindowData(message, &embedPrint->window)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,576
static int do_send_NPEvent(rpc_message_t *message, void *p_value) { NPEvent *event = (NPEvent *)p_value; int error; if (event == NULL || !is_valid_NPEvent_type(event)) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; if ((error = rpc_message_send_int32(message, event->type)) < 0) return error; switch (event->type) { case GraphicsExpose: if ((error = do_send_XGraphicsExposeEvent(message, event)) < 0) return error; break; case FocusIn: case FocusOut: if ((error = do_send_XFocusChangeEvent(message, event)) < 0) return error; break; case EnterNotify: case LeaveNotify: if ((error = do_send_XCrossingEvent(message, event)) < 0) return error; break; case MotionNotify: if ((error = do_send_XMotionEvent(message, event)) < 0) return error; break; case ButtonPress: case ButtonRelease: if ((error = do_send_XButtonEvent(message, event)) < 0) return error; break; case KeyPress: case KeyRelease: if ((error = do_send_XKeyEvent(message, event)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPEvent(rpc_message_t *message, void *p_value) { NPEvent *event = (NPEvent *)p_value; int error; if (event == NULL || !is_valid_NPEvent_type(event)) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; if ((error = rpc_message_send_int32(message, event->type)) < 0) return error; switch (event->type) { case GraphicsExpose: if ((error = do_send_XGraphicsExposeEvent(message, event)) < 0) return error; break; case FocusIn: case FocusOut: if ((error = do_send_XFocusChangeEvent(message, event)) < 0) return error; break; case EnterNotify: case LeaveNotify: if ((error = do_send_XCrossingEvent(message, event)) < 0) return error; break; case MotionNotify: if ((error = do_send_XMotionEvent(message, event)) < 0) return error; break; case ButtonPress: case ButtonRelease: if ((error = do_send_XButtonEvent(message, event)) < 0) return error; break; case KeyPress: case KeyRelease: if ((error = do_send_XKeyEvent(message, event)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,577
static int do_send_NPObject(rpc_message_t *message, void *p_value) { uint32_t npobj_id = 0; NPObject *npobj = (NPObject *)p_value; if (npobj) { NPObjectInfo *npobj_info = npobject_info_lookup(npobj); if (npobj_info) npobj_id = npobj_info->npobj_id; #ifdef BUILD_WRAPPER else { if ((npobj_info = npobject_info_new(npobj)) == NULL) return RPC_ERROR_NO_MEMORY; npobj_id = npobj_info->npobj_id; npobject_associate(npobj, npobj_info); } #endif assert(npobj_id != 0); } int error = rpc_message_send_uint32(message, npobj_id); if (error < 0) return error; #ifdef BUILD_WRAPPER if (npobj) { if ((error = rpc_message_send_uint32(message, npobj->referenceCount)) < 0) return error; } #endif return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPObject(rpc_message_t *message, void *p_value) { uint32_t npobj_id = 0; NPObject *npobj = (NPObject *)p_value; if (npobj) { NPObjectInfo *npobj_info = npobject_info_lookup(npobj); if (npobj_info) npobj_id = npobj_info->npobj_id; #ifdef BUILD_WRAPPER else { if ((npobj_info = npobject_info_new(npobj)) == NULL) return RPC_ERROR_NO_MEMORY; npobj_id = npobj_info->npobj_id; npobject_associate(npobj, npobj_info); } #endif assert(npobj_id != 0); } int error = rpc_message_send_uint32(message, npobj_id); if (error < 0) return error; #ifdef BUILD_WRAPPER if (npobj) { if ((error = rpc_message_send_uint32(message, npobj->referenceCount)) < 0) return error; } #endif return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,578
static int do_send_NPP(rpc_message_t *message, void *p_value) { NPP instance = (NPP)p_value; NPW_PluginInstance *plugin = NULL; if (instance) plugin = NPW_PLUGIN_INSTANCE(instance); return do_send_NPW_PluginInstance(message, plugin); }
Bypass
0
static int do_send_NPP(rpc_message_t *message, void *p_value) { NPP instance = (NPP)p_value; NPW_PluginInstance *plugin = NULL; if (instance) plugin = NPW_PLUGIN_INSTANCE(instance); return do_send_NPW_PluginInstance(message, plugin); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,579
static int do_send_NPPrint(rpc_message_t *message, void *p_value) { NPPrint *printInfo = (NPPrint *)p_value; int error; if ((error = rpc_message_send_uint32(message, printInfo->mode)) < 0) return error; switch (printInfo->mode) { case NP_FULL: if ((error = do_send_NPFullPrint(message, &printInfo->print.fullPrint)) < 0) return error; break; case NP_EMBED: if ((error = do_send_NPEmbedPrint(message, &printInfo->print.embedPrint)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPPrint(rpc_message_t *message, void *p_value) { NPPrint *printInfo = (NPPrint *)p_value; int error; if ((error = rpc_message_send_uint32(message, printInfo->mode)) < 0) return error; switch (printInfo->mode) { case NP_FULL: if ((error = do_send_NPFullPrint(message, &printInfo->print.fullPrint)) < 0) return error; break; case NP_EMBED: if ((error = do_send_NPEmbedPrint(message, &printInfo->print.embedPrint)) < 0) return error; break; default: return RPC_ERROR_GENERIC; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,580
static int do_send_NPPrintData(rpc_message_t *message, void *p_value) { NPPrintData *printData = (NPPrintData *)p_value; int error; if ((error = rpc_message_send_uint32(message, printData->size)) < 0) return error; if ((error = rpc_message_send_bytes(message, printData->data, printData->size)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPPrintData(rpc_message_t *message, void *p_value) { NPPrintData *printData = (NPPrintData *)p_value; int error; if ((error = rpc_message_send_uint32(message, printData->size)) < 0) return error; if ((error = rpc_message_send_bytes(message, printData->data, printData->size)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,581
static int do_send_NPSavedData(rpc_message_t *message, void *p_value) { NPSavedData *save_area = (NPSavedData *)p_value; int error; if (save_area == NULL) { if ((error = rpc_message_send_int32(message, 0)) < 0) return error; } else { if ((error = rpc_message_send_int32(message, save_area->len)) < 0) return error; if ((error = rpc_message_send_bytes(message, save_area->buf, save_area->len)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPSavedData(rpc_message_t *message, void *p_value) { NPSavedData *save_area = (NPSavedData *)p_value; int error; if (save_area == NULL) { if ((error = rpc_message_send_int32(message, 0)) < 0) return error; } else { if ((error = rpc_message_send_int32(message, save_area->len)) < 0) return error; if ((error = rpc_message_send_bytes(message, save_area->buf, save_area->len)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,582
static int do_send_NPSetWindowCallbackStruct(rpc_message_t *message, void *p_value) { NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *)p_value; int error; if (ws_info) { if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = rpc_message_send_int32(message, ws_info->type)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->visual ? XVisualIDFromVisual(ws_info->visual) : 0)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->colormap)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->depth)) < 0) return error; } else { if ((error = rpc_message_send_uint32(message, 0)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPSetWindowCallbackStruct(rpc_message_t *message, void *p_value) { NPSetWindowCallbackStruct *ws_info = (NPSetWindowCallbackStruct *)p_value; int error; if (ws_info) { if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = rpc_message_send_int32(message, ws_info->type)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->visual ? XVisualIDFromVisual(ws_info->visual) : 0)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->colormap)) < 0) return error; if ((error = rpc_message_send_uint32(message, ws_info->depth)) < 0) return error; } else { if ((error = rpc_message_send_uint32(message, 0)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,583
static int do_send_NPStream(rpc_message_t *message, void *p_value) { uint32_t stream_id = 0; NPStream *stream = (NPStream *)p_value; if (stream) { NPW_StreamInstance *sip = NPW_STREAM_INSTANCE(stream); if (sip) stream_id = sip->stream_id; } return rpc_message_send_uint32(message, stream_id); }
Bypass
0
static int do_send_NPStream(rpc_message_t *message, void *p_value) { uint32_t stream_id = 0; NPStream *stream = (NPStream *)p_value; if (stream) { NPW_StreamInstance *sip = NPW_STREAM_INSTANCE(stream); if (sip) stream_id = sip->stream_id; } return rpc_message_send_uint32(message, stream_id); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,584
static int do_send_NPVariant(rpc_message_t *message, void *p_value) { NPVariant *variant = (NPVariant *)p_value; if (variant == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; int error = rpc_message_send_uint32(message, variant->type); if (error < 0) return error; switch (variant->type) { case NPVariantType_Void: case NPVariantType_Null: break; case NPVariantType_Bool: if ((error = rpc_message_send_uint32(message, variant->value.boolValue)) < 0) return error; break; case NPVariantType_Int32: if ((error = rpc_message_send_int32(message, variant->value.intValue)) < 0) return error; break; case NPVariantType_Double: if ((error = rpc_message_send_double(message, variant->value.doubleValue)) < 0) return error; break; case NPVariantType_String: if ((error = do_send_NPString(message, &variant->value.stringValue)) < 0) return error; break; case NPVariantType_Object: if (NPW_IS_BROWSER) { /* Note: when we pass an NPObject to the plugin, it's supposed to be released once it's done with processing the RPC args. i.e. NPN_ReleaseVariantValue() is called for any NPVariant we received through rpc_method_get_args(). */ NPN_RetainObject(variant->value.objectValue); } if ((error = do_send_NPObject(message, variant->value.objectValue)) < 0) return error; break; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPVariant(rpc_message_t *message, void *p_value) { NPVariant *variant = (NPVariant *)p_value; if (variant == NULL) return RPC_ERROR_MESSAGE_ARGUMENT_INVALID; int error = rpc_message_send_uint32(message, variant->type); if (error < 0) return error; switch (variant->type) { case NPVariantType_Void: case NPVariantType_Null: break; case NPVariantType_Bool: if ((error = rpc_message_send_uint32(message, variant->value.boolValue)) < 0) return error; break; case NPVariantType_Int32: if ((error = rpc_message_send_int32(message, variant->value.intValue)) < 0) return error; break; case NPVariantType_Double: if ((error = rpc_message_send_double(message, variant->value.doubleValue)) < 0) return error; break; case NPVariantType_String: if ((error = do_send_NPString(message, &variant->value.stringValue)) < 0) return error; break; case NPVariantType_Object: if (NPW_IS_BROWSER) { /* Note: when we pass an NPObject to the plugin, it's supposed to be released once it's done with processing the RPC args. i.e. NPN_ReleaseVariantValue() is called for any NPVariant we received through rpc_method_get_args(). */ NPN_RetainObject(variant->value.objectValue); } if ((error = do_send_NPObject(message, variant->value.objectValue)) < 0) return error; break; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,585
static int do_send_NPW_PluginInstance(rpc_message_t *message, void *p_value) { NPW_PluginInstance *plugin = (NPW_PluginInstance *)p_value; uint32_t instance_id = 0; if (plugin) instance_id = plugin->instance_id; return rpc_message_send_uint32(message, instance_id); }
Bypass
0
static int do_send_NPW_PluginInstance(rpc_message_t *message, void *p_value) { NPW_PluginInstance *plugin = (NPW_PluginInstance *)p_value; uint32_t instance_id = 0; if (plugin) instance_id = plugin->instance_id; return rpc_message_send_uint32(message, instance_id); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,586
static int do_send_NPWindow(rpc_message_t *message, void *p_value) { NPWindow *window = (NPWindow *)p_value; int error; if (window == NULL) { if ((error = rpc_message_send_uint32(message, 0)) < 0) return error; } else { if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = do_send_NPWindowData(message, window)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_NPWindow(rpc_message_t *message, void *p_value) { NPWindow *window = (NPWindow *)p_value; int error; if (window == NULL) { if ((error = rpc_message_send_uint32(message, 0)) < 0) return error; } else { if ((error = rpc_message_send_uint32(message, 1)) < 0) return error; if ((error = do_send_NPWindowData(message, window)) < 0) return error; } return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,587
static int do_send_NotifyData(rpc_message_t *message, void *p_value) { void *notifyData = (void *)p_value; return rpc_message_send_uint64(message, (uintptr_t)notifyData); }
Bypass
0
static int do_send_NotifyData(rpc_message_t *message, void *p_value) { void *notifyData = (void *)p_value; return rpc_message_send_uint64(message, (uintptr_t)notifyData); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,588
static int do_send_XAnyEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = rpc_message_send_uint32(message, xevent->xany.serial)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xany.send_event)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xany.window)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XAnyEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = rpc_message_send_uint32(message, xevent->xany.serial)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xany.send_event)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xany.window)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,589
static int do_send_XCrossingEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.y_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.mode)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.detail)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.same_screen)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.focus)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.state)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XCrossingEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.y_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.mode)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.detail)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.same_screen)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xcrossing.focus)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xcrossing.state)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,590
static int do_send_XFocusChangeEvent(rpc_message_t *message, XEvent *xevent) { return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XFocusChangeEvent(rpc_message_t *message, XEvent *xevent) { return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,591
static int do_send_XGraphicsExposeEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xgraphicsexpose.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xgraphicsexpose.y)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xgraphicsexpose.width)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xgraphicsexpose.height)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XGraphicsExposeEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xgraphicsexpose.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xgraphicsexpose.y)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xgraphicsexpose.width)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xgraphicsexpose.height)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,592
static int do_send_XKeyEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.y_root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.state)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.keycode)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.same_screen)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XKeyEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.y_root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.state)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xkey.keycode)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xkey.same_screen)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,593
static int do_send_XMotionEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.y_root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.state)) < 0) return error; if ((error = rpc_message_send_char(message, xevent->xmotion.is_hint)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.same_screen)) < 0) return error; return RPC_ERROR_NO_ERROR; }
Bypass
0
static int do_send_XMotionEvent(rpc_message_t *message, XEvent *xevent) { int error; if ((error = do_send_XAnyEvent(message, xevent)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.subwindow)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.time)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.x)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.y)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.x_root)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.y_root)) < 0) return error; if ((error = rpc_message_send_uint32(message, xevent->xmotion.state)) < 0) return error; if ((error = rpc_message_send_char(message, xevent->xmotion.is_hint)) < 0) return error; if ((error = rpc_message_send_int32(message, xevent->xmotion.same_screen)) < 0) return error; return RPC_ERROR_NO_ERROR; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,594
static bool is_valid_NPEvent_type(NPEvent *event) { switch (event->type) { case GraphicsExpose: case FocusIn: case FocusOut: case EnterNotify: case LeaveNotify: case MotionNotify: case ButtonPress: case ButtonRelease: case KeyPress: case KeyRelease: return true; default: break; } return false; }
Bypass
0
static bool is_valid_NPEvent_type(NPEvent *event) { switch (event->type) { case GraphicsExpose: case FocusIn: case FocusOut: case EnterNotify: case LeaveNotify: case MotionNotify: case ButtonPress: case ButtonRelease: case KeyPress: case KeyRelease: return true; default: break; } return false; }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,595
int rpc_add_np_marshalers(rpc_connection_t *connection) { return rpc_connection_add_message_descriptors(connection, message_descs, sizeof(message_descs) / sizeof(message_descs[0])); }
Bypass
0
int rpc_add_np_marshalers(rpc_connection_t *connection) { return rpc_connection_add_message_descriptors(connection, message_descs, sizeof(message_descs) / sizeof(message_descs[0])); }
@@ -41,6 +41,8 @@ int rpc_type_of_NPNVariable(int variable) case NPNVisOfflineBool: case NPNVSupportsXEmbedBool: case NPNVSupportsWindowless: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPNVToolkit: @@ -65,6 +67,7 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginNameString: case NPPVpluginDescriptionString: case NPPVformValue: // byte values of 0 does not appear in the UTF-8 encoding but for U+0000 + case NPPVpluginNativeAccessibleAtkPlugId: type = RPC_TYPE_STRING; break; case NPPVpluginWindowSize: @@ -76,6 +79,10 @@ int rpc_type_of_NPPVariable(int variable) case NPPVpluginTransparentBool: case NPPVjavascriptPushCallerBool: case NPPVpluginKeepLibraryInMemory: + case NPPVpluginUrlRequestsDisplayedBool: + case NPPVpluginWantsAllNetworkStreams: + case NPPVpluginCancelSrcStream: + case NPPVSupportsAdvancedKeyHandling: type = RPC_TYPE_BOOLEAN; break; case NPPVpluginScriptableNPObject:
CWE-264
null
null
21,596
static inline int add_appcontext_input(int fd, int n) { return XtAppAddInput(x_app_context, fd, GUINT_TO_POINTER(XtInputWriteMask), xt_dummy_input_cb, GUINT_TO_POINTER(0xdead0000)); }
Bypass
0
static inline int add_appcontext_input(int fd, int n) { return XtAppAddInput(x_app_context, fd, GUINT_TO_POINTER(XtInputWriteMask), xt_dummy_input_cb, GUINT_TO_POINTER(0xdead0000)); }
@@ -1302,6 +1302,8 @@ g_NPN_GetValue(NPP instance, NPNVariable variable, void *value) case NPNVSupportsXEmbedBool: case NPNVWindowNPObject: case NPNVPluginElementNPObject: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: return g_NPN_GetValue_real(instance, variable, value); default: switch (variable & 0xff) {
CWE-264
null
null
21,597
cached_NPN_GetIntIdentifier(int32_t intid) { NPIdentifier ident; if (!use_npidentifier_cache()) ident = invoke_NPN_GetIntIdentifier(intid); #if USE_NPIDENTIFIER_CACHE else if (!npidentifier_cache_has_int(intid, &ident)) { ident = invoke_NPN_GetIntIdentifier(intid); npidentifier_cache_reserve(1); npidentifier_cache_add_int(ident, intid); } #endif return ident; }
Bypass
0
cached_NPN_GetIntIdentifier(int32_t intid) { NPIdentifier ident; if (!use_npidentifier_cache()) ident = invoke_NPN_GetIntIdentifier(intid); #if USE_NPIDENTIFIER_CACHE else if (!npidentifier_cache_has_int(intid, &ident)) { ident = invoke_NPN_GetIntIdentifier(intid); npidentifier_cache_reserve(1); npidentifier_cache_add_int(ident, intid); } #endif return ident; }
@@ -1302,6 +1302,8 @@ g_NPN_GetValue(NPP instance, NPNVariable variable, void *value) case NPNVSupportsXEmbedBool: case NPNVWindowNPObject: case NPNVPluginElementNPObject: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: return g_NPN_GetValue_real(instance, variable, value); default: switch (variable & 0xff) {
CWE-264
null
null
21,598
cached_NPN_GetStringIdentifier(const NPUTF8 *name) { NPIdentifier ident; if (!use_npidentifier_cache()) ident = invoke_NPN_GetStringIdentifier(name); #if USE_NPIDENTIFIER_CACHE else if (!npidentifier_cache_has_string(name, &ident)) { ident = invoke_NPN_GetStringIdentifier(name); npidentifier_cache_reserve(1); npidentifier_cache_add_string(ident, name); } #endif return ident; }
Bypass
0
cached_NPN_GetStringIdentifier(const NPUTF8 *name) { NPIdentifier ident; if (!use_npidentifier_cache()) ident = invoke_NPN_GetStringIdentifier(name); #if USE_NPIDENTIFIER_CACHE else if (!npidentifier_cache_has_string(name, &ident)) { ident = invoke_NPN_GetStringIdentifier(name); npidentifier_cache_reserve(1); npidentifier_cache_add_string(ident, name); } #endif return ident; }
@@ -1302,6 +1302,8 @@ g_NPN_GetValue(NPP instance, NPNVariable variable, void *value) case NPNVSupportsXEmbedBool: case NPNVWindowNPObject: case NPNVPluginElementNPObject: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: return g_NPN_GetValue_real(instance, variable, value); default: switch (variable & 0xff) {
CWE-264
null
null
21,599
cached_NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) { /* XXX: could be optimized further */ invoke_NPN_GetStringIdentifiers(names, nameCount, identifiers); #if USE_NPIDENTIFIER_CACHE if (use_npidentifier_cache()) { for (int i = 0; i < nameCount; i++) { NPIdentifier ident = identifiers[i]; if (npidentifier_cache_lookup(ident) == NULL) { npidentifier_cache_reserve(1); npidentifier_cache_add_string(ident, names[i]); } } } #endif }
Bypass
0
cached_NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers) { /* XXX: could be optimized further */ invoke_NPN_GetStringIdentifiers(names, nameCount, identifiers); #if USE_NPIDENTIFIER_CACHE if (use_npidentifier_cache()) { for (int i = 0; i < nameCount; i++) { NPIdentifier ident = identifiers[i]; if (npidentifier_cache_lookup(ident) == NULL) { npidentifier_cache_reserve(1); npidentifier_cache_add_string(ident, names[i]); } } } #endif }
@@ -1302,6 +1302,8 @@ g_NPN_GetValue(NPP instance, NPNVariable variable, void *value) case NPNVSupportsXEmbedBool: case NPNVWindowNPObject: case NPNVPluginElementNPObject: + case NPNVprivateModeBool: + case NPNVsupportsAdvancedKeyHandling: return g_NPN_GetValue_real(instance, variable, value); default: switch (variable & 0xff) {
CWE-264
null
null