<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/hid/uhid.c, branch 0x221E-v0.0.1-v6.19</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0.1-v6.19'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-09-27T15:18:43Z</updated>
<entry>
<title>[tree-wide] finally take no_llseek out</title>
<updated>2024-09-27T15:18:43Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-09-27T01:56:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cb787f4ac0c2e439ea8d7e6387b925f74576bdf8'/>
<id>urn:sha1:cb787f4ac0c2e439ea8d7e6387b925f74576bdf8</id>
<content type='text'>
no_llseek had been defined to NULL two years ago, in commit 868941b14441
("fs: remove no_llseek")

To quote that commit,

  At -rc1 we'll need do a mechanical removal of no_llseek -

  git grep -l -w no_llseek | grep -v porting.rst | while read i; do
	sed -i '/\&lt;no_llseek\&gt;/d' $i
  done

  would do it.

Unfortunately, that hadn't been done.  Linus, could you do that now, so
that we could finally put that thing to rest? All instances are of the
form
	.llseek = no_llseek,
so it's obviously safe.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>HID: uhid: replace deprecated strncpy with strscpy</title>
<updated>2023-11-30T21:38:50Z</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-10-03T21:01:58Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d4011f6817ae85e42874af705fec866fec7c4ecf'/>
<id>urn:sha1:d4011f6817ae85e42874af705fec866fec7c4ecf</id>
<content type='text'>
`strncpy` is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on the destination buffer without
unnecessarily NUL-padding.

Furthermore, let's make sure `hid-&gt;xyz` and `ev-&gt;u.create2.xyz` are the
same size at compile time to prevent silent truncation.

With these changes, it is abundantly clear what the intent and behavior
of the code is -- We are getting a string to string copy with
NUL-termination and no truncation.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Link: https://lore.kernel.org/r/20231003-strncpy-drivers-hid-uhid-c-v2-1-6a501402581e@google.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>HID: uhid: Over-ride the default maximum data buffer value with our own</title>
<updated>2023-02-23T10:52:05Z</updated>
<author>
<name>Lee Jones</name>
<email>lee@kernel.org</email>
</author>
<published>2023-01-23T12:39:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=1c5d4221240a233df2440fe75c881465cdf8da07'/>
<id>urn:sha1:1c5d4221240a233df2440fe75c881465cdf8da07</id>
<content type='text'>
The default maximum data buffer size for this interface is UHID_DATA_MAX
(4k).  When data buffers are being processed, ensure this value is used
when ensuring the sanity, rather than a value between the user provided
value and HID_MAX_BUFFER_SIZE (16k).

Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Make lowlevel driver structs const</title>
<updated>2023-01-17T12:44:02Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2022-12-22T05:10:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=52d22534690446d1f4b45436b570f77df3e855ba'/>
<id>urn:sha1:52d22534690446d1f4b45436b570f77df3e855ba</id>
<content type='text'>
Nothing is nor should be modifying these structs so mark them as const.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: David Rheinsberg &lt;david.rheinsberg@gmail.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Unexport struct uhid_hid_driver</title>
<updated>2023-01-17T12:44:01Z</updated>
<author>
<name>Thomas Weißschuh</name>
<email>linux@weissschuh.net</email>
</author>
<published>2022-12-22T05:10:48Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8482aa2399e55b994e480a902ba86057f52887f4'/>
<id>urn:sha1:8482aa2399e55b994e480a902ba86057f52887f4</id>
<content type='text'>
As there are no external users this implementation detail does not need
to be exported.

Signed-off-by: Thomas Weißschuh &lt;linux@weissschuh.net&gt;
Reviewed-by: David Rheinsberg &lt;david.rheinsberg@gmail.com&gt;
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>uaccess: remove CONFIG_SET_FS</title>
<updated>2022-02-25T08:36:06Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2022-02-11T20:42:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=967747bbc084b93b54e66f9047d342232314cd25'/>
<id>urn:sha1:967747bbc084b93b54e66f9047d342232314cd25</id>
<content type='text'>
There are no remaining callers of set_fs(), so CONFIG_SET_FS
can be removed globally, along with the thread_info field and
any references to it.

This turns access_ok() into a cheaper check against TASK_SIZE_MAX.

As CONFIG_SET_FS is now gone, drop all remaining references to
set_fs()/get_fs(), mm_segment_t, user_addr_max() and uaccess_kernel().

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt; # for sparc32 changes
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Tested-by: Sergey Matyukevich &lt;sergey.matyukevich@synopsys.com&gt; # for arc changes
Acked-by: Stafford Horne &lt;shorne@gmail.com&gt; # [openrisc, asm-generic]
Acked-by: Dinh Nguyen &lt;dinguyen@kernel.org&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>HID: uhid: Use READ_ONCE()/WRITE_ONCE() for -&gt;running</title>
<updated>2022-01-19T14:59:05Z</updated>
<author>
<name>Jann Horn</name>
<email>jannh@google.com</email>
</author>
<published>2022-01-14T13:33:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c8e7ff41f819b0c31c66c5196933c26c18f7681f'/>
<id>urn:sha1:c8e7ff41f819b0c31c66c5196933c26c18f7681f</id>
<content type='text'>
The flag uhid-&gt;running can be set to false by uhid_device_add_worker()
without holding the uhid-&gt;devlock. Mark all reads/writes of the flag
that might race with READ_ONCE()/WRITE_ONCE() for clarity and
correctness.

Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: uhid: Fix worker destroying device without any protection</title>
<updated>2022-01-19T14:59:05Z</updated>
<author>
<name>Jann Horn</name>
<email>jannh@google.com</email>
</author>
<published>2022-01-14T13:33:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4ea5763fb79ed89b3bdad455ebf3f33416a81624'/>
<id>urn:sha1:4ea5763fb79ed89b3bdad455ebf3f33416a81624</id>
<content type='text'>
uhid has to run hid_add_device() from workqueue context while allowing
parallel use of the userspace API (which is protected with -&gt;devlock).
But hid_add_device() can fail. Currently, that is handled by immediately
destroying the associated HID device, without using -&gt;devlock - but if
there are concurrent requests from userspace, that's wrong and leads to
NULL dereferences and/or memory corruption (via use-after-free).

Fix it by leaving the HID device as-is in the worker. We can clean it up
later, either in the UHID_DESTROY command handler or in the -&gt;release()
handler.

Cc: stable@vger.kernel.org
Fixes: 67f8ecc550b5 ("HID: uhid: fix timeout when probe races with IO")
Signed-off-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: hidraw, uhid: Always report EPOLLOUT</title>
<updated>2020-01-10T14:34:28Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2020-01-10T14:32:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9e635c2851df6caee651e589fbf937b637973c91'/>
<id>urn:sha1:9e635c2851df6caee651e589fbf937b637973c91</id>
<content type='text'>
hidraw and uhid device nodes are always available for writing so we should
always report EPOLLOUT and EPOLLWRNORM bits, not only in the cases when
there is nothing to read.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Fixes: be54e7461ffdc ("HID: uhid: Fix returning EPOLLOUT from uhid_char_poll")
Fixes: 9f3b61dc1dd7b ("HID: hidraw: Fix returning EPOLLOUT from hidraw_poll")
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: uhid: Fix returning EPOLLOUT from uhid_char_poll</title>
<updated>2019-12-09T12:53:37Z</updated>
<author>
<name>Marcel Holtmann</name>
<email>marcel@holtmann.org</email>
</author>
<published>2019-12-04T02:43:55Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=be54e7461ffdc5809b67d2aeefc1ddc9a91470c7'/>
<id>urn:sha1:be54e7461ffdc5809b67d2aeefc1ddc9a91470c7</id>
<content type='text'>
Always return EPOLLOUT from uhid_char_poll to allow polling /dev/uhid
for writable state.

Fixes: 1f9dec1e0164 ("HID: uhid: allow poll()'ing on uhid devices")
Signed-off-by: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
