Fix functions that return undefined values. These issues were caught by
running clang using LLVM=1 option; and are as follows:
--
ovpn-cli.c:1587:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1587 | if (!sock) {
| ^~~~~
ovpn-cli.c:1635:9: note: uninitialized use occurs here
1635 | return ret;
| ^~~
ovpn-cli.c:1587:2: note: remove the 'if' if its condition is always false
1587 | if (!sock) {
| ^~~~~~~~~~~~
1588 | fprintf(stderr, "cannot allocate netlink socket\n");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1589 | goto err_free;
| ~~~~~~~~~~~~~~
1590 | }
| ~
ovpn-cli.c:1584:15: note: initialize the variable 'ret' to silence this warning
1584 | int mcid, ret;
| ^
| = 0
ovpn-cli.c:2107:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
2107 | case CMD_INVALID:
| ^~~~~~~~~~~
ovpn-cli.c:2111:9: note: uninitialized use occurs here
2111 | return ret;
| ^~~
ovpn-cli.c:1939:12: note: initialize the variable 'ret' to silence this warning
1939 | int n, ret;
| ^
|
--
Fixes: 959bc330a439 ("testing/selftests: add test tool and scripts for ovpn module")
ovpn module")
v3:
- Use prefix net.
- Remove so_txtime fix as default case calls error().
- Changelog before sign-off.
- Three dashes after sign-off
v2:
- Use subsystem name "net".
- Add fixes tags.
- Remove txtimestamp fix as default case calls error.
- Assign constant error string instead of NULL.
Signed-off-by: Sidharth Seela <sidharthseela(a)gmail.com>
---
diff --git a/tools/testing/selftests/net/ovpn/ovpn-cli.c b/tools/testing/selftests/net/ovpn/ovpn-cli.c
index 9201f2905f2c..20d00378f34a 100644
--- a/tools/testing/selftests/net/ovpn/ovpn-cli.c
+++ b/tools/testing/selftests/net/ovpn/ovpn-cli.c
@@ -1581,7 +1581,7 @@ static int ovpn_listen_mcast(void)
{
struct nl_sock *sock;
struct nl_cb *cb;
- int mcid, ret;
+ int mcid, ret = -1;
sock = nl_socket_alloc();
if (!sock) {
@@ -1936,7 +1936,7 @@ static int ovpn_run_cmd(struct ovpn_ctx *ovpn)
{
char peer_id[10], vpnip[INET6_ADDRSTRLEN], laddr[128], lport[10];
char raddr[128], rport[10];
- int n, ret;
+ int n, ret = -1;
FILE *fp;
switch (ovpn->cmd) {
--
2.47.3
This is a follow-up series of [1]. It tries to fix a possible UAF in the
fops of cros_ec_chardev after the underlying protocol device has gone by
using revocable.
The 1st patch introduces the revocable which is an implementation of ideas
from the talk [2].
The 2nd and 3rd patches add test cases for revocable in Kunit and selftest.
The 4th patch converts existing protocol devices to resource providers
of cros_ec_device.
The 5th - 7th are PoC patches for moving most revocable code to subsystem
level. Miscdevice is used as it would be simpler for PoC. Note that the
device driver (e.g., cros_ec_chardev) still needs to be revocable-aware.
The driver needs to specify where to save the pointer and thus the resource
is available in fops.
- The 5th patch adds a helper for using revocable API with fops.
- The 6th patch leverages the helper in miscdevice.
- The 7th patch converts cros_ec_chardev to a resource consumer of
cros_ec_device to fix the UAF.
[1] https://lore.kernel.org/chrome-platform/20250721044456.2736300-6-tzungbi@ke…
[2] https://lpc.events/event/17/contributions/1627/
v4:
- Rebase onto next-20250922.
- Remove the 5th patch from v3.
- Add fops replacement PoC in 5th - 7th patches.
v3: https://lore.kernel.org/chrome-platform/20250912081718.3827390-1-tzungbi@ke…
- Rebase onto https://lore.kernel.org/chrome-platform/20250828083601.856083-1-tzungbi@ker…
and next-20250912.
- The 4th patch changed accordingly.
v2: https://lore.kernel.org/chrome-platform/20250820081645.847919-1-tzungbi@ker…
- Rename "ref_proxy" -> "revocable".
- Add test cases in Kunit and selftest.
v1: https://lore.kernel.org/chrome-platform/20250814091020.1302888-1-tzungbi@ke…
Tzung-Bi Shih (7):
revocable: Revocable resource management
revocable: Add Kunit test cases
selftests: revocable: Add kselftest cases
platform/chrome: Protect cros_ec_device lifecycle with revocable
revocable: Add fops replacement
char: misc: Leverage revocable fops replacement
platform/chrome: cros_ec_chardev: Secure cros_ec_device via revocable
.../driver-api/driver-model/index.rst | 1 +
.../driver-api/driver-model/revocable.rst | 87 ++++
MAINTAINERS | 9 +
drivers/base/Kconfig | 8 +
drivers/base/Makefile | 5 +-
drivers/base/revocable.c | 374 ++++++++++++++++++
drivers/base/revocable_test.c | 110 ++++++
drivers/char/misc.c | 7 +
drivers/platform/chrome/cros_ec.c | 5 +
drivers/platform/chrome/cros_ec_chardev.c | 15 +-
include/linux/miscdevice.h | 3 +
include/linux/platform_data/cros_ec_proto.h | 4 +
include/linux/revocable.h | 60 +++
tools/testing/selftests/Makefile | 1 +
.../selftests/drivers/base/revocable/Makefile | 7 +
.../drivers/base/revocable/revocable_test.c | 116 ++++++
.../drivers/base/revocable/test-revocable.sh | 39 ++
.../base/revocable/test_modules/Makefile | 10 +
.../revocable/test_modules/revocable_test.c | 188 +++++++++
19 files changed, 1047 insertions(+), 2 deletions(-)
create mode 100644 Documentation/driver-api/driver-model/revocable.rst
create mode 100644 drivers/base/revocable.c
create mode 100644 drivers/base/revocable_test.c
create mode 100644 include/linux/revocable.h
create mode 100644 tools/testing/selftests/drivers/base/revocable/Makefile
create mode 100644 tools/testing/selftests/drivers/base/revocable/revocable_test.c
create mode 100755 tools/testing/selftests/drivers/base/revocable/test-revocable.sh
create mode 100644 tools/testing/selftests/drivers/base/revocable/test_modules/Makefile
create mode 100644 tools/testing/selftests/drivers/base/revocable/test_modules/revocable_test.c
--
2.51.0.534.gc79095c0ca-goog
Fix functions that return undefined values. These issues were caught by
running clang using LLVM=1 option.
Clang warnings are as follows:
ovpn-cli.c:1587:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1587 | if (!sock) {
| ^~~~~
ovpn-cli.c:1635:9: note: uninitialized use occurs here
1635 | return ret;
| ^~~
ovpn-cli.c:1587:2: note: remove the 'if' if its condition is always false
1587 | if (!sock) {
| ^~~~~~~~~~~~
1588 | fprintf(stderr, "cannot allocate netlink socket\n");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1589 | goto err_free;
| ~~~~~~~~~~~~~~
1590 | }
| ~
ovpn-cli.c:1584:15: note: initialize the variable 'ret' to silence this warning
1584 | int mcid, ret;
| ^
| = 0
ovpn-cli.c:2107:7: warning: variable 'ret' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
2107 | case CMD_INVALID:
| ^~~~~~~~~~~
ovpn-cli.c:2111:9: note: uninitialized use occurs here
2111 | return ret;
| ^~~
ovpn-cli.c:1939:12: note: initialize the variable 'ret' to silence this warning
1939 | int n, ret;
| ^
|
Fixes: 959bc330a439 ("testing/selftests: add test tool and scripts for ovpn module")
Signed-off-by: Sidharth Seela <sidharthseela(a)gmail.com>
---
v6:
- Remove stray line near Fixes tag.
- Include ovpn prefix in commit message.
v5:
- Assign -ENOMEM to ret inside if block.
- Assign -EINVAL to ret inside case block.
v4:
- Move changelog below sign-off.
- Remove double-hyphens in commit description.
v3:
- Use prefix net.
- Remove so_txtime fix as default case calls error().
- Changelog before sign-off.
- Three dashes after sign-off
v2:
- Use subsystem name "net".
- Add fixes tags.
- Remove txtimestamp fix as default case calls error.
- Assign constant error string instead of NULL.
diff --git a/tools/testing/selftests/net/ovpn/ovpn-cli.c b/tools/testing/selftests/net/ovpn/ovpn-cli.c
index 9201f2905f2c..8d0f2f61923c 100644
--- a/tools/testing/selftests/net/ovpn/ovpn-cli.c
+++ b/tools/testing/selftests/net/ovpn/ovpn-cli.c
@@ -1586,6 +1586,7 @@ static int ovpn_listen_mcast(void)
sock = nl_socket_alloc();
if (!sock) {
fprintf(stderr, "cannot allocate netlink socket\n");
+ ret = -ENOMEM;
goto err_free;
}
@@ -2105,6 +2106,7 @@ static int ovpn_run_cmd(struct ovpn_ctx *ovpn)
ret = ovpn_listen_mcast();
break;
case CMD_INVALID:
+ ret = -EINVAL;
break;
}
--
2.47.3
This series includes several changes to the MPTCP RX path. The main
goals are improving the RX performances, and increase the long term
maintainability.
Some changes reflects recent(ish) improvements introduced in the TCP
stack: patch 1, 2 and 3 are the MPTCP counter part of SKB deferral free
and auto-tuning improvements. Note that patch 3 could possibly fix
additional issues, and overall such patch should protect from similar
issues to arise in the future.
Patches 4-7 are aimed at introducing the socket backlog usage which will
be done in a later series to process the packets received by the
different subflows while the msk socket is owned.
Patch 8 is not related to the RX path, but it contains additional tests
for new features recently introduced in net-next.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
---
Notes:
- Sorry for sending this series that late, we had quite a few patches
to upstream during this cycle. This is the last batch, and it has
been heavily tested the last 2 weeks.
- If there are some issues with some patches, but not with 1-3, it
would be nice, if possible, if these 3 first patches can be accepted,
to reduce the recently introduced gap with TCP.
- Patches can be grouped like this if needed: 1-3, 4-5, 6-7, 8. 6-7 are
preparing the ground for future on-going work, they can be dropped if
there are issues with them.
---
Matthieu Baerts (NGI0) (1):
selftests: mptcp: join: validate new laminar endp
Paolo Abeni (7):
mptcp: leverage skb deferral free
tcp: make tcp_rcvbuf_grow() accessible to mptcp code
mptcp: rcvbuf auto-tuning improvement
mptcp: introduce the mptcp_init_skb helper
mptcp: remove unneeded mptcp_move_skb()
mptcp: factor out a basic skb coalesce helper
mptcp: minor move_skbs_to_msk() cleanup
include/net/tcp.h | 1 +
net/ipv4/tcp_input.c | 2 +-
net/mptcp/protocol.c | 187 ++++++++++++------------
net/mptcp/protocol.h | 4 +-
tools/testing/selftests/net/mptcp/mptcp_join.sh | 69 +++++++++
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 9 ++
6 files changed, 177 insertions(+), 95 deletions(-)
---
base-commit: 1493c18fe8696bfc758a97130a485fc4e08387f5
change-id: 20250927-net-next-mptcp-rcv-path-imp-192d8c24c9c7
Best regards,
--
Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
The __nolibc_enosys() fallback is used when the UAPI headers do not
provide a certain syscall number or any possible fallback syscall.
This is either because the syscall definition is fairly new and nolibc
tries to be compatible with old UAPI headers or an architecture does not
support a syscall at all.
Many of these __nolibc_enosys() fallbacks have become unnecessary.
Either because the "new" syscalls or not so new anymore or real
fallbacks have been implemented in the meantime.
Unnecessary usages of __nolibc_enosys() as it is not obvious anymore if
a given function is really implemented on all architectures.
Signed-off-by: Thomas Weißschuh <linux(a)weissschuh.net>
---
Thomas Weißschuh (7):
tools/nolibc: remove __nolibc_enosys() fallback from time64-related functions
tools/nolibc: remove __nolibc_enosys() fallback from *at() functions
tools/nolibc: remove __nolibc_enosys() fallback from dup2()
tools/nolibc: remove __nolibc_enosys() fallback from fork functions
tools/nolibc: fold llseek fallback into lseek()
kselftest/arm64: tpidr2: Switch to waitpid() over wait4()
tools/nolibc: drop wait4() support
tools/include/nolibc/poll.h | 4 +-
tools/include/nolibc/sys.h | 90 +++++++++---------------------
tools/include/nolibc/sys/timerfd.h | 8 +--
tools/include/nolibc/sys/wait.h | 17 ------
tools/include/nolibc/time.h | 8 +--
tools/testing/selftests/arm64/abi/tpidr2.c | 6 +-
6 files changed, 34 insertions(+), 99 deletions(-)
---
base-commit: 850047b19741490631855a475ccaa3ed29316039
change-id: 20250821-nolibc-enosys-2b2ec0b505ba
Best regards,
--
Thomas Weißschuh <linux(a)weissschuh.net>