3.2.86-rc1 review
PATCH 2/4 USB: serial: kl5kusb105: fix line-state error handling
In reply to Ben Hutchings3.2.86-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 146cc8a17a3b4996f6805ee5c080e7101277c410 upstream.
The current implementation failed to detect short transfers when attempting to read the line state, and also, to make things worse, logged the content of the uninitialised heap transfer buffer.
--- drivers/usb/serial/kl5kusb105.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/usb/serial/kl5kusb105.c +5 -4
@@ -209,10 +209,11 @@ static int klsi_105_get_line_state(struc status_buf,KLSI_STATUSBUF_LEN ,10000 ); -if (rc <0 ) -dev_err (&port->dev,"Reading line status failed (error = %d)\n" , - rc); -else { +if (rc !=KLSI_STATUSBUF_LEN ) { +dev_err (&port->dev,"reading line status failed: %d\n" , rc); +if (rc >=0 ) + rc = -EIO ; + }else { status =get_unaligned_le16 (status_buf); dev_info(&port->serial->dev->dev, "read status %x %x",
cover 3.2.86-rc1 review
This is the start of the stable review cycle for the 3.2.86 release. There are 4 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 26 12:07:01 UTC 2017. Anything received after that time might be too late.
A combined patch relative to 3.2.85 will be posted as an additional response to this. A shortlog and diffstat can be found below.
Ben.
-------------
Andrey Konovalov (1):
dccp: fix freeing skb too early for IPV6_RECVPKTINFO
[5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4]
Eric Dumazet (1):
tcp: avoid infinite loop in tcp_splice_read()
[ccf7abb93af09ad0868ae9033d1ca8108bdaec82]
Jim Mattson (1):
kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
[ef85b67385436ddc1998f45f1d6a210f935b3388]
Johan Hovold (1):
USB: serial: kl5kusb105: fix line-state error handling
[146cc8a17a3b4996f6805ee5c080e7101277c410]
Makefile | 4 ++-- arch/x86/kvm/vmx.c | 11 +++++------ drivers/usb/serial/kl5kusb105.c | 9 +++++---- net/dccp/input.c | 3 ++- net/ipv4/tcp.c | 6 ++++++ 5 files changed, 20 insertions(+), 13 deletions(-)
Signature · 2 lines
Ben Hutchings All the simple programs have been written, and all the good names taken.
PATCH 1/4 kvm: nVMX: Allow L1 to intercept software exceptions (#BP and #OF)
3.2.86-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Jim Mattson <[email protected]>
commit ef85b67385436ddc1998f45f1d6a210f935b3388 upstream.
When L2 exits to L0 due to "exception or NMI", software exceptions (#BP and #OF) for which L1 has requested an intercept should be handled by L1 rather than L0. Previously, only hardware exceptions were forwarded to L1.
--- arch/x86/kvm/vmx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
arch/x86/kvm/vmx.c +5 -6
@@ -876,10 +876,10 @@ static inline bool nested_cpu_has_virtuareturn vmcs12->pin_based_vm_exec_control &PIN_BASED_VIRTUAL_NMIS ; } -static inline bool is_exception (u32 intr_info) +static inline bool is_nmi (u32 intr_info) {return (intr_info & (INTR_INFO_INTR_TYPE_MASK |INTR_INFO_VALID_MASK )) - == (INTR_TYPE_HARD_EXCEPTION |INTR_INFO_VALID_MASK ); + == (INTR_TYPE_NMI_INTR |INTR_INFO_VALID_MASK ); }static void nested_vmx_vmexit (struct kvm_vcpu *vcpu);
@@ -4225,7 +4225,7 @@ static int handle_exception(struct kvm_vreturn 0 ; } -if ((intr_info &INTR_INFO_INTR_TYPE_MASK ) ==INTR_TYPE_NMI_INTR ) +if (is_nmi (intr_info))return 1 ;/* already handled by vmx_vcpu_run() */ if (is_no_device (intr_info)) {
@@ -5773,7 +5773,7 @@ static bool nested_vmx_exit_handled(struswitch (exit_reason) {case EXIT_REASON_EXCEPTION_NMI : -if (!is_exception (intr_info)) +if (is_nmi (intr_info))return 0 ;else if (is_page_fault (intr_info))return enable_ept;
@@ -5973,8 +5973,7 @@ static void vmx_complete_atomic_exit(strkvm_machine_check ();/* We need to handle NMIs before interrupts are enabled */ -if ((exit_intr_info &INTR_INFO_INTR_TYPE_MASK ) ==INTR_TYPE_NMI_INTR && - (exit_intr_info &INTR_INFO_VALID_MASK )) { +if (is_nmi (exit_intr_info)) {kvm_before_handle_nmi (&vmx->vcpu); asm("int $2" );kvm_after_handle_nmi (&vmx->vcpu);
PATCH 3/4 dccp: fix freeing skb too early for IPV6_RECVPKTINFO
In reply to Ben Hutchings3.2.86-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Konovalov <[email protected]>
commit 5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4 upstream.
In the current DCCP implementation an skb for a DCCP_PKT_REQUEST packet is forcibly freed via __kfree_skb in dccp_rcv_state_process if dccp_v6_conn_request successfully returns.
However, if IPV6_RECVPKTINFO is set on a socket, the address of the skb is saved to ireq->pktopts and the ref count for skb is incremented in dccp_v6_conn_request, so skb is still in use. Nevertheless, it gets freed in dccp_rcv_state_process.
Fix by calling consume_skb instead of doing goto discard and therefore calling __kfree_skb.
Similar fixes for TCP:
fb7e2399ec17f1004c0e0ccfd17439f8759ede01 [TCP]: skb is unexpectedly freed. 0aea76d35c9651d55bbaf746e7914e5f9ae5a25d tcp: SYN packets are now simply consumed
--- net/dccp/input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/dccp/input.c +2 -1
@@ -606,7 +606,8 @@ int dccp_rcv_state_process(struct sock *if (inet_csk (sk)->icsk_af_ops->conn_request (sk, skb) <0 )return 1 ; - goto discard; +consume_skb (skb); +return 0 ; }if (dh->dccph_type ==DCCP_PKT_RESET ) goto discard;
PATCH 4/4 tcp: avoid infinite loop in tcp_splice_read()
In reply to Ben Hutchings3.2.86-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit ccf7abb93af09ad0868ae9033d1ca8108bdaec82 upstream.
Splicing from TCP socket is vulnerable when a packet with URG flag is received and stored into receive queue.
__tcp_splice_read() returns 0, and sk_wait_data() immediately returns since there is the problematic skb in queue.
This is a nice way to burn cpu (aka infinite loop) and trigger soft lockups.
Again, this gem was found by syzkaller tool.
--- net/ipv4/tcp.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/ipv4/tcp.c +6 -0
@@ -659,6 +659,12 @@ ssize_t tcp_splice_read(struct socket *s ret = -EAGAIN ;break ; } +/* if __tcp_splice_read() got nothing while we have +* an skb in receive queue, we do not want to loop. +* This might happen with URG data. +*/ +if (!skb_queue_empty (&sk->sk_receive_queue)) +break ;sk_wait_data (sk, &timeo);if (signal_pending (current)) { ret =sock_intr_errno (timeo);
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.86 release. There are 4 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 26 12:07:01 UTC 2017. Anything received after that time might be too late.
Build results:
total: 89 pass: 89 fail: 0 Qemu test results: total: 69 pass: 69 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Ben Hutchings
This is the start of the stable review cycle for the 3.2.86 release. There are 4 patches in this series, which will be posted as responses to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun Feb 26 12:07:01 UTC 2017. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 89 pass: 89 fail: 0 Qemu test results: total: 69 pass: 69 fail: 0Details are available at http://kerneltests.org/builders.
Thanks for testing!
Ben.
Signature · 3 lines
Ben Hutchings All the simple programs have been written, and all the good names taken.