aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/af_unix.c
diff options
context:
space:
mode:
authorJason Gerecke <[email protected]>2017-09-18 16:27:42 +0000
committerJiri Kosina <[email protected]>2017-10-02 09:45:29 +0000
commit2a5e597c6bb1b873e473e5f57147e9e5d2755430 (patch)
treecbcc06ee0cf7c42828cee83faf24ea0f8fc27461 /net/unix/af_unix.c
parentHID: wacom: generic: Clear ABS_MISC when tool leaves proximity (diff)
downloadkernel-2a5e597c6bb1b873e473e5f57147e9e5d2755430.tar.gz
kernel-2a5e597c6bb1b873e473e5f57147e9e5d2755430.zip
HID: wacom: Always increment hdev refcount within wacom_get_hdev_data
The wacom_get_hdev_data function is used to find and return a reference to the "other half" of a Wacom device (i.e., the touch device associated with a pen, or vice-versa). To ensure these references are properly accounted for, the function is supposed to automatically increment the refcount before returning. This was not done, however, for devices which have pen & touch on different interfaces of the same USB device. This can lead to a WARNING ("refcount_t: underflow; use-after-free") when removing the module or device as we call kref_put() more times than kref_get(). Triggering an "actual" use- after-free would be difficult since both devices will disappear nearly- simultaneously. To silence this warning and prevent the potential error, we need to increment the refcount for all cases within wacom_get_hdev_data. Fixes: 41372d5d40 ("HID: wacom: Augment 'oVid' and 'oPid' with heuristics for HID_GENERIC") Cc: <[email protected]> # v4.9+ Signed-off-by: Jason Gerecke <[email protected]> Reviewed-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions