Merge 5.15.59 into android14-5.15
Changes in 5.15.59
Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_put
Revert "ocfs2: mount shared volume without ha stack"
ntfs: fix use-after-free in ntfs_ucsncmp()
fs: sendfile handles O_NONBLOCK of out_fd
secretmem: fix unhandled fault in truncate
mm: fix page leak with multiple threads mapping the same page
hugetlb: fix memoryleak in hugetlb_mcopy_atomic_pte
asm-generic: remove a broken and needless ifdef conditional
s390/archrandom: prevent CPACF trng invocations in interrupt context
nouveau/svm: Fix to migrate all requested pages
drm/simpledrm: Fix return type of simpledrm_simple_display_pipe_mode_valid()
watch_queue: Fix missing rcu annotation
watch_queue: Fix missing locking in add_watch_to_object()
tcp: Fix data-races around sysctl_tcp_dsack.
tcp: Fix a data-race around sysctl_tcp_app_win.
tcp: Fix a data-race around sysctl_tcp_adv_win_scale.
tcp: Fix a data-race around sysctl_tcp_frto.
tcp: Fix a data-race around sysctl_tcp_nometrics_save.
tcp: Fix data-races around sysctl_tcp_no_ssthresh_metrics_save.
ice: check (DD | EOF) bits on Rx descriptor rather than (EOP | RS)
ice: do not setup vlan for loopback VSI
scsi: ufs: host: Hold reference returned by of_parse_phandle()
Revert "tcp: change pingpong threshold to 3"
octeontx2-pf: Fix UDP/TCP src and dst port tc filters
tcp: Fix data-races around sysctl_tcp_moderate_rcvbuf.
tcp: Fix a data-race around sysctl_tcp_limit_output_bytes.
tcp: Fix a data-race around sysctl_tcp_challenge_ack_limit.
scsi: core: Fix warning in scsi_alloc_sgtables()
scsi: mpt3sas: Stop fw fault watchdog work item during system shutdown
net: ping6: Fix memleak in ipv6_renew_options().
ipv6/addrconf: fix a null-ptr-deref bug for ip6_ptr
net/tls: Remove the context from the list in tls_device_down
igmp: Fix data-races around sysctl_igmp_qrv.
net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii
net: sungem_phy: Add of_node_put() for reference returned by of_get_parent()
tcp: Fix a data-race around sysctl_tcp_min_tso_segs.
tcp: Fix a data-race around sysctl_tcp_min_rtt_wlen.
tcp: Fix a data-race around sysctl_tcp_autocorking.
tcp: Fix a data-race around sysctl_tcp_invalid_ratelimit.
Documentation: fix sctp_wmem in ip-sysctl.rst
macsec: fix NULL deref in macsec_add_rxsa
macsec: fix error message in macsec_add_rxsa and _txsa
macsec: limit replay window size with XPN
macsec: always read MACSEC_SA_ATTR_PN as a u64
net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa()
net: mld: fix reference count leak in mld_{query | report}_work()
tcp: Fix data-races around sk_pacing_rate.
net: Fix data-races around sysctl_[rw]mem(_offset)?.
tcp: Fix a data-race around sysctl_tcp_comp_sack_delay_ns.
tcp: Fix a data-race around sysctl_tcp_comp_sack_slack_ns.
tcp: Fix a data-race around sysctl_tcp_comp_sack_nr.
tcp: Fix data-races around sysctl_tcp_reflect_tos.
ipv4: Fix data-races around sysctl_fib_notify_on_flag_change.
i40e: Fix interface init with MSI interrupts (no MSI-X)
sctp: fix sleep in atomic context bug in timer handlers
octeontx2-pf: cn10k: Fix egress ratelimit configuration
netfilter: nf_queue: do not allow packet truncation below transport header offset
virtio-net: fix the race between refill work and close
perf symbol: Correct address for bss symbols
sfc: disable softirqs for ptp TX
sctp: leave the err path free in sctp_stream_init to sctp_stream_free
ARM: crypto: comment out gcc warning that breaks clang builds
mm/hmm: fault non-owner device private entries
page_alloc: fix invalid watermark check on a negative value
ARM: 9216/1: Fix MAX_DMA_ADDRESS overflow
EDAC/ghes: Set the DIMM label unconditionally
docs/kernel-parameters: Update descriptions for "mitigations=" param with retbleed
locking/rwsem: Allow slowpath writer to ignore handoff bit if not set by first waiter
x86/bugs: Do not enable IBPB at firmware entry when IBPB is not available
Linux 5.15.59
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4f2002d38aea467e150a912f50d456c41b23de89
This commit is contained in:
@@ -427,7 +427,7 @@ static void tcp_sndbuf_expand(struct sock *sk)
|
||||
|
||||
if (sk->sk_sndbuf < sndmem)
|
||||
WRITE_ONCE(sk->sk_sndbuf,
|
||||
min(sndmem, sock_net(sk)->ipv4.sysctl_tcp_wmem[2]));
|
||||
min(sndmem, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_wmem[2])));
|
||||
}
|
||||
|
||||
/* 2. Tuning advertised window (window_clamp, rcv_ssthresh)
|
||||
@@ -462,7 +462,7 @@ static int __tcp_grow_window(const struct sock *sk, const struct sk_buff *skb,
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
/* Optimize this! */
|
||||
int truesize = tcp_win_from_space(sk, skbtruesize) >> 1;
|
||||
int window = tcp_win_from_space(sk, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]) >> 1;
|
||||
int window = tcp_win_from_space(sk, READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2])) >> 1;
|
||||
|
||||
while (tp->rcv_ssthresh <= window) {
|
||||
if (truesize <= skb->len)
|
||||
@@ -527,7 +527,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb,
|
||||
*/
|
||||
static void tcp_init_buffer_space(struct sock *sk)
|
||||
{
|
||||
int tcp_app_win = sock_net(sk)->ipv4.sysctl_tcp_app_win;
|
||||
int tcp_app_win = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_app_win);
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
int maxwin;
|
||||
|
||||
@@ -567,16 +567,17 @@ static void tcp_clamp_window(struct sock *sk)
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
struct inet_connection_sock *icsk = inet_csk(sk);
|
||||
struct net *net = sock_net(sk);
|
||||
int rmem2;
|
||||
|
||||
icsk->icsk_ack.quick = 0;
|
||||
rmem2 = READ_ONCE(net->ipv4.sysctl_tcp_rmem[2]);
|
||||
|
||||
if (sk->sk_rcvbuf < net->ipv4.sysctl_tcp_rmem[2] &&
|
||||
if (sk->sk_rcvbuf < rmem2 &&
|
||||
!(sk->sk_userlocks & SOCK_RCVBUF_LOCK) &&
|
||||
!tcp_under_memory_pressure(sk) &&
|
||||
sk_memory_allocated(sk) < sk_prot_mem_limits(sk, 0)) {
|
||||
WRITE_ONCE(sk->sk_rcvbuf,
|
||||
min(atomic_read(&sk->sk_rmem_alloc),
|
||||
net->ipv4.sysctl_tcp_rmem[2]));
|
||||
min(atomic_read(&sk->sk_rmem_alloc), rmem2));
|
||||
}
|
||||
if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf)
|
||||
tp->rcv_ssthresh = min(tp->window_clamp, 2U * tp->advmss);
|
||||
@@ -717,7 +718,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
|
||||
* <prev RTT . ><current RTT .. ><next RTT .... >
|
||||
*/
|
||||
|
||||
if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf &&
|
||||
if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf) &&
|
||||
!(sk->sk_userlocks & SOCK_RCVBUF_LOCK)) {
|
||||
int rcvmem, rcvbuf;
|
||||
u64 rcvwin, grow;
|
||||
@@ -738,7 +739,7 @@ void tcp_rcv_space_adjust(struct sock *sk)
|
||||
|
||||
do_div(rcvwin, tp->advmss);
|
||||
rcvbuf = min_t(u64, rcvwin * rcvmem,
|
||||
sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);
|
||||
READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_rmem[2]));
|
||||
if (rcvbuf > sk->sk_rcvbuf) {
|
||||
WRITE_ONCE(sk->sk_rcvbuf, rcvbuf);
|
||||
|
||||
@@ -903,9 +904,9 @@ static void tcp_update_pacing_rate(struct sock *sk)
|
||||
* end of slow start and should slow down.
|
||||
*/
|
||||
if (tcp_snd_cwnd(tp) < tp->snd_ssthresh / 2)
|
||||
rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio;
|
||||
rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ss_ratio);
|
||||
else
|
||||
rate *= sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio;
|
||||
rate *= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_pacing_ca_ratio);
|
||||
|
||||
rate *= max(tcp_snd_cwnd(tp), tp->packets_out);
|
||||
|
||||
@@ -2168,7 +2169,7 @@ void tcp_enter_loss(struct sock *sk)
|
||||
* loss recovery is underway except recurring timeout(s) on
|
||||
* the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing
|
||||
*/
|
||||
tp->frto = net->ipv4.sysctl_tcp_frto &&
|
||||
tp->frto = READ_ONCE(net->ipv4.sysctl_tcp_frto) &&
|
||||
(new_recovery || icsk->icsk_retransmits) &&
|
||||
!inet_csk(sk)->icsk_mtup.probe_size;
|
||||
}
|
||||
@@ -3051,7 +3052,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una,
|
||||
|
||||
static void tcp_update_rtt_min(struct sock *sk, u32 rtt_us, const int flag)
|
||||
{
|
||||
u32 wlen = sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen * HZ;
|
||||
u32 wlen = READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_min_rtt_wlen) * HZ;
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
|
||||
if ((flag & FLAG_ACK_MAYBE_DELAYED) && rtt_us > tcp_min_rtt(tp)) {
|
||||
@@ -3575,7 +3576,8 @@ static bool __tcp_oow_rate_limited(struct net *net, int mib_idx,
|
||||
if (*last_oow_ack_time) {
|
||||
s32 elapsed = (s32)(tcp_jiffies32 - *last_oow_ack_time);
|
||||
|
||||
if (0 <= elapsed && elapsed < net->ipv4.sysctl_tcp_invalid_ratelimit) {
|
||||
if (0 <= elapsed &&
|
||||
elapsed < READ_ONCE(net->ipv4.sysctl_tcp_invalid_ratelimit)) {
|
||||
NET_INC_STATS(net, mib_idx);
|
||||
return true; /* rate-limited: don't send yet! */
|
||||
}
|
||||
@@ -3623,7 +3625,7 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb)
|
||||
/* Then check host-wide RFC 5961 rate limit. */
|
||||
now = jiffies / HZ;
|
||||
if (now != challenge_timestamp) {
|
||||
u32 ack_limit = net->ipv4.sysctl_tcp_challenge_ack_limit;
|
||||
u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
|
||||
u32 half = (ack_limit + 1) >> 1;
|
||||
|
||||
challenge_timestamp = now;
|
||||
@@ -4420,7 +4422,7 @@ static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
|
||||
{
|
||||
struct tcp_sock *tp = tcp_sk(sk);
|
||||
|
||||
if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {
|
||||
if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {
|
||||
int mib_idx;
|
||||
|
||||
if (before(seq, tp->rcv_nxt))
|
||||
@@ -4467,7 +4469,7 @@ static void tcp_send_dupack(struct sock *sk, const struct sk_buff *skb)
|
||||
NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKLOST);
|
||||
tcp_enter_quickack_mode(sk, TCP_MAX_QUICKACKS);
|
||||
|
||||
if (tcp_is_sack(tp) && sock_net(sk)->ipv4.sysctl_tcp_dsack) {
|
||||
if (tcp_is_sack(tp) && READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_dsack)) {
|
||||
u32 end_seq = TCP_SKB_CB(skb)->end_seq;
|
||||
|
||||
tcp_rcv_spurious_retrans(sk, skb);
|
||||
@@ -5491,7 +5493,7 @@ send_now:
|
||||
}
|
||||
|
||||
if (!tcp_is_sack(tp) ||
|
||||
tp->compressed_ack >= sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr)
|
||||
tp->compressed_ack >= READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_nr))
|
||||
goto send_now;
|
||||
|
||||
if (tp->compressed_ack_rcv_nxt != tp->rcv_nxt) {
|
||||
@@ -5512,11 +5514,12 @@ send_now:
|
||||
if (tp->srtt_us && tp->srtt_us < rtt)
|
||||
rtt = tp->srtt_us;
|
||||
|
||||
delay = min_t(unsigned long, sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns,
|
||||
delay = min_t(unsigned long,
|
||||
READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_delay_ns),
|
||||
rtt * (NSEC_PER_USEC >> 3)/20);
|
||||
sock_hold(sk);
|
||||
hrtimer_start_range_ns(&tp->compressed_ack_timer, ns_to_ktime(delay),
|
||||
sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns,
|
||||
READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_comp_sack_slack_ns),
|
||||
HRTIMER_MODE_REL_PINNED_SOFT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user