<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/um/drivers/vector_user.c, branch v6.6.133</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.133</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.133'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-08-16T20:50:37+00:00</updated>
<entry>
<title>um: vector: refactor deprecated strncpy</title>
<updated>2023-08-16T20:50:37+00:00</updated>
<author>
<name>Justin Stitt</name>
<email>justinstitt@google.com</email>
</author>
<published>2023-08-07T18:22:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=30bed99e0c6335b711119b9fda806da7b4031dfb'/>
<id>urn:sha1:30bed99e0c6335b711119b9fda806da7b4031dfb</id>
<content type='text'>
`strncpy` is deprecated for use on NUL-terminated destination strings [1].

A suitable replacement is `strscpy` [2] due to the fact that it
guarantees NUL-termination on its destination buffer argument which is
_not_ the case for `strncpy`!

In this case, we are able to drop the now superfluous `... - 1`
instances because `strscpy` will automatically truncate the last byte by
setting it to a NUL byte if the source size exceeds the destination size
or if the source string is not NUL-terminated.

I've also opted to remove the seemingly useless char* casts. I'm not
sure why they're present at all since (after expanding the `ifr_name`
macro) `ifr.ifr_ifrn.ifrn_name` is a char* already.

All in all, `strscpy` is a more robust and less ambiguous interface
while also letting us remove some `... -1`'s which cleans things up a
bit.

[1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html

Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt &lt;justinstitt@google.com&gt;
Acked-by: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Link: https://lore.kernel.org/r/20230807-arch-um-drivers-v1-1-10d602c5577a@google.com
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
</content>
</entry>
<entry>
<title>uml: net: vector: fix const issue</title>
<updated>2022-03-11T09:47:05+00:00</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2022-01-31T14:35:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5fa1d09f10f2b30603bf2578ef781d2a507be17'/>
<id>urn:sha1:b5fa1d09f10f2b30603bf2578ef781d2a507be17</id>
<content type='text'>
Since the constification of MAC addresses, the argument
to uml_vector_default_bpf() must be const.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Acked-By: anton ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>isystem: trim/fixup stdarg.h and other headers</title>
<updated>2021-08-19T00:02:55+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2021-08-02T20:40:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=39f75da7bcc829ddc4d40bb60d0e95520de7898b'/>
<id>urn:sha1:39f75da7bcc829ddc4d40bb60d0e95520de7898b</id>
<content type='text'>
Delete/fixup few includes in anticipation of global -isystem compile
option removal.

Note: crypto/aegis128-neon-inner.c keeps &lt;stddef.h&gt; due to redefinition
of uintptr_t error (one definition comes from &lt;stddef.h&gt;, another from
&lt;linux/types.h&gt;).

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>um: vector: Add dynamic tap interfaces and scripting</title>
<updated>2020-10-11T21:26:37+00:00</updated>
<author>
<name>Anton Ivanov</name>
<email>anton.ivanov@cambridgegreys.com</email>
</author>
<published>2020-09-21T13:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f06885b3f3e3884f98351d7b72a4fc8400911cde'/>
<id>urn:sha1:f06885b3f3e3884f98351d7b72a4fc8400911cde</id>
<content type='text'>
Provide functionality roughly compatible with the existing qemu
ifup scripting:
* invocation of an ifup script. The interface name is passed as the
  first and only argument
* allocating tap interfaces on the fly if they are not explicitly
  specified

Signed-off-by: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Remove redundant NULL check</title>
<updated>2020-10-11T21:19:35+00:00</updated>
<author>
<name>Li Heng</name>
<email>liheng40@huawei.com</email>
</author>
<published>2020-07-23T03:15:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9a10705b42dd541feadda4817582a7efc984c917'/>
<id>urn:sha1:9a10705b42dd541feadda4817582a7efc984c917</id>
<content type='text'>
Fix below warnings reported by coccicheck:
./arch/um/drivers/vector_user.c:403:2-7: WARNING: NULL check before some freeing functions is not needed.

Fixes: bc8f8e4e6e7a ("um: Add a generic "fd" vector transport")
Signed-off-by: Li Heng &lt;liheng40@huawei.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Some fixes to build UML with musl</title>
<updated>2020-10-11T21:13:06+00:00</updated>
<author>
<name>Ignat Korchagin</name>
<email>ignat@cloudflare.com</email>
</author>
<published>2020-07-19T21:02:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e1121cd43d4d3436140a462bfc230ff8aeb1693'/>
<id>urn:sha1:5e1121cd43d4d3436140a462bfc230ff8aeb1693</id>
<content type='text'>
musl toolchain and headers are a bit more strict. These fixes enable building
UML with musl as well as seem not to break on glibc.

Signed-off-by: Ignat Korchagin &lt;ignat@cloudflare.com&gt;
Tested-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Fix null pointer dereference in vector_user_bpf</title>
<updated>2020-10-11T21:12:51+00:00</updated>
<author>
<name>Gaurav Singh</name>
<email>gaurav1086@gmail.com</email>
</author>
<published>2020-06-14T01:19:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bab991cf40f631d18d00cb8c2a97325c8fd4292e'/>
<id>urn:sha1:bab991cf40f631d18d00cb8c2a97325c8fd4292e</id>
<content type='text'>
The bpf_prog is being checked for !NULL after uml_kmalloc
but later its used directly for example:
bpf_prog-&gt;filter = bpf and is also later returned upon
success. Fix this, do a NULL check and return right away.

Signed-off-by: Gaurav Singh &lt;gaurav1086@gmail.com&gt;
Acked-By: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Add a generic "fd" vector transport</title>
<updated>2020-06-02T20:37:28+00:00</updated>
<author>
<name>Marc-André Lureau</name>
<email>marcandre.lureau@redhat.com</email>
</author>
<published>2020-04-07T20:28:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc8f8e4e6e7a648e8c6357307d614be8fdcfdf2a'/>
<id>urn:sha1:bc8f8e4e6e7a648e8c6357307d614be8fdcfdf2a</id>
<content type='text'>
Learn to take a pre-opened file-descriptor for vector IO.

Instead of teaching the driver to open a FD in multiple ways, it can
rely on management layer to do it on its behalf. For example, this
allows inheriting a preconfigured device fd or a simple socketpair()
setup, without further arguments, privileges or system access by UML.

Signed-off-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Acked-By: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Remove some unnecessary NULL checks in vector_user.c</title>
<updated>2020-03-29T21:56:47+00:00</updated>
<author>
<name>Alex Dewar</name>
<email>alex.dewar@gmx.co.uk</email>
</author>
<published>2020-03-27T19:36:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a7c46247f9c620c0390a15cb00b6ef9576b9c23'/>
<id>urn:sha1:4a7c46247f9c620c0390a15cb00b6ef9576b9c23</id>
<content type='text'>
kfree() already checks for null pointers, so additional checking is
unnecessary.

Signed-off-by: Alex Dewar &lt;alex.dewar@gmx.co.uk&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>um: Loadable BPF "Firmware" for vector drivers</title>
<updated>2019-11-25T21:43:31+00:00</updated>
<author>
<name>Anton Ivanov</name>
<email>anton.ivanov@cambridgegreys.com</email>
</author>
<published>2019-10-02T10:26:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9807019a62dc670c73ce8e59e09b41ae458c34b3'/>
<id>urn:sha1:9807019a62dc670c73ce8e59e09b41ae458c34b3</id>
<content type='text'>
All vector drivers now allow a BPF program to be loaded and
associated with the RX socket in the host kernel.

1. The program can be loaded as an extra kernel command line
option to any of the vector drivers.

2. The program can also be loaded as "firmware", using the
ethtool flash option. It is possible to turn this facility
on or off using a command line option.

A simplistic wrapper for generating the BPF firmware for the raw
socket driver out of a tcpdump/libpcap filter expression can be
found at: https://github.com/kot-begemot-uk/uml_vector_utilities/

Signed-off-by: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
</feed>
