isdn_ppp: Add checks for allocation failure in isdn_ppp_open()
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): aa387f55227cb730b41e3d621bf460ff@local
PATCH 1/42 ip6mr: call del_timer_sync() in ip6mr_free_table()
2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: WANG Cong <[email protected]>
commit 7ba0c47c34a1ea5bc7a24ca67309996cce0569b5 upstream.
We need to wait for the flying timers, since we are going to free the mrtable right after it.
[ wt: 2.6.32 has a single table hence a single timer. ip6_mr_init() has
the same del_timer() call on the error path, but we don't need to change it since at this point the timer hasn't been started yet ]
--- net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6mr.c +1 -1
@@ -1098,7 +1098,7 @@ reg_pernet_fail:void ip6_mr_cleanup (void ) {unregister_netdevice_notifier (&ip6_mr_notifier); -del_timer (&ipmr_expire_timer); +del_timer_sync (&ipmr_expire_timer);unregister_pernet_subsys (&ip6mr_net_ops);kmem_cache_destroy (mrt_cachep); }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 2/42 isdn_ppp: Add checks for allocation failure in isdn_ppp_open()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
commit 0baa57d8dc32db78369d8b5176ef56c5e2e18ab3 upstream.
Compile-tested only.
--- drivers/isdn/i4l/isdn_ppp.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/isdn/i4l/isdn_ppp.c +6 -0
@@ -300,6 +300,8 @@ isdn_ppp_open(int min, struct file *file) is->compflags =0 ; is->reset =isdn_ppp_ccp_reset_alloc (is); +if (!is->reset) +return -ENOMEM ; is->lp =NULL ; is->mp_seqno =0 ;/* MP sequence number */
@@ -319,6 +321,10 @@ isdn_ppp_open(int min, struct file *file)* VJ header compression init */ is->slcomp =slhc_init (16 ,16 );/* not necessary for 2. link in bundle */ +if (!is->slcomp) { +isdn_ppp_ccp_reset_free (is); +return -ENOMEM ; + }#endif #ifdef CONFIG_IPPP_FILTER is->pass_filter =NULL ;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 4/42 RDS: fix race condition when sending a message on unbound socket
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Quentin Casasnovas <[email protected]>
commit 8c7188b23474cca017b3ef354c4a58456f68303a upstream.
Sasha's found a NULL pointer dereference in the RDS connection code when sending a message to an apparently unbound socket. The problem is caused by the code checking if the socket is bound in rds_sendmsg(), which checks the rs_bound_addr field without taking a lock on the socket. This opens a race where rs_bound_addr is temporarily set but where the transport is not in rds_bind(), leading to a NULL pointer dereference when trying to dereference 'trans' in __rds_conn_create().
Vegard wrote a reproducer for this issue, so kindly ask him to share if you're interested.
I cannot reproduce the NULL pointer dereference using Vegard's reproducer with this patch, whereas I could without.
Complete earlier incomplete fix to CVE-2015-6937:
74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")
--- net/rds/connection.c | 6 ------ net/rds/send.c | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-)
net/rds/connection.c +0 -6
@@ -187,12 +187,6 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr, } } -if (trans ==NULL ) { -kmem_cache_free (rds_conn_slab, conn); - conn =ERR_PTR (-ENODEV ); - goto out; - } - conn->c_trans = trans; ret = trans->conn_alloc (conn, gfp);
net/rds/send.c +3 -1
@@ -842,11 +842,13 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,release_sock (sk); } -/* racing with another thread binding seems ok here */ +lock_sock (sk);if (daddr ==0 || rs->rs_bound_addr ==0 ) { +release_sock (sk); ret = -ENOTCONN ;/* XXX not a great errno */ goto out; } +release_sock (sk); rm =rds_message_copy_from_user (msg->msg_iov, payload_len);if (IS_ERR (rm)) {
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 5/42 unix: avoid use-after-free in ep_remove_wait_queue
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Rainer Weikusat <[email protected]>
commit 7d267278a9ece963d77eefec61630223fce08c6c upstream.
Rainer Weikusat <[email protected]> writes:
An AF_UNIX datagram socket being the client in an n:1 association with some server socket is only allowed to send messages to the server if the receive queue of this socket contains at most sk_max_ack_backlog datagrams. This implies that prospective writers might be forced to go to sleep despite none of the message presently enqueued on the server receive queue were sent by them. In order to ensure that these will be woken up once space becomes again available, the present unix_dgram_poll routine does a second sock_poll_wait call with the peer_wait wait queue of the server socket as queue argument (unix_dgram_recvmsg does a wake up on this queue after a datagram was received). This is inherently problematic because the server socket is only guaranteed to remain alive for as long as the client still holds a reference to it. In case the connection is dissolved via connect or by the dead peer detection logic in unix_dgram_sendmsg, the server socket may be freed despite "the polling mechanism" (in particular, epoll) still has a pointer to the corresponding peer_wait queue. There's no way to forcibly deregister a wait queue with epoll.
Based on an idea by Jason Baron, the patch below changes the code such that a wait_queue_t belonging to the client socket is enqueued on the peer_wait queue of the server whenever the peer receive queue full condition is detected by either a sendmsg or a poll. A wake up on the peer queue is then relayed to the ordinary wait queue of the client socket via wake function. The connection to the peer wait queue is again dissolved if either a wake up is about to be relayed or the client socket reconnects or a dead peer is detected or the client socket is itself closed. This enables removing the second sock_poll_wait from unix_dgram_poll, thus avoiding the use-after-free, while still ensuring that no blocked writer sleeps forever.
[bwh: Backported to 2.6.32:
- Access sk_sleep directly, not through sk_sleep() function
- Adjust context]
--- include/net/af_unix.h | 1 + net/unix/af_unix.c | 183 ++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 163 insertions(+), 21 deletions(-)
include/net/af_unix.h +1 -0
@@ -59,6 +59,7 @@ struct unix_sock { unsigned int gc_maybe_cycle : 1;unsigned char recursion_level;wait_queue_head_t peer_wait; +wait_queue_t peer_wake; };#define unix_sk (__sk) ((struct unix_sock *)__sk)
net/unix/af_unix.c +162 -21
258 lines not on this page · raw message
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 6/42 ext4: Fix null dereference in ext4_fill_super()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <[email protected]>
Fix failure paths in ext4_fill_super() that can lead to a null dereference. This was designated CVE-2015-8324.
Mostly extracted from commit 744692dc0598 ("ext4: use ext4_get_block_write in buffer write").
However there's one more incorrect goto to fix, removed upstream in commit cf40db137cc2 ("ext4: remove failed journal checksum check").
Reference: https://bugs.openvz.org/browse/OVZ-6541
--- fs/ext4/super.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/ext4/super.c +4 -4
@@ -2767,14 +2767,14 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)EXT4_SB (sb)->s_mount_state |=EXT4_ERROR_FS ; es->s_state |=cpu_to_le16 (EXT4_ERROR_FS );ext4_commit_super (sb,1 ); - goto failed_mount4; + goto failed_mount_wq; } } }else if (test_opt (sb,NOLOAD ) && !(sb->s_flags &MS_RDONLY ) &&EXT4_HAS_INCOMPAT_FEATURE (sb,EXT4_FEATURE_INCOMPAT_RECOVER )) {ext4_msg (sb,KERN_ERR ,"required journal recovery " "suppressed and not mounted read-only" ); - goto failed_mount4; + goto failed_mount_wq; }else {clear_opt (sbi->s_mount_opt,DATA_FLAGS );set_opt (sbi->s_mount_opt,WRITEBACK_DATA );
@@ -2787,7 +2787,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_64BIT)) {ext4_msg (sb,KERN_ERR ,"Failed to set 64-bit journal feature" ); - goto failed_mount4; + goto failed_mount_wq; }if (test_opt (sb,JOURNAL_ASYNC_COMMIT )) {
@@ -2826,7 +2826,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) (sbi->s_journal, 0, 0, JBD2_FEATURE_INCOMPAT_REVOKE)) {ext4_msg (sb,KERN_ERR ,"Journal does not support " "requested data journaling mode" ); - goto failed_mount4; + goto failed_mount_wq; }default :break ;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 7/42 Revert "net: add length argument to skb_copy_and_csum_datagram_iovec"
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Willy Tarreau <[email protected]>
This reverts commit c507639ba963bb47e3f515670a7cace76af76ab6. As reported by Michal Kubecek, this fix doesn't handle truncated reads correctly. Next patch from Eric fixes it better.
--- include/linux/skbuff.h | 3 +-- net/core/datagram.c | 6 +----- net/ipv4/tcp_input.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/raw.c | 2 +- net/ipv6/udp.c | 3 +-- net/rxrpc/ar-recvmsg.c | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-)
include/linux/skbuff.h +1 -2
@@ -1765,8 +1765,7 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, int size);extern int skb_copy_and_csum_datagram_iovec (struct sk_buff *skb,int hlen, -struct iovec *iov, -int len); +struct iovec *iov); extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, const struct iovec *from,
net/core/datagram.c +1 -5
@@ -693,7 +693,6 @@ EXPORT_SYMBOL(__skb_checksum_complete);* @skb: skbuff * @hlen: hardware length * @iov: io vector -* @len: amount of data to copy from skb to iov * * Caller _must_ check that skb will fit to this iovec. *
@@ -703,14 +702,11 @@ EXPORT_SYMBOL(__skb_checksum_complete);* can be modified! */ int skb_copy_and_csum_datagram_iovec (struct sk_buff *skb, -int hlen,struct iovec *iov,int len) +int hlen,struct iovec *iov) {__wsum csum;int chunk = skb->len - hlen; -if (chunk > len) - chunk = len; -if (!chunk)return 0 ;
net/ipv4/tcp_input.c +1 -1
@@ -4985,7 +4985,7 @@ static int tcp_copy_to_iovec(struct sock *sk, struct sk_buff *skb, int hlen) err =skb_copy_datagram_iovec (skb, hlen, tp->ucopy.iov, chunk); else err =skb_copy_and_csum_datagram_iovec (skb, hlen, - tp->ucopy.iov, chunk); + tp->ucopy.iov);if (!err) { tp->ucopy.len -= chunk;
net/ipv4/udp.c +1 -1
@@ -975,7 +975,7 @@ try_again:else { err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), - msg->msg_iov, copied); + msg->msg_iov);if (err == -EINVAL ) goto csum_copy_err;
net/ipv6/raw.c +1 -1
@@ -476,7 +476,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, goto csum_copy_err; err =skb_copy_datagram_iovec (skb,0 , msg->msg_iov, copied); }else { - err =skb_copy_and_csum_datagram_iovec (skb,0 , msg->msg_iov, copied); + err =skb_copy_and_csum_datagram_iovec (skb,0 , msg->msg_iov);if (err == -EINVAL ) goto csum_copy_err; }
net/ipv6/udp.c +1 -2
@@ -233,8 +233,7 @@ try_again: err =skb_copy_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov, copied ); else { - err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), - msg->msg_iov, copied); + err =skb_copy_and_csum_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov);if (err == -EINVAL ) goto csum_copy_err; }
net/rxrpc/ar-recvmsg.c +1 -2
@@ -184,8 +184,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, msg->msg_iov, copy); }else { ret =skb_copy_and_csum_datagram_iovec (skb, offset, - msg->msg_iov, - copy); + msg->msg_iov);if (ret == -EINVAL ) goto csum_copy_error; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 8/42 udp: properly support MSG_PEEK with truncated buffers
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 197c949e7798fbf28cfadc69d9ca0c2abbf93191 upstream.
Backport of this upstream commit into stable kernels :89c22d8c3b27 ("net: Fix skb csum races when peeking") exposed a bug in udp stack vs MSG_PEEK support, when user provides a buffer smaller than skb payload.
In this case, skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr),
msg->msg_iov);
returns -EFAULT.
This bug does not happen in upstream kernels since Al Viro did a great job to replace this into :skb_copy_and_csum_datagram_msg(skb, sizeof(struct udphdr), msg); This variant is safe vs short buffers.
For the time being, instead reverting Herbert Xu patch and add back skb->ip_summed invalid changes, simply store the result of udp_lib_checksum_complete() so that we avoid computing the checksum a second time, and avoid the problematic skb_copy_and_csum_datagram_iovec() call.
This patch can be applied on recent kernels as it avoids a double checksumming, then backported to stable kernels as a bug fix.
--- net/ipv4/udp.c | 6 ++++-- net/ipv6/udp.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
net/ipv4/udp.c +4 -2
@@ -941,6 +941,7 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,int peeked;int err;int is_udplite =IS_UDPLITE (sk); +bool checksum_valid = false;if (flags &MSG_ERRQUEUE )return ip_recv_error (sk, msg, len, addr_len);
@@ -965,11 +966,12 @@ try_again:*/ if (copied < ulen ||UDP_SKB_CB (skb)->partial_cov) { -if (udp_lib_checksum_complete (skb)) + checksum_valid = !udp_lib_checksum_complete (skb); +if (!checksum_valid) goto csum_copy_err; } -if (skb_csum_unnecessary (skb)) +if (checksum_valid ||skb_csum_unnecessary (skb)) err =skb_copy_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov, copied);else {
net/ipv6/udp.c +4 -2
@@ -198,6 +198,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,int peeked;int err;int is_udplite =IS_UDPLITE (sk); +bool checksum_valid = false;int is_udp4;if (flags &MSG_ERRQUEUE )
@@ -225,11 +226,12 @@ try_again:*/ if (copied < ulen ||UDP_SKB_CB (skb)->partial_cov) { -if (udp_lib_checksum_complete (skb)) + checksum_valid = !udp_lib_checksum_complete (skb); +if (!checksum_valid) goto csum_copy_err; } -if (skb_csum_unnecessary (skb)) +if (checksum_valid ||skb_csum_unnecessary (skb)) err =skb_copy_datagram_iovec (skb,sizeof (struct udphdr ), msg->msg_iov, copied );else {
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 9/42 KEYS: Fix race between read and revoke
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
commit b4a1b4f5047e4f54e194681125c74c0aa64d637d upstream.
This fixes CVE-2015-7550.
There's a race between keyctl_read() and keyctl_revoke(). If the revoke happens between keyctl_read() checking the validity of a key and the key's semaphore being taken, then the key type read method will see a revoked key.
This causes a problem for the user-defined key type because it assumes in its read method that there will always be a payload in a non-revoked key and doesn't check for a NULL pointer.
Fix this by making keyctl_read() check the validity of a key after taking semaphore instead of before.
I think the bug was introduced with the original keyrings code.
This was discovered by a multithreaded test program generated by syzkaller
(http://github.com/google/syzkaller). Here's a cleaned up version:
#include <sys/types.h>
#include <keyutils.h>
#include <pthread.h>
void *thr0(void *arg)
{
key_serial_t key = (unsigned long)arg;
keyctl_revoke(key);
return 0;
}
void *thr1(void *arg)
{
key_serial_t key = (unsigned long)arg;
char buffer[16];
keyctl_read(key, buffer, 16);
return 0;
}
int main()
{
key_serial_t key = add_key("user", "%", "foo", 3, KEY_SPEC_USER_KEYRING);
pthread_t th[5];
pthread_create(&th[0], 0, thr0, (void *)(unsigned long)key);
pthread_create(&th[1], 0, thr1, (void *)(unsigned long)key);
pthread_create(&th[2], 0, thr0, (void *)(unsigned long)key);
pthread_create(&th[3], 0, thr1, (void *)(unsigned long)key);
pthread_join(th[0], 0);
pthread_join(th[1], 0);
pthread_join(th[2], 0);
pthread_join(th[3], 0);
return 0;
}Build as:
cc -o keyctl-race keyctl-race.c -lkeyutils -lpthread
Run as:
while keyctl-race; do :; done
as it may need several iterations to crash the kernel. The crash can be summarised as:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 IP: [<ffffffff81279b08>] user_read+0x56/0xa3 ... Call Trace: [<ffffffff81276aa9>] keyctl_read_key+0xb6/0xd7 [<ffffffff81277815>] SyS_keyctl+0x83/0xe0 [<ffffffff815dbb97>] entry_SYSCALL_64_fastpath+0x12/0x6f
--- security/keys/keyctl.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
security/keys/keyctl.c +9 -9
@@ -674,16 +674,16 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)/* the key is probably readable - now try to read it */ can_read_key: - ret =key_validate (key); -if (ret ==0 ) { - ret = -EOPNOTSUPP ; -if (key->type->read) { -/* read the data with the semaphore held (since we -* might sleep) */ -down_read (&key->sem); + ret = -EOPNOTSUPP ; +if (key->type->read) { +/* Read the data with the semaphore held (since we might sleep) +* to protect against the key being updated or revoked. +*/ +down_read (&key->sem); + ret =key_validate (key); +if (ret ==0 ) ret = key->type->read (key, buffer, buflen); -up_read (&key->sem); - } +up_read (&key->sem); } error2:
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 11/42 net: fix warnings in make htmldocs by moving macro definition out of field declaration
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <[email protected]>
commit 7bbadd2d1009575dad675afc16650ebb5aa10612 upstream.
Docbook does not like the definition of macros inside a field declaration and adds a warning. Move the definition out.
--- include/net/sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/sock.h +1 -1
@@ -230,8 +230,8 @@ struct sock { sk_no_check : 2, sk_userlocks : 4, sk_protocol : 8, -#define SK_PROTOCOL_MAX ((u8)~0U) sk_type : 16; +#define SK_PROTOCOL_MAX ((u8)~0U)kmemcheck_bitfield_end (flags);int sk_rcvbuf;socket_lock_t sk_lock;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 12/42 bluetooth: Validate socket address length in sco_sock_bind().
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <[email protected]>
commit 5233252fce714053f0151680933571a2da9cbfb4 upstream.
--- net/bluetooth/sco.c | 3 +++ 1 file changed, 3 insertions(+)
net/bluetooth/sco.c +3 -0
@@ -463,6 +463,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_leif (!addr || addr->sa_family !=AF_BLUETOOTH )return -EINVAL ; +if (addr_len <sizeof (struct sockaddr_sco )) +return -EINVAL ; +lock_sock (sk);if (sk->sk_state !=BT_OPEN ) {
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 13/42 sctp: translate host order to network order when setting a hmacid
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: lucien <[email protected]>
commit ed5a377d87dc4c87fb3e1f7f698cba38cd893103 upstream.
now sctp auth cannot work well when setting a hmacid manually, which is caused by that we didn't use the network order for hmacid, so fix it by adding the transformation in sctp_auth_ep_set_hmacs.
even we set hmacid with the network order in userspace, it still can't work, because of this condition in sctp_auth_ep_set_hmacs():
if (id > SCTP_AUTH_HMAC_ID_MAX) return -EOPNOTSUPP;
so this wasn't working before and thus it won't break compatibility.
--- net/sctp/auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/sctp/auth.c +2 -2
@@ -803,8 +803,8 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep,if (!has_sha1)return -EINVAL ; -memcpy (ep->auth_hmacs_list->hmac_ids, &hmacs->shmac_idents[0 ], - hmacs->shmac_num_idents *sizeof (__u16)); +for (i =0 ; i < hmacs->shmac_num_idents; i++) + ep->auth_hmacs_list->hmac_ids[i] =htons (hmacs->shmac_idents[i]); ep->auth_hmacs_list->param_hdr.length =htons (sizeof (sctp_paramhdr_t) + hmacs->shmac_num_idents *sizeof (__u16));return 0 ;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 14/42 fuse: break infinite loop in fuse_fill_write_pages()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Roman Gushchin <[email protected]>
commit 3ca8138f014a913f98e6ef40e939868e1e9ea876 upstream.
I got a report about unkillable task eating CPU. Further investigation shows, that the problem is in the fuse_fill_write_pages() function. If iov's first segment has zero length, we get an infinite loop, because we never reach iov_iter_advance() call.
Fix this by calling iov_iter_advance() before repeating an attempt to copy data from userspace.
A similar problem is described in 124d3b7041f ("fix writev regression:
pan hanging unkillable and un-straceable"). If zero-length segmend is followed by segment with invalid address, iov_iter_fault_in_readable() checks only first segment (zero-length), iov_iter_copy_from_user_atomic() skips it, fails at second and returns zero -> goto again without skipping zero-length segment.
Patch calls iov_iter_advance() before goto again: we'll skip zero-length segment at second iteraction and iov_iter_fault_in_readable() will detect invalid address.
Special thanks to Konstantin Khlebnikov, who helped a lot with the commit description.
[wt: adjusted context, as commit 478e0841b from 3.1 was never backported
to call mark_page_accessed() eventhough it seems it should have been]
--- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fuse/file.c +1 -1
@@ -885,6 +885,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,pagefault_enable ();flush_dcache_page (page); +iov_iter_advance (ii, tmp);if (!tmp) {unlock_page (page);page_cache_release (page);
@@ -896,7 +897,6 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req, req->pages[req->num_pages] = page; req->num_pages++; -iov_iter_advance (ii, tmp); count += tmp; pos += tmp; offset += tmp;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 15/42 fix sysvfs symlinks
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <[email protected]>
commit 0ebf7f10d67a70e120f365018f1c5fce9ddc567d upstream.
The thing got broken back in 2002 - sysvfs does *not* have inline symlinks; even short ones have bodies stored in the first block of file. sysv_symlink() handles that correctly; unfortunately, attempting to look an existing symlink up will end up confusing them for inline symlinks, and interpret the block number containing the body as the body itself.
Nobody has noticed until now, which says something about the level of testing sysvfs gets ;-/
[bwh: Backported to 3.2:
- Adjust context
- Also delete unused sysv_fast_symlink_inode_operations]
--- fs/sysv/Makefile | 2 +- fs/sysv/inode.c | 10 ++-------- fs/sysv/symlink.c | 20 -------------------- 3 files changed, 3 insertions(+), 29 deletions(-) delete mode 100644 fs/sysv/symlink.c
fs/sysv/Makefile +1 -1
@@ -5,4 +5,4 @@ obj-$(CONFIG_SYSV_FS) += sysv.o sysv-objs := ialloc.o balloc.o inode.o itree.o file.o dir.o \ - namei.o super.o symlink.o + namei.o super.o
fs/sysv/inode.c +2 -8
@@ -174,14 +174,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev) inode->i_fop = &sysv_dir_operations; inode->i_mapping->a_ops = &sysv_aops; }else if (S_ISLNK (inode->i_mode)) { -if (inode->i_blocks) { - inode->i_op = &sysv_symlink_inode_operations; - inode->i_mapping->a_ops = &sysv_aops; - }else { - inode->i_op = &sysv_fast_symlink_inode_operations; -nd_terminate_link (SYSV_I (inode)->i_data, inode->i_size, -sizeof (SYSV_I (inode)->i_data) -1 ); - } + inode->i_op = &sysv_symlink_inode_operations; + inode->i_mapping->a_ops = &sysv_aops; }else init_special_inode (inode, inode->i_mode, rdev); }
fs/sysv/symlink.c deleted +0 -20
@@ -1,20 +0,0 @@ -/* -* linux/fs/sysv/symlink.c -* -* Handling of System V filesystem fast symlinks extensions. -* Aug 2001, Christoph Hellwig ([email protected]) -*/ - -#include "sysv.h" -#include <linux/namei.h> - -static void *sysv_follow_link (struct dentry *dentry,struct nameidata *nd) -{ -nd_set_link (nd, (char *)SYSV_I (dentry->d_inode)->i_data); -return NULL ; -} - -const struct inode_operations sysv_fast_symlink_inode_operations = { - .readlink = generic_readlink, - .follow_link = sysv_follow_link, -};
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 16/42 vfs: Avoid softlockups with sendfile(2)
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
commit c2489e07c0a71a56fb2c84bc0ee66cddfca7d068 upstream.
The following test program from Dmitry can cause softlockups or RCU stalls as it copies 1GB from tmpfs into eventfd and we don't have any scheduling point at that path in sendfile(2) implementation:
int r1 = eventfd(0, 0);
int r2 = memfd_create("", 0);
unsigned long n = 1<<30;
fallocate(r2, 0, 0, n);
sendfile(r1, r2, 0, n);Add cond_resched() into __splice_from_pipe() to fix the problem.
--- fs/splice.c | 1 + 1 file changed, 1 insertion(+)
fs/splice.c +1 -0
@@ -882,6 +882,7 @@ ssize_t __splice_from_pipe(struct pipe_inode_info *pipe, struct splice_desc *sd,splice_from_pipe_begin (sd); do { + cond_resched(); ret = splice_from_pipe_next(pipe, sd); if (ret > 0) ret = splice_from_pipe_feed(pipe, sd, actor);
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 17/42 ext4: Fix handling of extended tv_sec
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: David Turner <[email protected]>
commit a4dad1ae24f850410c4e60f22823cba1289b8d52 upstream.
In ext4, the bottom two bits of {a,c,m}time_extra are used to extend the {a,c,m}time fields, deferring the year 2038 problem to the year 2446.
When decoding these extended fields, for times whose bottom 32 bits would represent a negative number, sign extension causes the 64-bit extended timestamp to be negative as well, which is not what's intended. This patch corrects that issue, so that the only negative {a,c,m}times are those between 1901 and 1970 (as per 32-bit signed timestamps).
Some older kernels might have written pre-1970 dates with 1,1 in the extra bits. This patch treats those incorrectly-encoded dates as pre-1970, instead of post-2311, until kernel 4.20 is released. Hopefully by then e2fsck will have fixed up the bad data.
Also add a comment explaining the encoding of ext4's extra {a,c,m}time bits.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=23732
--- fs/ext4/ext4.h | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-)
fs/ext4/ext4.h +44 -7
@@ -26,6 +26,7 @@#include <linux/seqlock.h> #include <linux/mutex.h> #include <linux/timer.h> +#include <linux/version.h> #include <linux/wait.h> #include <linux/blockgroup_lock.h> #include <linux/percpu_counter.h>
@@ -605,19 +606,55 @@ struct move_extent { <= (EXT4_GOOD_OLD_INODE_SIZE + \ (einode)->i_extra_isize)) \ +/* +* We use an encoding that preserves the times for extra epoch "00": +* +* extra msb of adjust for signed +* epoch 32-bit 32-bit tv_sec to +* bits time decoded 64-bit tv_sec 64-bit tv_sec valid time range +* 0 0 1 -0x80000000..-0x00000001 0x000000000 1901-12-13..1969-12-31 +* 0 0 0 0x000000000..0x07fffffff 0x000000000 1970-01-01..2038-01-19 +* 0 1 1 0x080000000..0x0ffffffff 0x100000000 2038-01-19..2106-02-07 +* 0 1 0 0x100000000..0x17fffffff 0x100000000 2106-02-07..2174-02-25 +* 1 0 1 0x180000000..0x1ffffffff 0x200000000 2174-02-25..2242-03-16 +* 1 0 0 0x200000000..0x27fffffff 0x200000000 2242-03-16..2310-04-04 +* 1 1 1 0x280000000..0x2ffffffff 0x300000000 2310-04-04..2378-04-22 +* 1 1 0 0x300000000..0x37fffffff 0x300000000 2378-04-22..2446-05-10 +* +* Note that previous versions of the kernel on 64-bit systems would +* incorrectly use extra epoch bits 1,1 for dates between 1901 and +* 1970. e2fsck will correct this, assuming that it is run on the +* affected filesystem before 2242. +*/ +static inline __le32 ext4_encode_extra_time (struct timespec *time) { -return cpu_to_le32 ((sizeof (time->tv_sec) >4 ? - (time->tv_sec >>32 ) &EXT4_EPOCH_MASK :0 ) | - ((time->tv_nsec <<EXT4_EPOCH_BITS ) &EXT4_NSEC_MASK )); +u32 extra =sizeof (time->tv_sec) >4 ? + ((time->tv_sec - (s32 )time->tv_sec) >>32 ) &EXT4_EPOCH_MASK :0 ; +return cpu_to_le32 (extra | (time->tv_nsec <<EXT4_EPOCH_BITS )); }static inline void ext4_decode_extra_time (struct timespec *time,__le32 extra) { -if (sizeof (time->tv_sec) >4 ) - time->tv_sec |= (__u64)(le32_to_cpu (extra) &EXT4_EPOCH_MASK ) - <<32 ; - time->tv_nsec = (le32_to_cpu (extra) &EXT4_NSEC_MASK ) >>EXT4_EPOCH_BITS ; +if (unlikely (sizeof (time->tv_sec) >4 && + (extra &cpu_to_le32 (EXT4_EPOCH_MASK )))) { +#if LINUX_VERSION_CODE <KERNEL_VERSION (4 ,20 ,0 ) +/* Handle legacy encoding of pre-1970 dates with epoch +* bits 1,1. We assume that by kernel version 4.20, +* everyone will have run fsck over the affected +* filesystems to correct the problem. (This +* backwards compatibility may be removed before this +* time, at the discretion of the ext4 developers.) +*/ +u64 extra_bits =le32_to_cpu (extra) &EXT4_EPOCH_MASK ; +if (extra_bits ==3 && ((time->tv_sec) &0x80000000 ) !=0 ) + extra_bits =0 ; + time->tv_sec += extra_bits <<32 ; +#else + time->tv_sec += (u64)(le32_to_cpu (extra) &EXT4_EPOCH_MASK ) <<32 ; +#endif + } + time->tv_nsec = (le32_to_cpu (extra) &EXT4_NSEC_MASK ) >>EXT4_EPOCH_BITS ; }#define EXT4_INODE_SET_XTIME (xtime, inode, raw_inode) \
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 18/42 nfs: if we have no valid attrs, then dont declare the attribute cache valid
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <[email protected]>
commit c812012f9ca7cf89c9e1a1cd512e6c3b5be04b85 upstream.
If we pass in an empty nfs_fattr struct to nfs_update_inode, it will (correctly) not update any of the attributes, but it then clears the NFS_INO_INVALID_ATTR flag, which indicates that the attributes are up to date. Don't clear the flag if the fattr struct has no valid attrs to apply.
--- fs/nfs/inode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/nfs/inode.c +5 -1
@@ -1333,7 +1333,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfsi->attrtimeo_timestamp = now; } } - invalid &= ~NFS_INO_INVALID_ATTR ; + +/* Don't declare attrcache up to date if there were no attrs! */ +if (fattr->valid !=0 ) + invalid &= ~NFS_INO_INVALID_ATTR ; +/* Don't invalidate the data if we were to blame */ if (!(S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) ||S_ISLNK (inode->i_mode)))
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 19/42 wan/x25: Fix use-after-free in x25_asy_open_tty()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <[email protected]>
commit ee9159ddce14bc1dec9435ae4e3bd3153e783706 upstream.
The N_X25 line discipline may access the previous line discipline's closed and already-freed private data on open [1].
The tty->disc_data field _never_ refers to valid data on entry to the line discipline's open() method. Rather, the ldisc is expected to initialize that field for its own use for the lifetime of the instance (ie. from open() to close() only).
[1]
[ 634.336761] ==================================================================
[ 634.338226] BUG: KASAN: use-after-free in x25_asy_open_tty+0x13d/0x490 at addr ffff8800a743efd0
[ 634.339558] Read of size 4 by task syzkaller_execu/8981
[ 634.340359] =============================================================================
[ 634.341598] BUG kmalloc-512 (Not tainted): kasan: bad access detected
...
[ 634.405018] Call Trace:
[ 634.405277] dump_stack (lib/dump_stack.c:52)
[ 634.405775] print_trailer (mm/slub.c:655)
[ 634.406361] object_err (mm/slub.c:662)
[ 634.406824] kasan_report_error (mm/kasan/report.c:138 mm/kasan/report.c:236)
[ 634.409581] __asan_report_load4_noabort (mm/kasan/report.c:279)
[ 634.411355] x25_asy_open_tty (drivers/net/wan/x25_asy.c:559 (discriminator 1))
[ 634.413997] tty_ldisc_open.isra.2 (drivers/tty/tty_ldisc.c:447)
[ 634.414549] tty_set_ldisc (drivers/tty/tty_ldisc.c:567)
[ 634.415057] tty_ioctl (drivers/tty/tty_io.c:2646 drivers/tty/tty_io.c:2879)
[ 634.423524] do_vfs_ioctl (fs/ioctl.c:43 fs/ioctl.c:607)
[ 634.427491] SyS_ioctl (fs/ioctl.c:622 fs/ioctl.c:613)
[ 634.427945] entry_SYSCALL_64_fastpath (arch/x86/entry/entry_64.S:188)--- drivers/net/wan/x25_asy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wan/x25_asy.c +1 -5
@@ -553,16 +553,12 @@ static void x25_asy_receive_buf(struct tty_struct *tty,static int x25_asy_open_tty (struct tty_struct *tty) { -struct x25_asy *sl = tty->disc_data; +struct x25_asy *sl;int err;if (tty->ops->write ==NULL )return -EOPNOTSUPP ; -/* First make sure we're not already connected. */ -if (sl && sl->magic ==X25_ASY_MAGIC ) -return -EEXIST ; -/* OK. Find a free X.25 channel to use. */ sl =x25_asy_alloc ();if (sl ==NULL )
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 20/42 ipv4: igmp: Allow removing groups from a removed interface
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Lunn <[email protected]>
commit 4eba7bb1d72d9bde67d810d09bf62dc207b63c5c upstream.
When a multicast group is joined on a socket, a struct ip_mc_socklist is appended to the sockets mc_list containing information about the joined group.
If the interface is hot unplugged, this entry becomes stale. Prior to commit 52ad353a5344f ("igmp: fix the problem when mc leave group") it was possible to remove the stale entry by performing a IP_DROP_MEMBERSHIP, passing either the old ifindex or ip address on the interface. However, this fix enforces that the interface must still exist. Thus with time, the number of stale entries grows, until sysctl_igmp_max_memberships is reached and then it is not possible to join and more groups.
The previous patch fixes an issue where a IP_DROP_MEMBERSHIP is performed without specifying the interface, either by ifindex or ip address. However here we do supply one of these. So loosen the restriction on device existence to only apply when the interface has not been specified. This then restores the ability to clean up the stale entries.
--- net/ipv4/igmp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/ipv4/igmp.c +3 -2
@@ -1841,7 +1841,7 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr)rtnl_lock (); in_dev =ip_mc_find_dev (net, imr); -if (!in_dev) { +if (!imr->imr_ifindex && !imr->imr_address.s_addr && !in_dev) { ret = -ENODEV ; goto out; }
@@ -1860,7 +1860,8 @@ int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr) *imlp = iml->next; -ip_mc_dec_group (in_dev, group); +if (in_dev) +ip_mc_dec_group (in_dev, group);rtnl_unlock ();sock_kfree_s (sk, iml,sizeof (*iml));return 0 ;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 21/42 sched/core: Remove false-positive warning from wake_up_process()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
commit 119d6f6a3be8b424b200dcee56e74484d5445f7e upstream.
Because wakeups can (fundamentally) be late, a task might not be in the expected state. Therefore testing against a task's state is racy, and can yield false positives.
--- kernel/sched.c | 1 - 1 file changed, 1 deletion(-)
kernel/sched.c +0 -1
@@ -2618,7 +2618,6 @@ out:*/ int wake_up_process (struct task_struct *p) { -WARN_ON (task_is_stopped_or_traced (p));return try_to_wake_up (p,TASK_NORMAL ,0 ); }EXPORT_SYMBOL (wake_up_process);
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 22/42 ipmi: move timer init to before irq is setup
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jan Stancek <[email protected]>
commit 27f972d3e00b50639deb4cc1392afaeb08d3cecc upstream.
We encountered a panic on boot in ipmi_si on a dell per320 due to an uninitialized timer as follows.
static int smi_start_processing(void *send_info,
ipmi_smi_t intf)
{
/* Try to claim any interrupts. */
if (new_smi->irq_setup)
new_smi->irq_setup(new_smi);--> IRQ arrives here and irq handler tries to modify uninitialized timer
which triggers BUG_ON(!timer->function) in __mod_timer().
Call Trace: <IRQ> [<ffffffffa0532617>] start_new_msg+0x47/0x80 [ipmi_si] [<ffffffffa053269e>] start_check_enables+0x4e/0x60 [ipmi_si] [<ffffffffa0532bd8>] smi_event_handler+0x1e8/0x640 [ipmi_si] [<ffffffff810f5584>] ? __rcu_process_callbacks+0x54/0x350 [<ffffffffa053327c>] si_irq_handler+0x3c/0x60 [ipmi_si] [<ffffffff810efaf0>] handle_IRQ_event+0x60/0x170 [<ffffffff810f245e>] handle_edge_irq+0xde/0x180 [<ffffffff8100fc59>] handle_irq+0x49/0xa0 [<ffffffff8154643c>] do_IRQ+0x6c/0xf0 [<ffffffff8100ba53>] ret_from_intr+0x0/0x11
/* Set up the timer that drives the interface. */
setup_timer(&new_smi->si_timer, smi_timeout, (long)new_smi);The following patch fixes the problem.
To: [email protected]
To: Corey Minyard <[email protected]>
CC: [email protected]
--- drivers/char/ipmi/ipmi_si_intf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/char/ipmi/ipmi_si_intf.c +4 -4
@@ -1066,15 +1066,15 @@ static int smi_start_processing(void *send_info, new_smi->intf = intf; -/* Try to claim any interrupts. */ -if (new_smi->irq_setup) - new_smi->irq_setup (new_smi); -/* Set up the timer that drives the interface. */ setup_timer (&new_smi->si_timer, smi_timeout, (long )new_smi); new_smi->last_timeout_jiffies = jiffies;mod_timer (&new_smi->si_timer, jiffies +SI_TIMEOUT_JIFFIES ); +/* Try to claim any interrupts. */ +if (new_smi->irq_setup) + new_smi->irq_setup (new_smi); +/* * Check if the user forcefully enabled the daemon. */
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 23/42 tcp: initialize tp->copied_seq in case of cross SYN connection
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 142a2e7ece8d8ac0e818eb2c91f99ca894730e2a ]
Dmitry provided a syzkaller (http://github.com/google/syzkaller)
generated program that triggers the WARNING at net/ipv4/tcp.c:1729 in tcp_recvmsg() :
WARN_ON(tp->copied_seq != tp->rcv_nxt &&
!(flags & (MSG_PEEK | MSG_TRUNC)));
His program is specifically attempting a Cross SYN TCP exchange, that we support (for the pleasure of hackers ?), but it looks we lack proper tcp->copied_seq initialization.
Thanks again Dmitry for your report and testings.
--- net/ipv4/tcp_input.c | 1 + 1 file changed, 1 insertion(+)
net/ipv4/tcp_input.c +1 -0
@@ -5559,6 +5559,7 @@ discard: } tp->rcv_nxt =TCP_SKB_CB (skb)->seq +1 ; + tp->copied_seq = tp->rcv_nxt; tp->rcv_wup =TCP_SKB_CB (skb)->seq +1 ;/* RFC1323: The window in SYN & SYN/ACK segments is
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 24/42 net, scm: fix PaX detected msg_controllen overflow in scm_detach_fds
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit 6900317f5eff0a7070c5936e5383f589e0de7a09 ]
David and HacKurx reported a following/similar size overflow triggered in a grsecurity kernel, thanks to PaX's gcc size overflow plugin:
(Already fixed in later grsecurity versions by Brad and PaX Team.)
[ 1002.296137] PAX: size overflow detected in function scm_detach_fds net/core/scm.c:314
cicus.202_127 min, count: 4, decl: msg_controllen; num: 0; context: msghdr;
[ 1002.296145] CPU: 0 PID: 3685 Comm: scm_rights_recv Not tainted 4.2.3-grsec+ #7
[ 1002.296149] Hardware name: Apple Inc. MacBookAir5,1/Mac-66F35F19FE2A0D05, [...]
[ 1002.296153] ffffffff81c27366 0000000000000000 ffffffff81c27375 ffffc90007843aa8
[ 1002.296162] ffffffff818129ba 0000000000000000 ffffffff81c27366 ffffc90007843ad8
[ 1002.296169] ffffffff8121f838 fffffffffffffffc fffffffffffffffc ffffc90007843e60
[ 1002.296176] Call Trace:
[ 1002.296190] [<ffffffff818129ba>] dump_stack+0x45/0x57
[ 1002.296200] [<ffffffff8121f838>] report_size_overflow+0x38/0x60
[ 1002.296209] [<ffffffff816a979e>] scm_detach_fds+0x2ce/0x300
[ 1002.296220] [<ffffffff81791899>] unix_stream_read_generic+0x609/0x930
[ 1002.296228] [<ffffffff81791c9f>] unix_stream_recvmsg+0x4f/0x60
[ 1002.296236] [<ffffffff8178dc00>] ? unix_set_peek_off+0x50/0x50
[ 1002.296243] [<ffffffff8168fac7>] sock_recvmsg+0x47/0x60
[ 1002.296248] [<ffffffff81691522>] ___sys_recvmsg+0xe2/0x1e0
[ 1002.296257] [<ffffffff81693496>] __sys_recvmsg+0x46/0x80
[ 1002.296263] [<ffffffff816934fc>] SyS_recvmsg+0x2c/0x40
[ 1002.296271] [<ffffffff8181a3ab>] entry_SYSCALL_64_fastpath+0x12/0x85Further investigation showed that this can happen when an *odd* number of fds are being passed over AF_UNIX sockets.
In these cases CMSG_LEN(i * sizeof(int)) and CMSG_SPACE(i * sizeof(int)), where i is the number of successfully passed fds, differ by 4 bytes due to the extra CMSG_ALIGN() padding in CMSG_SPACE() to an 8 byte boundary on 64 bit. The padding is used to align subsequent cmsg headers in the control buffer.
When the control buffer passed in from the receiver side *lacks* these 4 bytes (e.g. due to buggy/wrong API usage), then msg->msg_controllen will overflow in scm_detach_fds():
int cmlen = CMSG_LEN(i * sizeof(int)); <--- cmlen w/o tail-padding
err = put_user(SOL_SOCKET, &cm->cmsg_level);
if (!err)
err = put_user(SCM_RIGHTS, &cm->cmsg_type);
if (!err)
err = put_user(cmlen, &cm->cmsg_len);
if (!err) {
cmlen = CMSG_SPACE(i * sizeof(int)); <--- cmlen w/ 4 byte extra tail-padding
msg->msg_control += cmlen;
msg->msg_controllen -= cmlen; <--- iff no tail-padding space here ...
} ... wrap-aroundF.e. it will wrap to a length of 18446744073709551612 bytes in case the receiver passed in msg->msg_controllen of 20 bytes, and the sender properly transferred 1 fd to the receiver, so that its CMSG_LEN results in 20 bytes and CMSG_SPACE in 24 bytes.
In case of MSG_CMSG_COMPAT (scm_detach_fds_compat()), I haven't seen an issue in my tests as alignment seems always on 4 byte boundary. Same should be in case of native 32 bit, where we end up with 4 byte boundaries as well.
In practice, passing msg->msg_controllen of 20 to recvmsg() while receiving a single fd would mean that on successful return, msg->msg_controllen is being set by the kernel to 24 bytes instead, thus more than the input buffer advertised. It could f.e. become an issue if such application later on zeroes or copies the control buffer based on the returned msg->msg_controllen elsewhere.
Maximum number of fds we can send is a hard upper limit SCM_MAX_FD (253).
Going over the code, it seems like msg->msg_controllen is not being read after scm_detach_fds() in scm_recv() anymore by the kernel, good!
Relevant recvmsg() handler are unix_dgram_recvmsg() (unix_seqpacket_recvmsg()) and unix_stream_recvmsg(). Both return back to their recvmsg() caller, and ___sys_recvmsg() places the updated length, that is, new msg_control - old msg_control pointer into msg->msg_controllen (hence the 24 bytes seen in the example).
Long time ago, Wei Yongjun fixed something related in commit 1ac70e7ad24a ("[NET]: Fix function put_cmsg() which may cause usr application memory overflow").
RFC3542, section 20.2. says:
The fields shown as "XX" are possible padding, between the cmsghdr structure and the data, and between the data and the next cmsghdr structure, if required by the implementation. While sending an application may or may not include padding at the end of last ancillary data in msg_controllen and implementations must accept both as valid. On receiving a portable application must provide space for padding at the end of the last ancillary data as implementations may copy out the padding at the end of the control message buffer and include it in the received msg_controllen. When recvmsg() is called if msg_controllen is too small for all the ancillary data items including any trailing padding after the last item an implementation may set MSG_CTRUNC.
Since we didn't place MSG_CTRUNC for already quite a long time, just do the same as in 1ac70e7ad24a to avoid an overflow.
Btw, even man-page author got this wrong :/ See db939c9b26e9 ("cmsg.3: Fix error in SCM_RIGHTS code sample"). Some people must have copied this (?), thus it got triggered in the wild (reported several times during boot by David and HacKurx).
No Fixes tag this time as pre 2002 (that is, pre history tree).
--- net/core/scm.c | 2 ++ 1 file changed, 2 insertions(+)
net/core/scm.c +2 -0
@@ -281,6 +281,8 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) err =put_user (cmlen, &cm->cmsg_len);if (!err) { cmlen =CMSG_SPACE (i*sizeof (int )); +if (msg->msg_controllen < cmlen) + cmlen = msg->msg_controllen; msg->msg_control += cmlen; msg->msg_controllen -= cmlen; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 25/42 sctp: update the netstamp_needed counter when copying sockets
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Marcelo Ricardo Leitner <[email protected]>
[ Upstream commit 01ce63c90170283a9855d1db4fe81934dddce648 ]
Dmitry Vyukov reported that SCTP was triggering a WARN on socket destroy related to disabling sock timestamp.
When SCTP accepts an association or peel one off, it copies sock flags but forgot to call net_enable_timestamp() if a packet timestamping flag was copied, leading to extra calls to net_disable_timestamp() whenever such clones were closed.
The fix is to call net_enable_timestamp() whenever we copy a sock with that flag on, like tcp does.
--- include/net/sock.h | 2 ++ net/sctp/socket.c | 3 +++ 2 files changed, 5 insertions(+)
include/net/sock.h +2 -0
@@ -507,6 +507,8 @@ enum sock_flags { SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ }; +#define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) +static inline void sock_copy_flags (struct sock *nsk,struct sock *osk) { nsk->sk_flags = osk->sk_flags;
net/sctp/socket.c +3 -0
@@ -6756,6 +6756,9 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk, newinet->mc_ttl =1 ; newinet->mc_index =0 ; newinet->mc_list =NULL ; + +if (newsk->sk_flags &SK_FLAGS_TIMESTAMP ) +net_enable_timestamp (); }/* Populate the fields of the newsk from the oldsk and migrate the assoc
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 26/42 af_unix: fix a fatal race with bit fields
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 60bc851ae59bfe99be6ee89d6bc50008c85ec75d upstream.
Using bit fields is dangerous on ppc64/sparc64, as the compiler [1] uses 64bit instructions to manipulate them.
If the 64bit word includes any atomic_t or spinlock_t, we can lose critical concurrent changes.
This is happening in af_unix, where unix_sk(sk)->gc_candidate/ gc_maybe_cycle/lock share the same 64bit word.
This leads to fatal deadlock, as one/several cpus spin forever on a spinlock that will never be available again.
A safer way would be to use a long to store flags. This way we are sure compiler/arch wont do bad things.
As we own unix_gc_lock spinlock when clearing or setting bits, we can use the non atomic __set_bit()/__clear_bit().
recursion_level can share the same 64bit location with the spinlock, as it is set only with this spinlock held.
[1] bug fixed in gcc-4.8.0 :
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52080
--- include/net/af_unix.h | 5 +++-- net/unix/garbage.c | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-)
include/net/af_unix.h +3 -2
@@ -55,9 +55,10 @@ struct unix_sock {struct list_head link;atomic_long_t inflight;spinlock_t lock; - unsigned int gc_candidate : 1; - unsigned int gc_maybe_cycle : 1;unsigned char recursion_level; +unsigned long gc_flags; +#define UNIX_GC_CANDIDATE 0 +#define UNIX_GC_MAYBE_CYCLE 1wait_queue_head_t peer_wait;wait_queue_t peer_wake; };
net/unix/garbage.c +6 -6
@@ -195,7 +195,7 @@ static void scan_inflight(struct sock *x, void (*func)(struct unix_sock *),* have been added to the queues after * starting the garbage collection */ -if (u->gc_candidate) { +if (test_bit (UNIX_GC_CANDIDATE , &u->gc_flags)) { hit = true;func (u); }
@@ -264,7 +264,7 @@ static void inc_inflight_move_tail(struct unix_sock *u)* of the list, so that it's checked even if it was already * passed over */ -if (u->gc_maybe_cycle) +if (test_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags))list_move_tail (&u->link, &gc_candidates); }
@@ -325,8 +325,8 @@ void unix_gc(void)BUG_ON (total_refs < inflight_refs);if (total_refs == inflight_refs) {list_move_tail (&u->link, &gc_candidates); - u->gc_candidate =1 ; - u->gc_maybe_cycle =1 ; +__set_bit (UNIX_GC_CANDIDATE , &u->gc_flags); +__set_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags); } }
@@ -354,7 +354,7 @@ void unix_gc(void)if (atomic_long_read (&u->inflight) >0 ) {list_move_tail (&u->link, ¬_cycle_list); - u->gc_maybe_cycle =0 ; +__clear_bit (UNIX_GC_MAYBE_CYCLE , &u->gc_flags);scan_children (&u->sk, inc_inflight_move_tail,NULL ); } }
@@ -366,7 +366,7 @@ void unix_gc(void)*/ while (!list_empty (¬_cycle_list)) { u = list_entry(not_cycle_list.next, struct unix_sock, link); - u->gc_candidate =0 ; +__clear_bit (UNIX_GC_CANDIDATE , &u->gc_flags);list_move_tail (&u->link, &gc_inflight_list); }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 27/42 rfkill: copy the name into the rfkill struct
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit b7bb110008607a915298bf0f47d25886ecb94477 upstream.
Some users of rfkill, like NFC and cfg80211, use a dynamic name when allocating rfkill, in those cases dev_name(). Therefore, the pointer passed to rfkill_alloc() might not be valid forever, I specifically found the case that the rfkill name was quite obviously an invalid pointer (or at least garbage) when the wiphy had been renamed.
Fix this by making a copy of the rfkill name in rfkill_alloc().
--- net/rfkill/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/rfkill/core.c +3 -3
@@ -49,7 +49,6 @@struct rfkill {spinlock_t lock; -const char *name;enum rfkill_type type;unsigned long state;
@@ -73,6 +72,7 @@ struct rfkill {struct delayed_work poll_work;struct work_struct uevent_work;struct work_struct sync_work; +char name[]; };#define to_rfkill (d) container_of(d, struct rfkill, dev)
@@ -820,14 +820,14 @@ struct rfkill * __must_check rfkill_alloc(const char *name,if (WARN_ON (type ==RFKILL_TYPE_ALL || type >=NUM_RFKILL_TYPES ))return NULL ; - rfkill =kzalloc (sizeof (*rfkill),GFP_KERNEL ); + rfkill =kzalloc (sizeof (*rfkill) +strlen (name) +1 ,GFP_KERNEL );if (!rfkill)return NULL ;spin_lock_init (&rfkill->lock);INIT_LIST_HEAD (&rfkill->node); rfkill->type = type; - rfkill->name = name; +strcpy (rfkill->name, name); rfkill->ops = ops; rfkill->data = ops_data;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 28/42 ses: Fix problems with simple enclosures
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit 3417c1b5cb1fdc10261dbed42b05cc93166a78fd upstream.
Simple enclosure implementations (mostly USB) are allowed to return only page 8 to every diagnostic query. That really confuses our implementation because we assume the return is the page we asked for and end up doing incorrect offsets based on bogus information leading to accesses outside of allocated ranges. Fix that by checking the page code of the return and giving an error if it isn't the one we asked for. This should fix reported bugs with USB storage by simply refusing to attach to enclosures that behave like this. It's also good defensive practise now that we're starting to see more USB enclosures.
--- drivers/scsi/ses.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/scsi/ses.c +19 -1
@@ -67,6 +67,7 @@ static int ses_probe(struct device *dev)static int ses_recv_diag (struct scsi_device *sdev,int page_code,void *buf,int bufflen) { +int ret;unsigned char cmd[] = {RECEIVE_DIAGNOSTIC ,1 ,/* Set PCV bit */
@@ -75,9 +76,26 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, bufflen &0xff ,0 }; +unsigned char recv_page_code; -return scsi_execute_req (sdev, cmd,DMA_FROM_DEVICE , buf, bufflen, + ret =scsi_execute_req (sdev, cmd,DMA_FROM_DEVICE , buf, bufflen,NULL ,SES_TIMEOUT ,SES_RETRIES ,NULL ); +if (unlikely (!ret)) +return ret; + + recv_page_code = ((unsigned char *)buf)[0 ]; + +if (likely (recv_page_code == page_code)) +return ret; + +/* successful diagnostic but wrong page code. This happens to some +* USB devices, just print a message and pretend there was an error */ + +sdev_printk (KERN_ERR , sdev, +"Wrong diagnostic page; asked for %d got %u\n" , + page_code, recv_page_code); + +return -EINVAL ; } static int ses_send_diag(struct scsi_device *sdev, int page_code,
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 29/42 ses: fix additional element traversal bug
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: James Bottomley <[email protected]>
commit 5e1033561da1152c57b97ee84371dba2b3d64c25 upstream.
KASAN found that our additional element processing scripts drop off the end of the VPD page into unallocated space. The reason is that not every element has additional information but our traversal routines think they do, leading to them expecting far more additional information than is present. Fix this by adding a gate to the traversal routine so that it only processes elements that are expected to have additional information (list is in SES-2 section 6.1.13.1:
Additional Element Status diagnostic page overview)
--- drivers/scsi/ses.c | 10 +++++++++- include/linux/enclosure.h | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-)
drivers/scsi/ses.c +9 -1
@@ -451,7 +451,15 @@ static void ses_enclosure_data_process(struct enclosure_device *edev,if (desc_ptr) desc_ptr += len; -if (addl_desc_ptr) +if (addl_desc_ptr && +/* only find additional descriptions for specific devices */ + (type_ptr[0 ] ==ENCLOSURE_COMPONENT_DEVICE || + type_ptr[0 ] ==ENCLOSURE_COMPONENT_ARRAY_DEVICE || + type_ptr[0 ] ==ENCLOSURE_COMPONENT_SAS_EXPANDER || +/* these elements are optional */ + type_ptr[0 ] ==ENCLOSURE_COMPONENT_SCSI_TARGET_PORT || + type_ptr[0 ] ==ENCLOSURE_COMPONENT_SCSI_INITIATOR_PORT || + type_ptr[0 ] ==ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS )) addl_desc_ptr += addl_desc_ptr[1 ] +2 ; }
include/linux/enclosure.h +4 -0
@@ -29,7 +29,11 @@/* A few generic types ... taken from ses-2 */ enum enclosure_component_type {ENCLOSURE_COMPONENT_DEVICE =0x01 , +ENCLOSURE_COMPONENT_CONTROLLER_ELECTRONICS =0x07 , +ENCLOSURE_COMPONENT_SCSI_TARGET_PORT =0x14 , +ENCLOSURE_COMPONENT_SCSI_INITIATOR_PORT =0x15 ,ENCLOSURE_COMPONENT_ARRAY_DEVICE =0x17 , +ENCLOSURE_COMPONENT_SAS_EXPANDER =0x18 , };/* ses-2 common element status */
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 30/42 tty: Fix GPF in flush_to_ldisc()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Peter Hurley <[email protected]>
commit 9ce119f318ba1a07c29149301f1544b6c4bea52a upstream.
A line discipline which does not define a receive_buf() method can can cause a GPF if data is ever received [1]. Oddly, this was known to the author of n_tracesink in 2011, but never fixed.
[1] GPF report
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [< (null)>] (null)
PGD 3752d067 PUD 37a7b067 PMD 0
Oops: 0010 [#1] SMP KASAN
Modules linked in:
CPU: 2 PID: 148 Comm: kworker/u10:2 Not tainted 4.4.0-rc2+ #51
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Workqueue: events_unbound flush_to_ldisc
task: ffff88006da94440 ti: ffff88006db60000 task.ti: ffff88006db60000
RIP: 0010:[<0000000000000000>] [< (null)>] (null)
RSP: 0018:ffff88006db67b50 EFLAGS: 00010246
RAX: 0000000000000102 RBX: ffff88003ab32f88 RCX: 0000000000000102
RDX: 0000000000000000 RSI: ffff88003ab330a6 RDI: ffff88003aabd388
RBP: ffff88006db67c48 R08: ffff88003ab32f9c R09: ffff88003ab31fb0
R10: ffff88003ab32fa8 R11: 0000000000000000 R12: dffffc0000000000
R13: ffff88006db67c20 R14: ffffffff863df820 R15: ffff88003ab31fb8
FS: 0000000000000000(0000) GS:ffff88006dc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 0000000037938000 CR4: 00000000000006e0
Stack:
ffffffff829f46f1 ffff88006da94bf8 ffff88006da94bf8 0000000000000000
ffff88003ab31fb0 ffff88003aabd438 ffff88003ab31ff8 ffff88006430fd90
ffff88003ab32f9c ffffed0007557a87 1ffff1000db6cf78 ffff88003ab32078
Call Trace:
[<ffffffff8127cf91>] process_one_work+0x8f1/0x17a0 kernel/workqueue.c:2030
[<ffffffff8127df14>] worker_thread+0xd4/0x1180 kernel/workqueue.c:2162
[<ffffffff8128faaf>] kthread+0x1cf/0x270 drivers/block/aoe/aoecmd.c:1302
[<ffffffff852a7c2f>] ret_from_fork+0x3f/0x70 arch/x86/entry/entry_64.S:468
Code: Bad RIP value.
RIP [< (null)>] (null)
RSP <ffff88006db67b50>
CR2: 0000000000000000
---[ end trace a587f8947e54d6ea ]------ drivers/char/tty_buffer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/char/tty_buffer.c +5 -3
@@ -450,10 +450,12 @@ static void flush_to_ldisc(struct work_struct *work) char_buf = head->char_buf_ptr + head->read; flag_buf = head->flag_buf_ptr + head->read; head->read += count; -spin_unlock_irqrestore (&tty->buf.lock, flags); - disc->ops->receive_buf (tty, char_buf, +if (disc->ops->receive_buf) { +spin_unlock_irqrestore (&tty->buf.lock, flags); + disc->ops->receive_buf (tty, char_buf, flag_buf, count); -spin_lock_irqsave (&tty->buf.lock, flags); +spin_lock_irqsave (&tty->buf.lock, flags); + } }clear_bit (TTY_FLUSHING , &tty->flags); }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 31/42 mISDN: fix a loop count
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 40d24c4d8a7430aa4dfd7a665fa3faf3b05b673f upstream.
There are two issue here.
1) cnt starts as maxloop + 1 so all these loops iterate one more time than intended.
2) At the end of the loop we test for "if (maxloop && !cnt)" but for the first two loops, we end with cnt equal to -1. Changing this to a pre-op means we end with cnt set to 0.
--- drivers/isdn/hardware/mISDN/mISDNipac.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/isdn/hardware/mISDN/mISDNipac.c +3 -4
@@ -1154,7 +1154,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop)if (ipac->type &IPAC_TYPE_IPACX ) { ista =ReadIPAC (ipac,ISACX_ISTA ); -while (ista && cnt--) { +while (ista && --cnt) {pr_debug ("%s: ISTA %02x\n" , ipac->name, ista);if (ista &IPACX__ICA )ipac_irq (&ipac->hscx[0 ], ista);
@@ -1166,7 +1166,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) } }else if (ipac->type &IPAC_TYPE_IPAC ) { ista =ReadIPAC (ipac,IPAC_ISTA ); -while (ista && cnt--) { +while (ista && --cnt) {pr_debug ("%s: ISTA %02x\n" , ipac->name, ista);if (ista & (IPAC__ICD |IPAC__EXD )) { istad =ReadISAC (isac,ISAC_ISTA );
@@ -1184,7 +1184,7 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop) ista =ReadIPAC (ipac,IPAC_ISTA ); } }else if (ipac->type &IPAC_TYPE_HSCX ) { -while (cnt) { +while (--cnt) { ista =ReadIPAC (ipac,IPAC_ISTAB + ipac->hscx[1 ].off);pr_debug ("%s: B2 ISTA %02x\n" , ipac->name, ista);if (ista)
@@ -1195,7 +1195,6 @@ mISDNipac_irq(struct ipac_hw *ipac, int maxloop)mISDNisac_irq (isac, istad);if (0 == (ista | istad))break ; - cnt--; } }if (cnt > maxloop)/* only for ISAC/HSCX without PCI IRQ test */
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 32/42 ser_gigaset: fix deallocation of platform device structure
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tilman Schmidt <[email protected]>
commit 4c5e354a974214dfb44cd23fa0429327693bc3ea upstream.
When shutting down the device, the struct ser_cardstate must not be kfree()d immediately after the call to platform_device_unregister() since the embedded struct platform_device is still in use. Move the kfree() call to the release method instead.
--- drivers/isdn/gigaset/ser-gigaset.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/isdn/gigaset/ser-gigaset.c +7 -3
@@ -381,20 +381,24 @@ static void gigaset_freecshw(struct cardstate *cs)tasklet_kill (&cs->write_tasklet);if (!cs->hw.ser)return ; -dev_set_drvdata (&cs->hw.ser->dev.dev,NULL );platform_device_unregister (&cs->hw.ser->dev); -kfree (cs->hw.ser); - cs->hw.ser =NULL ; }static void gigaset_device_release (struct device *dev) {struct platform_device *pdev =to_platform_device (dev); +struct cardstate *cs =dev_get_drvdata (dev);/* adapted from platform_device_release() in drivers/base/platform.c */ //FIXME is this actually necessary? kfree (dev->platform_data);kfree (pdev->resource); + +if (!cs) +return ; +dev_set_drvdata (dev,NULL ); +kfree (cs->hw.ser); + cs->hw.ser =NULL ; }/*
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 33/42 spi: fix parent-device reference leak
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 157f38f993919b648187ba341bfb05d0e91ad2f6 upstream.
Fix parent-device reference leak due to SPI-core taking an unnecessary reference to the parent when allocating the master structure, a reference that was never released.
Note that driver core takes its own reference to the parent when the master device is registered.
--- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi.c +1 -1
@@ -472,7 +472,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size)device_initialize (&master->dev); master->dev.class = &spi_master_class; - master->dev.parent =get_device (dev); + master->dev.parent = dev;spi_master_set_devdata (master, &master[1 ]);return master;
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 34/42 s390/dis: Fix handling of format specifiers
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Michael Holzheu <[email protected]>
commit 272fa59ccb4fc802af28b1d699c2463db6a71bf7 upstream.
The print_insn() function returns strings like "lghi %r1,0". To escape the '%' character in sprintf() a second '%' is used. For example "lghi %%r1,0" is converted into "lghi %r1,0".
After print_insn() the output string is passed to printk(). Because format specifiers like "%r" or "%f" are ignored by printk() this works by chance most of the time. But for instructions with control registers like "lctl %c6,%c6,780" this fails because printk() interprets "%c" as character format specifier.
Fix this problem and escape the '%' characters twice.
For example "lctl %%%%c6,%%%%c6,780" is then converted by sprintf() into "lctl %%c6,%%c6,780" and by printk() into "lctl %c6,%c6,780".
--- arch/s390/kernel/dis.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
arch/s390/kernel/dis.c +11 -4
@@ -1182,14 +1182,21 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr) }if (separator) ptr +=sprintf (ptr,"%c" , separator); +/* +* Use four '%' characters below because of the +* following two conversions: +* +* 1) sprintf: %%%%r -> %%r +* 2) printk : %%r -> %r +*/ if (operand->flags &OPERAND_GPR ) - ptr +=sprintf (ptr,"%%r%i" , value); + ptr +=sprintf (ptr,"%%%%r%i" , value);else if (operand->flags &OPERAND_FPR ) - ptr +=sprintf (ptr,"%%f%i" , value); + ptr +=sprintf (ptr,"%%%%f%i" , value);else if (operand->flags &OPERAND_AR ) - ptr +=sprintf (ptr,"%%a%i" , value); + ptr +=sprintf (ptr,"%%%%a%i" , value);else if (operand->flags &OPERAND_CR ) - ptr +=sprintf (ptr,"%%c%i" , value); + ptr +=sprintf (ptr,"%%%%c%i" , value);else if (operand->flags &OPERAND_PCREL ) ptr +=sprintf (ptr,"%lx" , (signed int ) value + addr);
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 35/42 USB: ipaq.c: fix a timeout loop
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit abdc9a3b4bac97add99e1d77dc6d28623afe682b upstream.
The code expects the loop to end with "retries" set to zero but, because it is a post-op, it will end set to -1. I have fixed this by moving the decrement inside the loop.
--- drivers/usb/serial/ipaq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/ipaq.c +2 -2
@@ -663,8 +663,8 @@ static int ipaq_open(struct tty_struct *tty,* through. Since this has a reasonably high failure rate, we retry * several times. */ - -while (retries--) { +while (retries) { + retries--; result =usb_control_msg (serial->dev,usb_sndctrlpipe (serial->dev,0 ),0x22 ,0x21 ,0x1 ,0 ,NULL ,0 ,100 );
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 36/42 USB: fix invalid memory access in hub_activate()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit e50293ef9775c5f1cf3fcc093037dd6a8c5684ea upstream.
Commit 8520f38099cc ("USB: change hub initialization sleeps to delayed_work") changed the hub_activate() routine to make part of it run in a workqueue. However, the commit failed to take a reference to the usb_hub structure or to lock the hub interface while doing so. As a result, if a hub is plugged in and quickly unplugged before the work routine can run, the routine will try to access memory that has been deallocated. Or, if the hub is unplugged while the routine is running, the memory may be deallocated while it is in active use.
This patch fixes the problem by taking a reference to the usb_hub at the start of hub_activate() and releasing it at the end (when the work is finished), and by locking the hub interface while the work routine is running. It also adds a check at the start of the routine to see if the hub has already been disconnected, in which nothing should be done.
[wt: made a few changes :
- adjusted context due to some autopm code being added only in 2.6.33
- no device_{lock,unlock}() in 2.6.32, use up/down(&->sem) instead]
--- drivers/usb/core/hub.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)
drivers/usb/core/hub.c +20 -4
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);#define HUB_DEBOUNCE_STEP 25#define HUB_DEBOUNCE_STABLE 100 - +static void hub_release (struct kref *kref);static int usb_reset_and_verify_device (struct usb_device *udev);static inline char *portspeed (int portstatus)
@@ -678,10 +678,20 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)unsigned delay;/* Continue a partial initialization */ -if (type ==HUB_INIT2 ) - goto init2; -if (type ==HUB_INIT3 ) +if (type ==HUB_INIT2 || type ==HUB_INIT3 ) { +down (&hub->intfdev->sem); + +/* Was the hub disconnected while we were waiting? */ +if (hub->disconnected) { +up (&hub->intfdev->sem); +kref_put (&hub->kref, hub_release); +return ; + } +if (type ==HUB_INIT2 ) + goto init2; goto init3; + } +kref_get (&hub->kref);/* After a resume, port power should still be on. * For any other type of activation, turn it on.
@@ -820,6 +830,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)PREPARE_DELAYED_WORK (&hub->init_work, hub_init_func3);schedule_delayed_work (&hub->init_work,msecs_to_jiffies (delay)); +up (&hub->intfdev->sem);return ;/* Continues at init3: below */ }else {msleep (delay);
@@ -836,6 +847,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)/* Scan all ports that need attention */ kick_khubd (hub); + +if (type ==HUB_INIT2 || type ==HUB_INIT3 ) +up (&hub->intfdev->sem); + +kref_put (&hub->kref, hub_release); }/* Implement the continuations for the delays above */
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 37/42 MIPS: Fix restart of indirect syscalls
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Ed Swierk <[email protected]>
commit e967ef022e00bb7c2e5b1a42007abfdd52055050 upstream.
When 32-bit MIPS userspace invokes a syscall indirectly via syscall(number, arg1, ..., arg7), the kernel looks up the actual syscall based on the given number, shifts the other arguments to the left, and jumps to the syscall.
If the syscall is interrupted by a signal and indicates it needs to be restarted by the kernel (by returning ERESTARTNOINTR for example), the syscall must be called directly, since the number is no longer the first argument, and the other arguments are now staged for a direct call.
Before shifting the arguments, store the syscall number in pt_regs->regs[2]. This gets copied temporarily into pt_regs->regs[0] after the syscall returns. If the syscall needs to be restarted, handle_signal()/do_signal() copies the number back to pt_regs->reg[2], which ends up in $v0 once control returns to userspace.
Patchwork: https://patchwork.linux-mips.org/patch/8929/
--- arch/mips/kernel/scall32-o32.S | 1 + arch/mips/kernel/scall64-o32.S | 1 + 2 files changed, 2 insertions(+)
arch/mips/kernel/scall32-o32.S +1 -0
@@ -194,6 +194,7 @@ illegal_syscall: sll t1, t0, 3 beqz v0, einval lw t2, sys_call_table(t1) # syscall routine + sw a0, PT_R2(sp) # call routine directly on restart /* Some syscalls like execve get their arguments from struct pt_regs and claim zero arguments in the syscall table. Thus we have to
arch/mips/kernel/scall64-o32.S +1 -0
@@ -180,6 +180,7 @@ LEAF(sys32_syscall) dsll t1, t0, 3 beqz v0, einval ld t2, sys_call_table(t1) # syscall routine + sd a0, PT_R2(sp) # call routine directly on restart move a0, a1 # shift argument registers move a1, a2
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 38/42 parisc: Fix syscall restarts
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <[email protected]>
commit 71a71fb5374a23be36a91981b5614590b9e722c3 upstream.
On parisc syscalls which are interrupted by signals sometimes failed to restart and instead returned -ENOSYS which in the worst case lead to userspace crashes.
A similiar problem existed on MIPS and was fixed by commit e967ef02 ("MIPS: Fix restart of indirect syscalls").
On parisc the current syscall restart code assumes that all syscall callers load the syscall number in the delay slot of the ble instruction. That's how it is e.g. done in the unistd.h header file:
ble 0x100(%sr2, %r0) ldi #syscall_nr, %r20
Because of that assumption the current code never restored %r20 before returning to userspace.
This assumption is at least not true for code which uses the glibc syscall() function, which instead uses this syntax:
ble 0x100(%sr2, %r0) copy regX, %r20
where regX depend on how the compiler optimizes the code and register usage.
This patch fixes this problem by adding code to analyze how the syscall number is loaded in the delay branch and - if needed - copy the syscall number to regX prior returning to userspace for the syscall restart.
--- arch/parisc/kernel/signal.c | 64 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 12 deletions(-)
arch/parisc/kernel/signal.c +52 -12
@@ -474,6 +474,55 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,return 1 ; } +/* +* Check how the syscall number gets loaded into %r20 within +* the delay branch in userspace and adjust as needed. +*/ + +static void check_syscallno_in_delay_branch (struct pt_regs *regs) +{ +u32 opcode, source_reg; +u32 __user *uaddr; +int err; + +/* Usually we don't have to restore %r20 (the system call number) +* because it gets loaded in the delay slot of the branch external +* instruction via the ldi instruction. +* In some cases a register-to-register copy instruction might have +* been used instead, in which case we need to copy the syscall +* number into the source register before returning to userspace. +*/ + +/* A syscall is just a branch, so all we have to do is fiddle the +* return pointer so that the ble instruction gets executed again. +*/ + regs->gr[31 ] -=8 ;/* delayed branching */ + +/* Get assembler opcode of code in delay branch */ + uaddr = (unsigned int *) ((regs->gr[31 ] & ~3 ) +4 ); + err =get_user (opcode, uaddr); +if (err) +return ; + +/* Check if delay branch uses "ldi int,%r20" */ +if ((opcode &0xffff0000 ) ==0x34140000 ) +return ;/* everything ok, just return */ + +/* Check if delay branch uses "nop" */ +if (opcode ==INSN_NOP ) +return ; + +/* Check if delay branch uses "copy %rX,%r20" */ +if ((opcode &0xffe0ffff ) ==0x08000254 ) { + source_reg = (opcode >>16 ) &31 ; + regs->gr[source_reg] = regs->gr[20 ]; +return ; + } + +pr_warn ("syscall restart: %s (pid %d): unexpected opcode 0x%08x\n" , + current->comm,task_pid_nr (current), opcode); +} +static inline void syscall_restart (struct pt_regs *regs,struct k_sigaction *ka) {
@@ -495,10 +544,7 @@ syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) }/* fallthrough */ case -ERESTARTNOINTR : -/* A syscall is just a branch, so all -* we have to do is fiddle the return pointer. -*/ - regs->gr[31 ] -=8 ;/* delayed branching */ +check_syscallno_in_delay_branch (regs);/* Preserve original r28. */ regs->gr[28 ] = regs->orig_r28;break ;
@@ -549,18 +595,12 @@ insert_restart_trampoline(struct pt_regs *regs) }case -ERESTARTNOHAND :case -ERESTARTSYS : -case -ERESTARTNOINTR : { -/* Hooray for delayed branching. We don't -* have to restore %r20 (the system call -* number) because it gets loaded in the delay -* slot of the branch external instruction. -*/ - regs->gr[31 ] -=8 ; +case -ERESTARTNOINTR : +check_syscallno_in_delay_branch (regs);/* Preserve original r28. */ regs->gr[28 ] = regs->orig_r28;return ; - }default :break ; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 39/42 ipv6/addrlabel: fix ip6addrlbl_get()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Ryabinin <[email protected]>
commit e459dfeeb64008b2d23bdf600f03b3605dbb8152 upstream.
ip6addrlbl_get() has never worked. If ip6addrlbl_hold() succeeded, ip6addrlbl_get() will exit with '-ESRCH'. If ip6addrlbl_hold() failed, ip6addrlbl_get() will use about to be free ip6addrlbl_entry pointer.
Fix this by inverting ip6addrlbl_hold() check.
--- net/ipv6/addrlabel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/addrlabel.c +1 -1
@@ -557,7 +557,7 @@ static int ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr* nlh,rcu_read_lock (); p =__ipv6_addr_label (net, addr,ipv6_addr_type (addr), ifal->ifal_index); -if (p &&ip6addrlbl_hold (p)) +if (p && !ip6addrlbl_hold (p)) p =NULL ; lseq = ip6addrlbl_table.seq;rcu_read_unlock ();
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 40/42 mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone()
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Banman <[email protected]>
commit 5f0f2887f4de9508dcf438deab28f1de8070c271 upstream.
test_pages_in_a_zone() does not account for the possibility of missing sections in the given pfn range. pfn_valid_within always returns 1 when CONFIG_HOLES_IN_ZONE is not set, allowing invalid pfns from missing sections to pass the test, leading to a kernel oops.
Wrap an additional pfn loop with PAGES_PER_SECTION granularity to check for missing sections before proceeding into the zone-check code.
This also prevents a crash from offlining memory devices with missing sections. Despite this, it may be a good idea to keep the related patch '[PATCH 3/3] drivers: memory: prohibit offlining of memory blocks with missing sections' because missing sections in a memory block may lead to other problems not covered by the scope of this fix.
--- mm/memory_hotplug.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
mm/memory_hotplug.c +19 -12
@@ -601,23 +601,30 @@ int is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)*/ static int test_pages_in_a_zone (unsigned long start_pfn,unsigned long end_pfn) { -unsigned long pfn; +unsigned long pfn, sec_end_pfn;struct zone *zone =NULL ;struct page *page;int i; -for (pfn = start_pfn; +for (pfn = start_pfn, sec_end_pfn =SECTION_ALIGN_UP (start_pfn); pfn < end_pfn; - pfn +=MAX_ORDER_NR_PAGES ) { - i =0 ; -/* This is just a CONFIG_HOLES_IN_ZONE check.*/ -while ((i <MAX_ORDER_NR_PAGES ) && !pfn_valid_within (pfn + i)) - i++; -if (i ==MAX_ORDER_NR_PAGES ) + pfn = sec_end_pfn +1 , sec_end_pfn +=PAGES_PER_SECTION ) { +/* Make sure the memory section is present first */ +if (!present_section_nr (pfn_to_section_nr (pfn)))continue ; - page =pfn_to_page (pfn + i); -if (zone &&page_zone (page) != zone) -return 0 ; - zone =page_zone (page); +for (; pfn < sec_end_pfn && pfn < end_pfn; + pfn +=MAX_ORDER_NR_PAGES ) { + i =0 ; +/* This is just a CONFIG_HOLES_IN_ZONE check.*/ +while ((i <MAX_ORDER_NR_PAGES ) && + !pfn_valid_within (pfn + i)) + i++; +if (i ==MAX_ORDER_NR_PAGES ) +continue ; + page =pfn_to_page (pfn + i); +if (zone &&page_zone (page) != zone) +return 0 ; + zone =page_zone (page); + } }return 1 ; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
Re: [PATCH 2.6.32 40/42] mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone()
Quoted 7 lines · Willy Tarreau
2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Banman <[email protected]>
commit
5f0f2887f4de9508dcf438deab28f1de8070c271upstream.
[...]
Quoted 5 lines
mm/memory_hotplug.c +0
-0
mm/memory_hotplug.c int is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages) · line 608
Quoted 10 lines
mm/memory_hotplug.c +2
-2@@ -601,23 +601,30 @@ int is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages)*/ static int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn) { -unsigned long pfn; +unsigned long pfn, sec_end_pfn; struct zone *zone = NULL; struct page *page; int i; - for (pfn = start_pfn; + for (pfn = start_pfn, sec_end_pfn = SECTION_ALIGN_UP(start_pfn);
[...]
SECTION_ALIGN_UP() is not defined in 2.6.32; it was added by commit a539f3533b78.
Ben.
Signature · 3 lines
Ben Hutchings
Life is what happens to you while you're busy making other plans.
- John LennonRe: [PATCH 2.6.32 40/42] mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone()
Quoted 2 lines · Ben Hutchings
SECTION_ALIGN_UP()is not defined in 2.6.32; it was added by commita539f3533b78.
... which means my build config was incomplete this time. I'll refresh it to be sure it covers more of the code :-/
I'll backport the patch above, it's small enough.
Thanks Ben,
Willy
Re: [PATCH 2.6.32 40/42] mm/memory_hotplug.c: check for missing sections in test_pages_in_a_zone()
Quoted 8 lines · Willy Tarreau
Quoted 2 lines · Ben Hutchings
SECTION_ALIGN_UP()is not defined in 2.6.32; it was added by commita539f3533b78.... which means my build config was incomplete this time. I'll refresh it to be sure it covers more of the code :-/
I'll backport the patch above, it's small enough.
Just wanted to confirm that allmodconfig passes with this one now.
Have a nice week-end,
Willy
PATCH 41/42 KVM: x86: Reload pit counters for all channels when restoring state
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Honig <[email protected]>
commit 0185604c2d82c560dab2f2933a18f797e74ab5a8 upstream.
Currently if userspace restores the pit counters with a count of 0 on channels 1 or 2 and the guest attempts to read the count on those channels, then KVM will perform a mod of 0 and crash. This will ensure that 0 values are converted to 65536 as per the spec.
This is CVE-2015-7513.
--- arch/x86/kvm/x86.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
arch/x86/kvm/x86.c +6 -3
@@ -2131,10 +2131,11 @@ static int kvm_vm_ioctl_get_pit(struct kvm *kvm, struct kvm_pit_state *ps)static int kvm_vm_ioctl_set_pit (struct kvm *kvm,struct kvm_pit_state *ps) {int r =0 ; - +int i;mutex_lock (&kvm->arch.vpit->pit_state.lock);memcpy (&kvm->arch.vpit->pit_state, ps,sizeof (struct kvm_pit_state )); -kvm_pit_load_count (kvm,0 , ps->channels[0 ].count,0 ); +for (i =0 ; i <3 ; i++) +kvm_pit_load_count (kvm, i, ps->channels[i].count,0 );mutex_unlock (&kvm->arch.vpit->pit_state.lock);return r; }
@@ -2155,6 +2156,7 @@ static int kvm_vm_ioctl_get_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)static int kvm_vm_ioctl_set_pit2 (struct kvm *kvm,struct kvm_pit_state2 *ps) {int r =0 , start =0 ; +int i;u32 prev_legacy, cur_legacy;mutex_lock (&kvm->arch.vpit->pit_state.lock); prev_legacy = kvm->arch.vpit->pit_state.flags &KVM_PIT_FLAGS_HPET_LEGACY ;
@@ -2164,7 +2166,8 @@ static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)memcpy (&kvm->arch.vpit->pit_state.channels, &ps->channels,sizeof (kvm->arch.vpit->pit_state.channels)); kvm->arch.vpit->pit_state.flags = ps->flags; -kvm_pit_load_count (kvm,0 , kvm->arch.vpit->pit_state.channels[0 ].count, start); +for (i =0 ; i <3 ; i++) +kvm_pit_load_count (kvm, i, kvm->arch.vpit->pit_state.channels[i].count, start);mutex_unlock (&kvm->arch.vpit->pit_state.lock);return r; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty
PATCH 42/42 kvm: x86: only channel 0 of the i8254 is linked to the HPET
In reply to a message not in the archive2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Paolo Bonzini <[email protected]>
commit e5e57e7a03b1cdcb98e4aed135def2a08cbf3257 upstream.
While setting the KVM PIT counters in 'kvm_pit_load_count', if 'hpet_legacy_start' is set, the function disables the timer on channel[0], instead of the respective index 'channel'. This is because channels 1-3 are not linked to the HPET. Fix the caller to only activate the special HPET processing for channel 0.
--- arch/x86/kvm/i8254.c | 1 + arch/x86/kvm/x86.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
arch/x86/kvm/i8254.c +1 -0
@@ -356,6 +356,7 @@ void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_su8 saved_mode;if (hpet_legacy_start) {/* save existing mode for later reenablement */ +WARN_ON (channel !=0 ); saved_mode = kvm->arch.vpit->pit_state.channels[0 ].mode; kvm->arch.vpit->pit_state.channels[0 ].mode =0xff ;/* disable timer */ pit_load_count (kvm, channel, val);
arch/x86/kvm/x86.c +2 -1
@@ -2167,7 +2167,8 @@ static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps) sizeof(kvm->arch.vpit->pit_state.channels)); kvm->arch.vpit->pit_state.flags = ps->flags;for (i =0 ; i <3 ; i++) -kvm_pit_load_count (kvm, i, kvm->arch.vpit->pit_state.channels[i].count, start); +kvm_pit_load_count (kvm, i, kvm->arch.vpit->pit_state.channels[i].count, + start && i ==0 );mutex_unlock (&kvm->arch.vpit->pit_state.lock);return r; }
Signature · 1 line
1.7.12.2.21.g234cd45.dirty