6.6.26-rc1 review
Subsystems (8)
Greg Kroah-Hartman
maintainerPATCH 242/252 of: module: prevent NULL pointer dereference in vsnprintf()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Shtylyov <[email protected]>
commit a1aa5390cc912934fee76ce80af5f940452fa987 upstream.
In of_modalias(), we can get passed the str and len parameters which would cause a kernel oops in vsnprintf() since it only allows passing a NULL ptr when the length is also 0. Also, we need to filter out the negative values of the len parameter as these will result in a really huge buffer since snprintf() takes size_t parameter while ours is ssize_t...
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
--- drivers/of/module.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/of/module.c +8 -0
@@ -16,6 +16,14 @@ ssize_t of_modalias(const struct device_ssize_t csize;ssize_t tsize; +/* +* Prevent a kernel oops in vsnprintf() -- it only allows passing a +* NULL ptr when the length is also 0. Also filter out the negative +* lengths... +*/ +if ((len >0 && !str) || len <0 ) +return -EINVAL ; +/* Name & Type */ /* %p eats all alphanum characters, so %c must be used here */ csize = snprintf(str, len, "of:N%pOFn%c%s", np, 'T',
Greg Kroah-Hartman
maintainerPATCH 243/252 selftests: mptcp: connect: fix shellcheck warnings
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
commit e3aae1098f109f0bd33c971deff1926f4e4441d0 upstream.
shellcheck recently helped to prevent issues. It is then good to fix the other harmless issues in order to spot "real" ones later.
Here, two categories of warnings are now ignored:
- SC2317: Command appears to be unreachable. The cleanup() function is invoked indirectly via the EXIT trap.
- SC2086: Double quote to prevent globbing and word splitting. This is recommended, but the current usage is correct and there is no need to do all these modifications to be compliant with this rule.
For the modifications:
- SC2034: ksft_skip appears unused.
- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
- SC2004: $/${} is unnecessary on arithmetic variables.
- SC2155: Declare and assign separately to avoid masking return values.
- SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
- SC2059: Don't use variables in the printf format string. Use printf
'..%s..' "$foo".
Now this script is shellcheck (0.9.0) compliant. We can easily spot new issues.
--- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 76 ++++++++++++--------- 1 file changed, 47 insertions(+), 29 deletions(-)
tools/testing/selftests/net/mptcp/mptcp_connect.sh +47 -29
@@ -1,6 +1,11 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Double quotes to prevent globbing and word splitting is recommended in new +# code but we accept it, especially because there were too many before having +# address all other issues detected by shellcheck. +#shellcheck disable=SC2086 + . "$(dirname "${0}")/mptcp_lib.sh" time_start=$(date +%s)
@@ -13,7 +18,6 @@ sout="" cin_disconnect="" cin="" cout="" -ksft_skip=4 capture=false timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1))
@@ -131,6 +135,8 @@ ns4="ns4-$rndh" TEST_COUNT=0 TEST_GROUP="" +# This function is used in the cleanup trap +#shellcheck disable=SC2317 cleanup() { rm -f "$cin_disconnect" "$cout_disconnect"
@@ -225,8 +231,9 @@ set_ethtool_flags() { local dev="$2" local flags="$3" - ip netns exec $ns ethtool -K $dev $flags 2>/dev/null - [ $? -eq 0 ] && echo "INFO: set $ns dev $dev: ethtool -K $flags" + if ip netns exec $ns ethtool -K $dev $flags 2>/dev/null; then + echo "INFO: set $ns dev $dev: ethtool -K $flags" + fi } set_random_ethtool_flags() {
@@ -363,7 +370,7 @@ do_transfer() local extra_args="$7" local port - port=$((10000+$TEST_COUNT)) + port=$((10000+TEST_COUNT)) TEST_COUNT=$((TEST_COUNT+1)) if [ "$rcvbuf" -gt 0 ]; then
@@ -420,12 +427,18 @@ do_transfer() nstat -n fi - local stat_synrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") - local stat_ackrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") - local stat_cookietx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") - local stat_cookierx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") - local stat_csum_err_s=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtDataCsumErr") - local stat_csum_err_c=$(mptcp_lib_get_counter "${connector_ns}" "MPTcpExtDataCsumErr") + local stat_synrx_last_l + local stat_ackrx_last_l + local stat_cookietx_last + local stat_cookierx_last + local stat_csum_err_s + local stat_csum_err_c + stat_synrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") + stat_ackrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") + stat_cookietx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") + stat_cookierx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") + stat_csum_err_s=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtDataCsumErr") + stat_csum_err_c=$(mptcp_lib_get_counter "${connector_ns}" "MPTcpExtDataCsumErr") timeout ${timeout_test} \ ip netns exec ${listener_ns} \
@@ -488,11 +501,16 @@ do_transfer() check_transfer $cin $sout "file received by server" rets=$? - local stat_synrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") - local stat_ackrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") - local stat_cookietx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") - local stat_cookierx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") - local stat_ooo_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtTCPOFOQueue") + local stat_synrx_now_l + local stat_ackrx_now_l + local stat_cookietx_now + local stat_cookierx_now + local stat_ooo_now + stat_synrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") + stat_ackrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") + stat_cookietx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") + stat_cookierx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") + stat_ooo_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtTCPOFOQueue") expect_synrx=$((stat_synrx_last_l)) expect_ackrx=$((stat_ackrx_last_l))
@@ -501,8 +519,8 @@ do_transfer() cookies=${cookies##*=} if [ ${cl_proto} = "MPTCP" ] && [ ${srv_proto} = "MPTCP" ]; then - expect_synrx=$((stat_synrx_last_l+$connect_per_transfer)) - expect_ackrx=$((stat_ackrx_last_l+$connect_per_transfer)) + expect_synrx=$((stat_synrx_last_l+connect_per_transfer)) + expect_ackrx=$((stat_ackrx_last_l+connect_per_transfer)) fi if [ ${stat_synrx_now_l} -lt ${expect_synrx} ]; then
@@ -510,7 +528,7 @@ do_transfer() "${stat_synrx_now_l}" "${expect_synrx}" 1>&2 retc=1 fi - if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} -a ${stat_ooo_now} -eq 0 ]; then + if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ] && [ ${stat_ooo_now} -eq 0 ]; then if [ ${stat_ooo_now} -eq 0 ]; then printf "[ FAIL ] lower MPC ACK rx (%d) than expected (%d)\n" \ "${stat_ackrx_now_l}" "${expect_ackrx}" 1>&2
@@ -521,18 +539,20 @@ do_transfer() fi if $checksum; then - local csum_err_s=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtDataCsumErr") - local csum_err_c=$(mptcp_lib_get_counter "${connector_ns}" "MPTcpExtDataCsumErr") + local csum_err_s + local csum_err_c + csum_err_s=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtDataCsumErr") + csum_err_c=$(mptcp_lib_get_counter "${connector_ns}" "MPTcpExtDataCsumErr") local csum_err_s_nr=$((csum_err_s - stat_csum_err_s)) if [ $csum_err_s_nr -gt 0 ]; then - printf "[ FAIL ]\nserver got $csum_err_s_nr data checksum error[s]" + printf "[ FAIL ]\nserver got %d data checksum error[s]" ${csum_err_s_nr} rets=1 fi local csum_err_c_nr=$((csum_err_c - stat_csum_err_c)) if [ $csum_err_c_nr -gt 0 ]; then - printf "[ FAIL ]\nclient got $csum_err_c_nr data checksum error[s]" + printf "[ FAIL ]\nclient got %d data checksum error[s]" ${csum_err_c_nr} retc=1 fi fi
@@ -701,7 +721,7 @@ run_test_transparent() return fi -ip netns exec "$listener_ns" nft -f /dev/stdin <<"EOF" + if ! ip netns exec "$listener_ns" nft -f /dev/stdin <<"EOF" flush ruleset table inet mangle { chain divert {
@@ -712,7 +732,7 @@ table inet mangle { } } EOF - if [ $? -ne 0 ]; then + then echo "SKIP: $msg, could not load nft ruleset" mptcp_lib_fail_if_expected_feature "nft rules" mptcp_lib_result_skip "${TEST_GROUP}"
@@ -727,8 +747,7 @@ EOF local_addr="0.0.0.0" fi - ip -net "$listener_ns" $r6flag rule add fwmark 1 lookup 100 - if [ $? -ne 0 ]; then + if ! ip -net "$listener_ns" $r6flag rule add fwmark 1 lookup 100; then ip netns exec "$listener_ns" nft flush ruleset echo "SKIP: $msg, ip $r6flag rule failed" mptcp_lib_fail_if_expected_feature "ip rule"
@@ -736,8 +755,7 @@ EOF return fi - ip -net "$listener_ns" route add local $local_addr/0 dev lo table 100 - if [ $? -ne 0 ]; then + if ! ip -net "$listener_ns" route add local $local_addr/0 dev lo table 100; then ip netns exec "$listener_ns" nft flush ruleset ip -net "$listener_ns" $r6flag rule del fwmark 1 lookup 100 echo "SKIP: $msg, ip route add local $local_addr failed"
@@ -900,7 +918,7 @@ stop_if_error "Could not even run ping t echo -n "INFO: Using loss of $tc_loss " test "$tc_delay" -gt 0 && echo -n "delay $tc_delay ms " -reorder_delay=$(($tc_delay / 4)) +reorder_delay=$((tc_delay / 4)) if [ -z "${tc_reorder}" ]; then reorder1=$((RANDOM%10))
Greg Kroah-Hartman
maintainerPATCH 244/252 mptcp: dont overwrite sock_ops in mptcp_is_tcpsk()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davide Caratti <[email protected]>
commit 8e2b8a9fa512709e6fee744dcd4e2a20ee7f5c56 upstream.
Eric Dumazet suggests:
Quoted 3 lines
The fact that
mptcp_is_tcpsk()was able to write oversock->opswas a bit strange to me.mptcp_is_tcpsk()should answer a question, with a read-only argument.
re-factor code to avoid overwriting sock_ops inside that function. Also, change the helper name to reflect the semantics and to disambiguate from its dual, sk_is_mptcp(). While at it, collapse mptcp_stream_accept() and mptcp_accept() into a single function, where fallback / non-fallback are separated into a single sk_is_mptcp() conditional.
--- net/mptcp/protocol.c | 108 ++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 64 deletions(-)
net/mptcp/protocol.c +44 -64
@@ -55,28 +55,14 @@ static u64 mptcp_wnd_end(const struct mpreturn READ_ONCE (msk->wnd_end); } -static bool mptcp_is_tcpsk (struct sock *sk) +static const struct proto_ops *mptcp_fallback_tcp_ops (const struct sock *sk) { -struct socket *sock = sk->sk_socket; - -if (unlikely (sk->sk_prot == &tcp_prot)) { -/* we are being invoked after mptcp_accept() has -* accepted a non-mp-capable flow: sk is a tcp_sk, -* not an mptcp one. -* -* Hand the socket over to tcp so all further socket ops -* bypass mptcp. -*/ -WRITE_ONCE (sock->ops, &inet_stream_ops); -return true;#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) - } else if (unlikely(sk->sk_prot == &tcpv6_prot)) { -WRITE_ONCE (sock->ops, &inet6_stream_ops); -return true; +if (sk->sk_prot == &tcpv6_prot) +return &inet6_stream_ops;#endif - } - -return false; +WARN_ON_ONCE (sk->sk_prot != &tcp_prot); +return &inet_stream_ops; }static int __mptcp_socket_create (struct mptcp_sock *msk)
@@ -3328,44 +3314,6 @@ void mptcp_rcv_space_init(struct mptcp_s msk->rcvq_space.space =TCP_INIT_CWND *TCP_MSS_DEFAULT ; } -static struct sock *mptcp_accept (struct sock *ssk,int flags,int *err, -bool kern) -{ -struct sock *newsk; - -pr_debug ("ssk=%p, listener=%p" , ssk,mptcp_subflow_ctx (ssk)); - newsk =inet_csk_accept (ssk, flags, err, kern); -if (!newsk) -return NULL ; - -pr_debug ("newsk=%p, subflow is mptcp=%d" , newsk,sk_is_mptcp (newsk)); -if (sk_is_mptcp (newsk)) { -struct mptcp_subflow_context *subflow; -struct sock *new_mptcp_sock; - - subflow =mptcp_subflow_ctx (newsk); - new_mptcp_sock = subflow->conn; - -/* is_mptcp should be false if subflow->conn is missing, see -* subflow_syn_recv_sock() -*/ -if (WARN_ON_ONCE (!new_mptcp_sock)) { -tcp_sk (newsk)->is_mptcp =0 ; - goto out; - } - - newsk = new_mptcp_sock; -MPTCP_INC_STATS (sock_net (ssk),MPTCP_MIB_MPCAPABLEPASSIVEACK ); - }else { -MPTCP_INC_STATS (sock_net (ssk), -MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ); - } - -out: - newsk->sk_kern_sock = kern; -return newsk; -} -void mptcp_destroy_common (struct mptcp_sock *msk,unsigned int flags) {struct mptcp_subflow_context *subflow, *tmp;
@@ -3802,7 +3750,6 @@ static struct proto mptcp_prot = { .connect = mptcp_connect, .disconnect = mptcp_disconnect, .close = mptcp_close, - .accept = mptcp_accept, .setsockopt = mptcp_setsockopt, .getsockopt = mptcp_getsockopt, .shutdown = mptcp_shutdown,
@@ -3912,18 +3859,36 @@ static int mptcp_stream_accept(struct soif (!ssk)return -EINVAL ; - newsk =mptcp_accept (ssk, flags, &err, kern); +pr_debug ("ssk=%p, listener=%p" , ssk,mptcp_subflow_ctx (ssk)); + newsk =inet_csk_accept (ssk, flags, &err, kern);if (!newsk)return err; -lock_sock (newsk); - -__inet_accept (sock, newsock, newsk); -if (!mptcp_is_tcpsk (newsock->sk)) { -struct mptcp_sock *msk =mptcp_sk (newsk); +pr_debug ("newsk=%p, subflow is mptcp=%d" , newsk,sk_is_mptcp (newsk)); +if (sk_is_mptcp (newsk)) {struct mptcp_subflow_context *subflow; +struct sock *new_mptcp_sock; + + subflow =mptcp_subflow_ctx (newsk); + new_mptcp_sock = subflow->conn; + +/* is_mptcp should be false if subflow->conn is missing, see +* subflow_syn_recv_sock() +*/ +if (WARN_ON_ONCE (!new_mptcp_sock)) { +tcp_sk (newsk)->is_mptcp =0 ; + goto tcpfallback; + } + + newsk = new_mptcp_sock; +MPTCP_INC_STATS (sock_net (ssk),MPTCP_MIB_MPCAPABLEPASSIVEACK ); + + newsk->sk_kern_sock = kern; +lock_sock (newsk); +__inet_accept (sock, newsock, newsk);set_bit (SOCK_CUSTOM_SOCKOPT , &newsock->flags); + msk =mptcp_sk (newsk); msk->in_accept_queue =0 ;/* set ssk->sk_socket of accept()ed flows to mptcp socket.
@@ -3945,6 +3910,21 @@ static int mptcp_stream_accept(struct soif (unlikely (list_is_singular (&msk->conn_list)))mptcp_set_state (newsk,TCP_CLOSE ); } + }else { +MPTCP_INC_STATS (sock_net (ssk), +MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ); +tcpfallback: + newsk->sk_kern_sock = kern; +lock_sock (newsk); +__inet_accept (sock, newsock, newsk); +/* we are being invoked after accepting a non-mp-capable +* flow: sk is a tcp_sk, not an mptcp one. +* +* Hand the socket over to tcp so all further socket ops +* bypass mptcp. +*/ +WRITE_ONCE (newsock->sk->sk_socket->ops, +mptcp_fallback_tcp_ops (newsock->sk)); }release_sock (newsk);
Greg Kroah-Hartman
maintainerPATCH 245/252 mptcp: dont account accept() of non-MPC client as fallback to TCP
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davide Caratti <[email protected]>
commit 7a1b3490f47e88ec4cbde65f1a77a0f4bc972282 upstream.
Current MPTCP servers increment MPTcpExtMPCapableFallbackACK when they accept non-MPC connections. As reported by Christoph, this is "surprising" because the counter might become greater than MPTcpExtMPCapableSYNRX.
MPTcpExtMPCapableFallbackACK counter's name suggests it should only be incremented when a connection was seen using MPTCP options, then a fallback to TCP has been done. Let's do that by incrementing it when the subflow context of an inbound MPC connection attempt is dropped. Also, update mptcp_connect.sh kselftest, to ensure that the above MIB does not increment in case a pure TCP client connects to a MPTCP server.
--- net/mptcp/protocol.c | 2 -- net/mptcp/subflow.c | 2 ++ tools/testing/selftests/net/mptcp/mptcp_connect.sh | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-)
net/mptcp/protocol.c +0 -2
@@ -3911,8 +3911,6 @@ static int mptcp_stream_accept(struct somptcp_set_state (newsk,TCP_CLOSE ); } }else { -MPTCP_INC_STATS (sock_net (ssk), -MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK ); tcpfallback: newsk->sk_kern_sock = kern;lock_sock (newsk);
net/mptcp/subflow.c +2 -0
@@ -905,6 +905,8 @@ dispose_child:return child; fallback: +if (fallback) +SUBFLOW_REQ_INC_STATS (req,MPTCP_MIB_MPCAPABLEPASSIVEFALLBACK );mptcp_subflow_drop_ctx (child);return child; }
tools/testing/selftests/net/mptcp/mptcp_connect.sh +9 -0
@@ -433,12 +433,14 @@ do_transfer() local stat_cookierx_last local stat_csum_err_s local stat_csum_err_c + local stat_tcpfb_last_l stat_synrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") stat_ackrx_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") stat_cookietx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") stat_cookierx_last=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") stat_csum_err_s=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtDataCsumErr") stat_csum_err_c=$(mptcp_lib_get_counter "${connector_ns}" "MPTcpExtDataCsumErr") + stat_tcpfb_last_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableFallbackACK") timeout ${timeout_test} \ ip netns exec ${listener_ns} \
@@ -506,11 +508,13 @@ do_transfer() local stat_cookietx_now local stat_cookierx_now local stat_ooo_now + local stat_tcpfb_now_l stat_synrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableSYNRX") stat_ackrx_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") stat_cookietx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesSent") stat_cookierx_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtSyncookiesRecv") stat_ooo_now=$(mptcp_lib_get_counter "${listener_ns}" "TcpExtTCPOFOQueue") + stat_tcpfb_now_l=$(mptcp_lib_get_counter "${listener_ns}" "MPTcpExtMPCapableFallbackACK") expect_synrx=$((stat_synrx_last_l)) expect_ackrx=$((stat_ackrx_last_l))
@@ -564,6 +568,11 @@ do_transfer() mptcp_lib_result_fail "${TEST_GROUP}: ${result_msg}" fi + if [ ${stat_ooo_now} -eq 0 ] && [ ${stat_tcpfb_last_l} -ne ${stat_tcpfb_now_l} ]; then + mptcp_lib_pr_fail "unexpected fallback to TCP" + rets=1 + fi + if [ $cookies -eq 2 ];then if [ $stat_cookietx_last -ge $stat_cookietx_now ] ;then printf " WARN: CookieSent: did not advance"
Greg Kroah-Hartman
maintainerPATCH 246/252 bpf: put uprobe links path and task in release callback
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrii Nakryiko <[email protected]>
commit e9c856cabefb71d47b2eeb197f72c9c88e9b45b0 upstream.
There is no need to delay putting either path or task to deallocation step. It can be done right after bpf_uprobe_unregister. Between release and dealloc, there could be still some running BPF programs, but they don't access either task or path, only data in link->uprobes, so it is safe to do.
On the other hand, doing path_put() in dealloc callback makes this dealloc sleepable because path_put() itself might sleep. Which is problematic due to the need to call uprobe's dealloc through call_rcu(), which is what is done in the next bug fix patch. So solve the problem by releasing these resources early.
--- kernel/trace/bpf_trace.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/trace/bpf_trace.c +3 -3
@@ -3065,6 +3065,9 @@ static void bpf_uprobe_multi_link_releas umulti_link = container_of(link, struct bpf_uprobe_multi_link, link);bpf_uprobe_unregister (&umulti_link->path, umulti_link->uprobes, umulti_link->cnt); +if (umulti_link->task) +put_task_struct (umulti_link->task); +path_put (&umulti_link->path); }static void bpf_uprobe_multi_link_dealloc (struct bpf_link *link)
@@ -3072,9 +3075,6 @@ static void bpf_uprobe_multi_link_deallostruct bpf_uprobe_multi_link *umulti_link; umulti_link = container_of(link, struct bpf_uprobe_multi_link, link); -if (umulti_link->task) -put_task_struct (umulti_link->task); -path_put (&umulti_link->path);kvfree (umulti_link->uprobes);kfree (umulti_link); }
Greg Kroah-Hartman
maintainerPATCH 247/252 bpf: support deferring bpf_link dealloc to after RCU grace period
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrii Nakryiko <[email protected]>
commit 1a80dbcb2dbaf6e4c216e62e30fa7d3daa8001ce upstream.
BPF link for some program types is passed as a "context" which can be used by those BPF programs to look up additional information. E.g., for multi-kprobes and multi-uprobes, link is used to fetch BPF cookie values.
Because of this runtime dependency, when bpf_link refcnt drops to zero there could still be active BPF programs running accessing link data.
This patch adds generic support to defer bpf_link dealloc callback to after RCU GP, if requested. This is done by exposing two different deallocation callbacks, one synchronous and one deferred. If deferred one is provided, bpf_link_free() will schedule dealloc_deferred() callback to happen after RCU GP.
BPF is using two flavors of RCU: "classic" non-sleepable one and RCU tasks trace one. The latter is used when sleepable BPF programs are used. bpf_link_free() accommodates that by checking underlying BPF program's sleepable flag, and goes either through normal RCU GP only for non-sleepable, or through RCU tasks trace GP *and* then normal RCU GP (taking into account rcu_trace_implies_rcu_gp() optimization), if BPF program is sleepable.
We use this for multi-kprobe and multi-uprobe links, which dereference link during program run. We also preventively switch raw_tp link to use deferred dealloc callback, as upcoming changes in bpf-next tree expose raw_tp link data (specifically, cookie value) to BPF program at runtime as well.
--- include/linux/bpf.h | 16 +++++++++++++++- kernel/bpf/syscall.c | 35 ++++++++++++++++++++++++++++++++--- kernel/trace/bpf_trace.c | 4 ++-- 3 files changed, 49 insertions(+), 6 deletions(-)
include/linux/bpf.h +15 -1
@@ -1524,12 +1524,26 @@ struct bpf_link {enum bpf_link_type type;const struct bpf_link_ops *ops;struct bpf_prog *prog; -struct work_struct work; +/* rcu is used before freeing, work can be used to schedule that +* RCU-based freeing before that, so they never overlap +*/ +union { +struct rcu_head rcu; +struct work_struct work; + }; };struct bpf_link_ops {void (*release)(struct bpf_link *link); +/* deallocate link resources callback, called without RCU grace period +* waiting +*/ void (*dealloc)(struct bpf_link *link); +/* deallocate link resources callback, called after RCU grace period; +* if underlying BPF program is sleepable we go through tasks trace +* RCU GP and then "classic" RCU GP +*/ +void (*dealloc_deferred)(struct bpf_link *link);int (*detach)(struct bpf_link *link);int (*update_prog)(struct bpf_link *link,struct bpf_prog *new_prog,struct bpf_prog *old_prog);
kernel/bpf/syscall.c +32 -3
@@ -2866,17 +2866,46 @@ void bpf_link_inc(struct bpf_link *link)atomic64_inc (&link->refcnt); } +static void bpf_link_defer_dealloc_rcu_gp (struct rcu_head *rcu) +{ + struct bpf_link *link = container_of(rcu, struct bpf_link, rcu); + +/* free bpf_link and its containing memory */ + link->ops->dealloc_deferred (link); +} + +static void bpf_link_defer_dealloc_mult_rcu_gp (struct rcu_head *rcu) +{ +if (rcu_trace_implies_rcu_gp ()) +bpf_link_defer_dealloc_rcu_gp (rcu); +else +call_rcu (rcu, bpf_link_defer_dealloc_rcu_gp); +} +/* bpf_link_free is guaranteed to be called from process context */ static void bpf_link_free (struct bpf_link *link) { +bool sleepable = false; +bpf_link_free_id (link->id);if (link->prog) { + sleepable = link->prog->aux->sleepable;/* detach BPF program, clean up used resources */ link->ops->release (link);bpf_prog_put (link->prog); } -/* free bpf_link and its containing memory */ - link->ops->dealloc (link); +if (link->ops->dealloc_deferred) { +/* schedule BPF link deallocation; if underlying BPF program +* is sleepable, we need to first wait for RCU tasks trace +* sync, then go through "classic" RCU grace period +*/ +if (sleepable) +call_rcu_tasks_trace (&link->rcu, bpf_link_defer_dealloc_mult_rcu_gp); +else +call_rcu (&link->rcu, bpf_link_defer_dealloc_rcu_gp); + } +if (link->ops->dealloc) + link->ops->dealloc (link); }static void bpf_link_put_deferred (struct work_struct *work)
@@ -3381,7 +3410,7 @@ static int bpf_raw_tp_link_fill_link_infstatic const struct bpf_link_ops bpf_raw_tp_link_lops = { .release = bpf_raw_tp_link_release, - .dealloc = bpf_raw_tp_link_dealloc, + .dealloc_deferred = bpf_raw_tp_link_dealloc, .show_fdinfo = bpf_raw_tp_link_show_fdinfo, .fill_link_info = bpf_raw_tp_link_fill_link_info, };
kernel/trace/bpf_trace.c +2 -2
@@ -2639,7 +2639,7 @@ static int bpf_kprobe_multi_link_fill_listatic const struct bpf_link_ops bpf_kprobe_multi_link_lops = { .release = bpf_kprobe_multi_link_release, - .dealloc = bpf_kprobe_multi_link_dealloc, + .dealloc_deferred = bpf_kprobe_multi_link_dealloc, .fill_link_info = bpf_kprobe_multi_link_fill_link_info, };
@@ -3081,7 +3081,7 @@ static void bpf_uprobe_multi_link_deallostatic const struct bpf_link_ops bpf_uprobe_multi_link_lops = { .release = bpf_uprobe_multi_link_release, - .dealloc = bpf_uprobe_multi_link_dealloc, + .dealloc_deferred = bpf_uprobe_multi_link_dealloc, }; static int uprobe_prog_run(struct bpf_uprobe *uprobe,
Greg Kroah-Hartman
maintainerPATCH 248/252 x86/head/64: Move the __head definition to <asm/init.h>
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Wenlong <[email protected]>
commit d2a285d65bfde3218fd0c3b88794d0135ced680b upstream.
Move the __head section definition to a header to widen its use.
An upcoming patch will mark the code as __head in mem_encrypt_identity.c too.
--- arch/x86/include/asm/init.h | 2 ++ arch/x86/kernel/head64.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-)
arch/x86/include/asm/init.h +2 -0
@@ -2,6 +2,8 @@ #ifndef _ASM_X86_INIT_H #define _ASM_X86_INIT_H +#define __head __section(".head.text") + struct x86_mapping_info { void *(*alloc_pgt_page)(void *); /* allocate buf for page table */ void *context; /* context for alloc_pgt_page */
arch/x86/kernel/head64.c +1 -2
@@ -41,6 +41,7 @@#include <asm/trapnr.h> #include <asm/sev.h> #include <asm/tdx.h> +#include <asm/init.h> /* * Manage page tables very early on.
@@ -84,8 +85,6 @@ static struct desc_ptr startup_gdt_descr .address = 0, }; -#define __head __section(".head.text") - static void __head *fixup_pointer(void *ptr, unsigned long physaddr) {return ptr - (void *)_text + (void *)physaddr;
Greg Kroah-Hartman
maintainerPATCH 249/252 efi/libstub: Add generic support for parsing mem_encrypt=
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 7205f06e847422b66c1506eee01b9998ffc75d76 upstream.
Parse the mem_encrypt= command line parameter from the EFI stub if CONFIG_ARCH_HAS_MEM_ENCRYPT=y, so that it can be passed to the early boot code by the arch code in the stub.
This avoids the need for the core kernel to do any string parsing very early in the boot.
--- drivers/firmware/efi/libstub/efi-stub-helper.c | 8 ++++++++ drivers/firmware/efi/libstub/efistub.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/firmware/efi/libstub/efi-stub-helper.c +8 -0
@@ -24,6 +24,8 @@ static bool efi_noinitrd;static bool efi_nosoftreserve;static bool efi_disable_pci_dma =IS_ENABLED (CONFIG_EFI_DISABLE_PCI_DMA ); +int efi_mem_encrypt; +bool __pure __efi_soft_reserve_enabled (void ) {return !efi_nosoftreserve;
@@ -75,6 +77,12 @@ efi_status_t efi_parse_options(char cons efi_noinitrd = true; }else if (IS_ENABLED (CONFIG_X86_64 ) && !strcmp (param,"no5lvl" )) { efi_no5lvl = true; + }else if (IS_ENABLED (CONFIG_ARCH_HAS_MEM_ENCRYPT ) && + !strcmp (param,"mem_encrypt" ) && val) { +if (parse_option_str (val,"on" )) + efi_mem_encrypt =1 ; +else if (parse_option_str (val,"off" )) + efi_mem_encrypt =-1 ; }else if (!strcmp (param,"efi" ) && val) { efi_nochunk =parse_option_str (val,"nochunk" ); efi_novamap |=parse_option_str (val,"novamap" );
drivers/firmware/efi/libstub/efistub.h +1 -1
@@ -37,8 +37,8 @@ extern bool efi_no5lvl;extern bool efi_nochunk;extern bool efi_nokaslr;extern int efi_loglevel; +extern int efi_mem_encrypt;extern bool efi_novamap; -extern const efi_system_table_t *efi_system_table;typedef union efi_dxe_services_table efi_dxe_services_table_t ;
Greg Kroah-Hartman
maintainerPATCH 250/252 x86/sme: Move early SME kernel encryption handling into .head.text
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 48204aba801f1b512b3abed10b8e1a63e03f3dd1 upstream.
The .head.text section is the initial primary entrypoint of the core kernel, and is entered with the CPU executing from a 1:1 mapping of memory. Such code must never access global variables using absolute references, as these are based on the kernel virtual mapping which is not active yet at this point.
Given that the SME startup code is also called from this early execution context, move it into .head.text as well. This will allow more thorough build time checks in the future to ensure that early startup code only uses RIP-relative references to global variables.
Also replace some occurrences of __pa_symbol() [which relies on the compiler generating an absolute reference, which is not guaranteed] and an open coded RIP-relative access with RIP_REL_REF().
--- arch/x86/include/asm/mem_encrypt.h | 8 +++---- arch/x86/mm/mem_encrypt_identity.c | 42 ++++++++++++++----------------------- 2 files changed, 21 insertions(+), 29 deletions(-)
arch/x86/include/asm/mem_encrypt.h +4 -4
@@ -46,8 +46,8 @@ void __init sme_unmap_bootdata(char *reavoid __init sme_early_init (void );void __init sev_setup_arch (void ); -void __init sme_encrypt_kernel (struct boot_params *bp); -void __init sme_enable (struct boot_params *bp); +void sme_encrypt_kernel (struct boot_params *bp); +void sme_enable (struct boot_params *bp);int __init early_set_memory_decrypted (unsigned long vaddr,unsigned long size);int __init early_set_memory_encrypted (unsigned long vaddr,unsigned long size);
@@ -81,8 +81,8 @@ static inline void __init sme_unmap_bootstatic inline void __init sme_early_init (void ) { }static inline void __init sev_setup_arch (void ) { } -static inline void __init sme_encrypt_kernel (struct boot_params *bp) { } -static inline void __init sme_enable (struct boot_params *bp) { } +static inline void sme_encrypt_kernel (struct boot_params *bp) { } +static inline void sme_enable (struct boot_params *bp) { }static inline void sev_es_init_vc_handling (void ) { }
arch/x86/mm/mem_encrypt_identity.c +17 -25
138 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 251/252 x86/sev: Move early startup code into .head.text section
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 428080c9b19bfda37c478cd626dbd3851db1aff9 upstream.
In preparation for implementing rigorous build time checks to enforce that only code that can support it will be called from the early 1:1 mapping of memory, move SEV init code that is called in this manner to the .head.text section.
--- arch/x86/boot/compressed/sev.c | 3 +++ arch/x86/include/asm/sev.h | 10 +++++----- arch/x86/kernel/sev-shared.c | 23 ++++++++++------------- arch/x86/kernel/sev.c | 14 ++++++++------ 4 files changed, 26 insertions(+), 24 deletions(-)
arch/x86/boot/compressed/sev.c +3 -0
@@ -116,6 +116,9 @@ static bool fault_in_kernel_space(unsign#undef __init#define __init +#undef __head +#define __head +#define __BOOT_COMPRESSED/* Basic instruction decoding support needed */
arch/x86/include/asm/sev.h +5 -5
@@ -199,15 +199,15 @@ static inline int pvalidate(unsigned lonstruct snp_guest_request_ioctl ;void setup_ghcb (void ); -void __init early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr, -unsigned long npages); -void __init early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr, -unsigned long npages); +void early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr, +unsigned long npages); +void early_snp_set_memory_shared (unsigned long vaddr,unsigned long paddr, +unsigned long npages);void snp_set_memory_shared (unsigned long vaddr,unsigned long npages);void snp_set_memory_private (unsigned long vaddr,unsigned long npages);void snp_set_wakeup_secondary_cpu (void );bool snp_init (struct boot_params *bp); -void __init __noreturn snp_abort (void ); +void __noreturn snp_abort (void );void snp_dmi_setup (void );int snp_issue_guest_request (u64 exit_code,struct snp_req_data *input,struct snp_guest_request_ioctl *rio);void snp_accept_memory (phys_addr_t start,phys_addr_t end);
arch/x86/kernel/sev-shared.c +10 -13
@@ -89,7 +89,8 @@ static bool __init sev_es_check_cpu_featreturn true; } -static void __noreturn sev_es_terminate (unsigned int set,unsigned int reason) +static void __head __noreturn +sev_es_terminate (unsigned int set,unsigned int reason) {u64 val =GHCB_MSR_TERM_REQ ;
@@ -326,13 +327,7 @@ static int sev_cpuid_hv(struct ghcb *ghc*/ static const struct snp_cpuid_table *snp_cpuid_get_table (void ) { -void *ptr; - - asm ("lea cpuid_table_copy(%%rip), %0" - :"=r" (ptr) - :"p" (&cpuid_table_copy)); - -return ptr; +return &RIP_REL_REF (cpuid_table_copy); }/*
@@ -391,7 +386,7 @@ static u32 snp_cpuid_calc_xsave_size(u64return xsave_size; } -static bool +static bool __headsnp_cpuid_get_validated_func (struct cpuid_leaf *leaf) {const struct snp_cpuid_table *cpuid_table =snp_cpuid_get_table ();
@@ -528,7 +523,8 @@ static int snp_cpuid_postprocess(struct* Returns -EOPNOTSUPP if feature not enabled. Any other non-zero return value * should be treated as fatal by caller. */ -static int snp_cpuid (struct ghcb *ghcb,struct es_em_ctxt *ctxt,struct cpuid_leaf *leaf) +static int __head +snp_cpuid (struct ghcb *ghcb,struct es_em_ctxt *ctxt,struct cpuid_leaf *leaf) {const struct snp_cpuid_table *cpuid_table =snp_cpuid_get_table ();
@@ -570,7 +566,7 @@ static int snp_cpuid(struct ghcb *ghcb,* page yet, so it only supports the MSR based communication with the * hypervisor and only the CPUID exit-code. */ -void __init do_vc_no_ghcb (struct pt_regs *regs,unsigned long exit_code) +void __head do_vc_no_ghcb(struct pt_regs *regs, unsigned long exit_code) {unsigned int subfn =lower_bits (regs->cx,32 );unsigned int fn =lower_bits (regs->ax,32 );
@@ -1016,7 +1012,8 @@ struct cc_setup_data {* Search for a Confidential Computing blob passed in as a setup_data entry * via the Linux Boot Protocol. */ -static struct cc_blob_sev_info *find_cc_blob_setup_data (struct boot_params *bp) +static __head +struct cc_blob_sev_info *find_cc_blob_setup_data(struct boot_params *bp) {struct cc_setup_data *sd =NULL ;struct setup_data *hdr;
@@ -1043,7 +1040,7 @@ static struct cc_blob_sev_info *find_cc_* mapping needs to be updated in sync with all the changes to virtual memory * layout and related mapping facilities throughout the boot process. */ -static void __init setup_cpuid_table (const struct cc_blob_sev_info *cc_info) +static void __head setup_cpuid_table(const struct cc_blob_sev_info *cc_info) {const struct snp_cpuid_table *cpuid_table_fw, *cpuid_table;int i;
arch/x86/kernel/sev.c +8 -6
@@ -26,6 +26,7 @@#include <linux/dmi.h> #include <uapi/linux/sev-guest.h> +#include <asm/init.h> #include <asm/cpu_entry_area.h> #include <asm/stacktrace.h> #include <asm/sev.h>
@@ -683,8 +684,9 @@ static u64 __init get_jump_table_addr(voreturn ret; } -static void early_set_pages_state (unsigned long vaddr,unsigned long paddr, -unsigned long npages,enum psc_op op) +static void __head +early_set_pages_state (unsigned long vaddr,unsigned long paddr, +unsigned long npages,enum psc_op op) {unsigned long paddr_end;u64 val;
@@ -740,7 +742,7 @@ e_term:sev_es_terminate (SEV_TERM_SET_LINUX ,GHCB_TERM_PSC ); } -void __init early_snp_set_memory_private (unsigned long vaddr,unsigned long paddr, +void __head early_snp_set_memory_private(unsigned long vaddr, unsigned long paddr,unsigned long npages) {/*
@@ -2045,7 +2047,7 @@ fail:* * Scan for the blob in that order. */ -static __init struct cc_blob_sev_info *find_cc_blob (struct boot_params *bp) +static __head struct cc_blob_sev_info *find_cc_blob(struct boot_params *bp) {struct cc_blob_sev_info *cc_info;
@@ -2071,7 +2073,7 @@ found_cc_info:return cc_info; } -bool __init snp_init (struct boot_params *bp) +bool __head snp_init(struct boot_params *bp) {struct cc_blob_sev_info *cc_info;
@@ -2093,7 +2095,7 @@ bool __init snp_init(struct boot_paramsreturn true; } -void __init __noreturn snp_abort (void ) +void __head __noreturn snp_abort(void) {sev_es_terminate (SEV_TERM_SET_GEN ,GHCB_SNP_UNSUPPORTED ); }
Greg Kroah-Hartman
maintainerPATCH 252/252 x86/efistub: Remap kernel text read-only before dropping NX attribute
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ard Biesheuvel <[email protected]>
commit 9c55461040a9264b7e44444c53d26480b438eda6 upstream.
Currently, the EFI stub invokes the EFI memory attributes protocol to strip any NX restrictions from the entire loaded kernel, resulting in all code and data being mapped read-write-execute.
The point of the EFI memory attributes protocol is to remove the need for all memory allocations to be mapped with both write and execute permissions by default, and make it the OS loader's responsibility to transition data mappings to code mappings where appropriate.
Even though the UEFI specification does not appear to leave room for denying memory attribute changes based on security policy, let's be cautious and avoid relying on the ability to create read-write-execute mappings. This is trivially achievable, given that the amount of kernel code executing via the firmware's 1:1 mapping is rather small and limited to the .head.text region. So let's drop the NX restrictions only on that subregion, but not before remapping it as read-only first.
--- arch/x86/boot/compressed/Makefile | 2 +- arch/x86/boot/compressed/misc.c | 1 + arch/x86/include/asm/boot.h | 1 + drivers/firmware/efi/libstub/x86-stub.c | 11 ++++++++++- 4 files changed, 13 insertions(+), 2 deletions(-)
arch/x86/boot/compressed/Makefile +1 -1
@@ -84,7 +84,7 @@ LDFLAGS_vmlinux += -T hostprogs := mkpiggy HOST_EXTRACFLAGS += -I$(srctree)/tools/include -sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|__bss_start\|_end\)$$/\#define VO_\2 _AC(0x\1,UL)/p' +sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|__start_rodata\|__bss_start\|_end\)$$/\#define VO_\2 _AC(0x\1,UL)/p' quiet_cmd_voffset = VOFFSET $@ cmd_voffset = $(NM) $< | sed -n $(sed-voffset) > $@
arch/x86/boot/compressed/misc.c +1 -0
@@ -330,6 +330,7 @@ static size_t parse_elf(void *output)return ehdr.e_entry -LOAD_PHYSICAL_ADDR ; } +const unsigned long kernel_text_size = VO___start_rodata - VO__text;const unsigned long kernel_total_size = VO__end - VO__text;static u8 boot_heap[BOOT_HEAP_SIZE ]__aligned(4) ;
arch/x86/include/asm/boot.h +1 -0
@@ -81,6 +81,7 @@#ifndef __ASSEMBLY__extern unsigned int output_len; +extern const unsigned long kernel_text_size;extern const unsigned long kernel_total_size; unsigned long decompress_kernel(unsigned char *outbuf, unsigned long virt_addr,
drivers/firmware/efi/libstub/x86-stub.c +10 -1
@@ -238,6 +238,15 @@ efi_status_t efi_adjust_memory_range_pro rounded_end =roundup (start + size,EFI_PAGE_SIZE );if (memattr !=NULL ) { + status =efi_call_proto (memattr, set_memory_attributes, + rounded_start, + rounded_end - rounded_start, +EFI_MEMORY_RO ); +if (status !=EFI_SUCCESS ) { +efi_warn ("Failed to set EFI_MEMORY_RO attribute\n" ); +return status; + } + status = efi_call_proto(memattr, clear_memory_attributes, rounded_start, rounded_end - rounded_start,
@@ -816,7 +825,7 @@ static efi_status_t efi_decompress_kerne *kernel_entry = addr + entry; -return efi_adjust_memory_range_protection (addr, kernel_total_size); +return efi_adjust_memory_range_protection (addr, kernel_text_size); } static void __noreturn enter_kernel(unsigned long kernel_addr,
Hello,
Quoted 5 lines · On Mon, 8 Apr 2024 14:54:59 +0200 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] ec59b99017e9 ("Linux 6.6.26-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
The s390 defconfig build failed with gcc-13 and clang-17 due following build warning / errors on Linux stable-rc linux-6.6.y.
Build error:
--------arch/s390/kernel/perf_pai_crypto.c: In function 'paicrypt_stop':arch/s390/kernel/perf_pai_crypto.c:280:51: error: 'paicrypt_root' undeclared (first use in this function); did you mean 'paicrypt_stop'?
280 | struct paicrypt_mapptr *mp = this_cpu_ptr(paicrypt_root.mapptr);
| ^~~~~~~~~~~~~
Commit detail,
s390/pai: fix sampling event removal for PMU device driver [ Upstream commit e9f3af02f63909f41b43c28330434cc437639c5c ]
Steps to reproduce:
# tuxmake --runtime podman --target-arch s390 --toolchain gcc-13 --kconfig defconfig
Links:
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.25-253-gec59b99017e9/testrun/23347738/suite/build/test/gcc-13-defconfig/log
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.25-253-gec59b99017e9/testrun/23347738/suite/build/test/gcc-13-defconfig/details/
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2eozoS8GQGxb94EUWNTPuXvYjVU/
--
Linaro LKFT
https://lkft.linaro.org
Greg Kroah-Hartman
maintainerQuoted 38 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
The s390 defconfig build failed with gcc-13 and clang-17 due following build warning / errors on Linux stable-rc linux-6.6.y.
Build error:
--------arch/s390/kernel/perf_pai_crypto.c: In function 'paicrypt_stop':arch/s390/kernel/perf_pai_crypto.c:280:51: error: 'paicrypt_root' undeclared (first use in this function); did you mean 'paicrypt_stop'?
280 | structpaicrypt_mapptr*mp =this_cpu_ptr(paicrypt_root.mapptr);
| ^~~~~~~~~~~~~Commit detail,
s390/pai: fix sampling event removal for PMU device driver [ Upstream commite9f3af02f63909f41b43c28330434cc437639c5c]
Quoted 8 lines
Steps to reproduce:
# tuxmake --runtime podman --target-arch s390 --toolchain gcc-13 --kconfig defconfigLinks:
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.25-253-gec59b99017e9/testrun/23347738/suite/build/test/gcc-13-defconfig/log
- https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.25-253-gec59b99017e9/testrun/23347738/suite/build/test/gcc-13-defconfig/details/
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2eozoS8GQGxb94EUWNTPuXvYjVU/
Thanks, I'll go drop a bunch of s390 patches from this tree and push out a -rc2 later tonight.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 34 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
The s390 defconfig build failed with gcc-13 and clang-17 due following build warning / errors on Linux stable-rc linux-6.6.y.
Build error:
--------arch/s390/kernel/perf_pai_crypto.c: In function 'paicrypt_stop':arch/s390/kernel/perf_pai_crypto.c:280:51: error: 'paicrypt_root' undeclared (first use in this function); did you mean 'paicrypt_stop'?
280 | structpaicrypt_mapptr*mp =this_cpu_ptr(paicrypt_root.mapptr);
| ^~~~~~~~~~~~~
Quoted 3 lines
Commit detail,
s390/pai: fix sampling event removal for PMU device driver [ Upstream commite9f3af02f63909f41b43c28330434cc437639c5c]
I'll drop the pai patches from this queue as well, thanks!
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
No regressions found on WSL (x86 and arm64).
Built, booted, and reviewed dmesg.
Thank you. :)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v6.6:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 116 pass, 0 failLinux version: 6.6.26-rc1-gec59b99017e9
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Jon
Hi Greg
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
6.6.26-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 6.6.26-rc1rv
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 13.2.1 20230801, GNU ld (GNU Binutils) 2.42.0) #1 SMP PREEMPT_DYNAMIC Tue Apr 9 18:54:11 JST 2024
Thanks
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Thanks,
Conor.
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro's test farm.
Regressions on x86_64, and i386.
Following kernel warnings have been noticed on x86_64, qemu-x86_64 and qemu-i386 while running LTP cve ioctl_sg01 tests the kernel with stable-rc 6.6.26-rc1 and 6.8.5-rc1.
Reverted this patch and I couldn't see the repoted warning.
scsi: sg: Avoid sg device teardown race
[ Upstream commit 27f58c04a8f438078583041468ec60597841284d ]
This has been reported on stable-rc 6.6.24-rc1 [1].
------------[ cut here ]------------ [ 839.268407] WARNING: CPU: 0 PID: 92507 at drivers/scsi/sg.c:2237 sg_remove_sfp_usercontext+0x145/0x150 [ 839.277715] Modules linked in: algif_hash x86_pkg_temp_thermal [ 839.284952] CPU: 0 PID: 92507 Comm: kworker/0:0 Not tainted 6.6.26-rc1 #1 [ 839.293108] Hardware name: Supermicro SYS-5019S-ML/X11SSH-F, BIOS 2.7 12/07/2021 [ 839.300514] Workqueue: events sg_remove_sfp_usercontext [ 839.307122] RIP: 0010:sg_remove_sfp_usercontext+0x145/0x150
<trim>
[ 839.415941] Call Trace: [ 839.419788] <TASK> [ 839.421924] ? show_regs+0x69/0x80 [ 839.425337] ? __warn+0x8d/0x150 [ 839.429950] ? sg_remove_sfp_usercontext+0x145/0x150 [ 839.434923] ? report_bug+0x171/0x1a0 [ 839.439968] ? handle_bug+0x42/0x80 [ 839.443466] ? exc_invalid_op+0x1c/0x70 [ 839.448688] ? asm_exc_invalid_op+0x1f/0x30 [ 839.452878] ? call_rcu+0x12/0x20 [ 839.457579] ? sg_remove_sfp_usercontext+0x145/0x150 [ 839.462551] process_one_work+0x13e/0x300 [ 839.467946] worker_thread+0x2f6/0x430 [ 839.471704] ? _raw_spin_unlock_irqrestore+0x22/0x50 [ 839.478049] ? __pfx_worker_thread+0x10/0x10 [ 839.482326] kthread+0x102/0x140 [ 839.486942] ? __pfx_kthread+0x10/0x10 [ 839.490699] ret_from_fork+0x3e/0x60 [ 839.495658] ? __pfx_kthread+0x10/0x10 [ 839.499419] ret_from_fork_asm+0x1b/0x30 [ 839.504727] </TASK> [ 839.506923] ---[ end trace 0000000000000000 ]---
[1]
- https://lore.kernel.org/stable/CA+G9fYs5MZaPV+tTukfUbJtdztQMExfixo=ZwbBr1A6Oga+OLQ@mail.gmail.com/
## Build
* kernel: 6.6.26-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.6.y
* git commit: ec59b99017e96d3bc8a6d5b87c01f47ec5a9bcb9
* git describe: v6.6.25-253-gec59b99017e9
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.6.y/build/v6.6.25-253-gec59b99017e9
## Test result summary
total: 165396, pass: 142577, fail: 2173, skip: 20493, xfail: 153
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 131 total, 131 passed, 0 failed
* arm64: 39 total, 39 passed, 0 failed
* i386: 31 total, 31 passed, 0 failed
* mips: 24 total, 24 passed, 0 failed
* parisc: 3 total, 3 passed, 0 failed
* powerpc: 34 total, 34 passed, 0 failed
* riscv: 16 total, 16 passed, 0 failed
* s390: 12 total, 8 passed, 4 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 35 total, 35 passed, 0 failed
## Test suites summary
* boot
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-filesystems-epoll
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mm
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-net-mptcp
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-smoketest
* ltp-syscalls
* ltp-tracing
* perf
* rcutorture
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64 with our testing.
Thanks,
Harshit
Quoted 10 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.6.26 release. There are 252 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 10 Apr 2024 12:52:23 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.6.26-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.6.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah