aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfire855 <thefire855@gmail.com>2017-02-12 02:12:14 +0100
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:59:45 +0200
commit18630c55e1472401bcf8d2f17ec9d90253585105 (patch)
tree8ffd51912ff5f663c9f28fdde50cac7b98047292
parenta0e40f4a2698fef4497265757f6c83e382365b60 (diff)
downloadandroid_kernel_m2note-18630c55e1472401bcf8d2f17ec9d90253585105.tar.gz
ion: blacklist %p kptr_restrict
-rwxr-xr-xdrivers/staging/android/ion/ion.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index f2ed3bb38..b6b3e8045 100755
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -259,7 +259,7 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
"heap->ops->map_dma should return ERR_PTR on error"))
table = ERR_PTR(-EINVAL);
if (IS_ERR(table)) {
- IONMSG("%s table is err 0x%p.\n", __func__, table);
+ IONMSG("%s table is err 0x%pK.\n", __func__, table);
heap->ops->free(buffer);
kfree(buffer);
return ERR_PTR(PTR_ERR(table));
@@ -607,7 +607,7 @@ struct ion_handle *__ion_alloc(struct ion_client *client, size_t len,
}
if (IS_ERR(buffer)) {
- IONMSG("%s buffer is error 0x%p.\n", __func__, buffer);
+ IONMSG("%s buffer is error 0x%pK.\n", __func__, buffer);
return ERR_PTR(PTR_ERR(buffer));
}
@@ -620,7 +620,7 @@ struct ion_handle *__ion_alloc(struct ion_client *client, size_t len,
ion_buffer_put(buffer);
if (IS_ERR(handle)) {
- IONMSG("%s handle is error 0x%p.\n", __func__, handle);
+ IONMSG("%s handle is error 0x%pK.\n", __func__, handle);
return handle;
}
@@ -724,7 +724,7 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer)
"heap->ops->map_kernel should return ERR_PTR on error"))
return ERR_PTR(-EINVAL);
if (IS_ERR(vaddr)) {
- IONMSG("%s map kernel is failed addr = 0x%p.\n", __func__, vaddr);
+ IONMSG("%s map kernel is failed addr = 0x%pK.\n", __func__, vaddr);
return vaddr;
}
buffer->vaddr = vaddr;
@@ -743,7 +743,7 @@ static void *ion_handle_kmap_get(struct ion_handle *handle)
}
vaddr = ion_buffer_kmap_get(buffer);
if (IS_ERR(vaddr)) {
- IONMSG("%s vadd is error 0x%p.\n", __func__, vaddr);
+ IONMSG("%s vadd is error 0x%pK.\n", __func__, vaddr);
return vaddr;
}
handle->kmap_cnt++;
@@ -1013,7 +1013,7 @@ struct ion_client *ion_client_create(struct ion_device *dev,
client = __ion_client_create(dev, name);
if(IS_ERR_OR_NULL(client)) {
- IONMSG("%s client is error or null 0x%p.\n", __func__, client);
+ IONMSG("%s client is error or null 0x%pK.\n", __func__, client);
return client;
}
@@ -1033,7 +1033,7 @@ void __ion_client_destroy(struct ion_client *client, int from_kern)
struct ion_handle *handle = rb_entry(n, struct ion_handle,
node);
mutex_lock(&client->lock);
- IONMSG("warning: release handle @ client destory: handle=%p, buf=%p, ref=%d, size=%zu, kmap=%d\n",
+ IONMSG("warning: release handle @ client destory: handle=%pK, buf=%pK, ref=%d, size=%zu, kmap=%d\n",
handle, handle->buffer, atomic_read(&handle->buffer->ref.refcount), handle->buffer->size, handle->buffer->kmap_cnt);
ion_handle_destroy(&handle->ref);
mutex_unlock(&client->lock);
@@ -1173,7 +1173,7 @@ static int ion_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address, pfn);
mutex_unlock(&buffer->lock);
if (ret) {
- IONMSG("%s vm insert pfn failed, vma = 0x%p, addr = 0x%p, pfn = %lu.\n", __func__, vma, vmf->virtual_address, pfn);
+ IONMSG("%s vm insert pfn failed, vma = 0x%pK, addr = 0x%pK, pfn = %lu.\n", __func__, vma, vmf->virtual_address, pfn);
return VM_FAULT_ERROR;
}
@@ -1342,7 +1342,7 @@ struct dma_buf *ion_share_dma_buf(struct ion_client *client,
dmabuf = dma_buf_export(buffer, &dma_buf_ops, buffer->size, O_RDWR);
if (IS_ERR(dmabuf)) {
- IONMSG("%s dma buf export failed dmabuf is error 0x%p.\n", __func__, dmabuf);
+ IONMSG("%s dma buf export failed dmabuf is error 0x%pK.\n", __func__, dmabuf);
ion_buffer_put(buffer);
return dmabuf;
}
@@ -1358,7 +1358,7 @@ int __ion_share_dma_buf_fd(struct ion_client *client, struct ion_handle *handle,
dmabuf = ion_share_dma_buf(client, handle);
if (IS_ERR(dmabuf)) {
- IONMSG("%s dmabuf is err 0x%p.\n", __func__, dmabuf);
+ IONMSG("%s dmabuf is err 0x%pK.\n", __func__, dmabuf);
return PTR_ERR(dmabuf);
}
@@ -1392,7 +1392,7 @@ struct ion_handle *__ion_import_dma_buf(struct ion_client *client, int fd, int f
dmabuf = dma_buf_get(fd);
if (IS_ERR(dmabuf))
{
- IONMSG("%s dma_buf_get fail fd=%d ret=0x%p\n", __func__, fd, dmabuf);
+ IONMSG("%s dma_buf_get fail fd=%d ret=0x%pK\n", __func__, fd, dmabuf);
return ERR_PTR(PTR_ERR(dmabuf));
}
/* if this memory came from ion */
@@ -1418,7 +1418,7 @@ struct ion_handle *__ion_import_dma_buf(struct ion_client *client, int fd, int f
if (IS_ERR(handle))
{
mutex_unlock(&client->lock);
- IONMSG("%s handle is error 0x%p.\n", __func__, handle);
+ IONMSG("%s handle is error 0x%pK.\n", __func__, handle);
goto end;
}
@@ -1456,7 +1456,7 @@ static int ion_sync_for_device(struct ion_client *client, int fd)
dmabuf = dma_buf_get(fd);
if (IS_ERR(dmabuf)) {
- IONMSG("%s dma_buf_get failed dmabuf is err %d, 0x%p.\n", __func__, fd, dmabuf);
+ IONMSG("%s dma_buf_get failed dmabuf is err %d, 0x%pK.\n", __func__, fd, dmabuf);
return PTR_ERR(dmabuf);
}
@@ -1636,7 +1636,7 @@ static int ion_open(struct inode *inode, struct file *file)
snprintf(debug_name, 64, "%u", task_pid_nr(current->group_leader));
client = __ion_client_create(dev, debug_name);
if (IS_ERR(client)) {
- IONMSG("%s ion client create failed 0x%p.\n", __func__, client);
+ IONMSG("%s ion client create failed 0x%pK.\n", __func__, client);
return PTR_ERR(client);
}
file->private_data = client;
@@ -1692,10 +1692,10 @@ static int ion_debug_heap_show(struct seq_file *s, void *unused)
char task_comm[TASK_COMM_LEN];
get_task_comm(task_comm, client->task);
- seq_printf(s, "%16.s(%16.s) %16u %16zu 0x%p\n", task_comm,
+ seq_printf(s, "%16.s(%16.s) %16u %16zu 0x%pK\n", task_comm,
client->dbg_name, client->pid, size, client);
} else {
- seq_printf(s, "%16.s(%16.s) %16u %16zu 0x%p\n", client->name,
+ seq_printf(s, "%16.s(%16.s) %16u %16zu 0x%pK\n", client->name,
"from_kernel", client->pid, size, client);
}
}
@@ -1983,13 +1983,13 @@ struct ion_handle* ion_drv_get_handle(struct ion_client* client, int user_handle
handle = kernel_handle;
if (IS_ERR_OR_NULL(handle)) {
- IONMSG("%s handle invalid, handle = 0x%p.\n", __FUNCTION__, handle);
+ IONMSG("%s handle invalid, handle = 0x%pK.\n", __FUNCTION__, handle);
return ERR_PTR(-EINVAL);
}
mutex_lock(&client->lock);
if (!ion_handle_validate(client, handle)) {
- IONMSG("%s handle invalid, handle=0x%p\n", __FUNCTION__, handle);
+ IONMSG("%s handle invalid, handle=0x%pK\n", __FUNCTION__, handle);
mutex_unlock(&client->lock);
return ERR_PTR(-EINVAL);
}
@@ -2383,7 +2383,7 @@ static int ion_debug_dbcl_show(struct seq_file *s, void *unused)
buffer_count++;
if(buffer_count == 1)
{
- seq_printf(s, "%8s[%2d] buffer: 0x%p buffer structure adr: 0x%p size(%d)\n", "buffer", buffer_cnt++, buf_rec->buffer, buf_rec->buffer_address, buf_rec->buffer->size);
+ seq_printf(s, "%8s[%2d] buffer: 0x%pK buffer structure adr: 0x%pK size(%d)\n", "buffer", buffer_cnt++, buf_rec->buffer, buf_rec->buffer_address, buf_rec->buffer->size);
}
seq_printf(s, "%s\n"," <BUFFER_ALLOCATION_LIST>");
seq_printf(s, "%s [0x%x] %10s [%d] (%s [%d])\n"," client",
@@ -2693,7 +2693,7 @@ static int ion_debug_dbis_show(struct seq_file *s, void *unused)
/* All clients */
for (cn = rb_first(&dev->clients); cn; cn = rb_next(cn)) {
client = rb_entry(cn, struct ion_client, node);
- seq_printf(s, "\n%8s[%2d] 0x%p PID[%d]\n", "client", client_cnt++, client, client->pid);
+ seq_printf(s, "\n%8s[%2d] 0x%pK PID[%d]\n", "client", client_cnt++, client, client->pid);
mutex_lock(&client->lock);
/* All client-handles */
for (hn = rb_first(&client->handles); hn; hn = rb_next(hn)) {
@@ -2714,7 +2714,7 @@ static int ion_debug_dbis_show(struct seq_file *s, void *unused)
client_cnt = 0;
while(client_rec != NULL)
{
- seq_printf(s, "\n[%2d]%s: fd[%d] 0x%p PID[%d] GROUP_PID[%d]\n",client_cnt++,"client",client_rec->fd, client_rec->tracking_info.recordID.client,client_rec->tracking_info.recordID.pid,client_rec->tracking_info.recordID.group_pid);
+ seq_printf(s, "\n[%2d]%s: fd[%d] 0x%pK PID[%d] GROUP_PID[%d]\n",client_cnt++,"client",client_rec->fd, client_rec->tracking_info.recordID.client,client_rec->tracking_info.recordID.pid,client_rec->tracking_info.recordID.group_pid);
/* Show buffer allocation backtrace */
seq_printf(s, " %s\n","<CLIENT_ALLOCATION_LIST>");
ion_debugdb_show_backtrace(s, &client_rec->tracking_info,ALLOCATE_BACKTRACE_INFO);
@@ -2737,7 +2737,7 @@ static int ion_debug_dbis_show(struct seq_file *s, void *unused)
#endif
while (buf_rec != NULL)
{
- seq_printf(s, "%8s[%2d][0x%x] buffer structure: 0x%p size(%d)\n", "buffer", buffer_cnt++,(unsigned int)buf_rec->buffer,buf_rec->buffer_address, buf_rec->buffer->size);
+ seq_printf(s, "%8s[%2d][0x%x] buffer structure: 0x%pK size(%d)\n", "buffer", buffer_cnt++,(unsigned int)buf_rec->buffer,buf_rec->buffer_address, buf_rec->buffer->size);
/* Allocation */
usg_rec = ion_get_list(LIST_BUFFER,buf_rec, BUFFER_ALLOCATION_LIST);
if(usg_rec)