mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
Snap for 8921111 from c2b3d2bf66 to android-mainline-keystone-qcom-release
Change-Id: I1131baf9dfe9b4e3b9faaf21681d1dfc296d1483
This commit is contained in:
commit
7d681d70e3
|
|
@ -12,6 +12,7 @@
|
|||
#include <trace/hooks/sched.h>
|
||||
#include <trace/hooks/fpsimd.h>
|
||||
#include <trace/hooks/binder.h>
|
||||
#include <trace/hooks/dma_buf.h>
|
||||
#include <trace/hooks/cpuidle.h>
|
||||
#include <trace/hooks/mpam.h>
|
||||
#include <trace/hooks/wqlockup.h>
|
||||
|
|
@ -108,6 +109,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_send_uic_command);
|
|||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_send_tm_command);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ufs_check_int_errors);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ignore_dmabuf_vmap_bounds);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_iommu_setup_dma_ops);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_alloc_iova);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_iommu_iovad_free_iova);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/mm.h>
|
||||
#include <linux/mount.h>
|
||||
#include <linux/pseudo_fs.h>
|
||||
#include <trace/hooks/dma_buf.h>
|
||||
|
||||
#include <uapi/linux/dma-buf.h>
|
||||
#include <uapi/linux/magic.h>
|
||||
|
|
@ -128,6 +129,7 @@ static struct file_system_type dma_buf_fs_type = {
|
|||
static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma)
|
||||
{
|
||||
struct dma_buf *dmabuf;
|
||||
bool ignore_bounds = false;
|
||||
|
||||
if (!is_dma_buf_file(file))
|
||||
return -EINVAL;
|
||||
|
|
@ -138,9 +140,11 @@ static int dma_buf_mmap_internal(struct file *file, struct vm_area_struct *vma)
|
|||
if (!dmabuf->ops->mmap)
|
||||
return -EINVAL;
|
||||
|
||||
trace_android_vh_ignore_dmabuf_vmap_bounds(dmabuf, &ignore_bounds);
|
||||
|
||||
/* check for overflowing the buffer's size */
|
||||
if (vma->vm_pgoff + vma_pages(vma) >
|
||||
dmabuf->size >> PAGE_SHIFT)
|
||||
if ((vma->vm_pgoff + vma_pages(vma) >
|
||||
dmabuf->size >> PAGE_SHIFT) && !ignore_bounds)
|
||||
return -EINVAL;
|
||||
|
||||
return dmabuf->ops->mmap(dmabuf, vma);
|
||||
|
|
|
|||
21
include/trace/hooks/dma_buf.h
Normal file
21
include/trace/hooks/dma_buf.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM dma_buf
|
||||
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
|
||||
#if !defined(_TRACE_HOOK_DMA_BUF_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_DMA_BUF_H
|
||||
|
||||
#include <linux/dma-buf.h>
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
DECLARE_HOOK(android_vh_ignore_dmabuf_vmap_bounds,
|
||||
TP_PROTO(struct dma_buf *dma_buf, bool *ignore_bounds),
|
||||
TP_ARGS(dma_buf, ignore_bounds));
|
||||
|
||||
#endif /* _TRACE_HOOK_DMA_BUF_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
Loading…
Reference in New Issue
Block a user