Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37af0d25 authored by xiaocong.gu's avatar xiaocong.gu
Browse files

Integrate security patch 2021-10-05-CVE-2021-0707

Change-Id: I0a40009d12e22fa128f8672aa6ed3dc2ed8b2d2f
parent d4438f13
Loading
Loading
Loading
Loading
+22 −27
Original line number Diff line number Diff line
@@ -102,35 +102,12 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen)
			     dentry->d_name.name, ret > 0 ? name : "");
}

static const struct dentry_operations dma_buf_dentry_ops = {
	.d_dname = dmabuffs_dname,
};

static struct vfsmount *dma_buf_mnt;

static struct dentry *dma_buf_fs_mount(struct file_system_type *fs_type,
		int flags, const char *name, void *data)
{
	return mount_pseudo(fs_type, "dmabuf:", NULL, &dma_buf_dentry_ops,
			DMA_BUF_MAGIC);
}

static struct file_system_type dma_buf_fs_type = {
	.name = "dmabuf",
	.mount = dma_buf_fs_mount,
	.kill_sb = kill_anon_super,
};

static int dma_buf_release(struct inode *inode, struct file *file)
static void dma_buf_release(struct dentry *dentry)
{
	struct dma_buf *dmabuf;
	struct dentry *dentry = file->f_path.dentry;
	int dtor_ret = 0;

	if (!is_dma_buf_file(file))
		return -EINVAL;

	dmabuf = file->private_data;
	dmabuf = dentry->d_fsdata;

	spin_lock(&dentry->d_lock);
	dentry->d_fsdata = NULL;
@@ -167,9 +144,28 @@ static int dma_buf_release(struct inode *inode, struct file *file)

	module_put(dmabuf->owner);
	dmabuf_dent_put(dmabuf);
	return 0;
}

static const struct dentry_operations dma_buf_dentry_ops = {
       .d_dname = dmabuffs_dname,
       .d_release = dma_buf_release,
};

static struct vfsmount *dma_buf_mnt;

static struct dentry *dma_buf_fs_mount(struct file_system_type *fs_type,
               int flags, const char *name, void *data)
{
       return mount_pseudo(fs_type, "dmabuf:", NULL, &dma_buf_dentry_ops,
                       DMA_BUF_MAGIC);
}

static struct file_system_type dma_buf_fs_type = {
       .name = "dmabuf",
       .mount = dma_buf_fs_mount,
       .kill_sb = kill_anon_super,
};

static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma)
{
	struct dma_buf *dmabuf;
@@ -488,7 +484,6 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file)
}

static const struct file_operations dma_buf_fops = {
	.release	= dma_buf_release,
	.mmap		= dma_buf_mmap_internal,
	.llseek		= dma_buf_llseek,
	.poll		= dma_buf_poll,