"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "drivers/hid/uhid.c" between
linux-3.16.62.tar.xz and linux-3.16.63.tar.xz

About: The full source of the Linux kernel 3.16.x (longterm stable)

uhid.c  (linux-3.16.62.tar.xz):uhid.c  (linux-3.16.63.tar.xz)
skipping to change at line 15 skipping to change at line 15
/* /*
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free * under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) * Software Foundation; either version 2 of the License, or (at your option)
* any later version. * any later version.
*/ */
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/cred.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/hid.h> #include <linux/hid.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/uhid.h> #include <linux/uhid.h>
#include <linux/wait.h> #include <linux/wait.h>
#define UHID_NAME "uhid" #define UHID_NAME "uhid"
#define UHID_BUFSIZE 32 #define UHID_BUFSIZE 32
struct uhid_device { struct uhid_device {
struct mutex devlock; struct mutex devlock;
bool running; bool running;
skipping to change at line 679 skipping to change at line 681
memset(&uhid->input_buf, 0, sizeof(uhid->input_buf)); memset(&uhid->input_buf, 0, sizeof(uhid->input_buf));
len = min(count, sizeof(uhid->input_buf)); len = min(count, sizeof(uhid->input_buf));
ret = uhid_event_from_user(buffer, len, &uhid->input_buf); ret = uhid_event_from_user(buffer, len, &uhid->input_buf);
if (ret) if (ret)
goto unlock; goto unlock;
switch (uhid->input_buf.type) { switch (uhid->input_buf.type) {
case UHID_CREATE: case UHID_CREATE:
/*
* 'struct uhid_create_req' contains a __user pointer which is
* copied from, so it's unsafe to allow this with elevated
* privileges (e.g. from a setuid binary) or via kernel_write().
*/
if (file->f_cred != current_cred() || uaccess_kernel()) {
pr_err_once("UHID_CREATE from different security context
by process %d (%s), this is not allowed.\n",
task_tgid_vnr(current), current->comm);
ret = -EACCES;
goto unlock;
}
ret = uhid_dev_create(uhid, &uhid->input_buf); ret = uhid_dev_create(uhid, &uhid->input_buf);
break; break;
case UHID_CREATE2: case UHID_CREATE2:
ret = uhid_dev_create2(uhid, &uhid->input_buf); ret = uhid_dev_create2(uhid, &uhid->input_buf);
break; break;
case UHID_DESTROY: case UHID_DESTROY:
ret = uhid_dev_destroy(uhid); ret = uhid_dev_destroy(uhid);
break; break;
case UHID_INPUT: case UHID_INPUT:
ret = uhid_dev_input(uhid, &uhid->input_buf); ret = uhid_dev_input(uhid, &uhid->input_buf);
 End of changes. 3 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)