Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f2afa771
Commit
f2afa771
authored
Aug 08, 2008
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: paper over a bug in Synaptics X driver
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
5402a734
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
drivers/input/evdev.c
drivers/input/evdev.c
+20
-1
No files found.
drivers/input/evdev.c
View file @
f2afa771
...
...
@@ -647,8 +647,10 @@ static int str_to_user(const char *str, unsigned int maxlen, void __user *p)
return
copy_to_user
(
p
,
str
,
len
)
?
-
EFAULT
:
len
;
}
#define OLD_KEY_MAX 0x1ff
static
int
handle_eviocgbit
(
struct
input_dev
*
dev
,
unsigned
int
cmd
,
void
__user
*
p
,
int
compat_mode
)
{
static
unsigned
long
keymax_warn_time
;
unsigned
long
*
bits
;
int
len
;
...
...
@@ -665,9 +667,26 @@ static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __user
case
EV_SW
:
bits
=
dev
->
swbit
;
len
=
SW_MAX
;
break
;
default:
return
-
EINVAL
;
}
/*
* Work around bugs in userspace programs that like to do
* EVIOCGBIT(EV_KEY, KEY_MAX) and not realize that 'len'
* should be in bytes, not in bits.
*/
if
((
_IOC_NR
(
cmd
)
&
EV_MAX
)
==
EV_KEY
&&
_IOC_SIZE
(
cmd
)
==
OLD_KEY_MAX
)
{
len
=
OLD_KEY_MAX
;
if
(
printk_timed_ratelimit
(
&
keymax_warn_time
,
10
*
1000
))
printk
(
KERN_WARNING
"evdev.c(EVIOCGBIT): Suspicious buffer size %d, "
"limiting output to %d bytes. See "
"http://userweb.kernel.org/~dtor/eviocgbit-bug.html
\n
"
,
OLD_KEY_MAX
,
BITS_TO_LONGS
(
OLD_KEY_MAX
)
*
sizeof
(
long
));
}
return
bits_to_user
(
bits
,
len
,
_IOC_SIZE
(
cmd
),
p
,
compat_mode
);
}
#undef OLD_KEY_MAX
static
long
evdev_do_ioctl
(
struct
file
*
file
,
unsigned
int
cmd
,
void
__user
*
p
,
int
compat_mode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment